Skip to content

Commit f03719c

Browse files
wiechuladavidrohr
authored andcommitted
Add possibility to fill ADC values for simple occupancy studies
1 parent 2d45daf commit f03719c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class Clusters
4343

4444
bool processCluster(const o2::tpc::ClusterNative& cluster, const o2::tpc::Sector sector, const int row);
4545

46+
void fillADCValue(int cru, int rowInSector, int padInRow, int timeBin, float adcValue);
47+
4648
void analyse();
4749

4850
void dumpToFile(std::string filename);
@@ -75,4 +77,4 @@ class Clusters
7577
} // namespace tpc
7678
} // namespace o2
7779

78-
#endif
80+
#endif

Detectors/TPC/qc/src/Clusters.cxx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "TPCQC/Clusters.h"
1818
#include "TPCBase/Painter.h"
1919
#include "TPCBase/ROC.h"
20+
#include "TPCBase/CRU.h"
2021
#include "TPCBase/Mapper.h"
2122
#include "DataFormatsTPC/ClusterNative.h"
2223

@@ -59,6 +60,21 @@ bool Clusters::processCluster(const o2::tpc::ClusterNative& cluster, const o2::t
5960
return true;
6061
}
6162

63+
//______________________________________________________________________________
64+
void Clusters::fillADCValue(int cru, int rowInSector, int padInRow, int timeBin, float adcValue)
65+
{
66+
const CRU cruID(cru);
67+
float val;
68+
val = mNClusters.getValue(cruID.sector(), rowInSector, padInRow);
69+
mNClusters.setValue(cruID.sector(), rowInSector, padInRow, val + 1);
70+
71+
val = mQMax.getValue(cruID.sector(), rowInSector, padInRow);
72+
mQMax.setValue(cruID.sector(), rowInSector, padInRow, val + adcValue);
73+
74+
val = mTimeBin.getValue(cruID.sector(), rowInSector, padInRow);
75+
mTimeBin.setValue(cruID.sector(), rowInSector, padInRow, val + timeBin);
76+
}
77+
6278
//______________________________________________________________________________
6379
void Clusters::analyse()
6480
{

0 commit comments

Comments
 (0)