Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Modules/ITS/include/ITS/ITSClusterTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class ITSClusterTask : public TaskInterface

std::vector<TObject*> mPublishedObjects;

// Task
TH1D* hTFCounter = nullptr;

// Inner barrel
TH1D* hClusterTopologySummaryIB[NLayer][48][9] = { { { nullptr } } };
TH1D* hGroupedClusterSizeSummaryIB[NLayer][48][9] = { { { nullptr } } };
Expand All @@ -96,6 +99,7 @@ class ITSClusterTask : public TaskInterface
TH1L* hClusterSizeLayerSummary[NLayer] = { nullptr };
TH1L* hClusterTopologyLayerSummary[NLayer] = { nullptr };
TH1L* hGroupedClusterSizeLayerSummary[NLayer] = { nullptr };
TH2D* hClusterOccupancyDistribution[NLayer] = { nullptr }; // number of clusters and hits per chip, per ROF. From clusters with npix > 2

// Anomalies plots
TH2D* hLongClustersPerChip[3] = { nullptr };
Expand Down
41 changes: 37 additions & 4 deletions Modules/ITS/src/ITSClusterTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ ITSClusterTask::ITSClusterTask() : TaskInterface() {}

ITSClusterTask::~ITSClusterTask()
{
delete hTFCounter;
delete hEmptyLaneFractionGlobal;
delete hClusterVsBunchCrossing;

for (int iLayer = 0; iLayer < NLayer; iLayer++) {

if (!mEnableLayers[iLayer])
Expand All @@ -54,6 +56,7 @@ ITSClusterTask::~ITSClusterTask()
delete hClusterSizeLayerSummary[iLayer];
delete hClusterTopologyLayerSummary[iLayer];
delete hGroupedClusterSizeLayerSummary[iLayer];
delete hClusterOccupancyDistribution[iLayer];

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

const auto& ROF = clusRofArr[iROF];
const auto bcdata = ROF.getBCData();
int nClustersForBunchCrossing = 0;
int nDigits3pixLay[7] = { 0 };
int nClusters3pixLay[7] = { 0 };
int nClusters3pix = 0;
int nLongClusters[ChipBoundary[NLayerIB]] = {};
int nHitsFromClusters[ChipBoundary[NLayerIB]] = {}; // only IB is implemented at the moment

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

if (npix > 2) {
nClustersForBunchCrossing++;
nClusters3pixLay[lay]++;
nClusters3pix++;
nDigits3pixLay[lay] += npix;
}

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

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

hTFCounter->Fill(0);

end = std::chrono::high_resolution_clock::now();
difference = std::chrono::duration_cast<std::chrono::microseconds>(end - start).count();
ILOG(Debug, Devel) << "Time in QC Cluster Task: " << difference << ENDM;
Expand Down Expand Up @@ -392,13 +407,15 @@ void ITSClusterTask::endOfActivity(const Activity& /*activity*/)
void ITSClusterTask::reset()
{
ILOG(Debug, Devel) << "Resetting the histograms" << ENDM;
hTFCounter->Reset();
hClusterVsBunchCrossing->Reset();
hEmptyLaneFractionGlobal->Reset("ICES");
mGeneralOccupancy->Reset();
for (int iLayer = 0; iLayer < NLayer; iLayer++) {
if (!mEnableLayers[iLayer])
continue;

hClusterOccupancyDistribution[iLayer]->Reset();
hClusterSizeLayerSummary[iLayer]->Reset();
hGroupedClusterSizeLayerSummary[iLayer]->Reset();
hClusterTopologyLayerSummary[iLayer]->Reset();
Expand Down Expand Up @@ -438,7 +455,12 @@ void ITSClusterTask::reset()

void ITSClusterTask::createAllHistos()
{
hClusterVsBunchCrossing = new TH2D("BunchCrossingIDvsClusters", "BunchCrossingIDvsClusters", nBCbins, 0, 4095, 100, 0, 2000);
hTFCounter = new TH1D("TFcounter", "TFcounter", 1, 0, 1);
hTFCounter->SetTitle("TF counter");
addObject(hTFCounter);
formatAxes(hTFCounter, "", "TF", 1, 1.10);

hClusterVsBunchCrossing = new TH2D("BunchCrossingIDvsClusters", "BunchCrossingIDvsClusters", nBCbins, 0, 4095, 150, 0, 3000);
hClusterVsBunchCrossing->SetTitle("#clusters vs BC id for clusters with npix > 2");
addObject(hClusterVsBunchCrossing);
formatAxes(hClusterVsBunchCrossing, "Bunch Crossing ID", "Number of clusters with npix > 2 in ROF", 1, 1.10);
Expand Down Expand Up @@ -478,6 +500,17 @@ void ITSClusterTask::createAllHistos()
formatAxes(hClusterSizeLayerSummary[iLayer], "Cluster Size (pixels)", "counts", 1, 1.10);
hClusterSizeLayerSummary[iLayer]->SetStats(0);

double dynbin[7][4] = { { 300, 100, 500, 1000 }, { 300, 100, 500, 1000 }, { 300, 100, 500, 1000 }, // IB
{ 300, 5, 500, 50 },
{ 300, 5, 500, 50 }, // ML
{ 300, 1.5, 500, 15 },
{ 300, 1.5, 500, 15 } }; // OL
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]);
hClusterOccupancyDistribution[iLayer]->SetTitle(Form("hits/chip/evt, form clusters with npix>2 - Layer%d", iLayer));
addObject(hClusterOccupancyDistribution[iLayer]);
formatAxes(hClusterOccupancyDistribution[iLayer], "N clus", "N hit", 1, 1.10);
hClusterOccupancyDistribution[iLayer]->SetStats(0);

hGroupedClusterSizeLayerSummary[iLayer] = new TH1L(Form("Layer%d/AverageGroupedClusterSizeSummary", iLayer), Form("Layer%dAverageGroupedClusterSizeSummary", iLayer), 128 * 128, 0, 128 * 128);
hGroupedClusterSizeLayerSummary[iLayer]->SetTitle(Form("Cluster size summary for Layer %d", iLayer));
addObject(hGroupedClusterSizeLayerSummary[iLayer]);
Expand Down