1919#include " ITS/ITSClusterTask.h"
2020
2121#include < sstream>
22- #include < TCanvas.h>
2322#include < DataFormatsParameters/GRPObject.h>
2423#include < ITSMFTReconstruction/DigitPixelReader.h>
2524#include < DataFormatsITSMFT/ROFRecord.h>
@@ -54,6 +53,7 @@ ITSClusterTask::ITSClusterTask() : TaskInterface() {}
5453ITSClusterTask::~ITSClusterTask ()
5554{
5655 delete hClusterVsBunchCrossing;
56+ delete hEmptyLaneFractionGlobal;
5757 for (int iLayer = 0 ; iLayer < NLayer; iLayer++) {
5858
5959 if (!mEnableLayers [iLayer])
@@ -221,7 +221,6 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
221221 nClustersForBunchCrossing++;
222222
223223 if (lay < NLayerIB) {
224-
225224 mClusterOccupancyIB [lay][sta][chip]++;
226225
227226 mClusterSize [lay][sta][chip] += npix;
@@ -236,7 +235,6 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
236235 hGroupedClusterSizeLayerSummary[lay]->Fill (npix);
237236 }
238237 } else {
239-
240238 mClusterOccupancyOB [lay][sta][lane]++;
241239
242240 mClusterSize [lay][sta][lane] += npix;
@@ -275,11 +273,14 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
275273
276274 if (!mEnableLayers [iLayer])
277275 continue ;
278-
279276 for (int iStave = 0 ; iStave < mNStaves [iLayer]; iStave++) {
280277
281278 if (iLayer < NLayerIB) {
282279 for (int iChip = 0 ; iChip < mNChipsPerHic [iLayer]; iChip++) {
280+ if (!mClusterOccupancyIB [iLayer][iStave][iChip]) {
281+ mNLaneEmpty [0 ]++;
282+ mNLaneEmpty [3 ]++;
283+ }
283284 hAverageClusterOccupancySummaryIB[iLayer]->SetBinContent (iChip + 1 , iStave + 1 , 1 . * mClusterOccupancyIB [iLayer][iStave][iChip] / mNRofs );
284285 hAverageClusterOccupancySummaryIB[iLayer]->SetBinError (iChip + 1 , iStave + 1 , 1e-15 );
285286 hAverageClusterSizeSummaryIB[iLayer]->SetBinContent (iChip + 1 , iStave + 1 , nClusters[iLayer][iStave][iChip] != 0 ? (double )mClusterSize [iLayer][iStave][iChip] / nClusters[iLayer][iStave][iChip] : 0 .);
@@ -292,6 +293,17 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
292293 } else {
293294
294295 for (int iLane = 0 ; iLane < mNLanePerHic [iLayer] * mNHicPerStave [iLayer]; iLane++) {
296+ if (iLayer < 5 ) {
297+ if (!mClusterOccupancyOB [iLayer][iStave][iLane]) {
298+ mNLaneEmpty [1 ]++;
299+ mNLaneEmpty [3 ]++;
300+ }
301+ } else {
302+ if (!mClusterOccupancyOB [iLayer][iStave][iLane]) {
303+ mNLaneEmpty [2 ]++;
304+ mNLaneEmpty [3 ]++;
305+ }
306+ }
295307 hAverageClusterOccupancySummaryOB[iLayer]->SetBinContent (iLane + 1 , iStave + 1 , 1 . * mClusterOccupancyOB [iLayer][iStave][iLane] / mNRofs / (mNChipsPerHic [iLayer] / mNLanePerHic [iLayer])); // 14 To have occupation per chip -> 7 because we're considering lanes
296308 hAverageClusterOccupancySummaryOB[iLayer]->SetBinError (iLane + 1 , iStave + 1 , 1e-15 ); // 14 To have occupation per chip
297309 hAverageClusterSizeSummaryOB[iLayer]->SetBinContent (iLane + 1 , iStave + 1 , nClusters[iLayer][iStave][iLane] != 0 ? (double )mClusterSize [iLayer][iStave][iLane] / nClusters[iLayer][iStave][iLane] : 0 .);
@@ -325,6 +337,9 @@ void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
325337 }
326338 }
327339 }
340+ for (int iflag = 0 ; iflag < NFlags; iflag++) {
341+ hEmptyLaneFractionGlobal->SetBinContent (iflag + 1 , 1 . * mNLaneEmpty [iflag] / mNLanes [iflag]);
342+ }
328343 }
329344
330345 end = std::chrono::high_resolution_clock::now ();
@@ -346,6 +361,7 @@ void ITSClusterTask::reset()
346361{
347362 ILOG (Debug, Devel) << " Resetting the histograms" << ENDM ;
348363 hClusterVsBunchCrossing->Reset ();
364+ hEmptyLaneFractionGlobal->Reset ();
349365 mGeneralOccupancy ->Reset ();
350366
351367 for (int iLayer = 0 ; iLayer < NLayer; iLayer++) {
@@ -392,6 +408,18 @@ void ITSClusterTask::createAllHistos()
392408 formatAxes (hClusterVsBunchCrossing, " Bunch Crossing ID" , " Number of clusters with npix > 2 in ROF" , 1 , 1.10 );
393409 hClusterVsBunchCrossing->SetStats (0 );
394410
411+ hEmptyLaneFractionGlobal = new TH1D (" EmptyLaneFractionGlobal" , " Empty Lane Fraction Global" , 4 , 0 , 4 );
412+ hEmptyLaneFractionGlobal->SetTitle (" Empty Lane /All Lane " );
413+ addObject (hEmptyLaneFractionGlobal);
414+ formatAxes (hEmptyLaneFractionGlobal, " " , " Fraction of empty lane" );
415+ for (int i = 0 ; i < NFlags; i++) {
416+ hEmptyLaneFractionGlobal->GetXaxis ()->SetBinLabel (i + 1 , mLaneStatusFlag [i].c_str ());
417+ }
418+ hEmptyLaneFractionGlobal->GetXaxis ()->CenterLabels ();
419+ hEmptyLaneFractionGlobal->SetMaximum (1 );
420+ hEmptyLaneFractionGlobal->SetMinimum (0 );
421+ hEmptyLaneFractionGlobal->SetStats (0 );
422+
395423 for (int iLayer = 0 ; iLayer < NLayer; iLayer++) {
396424 if (!mEnableLayers [iLayer])
397425 continue ;
0 commit comments