From bd9dfdc411d0a8fab4fa91f4895955a639cbbea3 Mon Sep 17 00:00:00 2001 From: Anton Riedel Date: Thu, 8 May 2025 17:09:10 +0200 Subject: [PATCH 1/2] Feat: add getOccupancy method to Cluster class --- Detectors/TPC/qc/include/TPCQC/Clusters.h | 6 ++++-- Detectors/TPC/qc/src/Clusters.cxx | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Detectors/TPC/qc/include/TPCQC/Clusters.h b/Detectors/TPC/qc/include/TPCQC/Clusters.h index ca9c53a43b3f6..b61c27e8bf0e6 100644 --- a/Detectors/TPC/qc/include/TPCQC/Clusters.h +++ b/Detectors/TPC/qc/include/TPCQC/Clusters.h @@ -17,10 +17,10 @@ #ifndef AliceO2_TPC_CLUSTERS_H #define AliceO2_TPC_CLUSTERS_H -//root includes +// root includes #include "TCanvas.h" -//o2 includes +// o2 includes #include "TPCBase/CalDet.h" #include "TPCBase/Sector.h" #include "DataFormatsTPC/Defs.h" @@ -75,6 +75,8 @@ class Clusters CalPad& getSigmaPad() { return mSigmaPad; } CalPad& getTimeBin() { return mTimeBin; } + CalPad getOccupancy(int nHBFPerTF = 32); + void endTF() { ++mProcessedTFs; } size_t getProcessedTFs() { return mProcessedTFs; } diff --git a/Detectors/TPC/qc/src/Clusters.cxx b/Detectors/TPC/qc/src/Clusters.cxx index 3a7b1d8481b16..5cf898e63998c 100644 --- a/Detectors/TPC/qc/src/Clusters.cxx +++ b/Detectors/TPC/qc/src/Clusters.cxx @@ -22,8 +22,10 @@ #include "TPCBase/ROC.h" #include "TPCBase/CRU.h" #include "TPCBase/Mapper.h" +#include "TPCBase/ParameterElectronics.h" #include "DataFormatsTPC/ClusterNative.h" #include "DataFormatsTPC/KrCluster.h" +#include "CommonConstants/LHCConstants.h" ClassImp(o2::tpc::qc::Clusters); @@ -152,6 +154,15 @@ void Clusters::reset() mProcessedTFs = 0; } +//______________________________________________________________________________ +o2::tpc::CalPad Clusters::getOccupancy(int nHBFPerTF) +{ + o2::tpc::CalPad Occupancy = mNClusters; + Occupancy /= float(mProcessedTFs * (o2::constants::lhc::LHCMaxBunches * nHBFPerTF) / float(o2::tpc::ParameterElectronics::TIMEBININBC)); + return Occupancy; + ; +} + //______________________________________________________________________________ void Clusters::merge(Clusters& clusters) { From f081adababfbc39d9e45fdfc522a066a144be7ed Mon Sep 17 00:00:00 2001 From: Anton Riedel Date: Fri, 9 May 2025 13:30:32 +0200 Subject: [PATCH 2/2] Fix: implement requested changes --- Detectors/TPC/qc/src/Clusters.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Detectors/TPC/qc/src/Clusters.cxx b/Detectors/TPC/qc/src/Clusters.cxx index 5cf898e63998c..4bf59ced195ed 100644 --- a/Detectors/TPC/qc/src/Clusters.cxx +++ b/Detectors/TPC/qc/src/Clusters.cxx @@ -157,12 +157,10 @@ void Clusters::reset() //______________________________________________________________________________ o2::tpc::CalPad Clusters::getOccupancy(int nHBFPerTF) { - o2::tpc::CalPad Occupancy = mNClusters; - Occupancy /= float(mProcessedTFs * (o2::constants::lhc::LHCMaxBunches * nHBFPerTF) / float(o2::tpc::ParameterElectronics::TIMEBININBC)); - return Occupancy; - ; + o2::tpc::CalPad occupancy = mNClusters; + occupancy /= float(mProcessedTFs * (o2::constants::lhc::LHCMaxBunches * nHBFPerTF) / float(o2::tpc::ParameterElectronics::TIMEBININBC)); + return occupancy; } - //______________________________________________________________________________ void Clusters::merge(Clusters& clusters) {