Skip to content

Commit fb08c35

Browse files
authored
TPC QC: Add getter for occupancy to Cluster class (#14251)
Feat: add getOccupancy method to Cluster class
1 parent b1040cc commit fb08c35

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Detectors/TPC/qc/include/TPCQC/Clusters.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#ifndef AliceO2_TPC_CLUSTERS_H
1818
#define AliceO2_TPC_CLUSTERS_H
1919

20-
//root includes
20+
// root includes
2121
#include "TCanvas.h"
2222

23-
//o2 includes
23+
// o2 includes
2424
#include "TPCBase/CalDet.h"
2525
#include "TPCBase/Sector.h"
2626
#include "DataFormatsTPC/Defs.h"
@@ -75,6 +75,8 @@ class Clusters
7575
CalPad& getSigmaPad() { return mSigmaPad; }
7676
CalPad& getTimeBin() { return mTimeBin; }
7777

78+
CalPad getOccupancy(int nHBFPerTF = 32);
79+
7880
void endTF() { ++mProcessedTFs; }
7981

8082
size_t getProcessedTFs() { return mProcessedTFs; }

Detectors/TPC/qc/src/Clusters.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
#include "TPCBase/ROC.h"
2323
#include "TPCBase/CRU.h"
2424
#include "TPCBase/Mapper.h"
25+
#include "TPCBase/ParameterElectronics.h"
2526
#include "DataFormatsTPC/ClusterNative.h"
2627
#include "DataFormatsTPC/KrCluster.h"
28+
#include "CommonConstants/LHCConstants.h"
2729

2830
ClassImp(o2::tpc::qc::Clusters);
2931

@@ -152,6 +154,13 @@ void Clusters::reset()
152154
mProcessedTFs = 0;
153155
}
154156

157+
//______________________________________________________________________________
158+
o2::tpc::CalPad Clusters::getOccupancy(int nHBFPerTF)
159+
{
160+
o2::tpc::CalPad occupancy = mNClusters;
161+
occupancy /= float(mProcessedTFs * (o2::constants::lhc::LHCMaxBunches * nHBFPerTF) / float(o2::tpc::ParameterElectronics::TIMEBININBC));
162+
return occupancy;
163+
}
155164
//______________________________________________________________________________
156165
void Clusters::merge(Clusters& clusters)
157166
{

0 commit comments

Comments
 (0)