Skip to content

Commit 2721fd4

Browse files
authored
ITS - plots of cluster and hit multiplicity distributions (#2565)
* WIP - Cluster occupancy distribution for ITS * Working version * Adding TF counter * dummy commit
1 parent 3254007 commit 2721fd4

File tree

2 files changed

+41
-4
lines changed

2 files changed

+41
-4
lines changed

Modules/ITS/include/ITS/ITSClusterTask.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class ITSClusterTask : public TaskInterface
7777

7878
std::vector<TObject*> mPublishedObjects;
7979

80+
// Task
81+
TH1D* hTFCounter = nullptr;
82+
8083
// Inner barrel
8184
TH1D* hClusterTopologySummaryIB[NLayer][48][9] = { { { nullptr } } };
8285
TH1D* hGroupedClusterSizeSummaryIB[NLayer][48][9] = { { { nullptr } } };
@@ -96,6 +99,7 @@ class ITSClusterTask : public TaskInterface
9699
TH1L* hClusterSizeLayerSummary[NLayer] = { nullptr };
97100
TH1L* hClusterTopologyLayerSummary[NLayer] = { nullptr };
98101
TH1L* hGroupedClusterSizeLayerSummary[NLayer] = { nullptr };
102+
TH2D* hClusterOccupancyDistribution[NLayer] = { nullptr }; // number of clusters and hits per chip, per ROF. From clusters with npix > 2
99103

100104
// Anomalies plots
101105
TH2D* hLongClustersPerChip[3] = { nullptr };

Modules/ITS/src/ITSClusterTask.cxx

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ ITSClusterTask::ITSClusterTask() : TaskInterface() {}
4040

4141
ITSClusterTask::~ITSClusterTask()
4242
{
43+
delete hTFCounter;
4344
delete hEmptyLaneFractionGlobal;
4445
delete hClusterVsBunchCrossing;
46+
4547
for (int iLayer = 0; iLayer < NLayer; iLayer++) {
4648

4749
if (!mEnableLayers[iLayer])
@@ -54,6 +56,7 @@ ITSClusterTask::~ITSClusterTask()
5456
delete hClusterSizeLayerSummary[iLayer];
5557
delete hClusterTopologyLayerSummary[iLayer];
5658
delete hGroupedClusterSizeLayerSummary[iLayer];
59+
delete hClusterOccupancyDistribution[iLayer];
5760

5861
if (mDoPublish1DSummary == 1) {
5962
if (iLayer < NLayerIB) {
@@ -154,7 +157,9 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
154157

155158
const auto& ROF = clusRofArr[iROF];
156159
const auto bcdata = ROF.getBCData();
157-
int nClustersForBunchCrossing = 0;
160+
int nDigits3pixLay[7] = { 0 };
161+
int nClusters3pixLay[7] = { 0 };
162+
int nClusters3pix = 0;
158163
int nLongClusters[ChipBoundary[NLayerIB]] = {};
159164
int nHitsFromClusters[ChipBoundary[NLayerIB]] = {}; // only IB is implemented at the moment
160165

@@ -213,7 +218,9 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
213218
}
214219

215220
if (npix > 2) {
216-
nClustersForBunchCrossing++;
221+
nClusters3pixLay[lay]++;
222+
nClusters3pix++;
223+
nDigits3pixLay[lay] += npix;
217224
}
218225

219226
if (lay < NLayerIB) {
@@ -273,7 +280,13 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
273280
hAverageClusterSizeSummaryFine[lay]->getNum()->Fill(getHorizontalBin(locC.Z(), chip, lay, lane), getVerticalBin(locC.X(), sta, lay), (float)npix);
274281
}
275282
}
276-
hClusterVsBunchCrossing->Fill(bcdata.bc, nClustersForBunchCrossing); // we count only the number of clusters, not their sizes
283+
hClusterVsBunchCrossing->Fill(bcdata.bc, nClusters3pix); // we count only the number of clusters, not their sizes
284+
for (int lay = 0; lay < 7; lay++) {
285+
if (nClusters3pixLay[lay] > 0) {
286+
int nchips = mNStaves[lay] * mNHicPerStave[lay] * mNChipsPerHic[lay];
287+
hClusterOccupancyDistribution[lay]->Fill(1. * nClusters3pixLay[lay] / nchips, 1. * nDigits3pixLay[lay] / nchips);
288+
}
289+
}
277290

278291
// filling these anomaly plots once per ROF, ignoring chips w/o long clusters
279292
for (int ichip = 0; ichip < ChipBoundary[NLayerIB]; ichip++) {
@@ -358,6 +371,8 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
358371
}
359372
}
360373

374+
hTFCounter->Fill(0);
375+
361376
end = std::chrono::high_resolution_clock::now();
362377
difference = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
363378
ILOG(Debug, Devel) << "Time in QC Cluster Task: " << difference << ENDM;
@@ -392,13 +407,15 @@ void ITSClusterTask::endOfActivity(const Activity& /*activity*/)
392407
void ITSClusterTask::reset()
393408
{
394409
ILOG(Debug, Devel) << "Resetting the histograms" << ENDM;
410+
hTFCounter->Reset();
395411
hClusterVsBunchCrossing->Reset();
396412
hEmptyLaneFractionGlobal->Reset("ICES");
397413
mGeneralOccupancy->Reset();
398414
for (int iLayer = 0; iLayer < NLayer; iLayer++) {
399415
if (!mEnableLayers[iLayer])
400416
continue;
401417

418+
hClusterOccupancyDistribution[iLayer]->Reset();
402419
hClusterSizeLayerSummary[iLayer]->Reset();
403420
hGroupedClusterSizeLayerSummary[iLayer]->Reset();
404421
hClusterTopologyLayerSummary[iLayer]->Reset();
@@ -438,7 +455,12 @@ void ITSClusterTask::reset()
438455

439456
void ITSClusterTask::createAllHistos()
440457
{
441-
hClusterVsBunchCrossing = new TH2D("BunchCrossingIDvsClusters", "BunchCrossingIDvsClusters", nBCbins, 0, 4095, 100, 0, 2000);
458+
hTFCounter = new TH1D("TFcounter", "TFcounter", 1, 0, 1);
459+
hTFCounter->SetTitle("TF counter");
460+
addObject(hTFCounter);
461+
formatAxes(hTFCounter, "", "TF", 1, 1.10);
462+
463+
hClusterVsBunchCrossing = new TH2D("BunchCrossingIDvsClusters", "BunchCrossingIDvsClusters", nBCbins, 0, 4095, 150, 0, 3000);
442464
hClusterVsBunchCrossing->SetTitle("#clusters vs BC id for clusters with npix > 2");
443465
addObject(hClusterVsBunchCrossing);
444466
formatAxes(hClusterVsBunchCrossing, "Bunch Crossing ID", "Number of clusters with npix > 2 in ROF", 1, 1.10);
@@ -478,6 +500,17 @@ void ITSClusterTask::createAllHistos()
478500
formatAxes(hClusterSizeLayerSummary[iLayer], "Cluster Size (pixels)", "counts", 1, 1.10);
479501
hClusterSizeLayerSummary[iLayer]->SetStats(0);
480502

503+
double dynbin[7][4] = { { 300, 100, 500, 1000 }, { 300, 100, 500, 1000 }, { 300, 100, 500, 1000 }, // IB
504+
{ 300, 5, 500, 50 },
505+
{ 300, 5, 500, 50 }, // ML
506+
{ 300, 1.5, 500, 15 },
507+
{ 300, 1.5, 500, 15 } }; // OL
508+
hClusterOccupancyDistribution[iLayer] = new TH2D(Form("Layer%d/OccupancyPerChipPerEvt", iLayer), Form("Layer%d/OccupancyPerChipPerEvt", iLayer), (int)dynbin[iLayer][0], 0, dynbin[iLayer][1], (int)dynbin[iLayer][2], 0, dynbin[iLayer][3]);
509+
hClusterOccupancyDistribution[iLayer]->SetTitle(Form("hits/chip/evt, form clusters with npix>2 - Layer%d", iLayer));
510+
addObject(hClusterOccupancyDistribution[iLayer]);
511+
formatAxes(hClusterOccupancyDistribution[iLayer], "N clus", "N hit", 1, 1.10);
512+
hClusterOccupancyDistribution[iLayer]->SetStats(0);
513+
481514
hGroupedClusterSizeLayerSummary[iLayer] = new TH1L(Form("Layer%d/AverageGroupedClusterSizeSummary", iLayer), Form("Layer%dAverageGroupedClusterSizeSummary", iLayer), 128 * 128, 0, 128 * 128);
482515
hGroupedClusterSizeLayerSummary[iLayer]->SetTitle(Form("Cluster size summary for Layer %d", iLayer));
483516
addObject(hGroupedClusterSizeLayerSummary[iLayer]);

0 commit comments

Comments
 (0)