Belle II Software release-09-00-00
SVDLocalCalibrationsCheckModule.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <svd/modules/svdCalibration/SVDLocalCalibrationsCheckModule.h>
10#include <vxd/geometry/GeoCache.h>
11#include <svd/geometry/SensorInfo.h>
12
13#include <TCanvas.h>
14#include <TLine.h>
15#include <TPaveText.h>
16#include <TStyle.h>
17#include <TText.h>
18
19using namespace Belle2;
20
21//-----------------------------------------------------------------
22// Register the Module
23//-----------------------------------------------------------------
24REG_MODULE(SVDLocalCalibrationsCheck);
25
26//-----------------------------------------------------------------
27// Implementation
28//-----------------------------------------------------------------
29
31{
32 // Set module properties
33 setDescription("Module to produce a list of histograms showing the uploaded calibration constants");
34
35 // Parameter definitions
36 addParam("outputPdfName", m_outputPdfName, "output pdf filename", std::string("SVDLocalCalibrationsCheck.pdf"));
37 addParam("referenceID", m_idFileNameREF, "ID of REFERENCE xml file.",
38 std::string("refID"));
39 addParam("checkID", m_idFileNameCHECK, "ID of CHECK xml file.",
40 std::string("checkID"));
41 addParam("reference_root", m_rootFileNameREF, "Name of REFERENCE root file.",
42 std::string("SVDLocalCalibrationsMonitor_ref.root"));
43 addParam("check_root", m_rootFileNameCHECK, "Name of CHECK root file.",
44 std::string("SVDLocalCalibrationsMonitor_check.root"));
45 addParam("plotGoodAPVs", m_plotGoodAPVs, "If true draw 1D plots also for good APVs", bool(false));
46
47 addParam("cutN_outliers", m_cutN_out, "Max number of outliers allowed", int(5));
48 addParam("cutNoise_average", m_cutNoise_ave, "Max deviation of average noise per APV, in ADC", float(0.1));
49 addParam("cutNoise_outliers", m_cutNoise_out, "Max deviation of single strip, in ADC", float(2));
50 addParam("cutCalPeakADC_average", m_cutCalpeakADC_ave, "Max deviation of average CalPeakADC per APV, in ADC", float(4));
51 addParam("cutCalPeakADC_outliers", m_cutCalpeakADC_out, "Max deviation of single strip, in ADC", float(10));
52 addParam("cutPedestal_average", m_cutPedestal_ave, "Max deviation of average pedestal per APV, in ADC", float(4));
53 addParam("cutPedestal_outliers", m_cutPedestal_out, "Max deviation of single strip, in ADC", float(10));
54
55}
56
58{
59 B2INFO("SVD Local Calibration Check Configuration");
60 B2INFO("-----------------------------------------");
61 B2INFO("");
62 B2INFO("- input files:");
63 B2INFO(" reference: " << m_idFileNameREF);
64 B2INFO(" check: " << m_idFileNameCHECK);
65 B2INFO("- output file:");
66 B2INFO(" output pdf: " << m_outputPdfName);
67 B2INFO("");
68 B2INFO("- analysis parameters:");
69 B2INFO(" outliers (Noise, Pedestal, CalPeakADC)");
70 B2INFO(" max allowed outliers = " << m_cutN_out);
71 B2INFO(" Noise");
72 B2INFO(" max difference on the APV averages = " << m_cutNoise_ave << " ADC");
73 B2INFO(" max to mark a strip as outlier = " << m_cutNoise_out << " ADC");
74 B2INFO(" CalPeakADC");
75 B2INFO(" max difference on the APV averages = " << m_cutCalpeakADC_ave << " ADC");
76 B2INFO(" max to mark a strip as outlier = " << m_cutCalpeakADC_out << " ADC");
77 B2INFO(" Pedestal");
78 B2INFO(" max difference on the APV averages = " << m_cutPedestal_ave << " ADC");
79 B2INFO(" max to mark a strip as outlier = " << m_cutPedestal_out << " ADC");
80 B2INFO("--------------------------------------------------------------");
81 B2INFO("");
82}
83
85{
86
88
89 gStyle->SetOptStat(0);
90 gStyle->SetLegendBorderSize(0);
91 gStyle->SetTextFont(42);
92
93 // read REFERENCE root file
94 m_rootFilePtrREF = new TFile(m_rootFileNameREF.c_str(), "READ");
95
96 // m_rootFilePtrREF->Print();
97
98 //REF tree initialization
99 m_treeREF = (TTree*)m_rootFilePtrREF->Get("calibLocalDetailed");
100 m_treeREF->SetBranchAddress("run", &m_runREF, &b_runREF);
101 m_treeREF->SetBranchAddress("layer", &m_layerREF, &b_layerREF);
102 m_treeREF->SetBranchAddress("ladder", &m_ladderREF, &b_ladderREF);
103 m_treeREF->SetBranchAddress("sensor", &m_sensorREF, &b_sensorREF);
104 m_treeREF->SetBranchAddress("side", &m_sideREF, &b_sideREF);
105 m_treeREF->SetBranchAddress("strip", &m_stripREF, &b_stripREF);
106 m_treeREF->SetBranchAddress("mask", &m_maskREF, &b_maskREF);
107 m_treeREF->SetBranchAddress("noise", &m_noiseREF, &b_noiseREF);
108 m_treeREF->SetBranchAddress("noiseEl", &m_noiseElREF, &b_noiseElREF);
109 m_treeREF->SetBranchAddress("gain", &m_gainREF, &b_gainREF);
110 m_treeREF->SetBranchAddress("pedestal", &m_pedestalREF, &b_pedestalREF);
111 m_treeREF->SetBranchAddress("calPeakADC", &m_calPeakADCREF, &b_calPeakADCREF);
112 m_treeREF->SetBranchAddress("calPeakTime", &m_calPeakTimeREF, &b_calPeakTimeREF);
113 m_treeREF->SetBranchAddress("pulseWidth", &m_pulseWidthREF, &b_pulseWidthREF);
114
115 // read CHECK root file
116 m_rootFilePtrCHECK = new TFile(m_rootFileNameCHECK.c_str(), "READ");
117 // m_rootFilePtrCHECK->Print();
118
119 //CHECK tree initialization
120 m_treeCHECK = (TTree*)m_rootFilePtrCHECK->Get("calibLocalDetailed");
121 m_treeCHECK->SetBranchAddress("run", &m_runCHECK, &b_runCHECK);
122 m_treeCHECK->SetBranchAddress("layer", &m_layerCHECK, &b_layerCHECK);
123 m_treeCHECK->SetBranchAddress("ladder", &m_ladderCHECK, &b_ladderCHECK);
124 m_treeCHECK->SetBranchAddress("sensor", &m_sensorCHECK, &b_sensorCHECK);
125 m_treeCHECK->SetBranchAddress("side", &m_sideCHECK, &b_sideCHECK);
126 m_treeCHECK->SetBranchAddress("strip", &m_stripCHECK, &b_stripCHECK);
127 m_treeCHECK->SetBranchAddress("mask", &m_maskCHECK, &b_maskCHECK);
128 m_treeCHECK->SetBranchAddress("noise", &m_noiseCHECK, &b_noiseCHECK);
129 m_treeCHECK->SetBranchAddress("noiseEl", &m_noiseElCHECK, &b_noiseElCHECK);
130 m_treeCHECK->SetBranchAddress("gain", &m_gainCHECK, &b_gainCHECK);
131 m_treeCHECK->SetBranchAddress("pedestal", &m_pedestalCHECK, &b_pedestalCHECK);
132 m_treeCHECK->SetBranchAddress("calPeakTime", &m_calPeakTimeCHECK, &b_calPeakTimeCHECK);
133 m_treeCHECK->SetBranchAddress("calPeakADC", &m_calPeakADCCHECK, &b_calPeakADCCHECK);
134 m_treeCHECK->SetBranchAddress("pulseWidth", &m_pulseWidthCHECK, &b_pulseWidthCHECK);
135
136
138 m_h2MaskREF = (SVDHistograms<TH2F>*)m_rootFilePtrREF->Get("expert/h2Mask");
139 m_h2MaskCHECK = (SVDHistograms<TH2F>*)m_rootFilePtrCHECK->Get("expert/h2Mask");
140
141 TH1F template_mask("maskDIFF_L@layerL@ladderS@sensor@view@apv",
142 "Mask Deviation Distribution in @layer.@ladder.@sensor @view/@side",
143 // 200, -1, 1);
144 200, -5, 5);
145 // template_mask.GetXaxis()->SetTitle("( ref - check ) / ref");
146 template_mask.GetXaxis()->SetTitle("ref - check");
147 m_hMaskDIFF = new SVDAPVHistograms<TH1F>(template_mask);
149 m_hMaskSummary = new SVDSummaryPlots("maskSummary@view", "REF - CHECK Number of Masked strips @view/@side Side");
150 m_hMaskSummaryCHECK = new SVDSummaryPlots("maskCHECKSummary@view", "CHECK Number Masked Strips @view/@side Side");
151
153 m_h2NoiseREF = (SVDHistograms<TH2F>*)m_rootFilePtrREF->Get("expert/h2Noise");
154 m_h2NoiseCHECK = (SVDHistograms<TH2F>*)m_rootFilePtrCHECK->Get("expert/h2Noise");
155
156 TH1F template_noise("noiseDIFF_L@layerL@ladderS@sensor@view@apv",
157 "Noise Deviation Distribution in @layer.@ladder.@sensor @view/@side",
158 // 200, -1, 1);
159 200, -5, 5);
160 // template_noise.GetXaxis()->SetTitle("( ref - check ) / ref");
161 template_noise.GetXaxis()->SetTitle("ref - check (ADC)");
162 m_hNoiseDIFF = new SVDAPVHistograms<TH1F>(template_noise);
164 m_hNoiseSummary = new SVDSummaryPlots("noiseSummary@view", "Number of problematic APV chips due to Noise for @view/@side Side");
165
166
167
168
170 m_h2CalpeakTimeREF = (SVDHistograms<TH2F>*)m_rootFilePtrREF->Get("expert/h2CalPeakTime");
171 m_h2CalpeakTimeCHECK = (SVDHistograms<TH2F>*)m_rootFilePtrCHECK->Get("expert/h2CalPeakTime");
172
173 TH1F template_calpeakTime("calpeakTimeDIFF_L@layerL@ladderS@sensor@view@apv",
174 // "CalpeakTime Deviation Distribution in @layer.@ladder.@sensor @view/@side APV @apv",
175 "CalPeakTime Deviation Distribution in @layer.@ladder.@sensor @view/@side",
176 500, -0.5, 0.5);
177 template_calpeakTime.GetXaxis()->SetTitle("( ref - check ) / ref");
178 m_hCalpeakTimeDIFF = new SVDAPVHistograms<TH1F>(template_calpeakTime);
180 m_hCalpeakTimeSummary = new SVDSummaryPlots("calPeakTimeSummary@view",
181 "Number of problematic APV chips due to CalPeakTime for @view/@side Side for @view/@side Side");
182
184 m_h2CalpeakADCREF = (SVDHistograms<TH2F>*)m_rootFilePtrREF->Get("expert/h2CalPeakADC");
185 m_h2CalpeakADCCHECK = (SVDHistograms<TH2F>*)m_rootFilePtrCHECK->Get("expert/h2CalPeakADC");
186
187 TH1F template_calpeakADC("calpeakADCDIFF_L@layerL@ladderS@sensor@view@apv",
188 // "CalpeakADC Deviation Distribution in @layer.@ladder.@sensor @view/@side APV @apv",
189 "CalPeakADC Deviation Distribution in @layer.@ladder.@sensor @view/@side",
190 400, -20, 20);
191 template_calpeakADC.GetXaxis()->SetTitle("ref - check (ADC)");
192 m_hCalpeakADCDIFF = new SVDAPVHistograms<TH1F>(template_calpeakADC);
194 m_hCalpeakADCSummary = new SVDSummaryPlots("calPeakADCSummary@view",
195 "Number of problematic APV chips due to CalPeakADC for @view/@side Side");
196
197
199 m_h2PedestalREF = (SVDHistograms<TH2F>*)m_rootFilePtrREF->Get("expert/h2Pedestal");
200 m_h2PedestalCHECK = (SVDHistograms<TH2F>*)m_rootFilePtrCHECK->Get("expert/h2Pedestal");
201
202 TH1F template_pedestal("pedestalDIFF_L@layerL@ladderS@sensor@view@apv",
203 "Pedestal Deviation Distribution in @layer.@ladder.@sensor @view/@side",
204 // 100, -0.5, 0.5);
205 100, -15, 15);
206 // template_pedestal.GetXaxis()->SetTitle("( ref - check ) / ref");
207 template_pedestal.GetXaxis()->SetTitle("(ref - check) (ADC)");
208 m_hPedestalDIFF = new SVDAPVHistograms<TH1F>(template_pedestal);
210 m_hPedestalSummary = new SVDSummaryPlots("pedestalSummary@view",
211 "Number of problematic APV chips due to Pedestal for @view/@side Side");
212
214}
215
217{
219
220 Long64_t nentries = m_treeREF->GetEntriesFast();
221
222 for (Long64_t jentry = 0; jentry < nentries; jentry++) {
223 m_treeREF->GetEntry(jentry);
224 m_treeCHECK->GetEntry(jentry);
226 float diff = 0;
227
228
229 diff = (m_maskREF - m_maskCHECK);// / m_maskREF;
230 m_hMaskDIFF->fill(theVxdID, (int)m_sideREF, (int)m_stripREF / 128, diff);
231 if (m_sideREF == 1) {
234 } else {
237 }
238 m_hMaskSummaryCHECK->fill(theVxdID, (int)m_sideREF, (float)m_maskCHECK);
239
240 diff = (m_noiseREF - m_noiseCHECK);// / m_noiseREF;
241 m_hNoiseDIFF->fill(theVxdID, (int)m_sideREF, (int)m_stripREF / 128, diff);
242
244 m_hCalpeakTimeDIFF->fill(theVxdID, (int)m_sideREF, (int)m_stripREF / 128, diff);
245
246 diff = (m_calPeakADCREF - m_calPeakADCCHECK);// / m_calPeakADCREF;
247 m_hCalpeakADCDIFF->fill(theVxdID, (int)m_sideREF, (int)m_stripREF / 128, diff);
248
249 diff = (m_pedestalREF - m_pedestalCHECK);// / m_pedestalREF;
250 m_hPedestalDIFF->fill(theVxdID, (int)m_sideREF, (int)m_stripREF / 128, diff);
251 }
252
253
254 //call for a geometry instance
256 std::set<Belle2::VxdID> svdLayers = aGeometry.getLayers(VXD::SensorInfoBase::SVD);
257 std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
258
259 while ((itSvdLayers != svdLayers.end()) && (itSvdLayers->getLayerNumber() != 7)) { //loop on Layers
260
261 bool isL3 = false;
262
263 int layer = itSvdLayers->getLayerNumber();
264 printLayerPage(layer);
265
266 if (layer == 3)
267 isL3 = true;
268
269 std::set<Belle2::VxdID> svdLadders = aGeometry.getLadders(*itSvdLayers);
270 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
271
272 while (itSvdLadders != svdLadders.end()) { //loop on Ladders
273
274 std::set<Belle2::VxdID> svdSensors = aGeometry.getSensors(*itSvdLadders);
275 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
276
277 while (itSvdSensors != svdSensors.end()) { //loop on sensors
278 B2DEBUG(1, " svd sensor info " << *itSvdSensors);
279
280
281 int ladder = itSvdSensors->getLadderNumber();
282 int sensor = itSvdSensors->getSensorNumber();
283 Belle2::VxdID theVxdID(layer, ladder, sensor);
284 const SVD::SensorInfo* currentSensorInfo = dynamic_cast<const SVD::SensorInfo*>(&VXD::GeoCache::get(theVxdID));
285
286 TList* listEmpty = new TList;
287
288 //noise
289 TList* listNoiseUBAD = new TList;
290 TList* listNoiseUGOOD = new TList;
291 TList* listNoiseVBAD = new TList;
292 TList* listNoiseVGOOD = new TList;
293
294
295 //calpeak
296 TList* listCalpeakADCUBAD = new TList;
297 TList* listCalpeakADCUGOOD = new TList;
298 TList* listCalpeakADCVBAD = new TList;
299 TList* listCalpeakADCVGOOD = new TList;
300
301 //calpeak
302 TList* listCalpeakTimeUGOOD = new TList;
303 TList* listCalpeakTimeVGOOD = new TList;
304
305 //pedestal
306 TList* listPedestalUBAD = new TList;
307 TList* listPedestalUGOOD = new TList;
308 TList* listPedestalVBAD = new TList;
309 TList* listPedestalVGOOD = new TList;
310
311 bool needPlot = false;
312 for (int side = 0; side < 2; side++) {
313
314 int Ncells = currentSensorInfo->getUCells();
315 if (side == 0)
316 Ncells = currentSensorInfo->getVCells();
317
318 int Napv = Ncells / 128;
319
320 for (int m_APV = 0; m_APV < Napv; m_APV++) {
321
322 int problem = 0;
323
324 //mask analysis
325 TH1F* hMask = m_hMaskDIFF->getHistogram(theVxdID, side, m_APV);
326 m_hMaskSummary->fill(theVxdID, side, hMask->GetMean() * 128);
327
328 //noise analysis
329 TH1F* hNoise = m_hNoiseDIFF->getHistogram(theVxdID, side, m_APV);
330 problem = hasAnyProblem(hNoise, m_cutNoise_ave, m_cutNoise_out);
331 if (problem) {
332 needPlot = true;
333 B2INFO("WARNING, ONE APV has Noise problems in: L" << layer << "L" << ladder << "S" << sensor << " side = " << side <<
334 ", APV number = " << m_APV << ", problem ID = " << problem);
335 m_hNoiseSummary->fill(theVxdID, side, 1);
336 if (side == 0)
337 listNoiseVBAD->Add(hNoise);
338 else
339 listNoiseUBAD->Add(hNoise);
340 } else {
341 if (side == 0)
342 listNoiseVGOOD->Add(hNoise);
343 else
344 listNoiseUGOOD->Add(hNoise);
345 }
346
347
348
349 //calpeak analysis
350 TH1F* hCalpeakADC = m_hCalpeakADCDIFF->getHistogram(theVxdID, side, m_APV);
352 if (problem) {
353 needPlot = true;
354 B2INFO("WARNING, ONE APV has CalpeakADC problems in: L" << layer << "L" << ladder << "S" << sensor << " side = " << side <<
355 ", APV number = " << m_APV << " problem ID = " << problem);
356 m_hCalpeakADCSummary->fill(theVxdID, side, 1);
357 if (side == 0)
358 listCalpeakADCVBAD->Add(hCalpeakADC);
359 else
360 listCalpeakADCUBAD->Add(hCalpeakADC);
361 } else {
362 if (side == 0)
363 listCalpeakADCVGOOD->Add(hCalpeakADC);
364 else
365 listCalpeakADCUGOOD->Add(hCalpeakADC);
366 }
367
368 //calpeak plot
369 TH1F* hCalpeakTime = m_hCalpeakTimeDIFF->getHistogram(theVxdID, side, m_APV);
370 if (side == 0)
371 listCalpeakTimeVGOOD->Add(hCalpeakTime);
372 else
373 listCalpeakTimeUGOOD->Add(hCalpeakTime);
374
375
376 //pedestal analysis
377 TH1F* hPedestal = m_hPedestalDIFF->getHistogram(theVxdID, side, m_APV);
379 if (problem) {
380 needPlot = true;
381 B2INFO("WARNING, ONE APV has Pedestal problems in: L" << layer << "L" << ladder << "S" << sensor << " side = " << side <<
382 ", APV number = " << m_APV << " problem ID = " << problem);
383 m_hPedestalSummary->fill(theVxdID, side, 1);
384 if (side == 0)
385 listPedestalVBAD->Add(hPedestal);
386 else
387 listPedestalUBAD->Add(hPedestal);
388 } else {
389 if (side == 0)
390 listPedestalVGOOD->Add(hPedestal);
391 else
392 listPedestalUGOOD->Add(hPedestal);
393 }
394
395
396
397 }
398 }
399 if (needPlot) {
400 printPage(theVxdID, listNoiseUBAD, listNoiseVBAD, listNoiseUGOOD, listNoiseVGOOD, "Noise", isL3);
401 printPage(theVxdID, listCalpeakADCUBAD, listCalpeakADCVBAD, listCalpeakADCUGOOD, listCalpeakADCVGOOD, "CalpeakADC", isL3);
402 printPage(theVxdID, listEmpty, listEmpty, listCalpeakTimeUGOOD, listCalpeakTimeVGOOD, "CalpeakTime", isL3);
403 printPage(theVxdID, listPedestalUBAD, listPedestalVBAD, listPedestalUGOOD, listPedestalVGOOD, "Pedestal", isL3);
404 }
405 ++itSvdSensors;
406 }
407 ++itSvdLadders;
408 }
409 ++itSvdLayers;
410 }
411
415
416}
417
419{
420
421 TCanvas* empty = new TCanvas();
422 TString pdf_open = TString(m_outputPdfName) + "[";
423 empty->Print(pdf_open);
424
425 TCanvas* first = new TCanvas("open_pag1", "test first page");
426 first->cd();
427 TPaveText* pt_title = new TPaveText(.05, .9, .95, 1, "blNDC");
428 char name[50];
429 sprintf(name, "Local Calibration Check Results");
430 pt_title->AddText(name);
431 pt_title->SetTextFont(42);
432 pt_title->SetTextColor(kBlack);
433 pt_title->SetShadowColor(0);
434 pt_title->SetFillColor(10);
435 pt_title->SetBorderSize(0);
436 pt_title->SetTextSize(0.08);
437 pt_title->Draw();
438
439 TPaveText* pt_input_title = new TPaveText(.05, .8, .95, .85);
440 TPaveText* pt_input = new TPaveText(.05, .72, .8, .8);
441 char input[150];
442 sprintf(input, "%s", "input files");
443 pt_input_title->AddText(input);
444 pt_input_title->SetShadowColor(0);
445 pt_input_title->SetBorderSize(0);
446 pt_input_title->SetTextSize(0.03);
447 if (m_idFileNameREF == "refID")
448 sprintf(input, "reference rootfile = %s", m_rootFileNameREF.c_str());
449 else
450 sprintf(input, " reference ID = %s", m_idFileNameREF.c_str());
451 pt_input->AddText(input);
452 ((TText*)pt_input->GetListOfLines()->Last())->SetTextColor(kRed);
453 if (m_idFileNameCHECK == "checkID")
454 sprintf(input, "calibration rootfile = %s", m_rootFileNameCHECK.c_str());
455 else
456 sprintf(input, "calibration ID = %s", m_idFileNameCHECK.c_str());
457 pt_input->AddText(input);
458 ((TText*)pt_input->GetListOfLines()->Last())->SetTextColor(kBlue);
459 pt_input->SetTextSize(0.02);
460 pt_input->SetTextAlign(12);
461 pt_input->SetShadowColor(0);
462 pt_input->SetBorderSize(0);
463 pt_input->SetFillColor(10);
464
465 pt_input_title->Draw();
466 pt_input->Draw();
467
468 TPaveText* pt_cuts_title = new TPaveText(.05, .65, .95, .7);
469 TPaveText* pt_cuts = new TPaveText(.05, .15, .8, .60);
470 char cuts[512];
471 sprintf(cuts, "%s", "selection criteria");
472 pt_cuts_title->AddText(cuts);
473 pt_cuts_title->SetShadowColor(0);
474 pt_cuts_title->SetBorderSize(0);
475 pt_cuts_title->SetTextSize(0.03);
476 sprintf(cuts, " An APV chip is selected as problematic if passes the criteria on Noise or CalPeakADC or Pedestal");
477 pt_cuts->AddText(cuts);
478 // NOISE
479 sprintf(cuts, " Noise: an APV is problematic if 1. or 2. or 3.");
480 pt_cuts->AddText(cuts);
481 sprintf(cuts, " 1. abs(ref_ave - check_ave) > %1.2f ADC", m_cutNoise_ave);
482 pt_cuts->AddText(cuts);
483 sprintf(cuts, " 2. more than %d strips with a value %1.2f ADC higher than the value of the ref calibration", m_cutN_out,
485 pt_cuts->AddText(cuts);
486 sprintf(cuts, " 3. more than %d strips with a value %1.2f ADC lower than the value of the ref calibration", m_cutN_out,
488 pt_cuts->AddText(cuts);
489 // CALPEAK ADC
490 sprintf(cuts, " CalPeakADC: an APV is problematic if 1. or 2. or 3.");
491 pt_cuts->AddText(cuts);
492 sprintf(cuts, " 1. abs(ref_ave - check_ave) > %1.2f ADC", m_cutCalpeakADC_ave);
493 pt_cuts->AddText(cuts);
494 sprintf(cuts, " 2. more than %d strips with a value %1.1f ADC higher than the value of the ref calibration", m_cutN_out,
496 pt_cuts->AddText(cuts);
497 sprintf(cuts, " 3. more than %d strips with a value %1.1f ADC lower than the value of the ref calibration", m_cutN_out,
499 pt_cuts->AddText(cuts);
500 // PEDESTAL
501 sprintf(cuts, " Pedestal: an APV is problematic if 1. or 2. or 3.");
502 pt_cuts->AddText(cuts);
503 sprintf(cuts, " 1. abs(ref_ave - check_ave) > %1.1f ADC", m_cutPedestal_ave);
504 pt_cuts->AddText(cuts);
505 sprintf(cuts, " 2. more than %d strips with a value %1.1f ADC higher than the value of the ref calibration", m_cutN_out,
507 pt_cuts->AddText(cuts);
508 sprintf(cuts, " 3. more than %d strips with a value %1.1f ADC lower than the value of the ref calibration", m_cutN_out,
510 pt_cuts->AddText(cuts);
511 sprintf(cuts,
512 " where:");
513 pt_cuts->AddText(cuts);
514 sprintf(cuts,
515 " - {ref,check}_ave is the variable averaged on one APV chip of the reference or the check calibration");
516 pt_cuts->AddText(cuts);
517 sprintf(cuts,
518 " - 1 2 and 3 are the problem ID printed on screen while running the python script");
519 pt_cuts->AddText(cuts);
520 pt_cuts->SetTextSize(0.02);
521 pt_cuts->SetShadowColor(0);
522 pt_cuts->SetBorderSize(0);
523 pt_cuts->SetFillColor(10);
524 pt_cuts->SetTextAlign(12);
525
526 pt_cuts_title->Draw();
527 pt_cuts->Draw();
528
529 TPaveText* pt_tag_title = new TPaveText(.05, .03, .95, .07);
530 char tag[100];
531 sprintf(tag, "analysis algorithm ID 1.0");
532 pt_tag_title->AddText(tag);
533 // pt_tag_title->SetTextFont(62);
534 pt_tag_title->SetShadowColor(0);
535 pt_tag_title->SetFillColor(18);
536 pt_tag_title->SetBorderSize(0);
537 pt_tag_title->SetTextSize(0.02);
538 pt_tag_title->Draw();
539 first->Print(m_outputPdfName.c_str());
540}
541
543{
544
545 TCanvas* cLayer = new TCanvas();
546 cLayer->cd();
547 TPaveText* pt_title = new TPaveText(.05, .4, .95, 0.6, "blNDC");
548 char name[50];
549 sprintf(name, "Layer %d", layer);
550 pt_title->AddText(name);
551 pt_title->SetTextFont(42);
552 pt_title->SetTextColor(kBlack);
553 pt_title->SetShadowColor(0);
554 pt_title->SetFillColor(10);
555 pt_title->SetBorderSize(0);
556 pt_title->SetTextSize(0.08);
557 pt_title->Draw();
558 cLayer->Print(m_outputPdfName.c_str());
559
560}
561
562void SVDLocalCalibrationsCheckModule::printPage(VxdID theVxdID, TList* listUBAD, TList* listVBAD, TList* listUGOOD,
563 TList* listVGOOD, TString variable, bool isL3)
564{
565
566 TH2F* refU = nullptr;
567 TH2F* refV = nullptr;
568 TH2F* checkU = nullptr;
569 TH2F* checkV = nullptr;
570
571 Int_t minY = 0;
572 Int_t maxY = 0;
573
574 Float_t leftLine = 0;
575 Float_t rightLine = 0;
576 Float_t topLine = 0;
577
578 if (variable == "Noise") {
579 refU = m_h2NoiseREF->getHistogram(theVxdID, 1);
580 refV = m_h2NoiseREF->getHistogram(theVxdID, 0);
581 checkU = m_h2NoiseCHECK->getHistogram(theVxdID, 1);
582 checkV = m_h2NoiseCHECK->getHistogram(theVxdID, 0);
583 // minY = refU->GetYaxis()->GetXmin();
584 // maxY = refU->GetYaxis()->GetXmax();
585 minY = 0;
586 maxY = 6;
587 leftLine = -m_cutNoise_out;
588 rightLine = m_cutNoise_out;
589 topLine = 5;
590 } else if (variable == "CalpeakADC") {
591 refU = m_h2CalpeakADCREF->getHistogram(theVxdID, 1);
592 refV = m_h2CalpeakADCREF->getHistogram(theVxdID, 0);
593 checkU = m_h2CalpeakADCCHECK->getHistogram(theVxdID, 1);
594 checkV = m_h2CalpeakADCCHECK->getHistogram(theVxdID, 0);
595 minY = refU->GetYaxis()->GetXmin();
596 maxY = refU->GetYaxis()->GetXmax();
597 leftLine = -m_cutCalpeakADC_out;
598 rightLine = m_cutCalpeakADC_out;
599 topLine = 15;
600 } else if (variable == "CalpeakTime") {
601 refU = m_h2CalpeakTimeREF->getHistogram(theVxdID, 1);
602 refV = m_h2CalpeakTimeREF->getHistogram(theVxdID, 0);
603 checkU = m_h2CalpeakTimeCHECK->getHistogram(theVxdID, 1);
604 checkV = m_h2CalpeakTimeCHECK->getHistogram(theVxdID, 0);
605 minY = refU->GetYaxis()->GetXmin();
606 maxY = refU->GetYaxis()->GetXmax();
607 } else if (variable == "Pedestal") {
608 refU = m_h2PedestalREF->getHistogram(theVxdID, 1);
609 refV = m_h2PedestalREF->getHistogram(theVxdID, 0);
610 checkU = m_h2PedestalCHECK->getHistogram(theVxdID, 1);
611 checkV = m_h2PedestalCHECK->getHistogram(theVxdID, 0);
612 // minY = refU->GetYaxis()->GetXmin();
613 // maxY = refU->GetYaxis()->GetXmax();
614 minY = 250;
615 maxY = 500;
616 leftLine = -m_cutPedestal_out;
617 rightLine = m_cutPedestal_out;
618 topLine = 25;
619 } else {
620 B2FATAL("The printPage function is not implemented for" << LogVar("variable", variable));
621 }
622 refU->GetYaxis()->SetRangeUser(minY, maxY);
623 refV->GetYaxis()->SetRangeUser(minY, maxY);
624 checkU->GetYaxis()->SetRangeUser(minY, maxY);
625 checkV->GetYaxis()->SetRangeUser(minY, maxY);
626
627 refU->SetMarkerColor(kRed);
628 refV->SetMarkerColor(kRed);
629 checkU->SetMarkerColor(kBlue);
630 checkV->SetMarkerColor(kBlue);
631
632 float min = minY;
633 float max = maxY;
634
635 //create outliers lines
636 TLine lLeft(leftLine, 0, leftLine, topLine);
637 TLine lRight(rightLine, 0, rightLine, topLine);
638 lLeft.SetLineColor(15);
639 lRight.SetLineColor(15);
640 lLeft.SetLineStyle(kDashed);
641 lRight.SetLineStyle(kDashed);
642
643 //create APVlines
644 TLine l1(128, min, 128, max);
645 TLine l2(128 * 2, min, 128 * 2, max);
646 TLine l3(128 * 3, min, 128 * 3, max);
647 TLine l4(128 * 4, min, 128 * 4, max);
648 TLine l5(128 * 5, min, 128 * 5, max);
649 l1.SetLineColor(15);
650 l2.SetLineColor(15);
651 l3.SetLineColor(15);
652 l4.SetLineColor(15);
653 l5.SetLineColor(15);
654 TCanvas* c = new TCanvas();
655 TPaveText* pt_sensorID = new TPaveText(.495, 0.485, .505, 0.505, "blNDC");
656 char name[50];
657 sprintf(name, "%d.%d.%.d", theVxdID.getLayerNumber(), theVxdID.getLadderNumber(), theVxdID.getSensorNumber());
658 pt_sensorID->AddText(name);
659 pt_sensorID->SetTextFont(82);
660 pt_sensorID->SetTextColor(kBlack);
661 pt_sensorID->SetShadowColor(0);
662 pt_sensorID->SetFillColor(10);
663 pt_sensorID->SetBorderSize(0);
664 pt_sensorID->SetTextSize(0.08);
665
666
667 c->Divide(2, 2);
668 c->cd(1);
669 refU->Draw();
670 l1.Draw("same");
671 l2.Draw("same");
672 l3.Draw("same");
673 l4.Draw("same");
674 l5.Draw("same");
675 refU->Draw("same");
676 checkU->Draw("same");
677 m_leg2D->Draw("same");
678
679 c->cd(2);
680 TH1F* objDiff;
681 int count = 0;
682 if (m_plotGoodAPVs) {
683 TIter nextH_uGood(listUGOOD);
684 while ((objDiff = (TH1F*)nextH_uGood())) {
685 objDiff->SetFillStyle(3004);
686 if (count == 0)
687 objDiff->Draw();
688 else
689 objDiff->Draw("same");
690 count++;
691 }
692 }
693 TIter nextH_uBad(listUBAD);
694 while ((objDiff = (TH1F*)nextH_uBad())) {
695 objDiff->SetFillStyle(0);
696 if (count == 0)
697 objDiff->Draw();
698 else
699 objDiff->Draw("same");
700 count++;
701 }
702 if (count > 0) {
703 lLeft.Draw("same");
704 lRight.Draw("same");
705 m_legU->Draw("same");
706 }
707
708 c->cd(3);
709 refV->Draw();
710 l1.Draw("same");
711 l2.Draw("same");
712 l3.Draw("same");
713 if (isL3) {
714 l4.Draw("same");
715 l5.Draw("same");
716 }
717
718 refV->Draw("same");
719 checkV->Draw("same");
720 m_leg2D->Draw("same");
721
722 c->cd(4);
723 TIter nextH_vBad(listVBAD);
724 count = 0;
725 if (m_plotGoodAPVs) {
726 TIter nextH_vGood(listVGOOD);
727 while ((objDiff = (TH1F*)nextH_vGood())) {
728 objDiff->SetFillStyle(3004);
729 if (count == 0)
730 objDiff->Draw();
731 else
732 objDiff->Draw("same");
733 count++;
734 }
735 }
736 while ((objDiff = (TH1F*)nextH_vBad())) {
737 objDiff->SetFillStyle(0);
738 if (count == 0)
739 objDiff->Draw();
740 else
741 objDiff->Draw("same");
742 count++;
743 }
744 if (count > 0) {
745 lLeft.Draw("same");
746 lRight.Draw("same");
747 if (isL3)
748 m_legU->Draw("same");
749 else
750 m_legV->Draw("same");
751 }
752 c->cd();
753 if (variable == "Noise")
754 pt_sensorID->Draw("same");
755 c->Print(m_outputPdfName.c_str());
756
757}
758
759int SVDLocalCalibrationsCheckModule::hasAnyProblem(TH1F* h, float cutAve, float cutCOUNT)
760{
761
762 float average = h->GetMean();
763 if (std::fabs(average) > cutAve)
764 return 1;
765
766 TAxis* xaxis = h->GetXaxis();
767 Int_t bin1 = xaxis->FindBin(-cutCOUNT);
768 Int_t bin2 = xaxis->FindBin(cutCOUNT);
769 if (bin1 > bin2) {
770 int tmp = bin1;
771 bin1 = bin2;
772 bin2 = tmp;
773 }
774
775 B2DEBUG(1, bin1 << " -> " << bin2 << " with " << xaxis->GetNbins() << " bins");
776
777 if (h->Integral(1, bin1) > m_cutN_out - 1) return 2;
778
779 if (h->Integral(bin2, xaxis->GetNbins()) > m_cutN_out - 1) return 3;
780
781 return 0;
782}
783
784
786{
787
789 std::set<Belle2::VxdID> svdLayers = aGeometry.getLayers(VXD::SensorInfoBase::SVD);
790 std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
791
792 while ((itSvdLayers != svdLayers.end()) && (itSvdLayers->getLayerNumber() != 7)) { //loop on Layers
793
794 std::set<Belle2::VxdID> svdLadders = aGeometry.getLadders(*itSvdLayers);
795 std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
796
797 while (itSvdLadders != svdLadders.end()) { //loop on Ladders
798
799 std::set<Belle2::VxdID> svdSensors = aGeometry.getSensors(*itSvdLadders);
800 std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
801
802 while (itSvdSensors != svdSensors.end()) { //loop on sensors
803
804 int layer = itSvdSensors->getLayerNumber();
805 int ladder = itSvdSensors->getLadderNumber();
806 int sensor = itSvdSensors->getSensorNumber();
807 Belle2::VxdID theVxdID(layer, ladder, sensor);
808 const SVD::SensorInfo* currentSensorInfo = dynamic_cast<const SVD::SensorInfo*>(&VXD::GeoCache::get(theVxdID));
809
810 for (int side = 0; side < 2; side++) {
811
812 int Ncells = currentSensorInfo->getUCells();
813 if (side == 0)
814 Ncells = currentSensorInfo->getVCells();
815
816 int Napv = Ncells / 128;
817
818 for (int m_APV = 0; m_APV < Napv; m_APV++) {
819
820 TH1F* h = m_APVhistos->getHistogram(theVxdID, side, m_APV);
821
822 h->SetFillColor(m_apvColors[m_APV]);
823 h->SetLineColor(m_apvColors[m_APV]);
824 h->SetMarkerColor(m_apvColors[m_APV]);
825 }
826 }
827
828 ++itSvdSensors;
829 }
830 ++itSvdLadders;
831 }
832 ++itSvdLayers;
833 }
834
835
836}
837
838
840{
841
842 TPaveText* pt_cuts_title = new TPaveText(.05, .6, .95, .65);
843 TPaveText* pt_cuts = new TPaveText(.15, .5, .85, .55);
844 char cuts[512];
845 sprintf(cuts, "%s", "APV SUMMARY");
846 pt_cuts_title->SetShadowColor(0);
847 pt_cuts_title->SetBorderSize(0);
848 pt_cuts_title->SetTextSize(0.03);
849 pt_cuts_title->AddText(cuts);
850 sprintf(cuts, "each bin of the plots in the next pages contains the number of problematic APV chips of the sensor");
851 pt_cuts->AddText(cuts);
852 sprintf(cuts, "corresponding to the combination of column (ladder number) and row (layer and sensor number)");
853 pt_cuts->AddText(cuts);
854 pt_cuts->SetTextSize(0.02);
855 pt_cuts->SetShadowColor(0);
856 pt_cuts->SetBorderSize(0);
857 pt_cuts->SetFillColor(10);
858 pt_cuts->SetTextAlign(12);
859
860 TCanvas* explain = new TCanvas();
861 pt_cuts_title->Draw();
862 pt_cuts->Draw();
863 explain->Print(m_outputPdfName.c_str());
864
865 TCanvas* noise = new TCanvas();
866 noise->SetGridx();
867 noise->Divide(2, 2);
868 noise->cd(1);
869 m_hNoiseSummary->getHistogram(1)->Draw("colztext");
870 noise->cd(3);
871 m_hNoiseSummary->getHistogram(0)->Draw("colztext");
872 noise->Print(m_outputPdfName.c_str());
873
874 TCanvas* calpeakADC = new TCanvas();
875 calpeakADC->Divide(2, 2);
876 calpeakADC->cd(1);
877 m_hCalpeakADCSummary->getHistogram(1)->Draw("colztext");
878 calpeakADC->cd(3);
879 m_hCalpeakADCSummary->getHistogram(0)->Draw("colztext");
880 calpeakADC->Print(m_outputPdfName.c_str());
881
882
883
884 TCanvas* pedestal = new TCanvas();
885 pedestal->Divide(2, 2);
886 pedestal->cd(1);
887 m_hPedestalSummary->getHistogram(1)->Draw("colztext");
888 pedestal->cd(3);
889 m_hPedestalSummary->getHistogram(0)->Draw("colztext");
890 pedestal->Print(m_outputPdfName.c_str());
891
892
893}
894
896{
897
898 TPaveText* pt_cuts_title = new TPaveText(.05, .6, .95, .65);
899 TPaveText* pt_cuts = new TPaveText(.15, .4, .85, .55);
900 char cuts[512];
901 sprintf(cuts, "%s", "Masked Strips SUMMARY");
902 pt_cuts_title->SetShadowColor(0);
903 pt_cuts_title->SetBorderSize(0);
904 pt_cuts_title->SetTextSize(0.03);
905 pt_cuts_title->AddText(cuts);
906 float nU = 768 * (2 * 7 + 3 * 10 + 4 * 12 + 5 * 16);
907 float nV = 512 * (2 * 7) + 768 * (3 * 10 + 4 * 12 + 5 * 16);
908 sprintf(cuts, "Number of MASKED strips on the u/P side in the REF calibration = %d (%.3f)%%", m_nMaskedUREF,
909 m_nMaskedUREF * 100. / nU);
910 pt_cuts->AddText(cuts);
911 sprintf(cuts, "Number of MASKED strips on the u/P side in the CHECK calibration = %d (%.3f)%%", m_nMaskedUCHECK,
912 m_nMaskedUCHECK * 100. / nU);
913 pt_cuts->AddText(cuts);
914 sprintf(cuts, "Number of MASKED strips on the v/N side in the REF calibration = %d (%.3f)%%", m_nMaskedVREF,
915 m_nMaskedVREF * 100. / nV);
916 pt_cuts->AddText(cuts);
917 sprintf(cuts, "Number of MASKED strips on the v/N side in the CHECK calibration = %d (%.3f)%%", m_nMaskedVCHECK,
918 m_nMaskedVCHECK * 100. / nV);
919 pt_cuts->AddText(cuts);
920 pt_cuts->SetTextSize(0.02);
921 pt_cuts->SetShadowColor(0);
922 pt_cuts->SetBorderSize(0);
923 pt_cuts->SetFillColor(10);
924 pt_cuts->SetTextAlign(12);
925
926 TCanvas* explain = new TCanvas();
927 pt_cuts_title->Draw();
928 pt_cuts->Draw();
929 explain->Print(m_outputPdfName.c_str());
930
931 TCanvas* mask = new TCanvas();
932 mask->SetGridx();
933 mask->Divide(2, 2);
934 mask->cd(1);
935 m_hMaskSummary->getHistogram(1)->Draw("colztext");
936 mask->cd(2);
937 m_hMaskSummaryCHECK->getHistogram(1)->Draw("colztext");
938 mask->cd(3);
939 m_hMaskSummary->getHistogram(0)->Draw("colztext");
940 mask->cd(4);
941 m_hMaskSummaryCHECK->getHistogram(0)->Draw("colztext");
942 mask->Print(m_outputPdfName.c_str());
943
944
945}
946
948{
949
950 TCanvas* empty = new TCanvas();
951 TString pdf_close = TString(m_outputPdfName) + "]";
952 empty->Print(pdf_close);
953
954
955}
956
957
959{
960
961
962 m_legU = new TLegend(0.75, 0.55, 0.89, 0.89);
963 m_legV = new TLegend(0.75, 0.65, 0.89, 0.89);
964 m_legU->SetFillStyle(0);
965 m_legV->SetFillStyle(0);
966
967
968 TH1F* hAPV1 = new TH1F("apv1", "apv 1", 1, 0, 1);
969 hAPV1->SetLineColor(m_apvColors[0]);
970 m_legU->AddEntry(hAPV1, "apv 1", "l");
971 m_legV->AddEntry(hAPV1, "apv 1", "l");
972 TH1F* hAPV2 = new TH1F("apv2", "apv 2", 2, 0, 2);
973 hAPV2->SetLineColor(m_apvColors[1]);
974 hAPV2->SetMarkerColor(m_apvColors[1]);
975 hAPV2->SetMarkerStyle(21);
976 hAPV2->SetMarkerSize(0.5);
977 m_legU->AddEntry(hAPV2, "apv 2", "l");
978 m_legV->AddEntry(hAPV2, "apv 2", "l");
979 TH1F* hAPV3 = new TH1F("apv3", "apv 3", 3, 0, 3);
980 hAPV3->SetLineColor(m_apvColors[2]);
981 m_legU->AddEntry(hAPV3, "apv 3", "l");
982 m_legV->AddEntry(hAPV3, "apv 3", "l");
983 TH1F* hAPV4 = new TH1F("apv4", "apv 4", 4, 0, 4);
984 hAPV4->SetLineColor(m_apvColors[3]);
985 hAPV4->SetMarkerColor(m_apvColors[3]);
986 hAPV4->SetMarkerStyle(21);
987 hAPV4->SetMarkerSize(0.5);
988 m_legU->AddEntry(hAPV4, "apv 4", "l");
989 m_legV->AddEntry(hAPV4, "apv 4", "l");
990 TH1F* hAPV5 = new TH1F("apv5", "apv 5", 5, 0, 5);
991 hAPV5->SetLineColor(m_apvColors[4]);
992 m_legU->AddEntry(hAPV5, "apv 5", "l");
993 TH1F* hAPV6 = new TH1F("apv6", "apv 6", 6, 0, 6);
994 hAPV6->SetLineColor(m_apvColors[5]);
995 m_legU->AddEntry(hAPV6, "apv 6", "l");
996
997 m_leg2D = new TLegend(0.78, 0.75, 0.89, 0.89);
998 m_leg2D->AddEntry(hAPV2, "ref", "pl");
999 m_leg2D->AddEntry(hAPV4, "check", "pl");
1000 m_leg2D->SetFillStyle(0);
1001}
1002
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
template class for the APV Histograms
H * getHistogram(const VxdID &vxdID, int view, int apv)
get a reference to the histogram for
void fill(const VxdID &vxdID, int view, int apv, Types ... args)
fill the histogram for
template class for SVd histograms
Definition: SVDHistograms.h:24
H * getHistogram(const VxdID &vxdID, int view)
get a reference to the histogram for
Definition: SVDHistograms.h:56
SVDHistograms< TH2F > * m_h2CalpeakADCREF
CALPEAKS ADC.
SVDSummaryPlots * m_hCalpeakADCSummary
calpeakADC summary histo
int m_nMaskedUCHECK
number of masked strips in the check calibration (u side)
TFile * m_rootFilePtrCHECK
pointer at the CHECK root file
SVDHistograms< TH2F > * m_h2CalpeakTimeCHECK
calpeakTime VS strip 2D histo
void printPage(VxdID theVxdID, TList *listUBAD, TList *listVBAD, TList *listUGOOD, TList *listVGOOD, TString variable, bool isL3)
print the page relative to a sensor with problematic APVs
SVDAPVHistograms< TH1F > * m_hMaskDIFF
mask histo
int m_cutN_out
maximum number of allowed outliers
int m_nMaskedUREF
number of masked strips in the reference calibration (u side)
SVDAPVHistograms< TH1F > * m_hCalpeakTimeDIFF
calpeakTime histo
SVDLocalCalibrationsCheckModule()
Constructor: Sets the description, the properties and the parameters of the module.
TBranch * b_calPeakADCCHECK
strip calPeakADC (ADC of max pulse)
SVDHistograms< TH2F > * m_h2CalpeakADCCHECK
calpeakADC VS strip 2D histo
SVDSummaryPlots * m_hMaskSummary
mask summary histo
void printMaskedSummaryPages()
summary page with Masked strips summary plot
virtual void event() override
perform analysis and Draw pdf Canvas
TBranch * b_calPeakADCREF
strip calPeakADC (ADC of max pulse)
float m_cutPedestal_ave
maximum relative deviation APV-average (pedestal)
SVDSummaryPlots * m_hMaskSummaryCHECK
mask summary histo
TFile * m_rootFilePtrREF
pointer at the REFERENCE root file
float m_cutCalpeakADC_ave
maximum relative deviation APV-average (calpeakADC)
void printLayerPage(int layer)
print layer-number page
SVDSummaryPlots * m_hCalpeakTimeSummary
calpeakTime summary histo
float m_cutCalpeakADC_out
maximum relative deviation strip (calpeakADC)
void printAPVSummaryPages()
summary page with 2D summary plot with problemtic APVs
std::string m_idFileNameCHECK
ID of the xml file name CHECK.
SVDHistograms< TH2F > * m_h2NoiseCHECK
noise VS strip 2D histo
SVDAPVHistograms< TH1F > * m_hPedestalDIFF
pedestal histo
bool m_plotGoodAPVs
if true also the good APVs are plotted on the DIFF canvas
float m_cutNoise_ave
maximum relative deviation APV-average (noise)
TBranch * b_calPeakTimeCHECK
strip calPeakTime (time of max pulse)
virtual void beginRun() override
initialize the TTrees and create SVDHistograms and SVDAPVHistograms
int m_nMaskedVREF
number of masked strips in the reference calibration (v side)
float m_cutNoise_out
maximum relative deviation strip (noise)
void printConfiguration()
print the configuration of the check of the calibration VS a reference calibration
int hasAnyProblem(TH1F *h, float cutAve, float cutCOUNT)
return True if the APV has a problem, given a variable
std::string m_rootFileNameREF
root file name REFERENCE
std::string m_idFileNameREF
ID of the xml file name REFERENCE.
SVDAPVHistograms< TH1F > * m_hCalpeakADCDIFF
calpeakADC histo
SVDHistograms< TH2F > * m_h2PedestalCHECK
pedestal VS strip 2D histo
TBranch * b_calPeakTimeREF
strip calPeakTime (time of max pulse)
int m_nMaskedVCHECK
number of masked strips in the check calibration (v side)
void printFirstPage()
print the first page of the output pdf
void createLegends()
create the TLegends for the plot
SVDAPVHistograms< TH1F > * m_hNoiseDIFF
noise histo
SVDSummaryPlots * m_hPedestalSummary
pedestal summary histo
SVDSummaryPlots * m_hNoiseSummary
noise summary histo
SVDHistograms< TH2F > * m_h2MaskCHECK
mask VS strip 2D histo
void setAPVHistoStyles(SVDAPVHistograms< TH1F > *m_APVhistos)
set style of APV histograms
SVDHistograms< TH2F > * m_h2CalpeakTimeREF
CALPEAKS TIME.
float m_cutPedestal_out
maximum relative deviation strip (pedestal)
class to summarize SVD quantities per sensor and side
void fill(int layer, int ladder, int sensor, int view, float value)
fill the histogram for
TH2F * getHistogram(int view)
get a reference to the histogram for
Specific implementation of SensorInfo for SVD Sensors which provides additional sensor specific infor...
Definition: SensorInfo.h:25
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
Definition: GeoCache.cc:176
const std::set< Belle2::VxdID > & getSensors(Belle2::VxdID ladder) const
Return a set of all sensor IDs belonging to a given ladder.
Definition: GeoCache.cc:204
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
const std::set< Belle2::VxdID > & getLadders(Belle2::VxdID layer) const
Return a set of all ladder IDs belonging to a given layer.
Definition: GeoCache.cc:193
static const SensorInfoBase & get(Belle2::VxdID id)
Return a reference to the SensorInfo of a given SensorID.
Definition: GeoCache.h:139
int getVCells() const
Return number of pixel/strips in v direction.
int getUCells() const
Return number of pixel/strips in u direction.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:100
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:98
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:96
Class to store variables with their name which were sent to the logging service.
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
Abstract base class for different kinds of events.