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