Skip to content

Commit ecf8295

Browse files
authored
ITS/Calibration: better handling of wrong run types and Pixel scans (#2530)
* Added error message about missmatch of scan type * Added correct plots for pixel scans
1 parent fe9ab02 commit ecf8295

File tree

2 files changed

+49
-27
lines changed

2 files changed

+49
-27
lines changed

Modules/ITS/include/ITS/ITSThresholdCalibrationTask.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ enum {
3232
VCASN,
3333
ITHR,
3434
THR,
35-
TOT,
36-
pixel_noise,
37-
pixel_dead,
38-
pixel_ineff
35+
pixel,
36+
TOT
3937
};
4038

4139
namespace o2::quality_control_modules::its
@@ -128,7 +126,9 @@ class ITSThresholdCalibrationTask : public TaskInterface
128126
TH2F *hCalibrationThrNoiseRMSChipAverage[3], *hCalibrationThrNoiseChipAverage[3];
129127
// TH2F *hCalibrationDeadColumns[3], *hCalibrationDeadPixels[3];
130128
TH2D* hCalibrationDColChipAverage[3];
131-
TH2D* hCalibrationPixelpAverage[3][3];
129+
TH2D* hCalibrationPixel_dead[3];
130+
TH2D* hCalibrationPixel_noise[3];
131+
TH2D* hCalibrationPixel_inEff[3];
132132

133133
TH2F* hUnsuccess[3];
134134
TH1F *hCalibrationLayer[NLayer][3], *hCalibrationRMSLayer[NLayer][3];

Modules/ITS/src/ITSThresholdCalibrationTask.cxx

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,11 @@ ITSThresholdCalibrationTask::~ITSThresholdCalibrationTask()
6363
delete hToA[iBarrel];
6464
delete hToARms[iBarrel];
6565
}
66-
if (iScan > 3) {
66+
if (iScan == pixel) {
6767
delete hCalibrationDColChipAverage[iBarrel];
68-
int iPixelScanType = iScan - 4;
69-
delete hCalibrationPixelpAverage[iPixelScanType][iBarrel];
68+
delete hCalibrationPixel_noise[iBarrel];
69+
delete hCalibrationPixel_dead[iBarrel];
70+
delete hCalibrationPixel_inEff[iBarrel];
7071
}
7172
}
7273

@@ -95,12 +96,11 @@ void ITSThresholdCalibrationTask::initialize(o2::framework::InitContext& /*ctx*/
9596
CalibType = VCASN;
9697
else if (mCalibrationType == "TOT")
9798
CalibType = TOT;
98-
else if (mCalibrationType == "pixel_noise")
99-
CalibType = pixel_noise;
100-
else if (mCalibrationType == "pixel_dead")
101-
CalibType = pixel_dead;
102-
else if (mCalibrationType == "pixel_ineff")
103-
CalibType = pixel_ineff;
99+
else if (mCalibrationType == "Pixel")
100+
CalibType = pixel;
101+
102+
else
103+
ILOG(Fatal, Support) << "Scan Type from .json " << mCalibrationType << " is Unknown! (should be THR, ITHR, VCASN or Pixel" << ENDM;
104104

105105
createAllHistos();
106106
publishHistos();
@@ -155,6 +155,10 @@ void ITSThresholdCalibrationTask::monitorData(o2::framework::ProcessingContext&
155155
else if (scanType == 'P') {
156156
iScan = 4;
157157
}
158+
159+
if (iScan != CalibType)
160+
ILOG(Fatal, Support) << "Scan Type from Data: " << scanType << " is different from scan type from .json " << CalibType << ENDM;
161+
158162
auto splitRes = splitString(inString, "O2");
159163

160164
if (scanType == 'A' || scanType == 'D')
@@ -237,8 +241,13 @@ void ITSThresholdCalibrationTask::doAnalysisPixel(std::string inString)
237241
int iBarrel = getBarrel(result.Layer);
238242
int currentChip = getCurrentChip(iBarrel, result.ChipID, result.HIC, result.Hs);
239243

240-
hCalibrationPixelpAverage[result.Type][iBarrel]->SetBinContent(currentChip, currentStave, result.counts);
241244
if (result.Type == 0)
245+
hCalibrationPixel_noise[iBarrel]->SetBinContent(currentChip, currentStave, result.counts);
246+
else if (result.Type == 1)
247+
hCalibrationPixel_dead[iBarrel]->SetBinContent(currentChip, currentStave, result.counts);
248+
else if (result.Type == 2)
249+
hCalibrationPixel_inEff[iBarrel]->SetBinContent(currentChip, currentStave, result.counts);
250+
else
242251
hCalibrationDColChipAverage[iBarrel]->SetBinContent(currentChip, currentStave, result.Dcols);
243252
}
244253
}
@@ -396,8 +405,9 @@ void ITSThresholdCalibrationTask::reset()
396405
}
397406
if (iScan > 3) {
398407
hCalibrationDColChipAverage[iBarrel]->Reset();
399-
int iPixelScanType = iScan - 4;
400-
hCalibrationPixelpAverage[iPixelScanType][iBarrel]->Reset();
408+
hCalibrationPixel_dead[iBarrel]->Reset();
409+
hCalibrationPixel_noise[iBarrel]->Reset();
410+
hCalibrationPixel_inEff[iBarrel]->Reset();
401411
}
402412
}
403413
if (iScan == TOT) {
@@ -560,19 +570,31 @@ void ITSThresholdCalibrationTask::createAllHistos()
560570
}
561571
}
562572

563-
if (iScan > 3) {
573+
if (iScan == pixel) {
564574

565575
for (int iBarrel = 0; iBarrel < 3; iBarrel++) {
566576

567-
int iType = iScan - 4;
568-
{
569-
hCalibrationPixelpAverage[iType][iBarrel] = new TH2D(Form("%sPixels%s", sCalibrationType[iType].Data(), sBarrelType[iBarrel].Data()), Form("Number of %s pixels per chip for %s", sCalibrationType[iType].Data(), sBarrelType[iBarrel].Data()), nChips[iBarrel], -0.5, nChips[iBarrel] - 0.5, nStaves[iBarrel], -0.5, nStaves[iBarrel] - 0.5);
570-
hCalibrationPixelpAverage[iType][iBarrel]->SetStats(0);
571-
if (iBarrel != 0)
572-
formatAxes(hCalibrationPixelpAverage[iType][iBarrel], "Chip", "", 1, 1.10);
573-
formatLayers(hCalibrationPixelpAverage[iType][iBarrel], iBarrel);
574-
addObject(hCalibrationPixelpAverage[iType][iBarrel]);
575-
}
577+
hCalibrationPixel_dead[iBarrel] = new TH2D(Form("DeadPixels%s", sBarrelType[iBarrel].Data()), Form("Number of Dead pixels per chip for %s", sBarrelType[iBarrel].Data()), nChips[iBarrel], -0.5, nChips[iBarrel] - 0.5, nStaves[iBarrel], -0.5, nStaves[iBarrel] - 0.5);
578+
hCalibrationPixel_dead[iBarrel]->SetStats(0);
579+
if (iBarrel != 0)
580+
formatAxes(hCalibrationPixel_dead[iBarrel], "Chip", "", 1, 1.10);
581+
formatLayers(hCalibrationPixel_dead[iBarrel], iBarrel);
582+
addObject(hCalibrationPixel_dead[iBarrel]);
583+
584+
hCalibrationPixel_noise[iBarrel] = new TH2D(Form("NoisePixels%s", sBarrelType[iBarrel].Data()), Form("Number of Noise pixels per chip for %s", sBarrelType[iBarrel].Data()), nChips[iBarrel], -0.5, nChips[iBarrel] - 0.5, nStaves[iBarrel], -0.5, nStaves[iBarrel] - 0.5);
585+
hCalibrationPixel_noise[iBarrel]->SetStats(0);
586+
if (iBarrel != 0)
587+
formatAxes(hCalibrationPixel_noise[iBarrel], "Chip", "", 1, 1.10);
588+
formatLayers(hCalibrationPixel_noise[iBarrel], iBarrel);
589+
addObject(hCalibrationPixel_noise[iBarrel]);
590+
591+
hCalibrationPixel_inEff[iBarrel] = new TH2D(Form("InEffPixels%s", sBarrelType[iBarrel].Data()), Form("Number of InEff pixels per chip for %s", sBarrelType[iBarrel].Data()), nChips[iBarrel], -0.5, nChips[iBarrel] - 0.5, nStaves[iBarrel], -0.5, nStaves[iBarrel] - 0.5);
592+
hCalibrationPixel_inEff[iBarrel]->SetStats(0);
593+
if (iBarrel != 0)
594+
formatAxes(hCalibrationPixel_inEff[iBarrel], "Chip", "", 1, 1.10);
595+
formatLayers(hCalibrationPixel_inEff[iBarrel], iBarrel);
596+
addObject(hCalibrationPixel_inEff[iBarrel]);
597+
576598
hCalibrationDColChipAverage[iBarrel] = new TH2D(Form("DCols%s", sBarrelType[iBarrel].Data()), Form("Number of DCols per chip for %s", sBarrelType[iBarrel].Data()), nChips[iBarrel], -0.5, nChips[iBarrel] - 0.5, nStaves[iBarrel], -0.5, nStaves[iBarrel] - 0.5);
577599
hCalibrationDColChipAverage[iBarrel]->SetStats(0);
578600
if (iBarrel != 0)

0 commit comments

Comments
 (0)