Belle II Software  release-05-01-25
SVDROIDQMModule.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2013 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Giulia Casarosa *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <tracking/modules/svdROIFinder/SVDROIDQMModule.h>
12 #include <vxd/geometry/GeoCache.h>
13 
14 #include <TDirectory.h>
15 #include <TH2F.h>
16 
17 using namespace std;
18 using namespace Belle2;
19 
20 //-----------------------------------------------------------------
21 // Register the Module
22 //-----------------------------------------------------------------
23 REG_MODULE(SVDROIDQM)
24 
25 //-----------------------------------------------------------------
26 // Implementation
27 //-----------------------------------------------------------------
28 
30  : HistoModule()
31  , m_InterDir(nullptr)
32  , m_ROIDir(nullptr)
33  , hInterDictionary(172, [](const Belle2::VxdID & vxdid) {return (size_t)vxdid.getID(); })
34 , hROIDictionary(172, [](const Belle2::VxdID& vxdid) {return (size_t)vxdid.getID(); })
35 , hROIDictionaryEvt(172, [](const Belle2::VxdID& vxdid) {return (size_t)vxdid.getID(); })
36 , m_numModules(0)
37 , hnROIs(nullptr)
38 , hnInter(nullptr)
39 , harea(nullptr)
40 , hredFactor(nullptr)
41 , hCellU(nullptr)
42 , hCellV(nullptr)
43 , n_events(0)
44 {
45  //Set module properties
46  setDescription("Monitor of the ROIs creation on HLT");
47  setPropertyFlags(c_ParallelProcessingCertified);
48 
49  addParam("SVDShaperDigitsName", m_SVDShaperDigitsName,
50  "name of the list of SVDShaperDigits", std::string(""));
51  addParam("SVDRecoDigitsName", m_SVDRecoDigitsName,
52  "name of the list of SVDRecoDigits", std::string(""));
53 
54  addParam("InterceptsName", m_InterceptsName,
55  "name of the list of interceptions", std::string(""));
56 
57  addParam("ROIsName", m_ROIsName,
58  "name of the list of ROIs", std::string(""));
59 
60 }
61 
62 void SVDROIDQMModule::defineHisto()
63 {
64 
65  // Create a separate histogram directory and cd into it.
66  TDirectory* oldDir = gDirectory;
67  TDirectory* roiDir = oldDir->mkdir("SVDROIs");
68  m_InterDir = roiDir->mkdir("intercept");
69  m_ROIDir = roiDir->mkdir("roi");
70 
71  hCellU = new TH1F("hCellU", "CellID U", 769, -0.5, 768.5);
72  hCellU->GetXaxis()->SetTitle("U cell ID");
73  hCellV = new TH1F("hCellV", "CellID V", 769, -0.5, 768.5);
74  hCellV->GetXaxis()->SetTitle("V cell ID");
75 
76  m_InterDir->cd();
77  hnInter = new TH1F("hnInter", "number of intercepts", 100, 0, 100);
78 
79  m_ROIDir->cd();
80  hnROIs = new TH1F("hnROIs", "number of ROIs", 100, 0, 100);
81  harea = new TH1F("harea", "ROIs area", 100, 0, 100000);
82  hredFactor = new TH1F("hredFactor", "ROI reduction factor", 1000, 0, 1);
83 
84 
85  createHistosDictionaries();
86 
87  oldDir->cd();
88 
89 }
90 
91 void SVDROIDQMModule::initialize()
92 {
93  REG_HISTOGRAM
94 
95  m_SVDShaperDigits.isOptional(m_SVDShaperDigitsName);
96  m_SVDRecoDigits.isOptional(m_SVDRecoDigitsName);
97  m_ROIs.isRequired(m_ROIsName);
98  m_Intercepts.isRequired(m_InterceptsName);
99 
100  n_events = 0;
101 
102 
103 }
104 
105 void SVDROIDQMModule::event()
106 {
107 
108  n_events++;
109 
110  for (auto& it : m_SVDShaperDigits)
111  if (it.isUStrip())
112  hCellU->Fill(it.getCellID());
113  else
114  hCellV->Fill(it.getCellID());
115 
116  hnInter->Fill(m_Intercepts.getEntries());
117 
118  for (auto& it : m_Intercepts)
119  fillSensorInterHistos(&it);
120 
121 
122  for (auto it = hROIDictionaryEvt.begin(); it != hROIDictionaryEvt.end(); ++it)
123  (it->second).value = 0;
124 
125  int ROIarea = 0;
126  double redFactor = 0;
127 
128  for (auto& it : m_ROIs) {
129 
130  fillSensorROIHistos(&it);
131 
132  const VXD::SensorInfoBase& aSensorInfo = m_geoCache.getSensorInfo(it.getSensorID());
133  const int nPixelsU = aSensorInfo.getUCells();
134  const int nPixelsV = aSensorInfo.getVCells();
135 
136  int minU = it.getMinUid();
137  int minV = it.getMinVid();
138  int maxU = it.getMaxUid();
139  int maxV = it.getMaxVid();
140 
141  int tmpROIarea = (maxU - minU) * (maxV - minV);
142  ROIarea += tmpROIarea;
143  redFactor += (double)tmpROIarea / (nPixelsU * nPixelsV * m_numModules);
144 
145  }
146 
147  hnROIs->Fill(m_ROIs.getEntries());
148 
149  harea->Fill((double)ROIarea);
150 
151  hredFactor->Fill((double)redFactor);
152 
153 
154  for (auto it = hROIDictionaryEvt.begin(); it != hROIDictionaryEvt.end(); ++it) {
155  ROIHistoAccumulateAndFill aROIHistoAccumulateAndFill = it->second;
156  aROIHistoAccumulateAndFill.fill(aROIHistoAccumulateAndFill.hPtr, aROIHistoAccumulateAndFill.value);
157  }
158 
159 }
160 
161 void SVDROIDQMModule::createHistosDictionaries()
162 {
163 
164  // VXD::GeoCache& aGeometry = VXD::GeoCache::getInstance();
165 
166  string name; //name of the histogram
167  string title; //title of the histogram
168  TH2F* tmp2D; //temporary 2D histo used to set axis title
169  TH1F* tmp1D; //temporary 1D histo used to set axis title
170 
171  m_numModules = 0;
172 
173  std::set<Belle2::VxdID> svdLayers = m_geoCache.getLayers(VXD::SensorInfoBase::SVD);
174  std::set<Belle2::VxdID>::iterator itSvdLayers = svdLayers.begin();
175 
176  while (itSvdLayers != svdLayers.end()) {
177 
178  std::set<Belle2::VxdID> svdLadders = m_geoCache.getLadders(*itSvdLayers);
179  std::set<Belle2::VxdID>::iterator itSvdLadders = svdLadders.begin();
180 
181  while (itSvdLadders != svdLadders.end()) {
182 
183  std::set<Belle2::VxdID> svdSensors = m_geoCache.getSensors(*itSvdLadders);
184  std::set<Belle2::VxdID>::iterator itSvdSensors = svdSensors.begin();
185 
186  while (itSvdSensors != svdSensors.end()) {
187 
188  m_numModules++; //counting the total number of modules
189 
190  const VXD::SensorInfoBase& wSensorInfo = m_geoCache.getSensorInfo(*itSvdSensors);
191 
192  const int nPixelsU = wSensorInfo.getUCells();
193  const int nPixelsV = wSensorInfo.getVCells();
194  string sensorid = std::to_string(itSvdSensors->getLayerNumber()) + "_" + std::to_string(itSvdSensors->getLadderNumber()) + "_" +
195  std::to_string(itSvdSensors->getSensorNumber());
196 
197 
198  // ------ HISTOGRAMS WITH AN ACCUMULATE PER ROI AND A FILL PER EVENT -------
199  m_ROIDir->cd();
200 
201  name = "hNROIs_" + sensorid;
202  title = "number of ROIs for sensor " + sensorid;
203  double value = 0;
205  new TH1F(name.c_str(), title.c_str(), 25, 0, 25),
206  [](const ROIid*, double & val) {val++;},
207  [](TH1 * hPtr, double & val) { hPtr->Fill(val); },
208  value
209  };
210  hROIDictionaryEvt.insert(pair< Belle2::VxdID, ROIHistoAccumulateAndFill& > ((Belle2::VxdID)*itSvdSensors, *aHAAF));
211 
212 
213 
214 
215  // ------ HISTOGRAMS WITH A FILL PER INTERCEPT -------
216  m_InterDir->cd();
217 
218  // coor U and V
219  name = "hCoorU_" + sensorid;
220  title = "U coordinate of the extrapolation in U for sensor " + sensorid;
221  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
222  (
223  (Belle2::VxdID)*itSvdSensors,
225  new TH1F(name.c_str(), title.c_str(), 100, -5, 5),
226  [](TH1 * hPtr, const SVDIntercept * inter) { hPtr->Fill(inter->getCoorU()); }
227  )
228  )
229  );
230 
231  name = "hCoorV_" + sensorid;
232  title = "V coordinate of the extrapolation in V for sensor " + sensorid;
233  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
234  (
235  (Belle2::VxdID)*itSvdSensors,
237  new TH1F(name.c_str(), title.c_str(), 100, -5, 5),
238  [](TH1 * hPtr, const SVDIntercept * inter) { hPtr->Fill(inter->getCoorV()); }
239  )
240  )
241  );
242 
243  // Intercept U vs V coordinate
244  name = "hCoorU_vs_CoorV_" + sensorid;
245  title = "U vs V intercept (cm) " + sensorid;
246  tmp2D = new TH2F(name.c_str(), title.c_str(), 100, -5, 5, 100, -5, 5);
247  tmp2D->GetXaxis()->SetTitle("intercept U coor (cm)");
248  tmp2D->GetYaxis()->SetTitle("intercept V coor (cm)");
249  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
250  (
251  (Belle2::VxdID)*itSvdSensors,
253  tmp2D,
254  [](TH1 * hPtr, const SVDIntercept * inter) { hPtr->Fill(inter->getCoorU(), inter->getCoorV()); }
255  )
256  )
257  );
258 
259 
260  // sigma U and V
261  name = "hStatErrU_" + sensorid;
262  title = "stat error of the extrapolation in U for sensor " + sensorid;
263  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
264  (
265  (Belle2::VxdID)*itSvdSensors,
267  new TH1F(name.c_str(), title.c_str(), 100, 0, 0.35),
268  [](TH1 * hPtr, const SVDIntercept * inter) { hPtr->Fill(inter->getSigmaU()); }
269  )
270  )
271  );
272  name = "hStatErrV_" + sensorid;
273  title = "stat error of the extrapolation in V for sensor " + sensorid;
274  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
275  (
276  (Belle2::VxdID)*itSvdSensors,
278  new TH1F(name.c_str(), title.c_str(), 100, 0, 0.35),
279  [](TH1 * hPtr, const SVDIntercept * inter) { hPtr->Fill(inter->getSigmaV()); }
280  )
281  )
282  );
283 
284  //1D residuals
285  name = "hResidU_" + sensorid;
286  title = "U residuals = intercept - digit, for sensor " + sensorid;
287  tmp1D = new TH1F(name.c_str(), title.c_str(), 1000, -5, 5);
288  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
289  (
290  (Belle2::VxdID)*itSvdSensors,
292  tmp1D,
293  [this](TH1 * hPtr, const SVDIntercept * inter) {
294  StoreArray<SVDShaperDigit> SVDShaperDigits(this->m_SVDShaperDigitsName);
295 
296  for (auto& it : SVDShaperDigits)
297  if ((int)it.getSensorID() == (int)inter->getSensorID()) {
298  if (it.isUStrip()) {
299  const VXD::SensorInfoBase& aSensorInfo = m_geoCache.getSensorInfo(it.getSensorID());
300  hPtr->Fill(inter->getCoorU() - aSensorInfo.getUCellPosition(it.getCellID()));
301  }
302  }
303  }
304  )
305  )
306  );
307 
308  name = "hResidV_" + sensorid;
309  title = "V residuals = intercept - digit, for sensor " + sensorid;
310  tmp1D = new TH1F(name.c_str(), title.c_str(), 1000, -5, 5);
311  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
312  (
313  (Belle2::VxdID)*itSvdSensors,
315  tmp1D,
316  [this](TH1 * hPtr, const SVDIntercept * inter) {
317  StoreArray<SVDShaperDigit> SVDShaperDigits(this->m_SVDShaperDigitsName);
318 
319  for (auto& it : SVDShaperDigits)
320  if ((int)it.getSensorID() == (int)inter->getSensorID()) {
321  if (!it.isUStrip()) {
322  const VXD::SensorInfoBase& aSensorInfo = m_geoCache.getSensorInfo(it.getSensorID());
323  hPtr->Fill(inter->getCoorV() - aSensorInfo.getVCellPosition(it.getCellID()));
324  }
325  }
326  }
327  )
328  )
329  );
330 
331  //residual U,V vs coordinate U,V
332  name = "hResidU_vs_CoorU_" + sensorid;
333  title = "U residual (cm) vs coor U (cm) " + sensorid;
334  tmp2D = new TH2F(name.c_str(), title.c_str(), 1000, -5, 5, 1000, -5, 5);
335  tmp2D->GetYaxis()->SetTitle("U resid (cm)");
336  tmp2D->GetXaxis()->SetTitle("U coor (cm)");
337  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
338  (
339  (Belle2::VxdID)*itSvdSensors,
341  tmp2D,
342  [this](TH1 * hPtr, const SVDIntercept * inter) {
343  StoreArray<SVDShaperDigit> SVDShaperDigits(this->m_SVDShaperDigitsName);
344 
345  for (auto& it : SVDShaperDigits)
346  if (((int)it.getSensorID() == (int)inter->getSensorID()) && it.isUStrip()) {
347  const VXD::SensorInfoBase& aSensorInfo = m_geoCache.getSensorInfo(it.getSensorID());
348  double resid = inter->getCoorU() - aSensorInfo.getUCellPosition(it.getCellID());
349  hPtr->Fill(inter->getCoorU(), resid);
350  }
351  }
352  )
353  )
354  );
355 
356  name = "hResidV_vs_CoorV_" + sensorid;
357  title = "V residual (cm) vs coor V (cm) " + sensorid;
358  tmp2D = new TH2F(name.c_str(), title.c_str(), 1000, -5, 5, 1000, -5, 5);
359  tmp2D->GetYaxis()->SetTitle("V resid (cm)");
360  tmp2D->GetXaxis()->SetTitle("V coor (cm)");
361  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
362  (
363  (Belle2::VxdID)*itSvdSensors,
365  tmp2D,
366  [this](TH1 * hPtr, const SVDIntercept * inter) {
367  StoreArray<SVDShaperDigit> SVDShaperDigits(this->m_SVDShaperDigitsName);
368 
369  for (auto& it : SVDShaperDigits)
370  if (((int)it.getSensorID() == (int)inter->getSensorID()) && (!it.isUStrip())) {
371  const VXD::SensorInfoBase& aSensorInfo = m_geoCache.getSensorInfo(it.getSensorID());
372  double resid = inter->getCoorV() - aSensorInfo.getVCellPosition(it.getCellID());
373  hPtr->Fill(inter->getCoorV(), resid);
374  }
375  }
376  )
377  )
378  );
379 
380 
381  //residual vs charge
382  name = "hResidU_vs_charge_" + sensorid;
383  title = "U residual (cm) vs charge " + sensorid;
384  tmp2D = new TH2F(name.c_str(), title.c_str(), 250, 0, 250, 100, -5, 5);
385  tmp2D->GetYaxis()->SetTitle("U resid (cm)");
386  tmp2D->GetXaxis()->SetTitle("charge");
387  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
388  (
389  (Belle2::VxdID)*itSvdSensors,
391  tmp2D,
392  [this](TH1 * hPtr, const SVDIntercept * inter) {
393  StoreArray<SVDRecoDigit> SVDRecoDigits(this->m_SVDRecoDigitsName);
394 
395  for (auto& it : SVDRecoDigits)
396  if (((int)it.getSensorID() == (int)inter->getSensorID()) && (it.isUStrip())) {
397  const VXD::SensorInfoBase& aSensorInfo = m_geoCache.getSensorInfo(it.getSensorID());
398  double resid = inter->getCoorU() - aSensorInfo.getUCellPosition(it.getCellID());
399  hPtr->Fill(it.getCharge(), resid);
400  }
401  }
402  )
403  )
404  );
405 
406  name = "hResidV_vs_charge_" + sensorid;
407  title = "V residual (cm) vs charge " + sensorid;
408  tmp2D = new TH2F(name.c_str(), title.c_str(), 250, 0, 250, 100, -5, 5);
409  tmp2D->GetYaxis()->SetTitle("V resid (cm)");
410  tmp2D->GetXaxis()->SetTitle("charge");
411  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
412  (
413  (Belle2::VxdID)*itSvdSensors,
415  tmp2D,
416  [this](TH1 * hPtr, const SVDIntercept * inter) {
417  StoreArray<SVDRecoDigit> SVDRecoDigits(this->m_SVDRecoDigitsName);
418 
419  for (auto& it : SVDRecoDigits)
420  if (((int)it.getSensorID() == (int)inter->getSensorID()) && (!it.isUStrip())) {
421  const VXD::SensorInfoBase& aSensorInfo = m_geoCache.getSensorInfo(it.getSensorID());
422  double resid = inter->getCoorV() - aSensorInfo.getVCellPosition(it.getCellID());
423  hPtr->Fill(it.getCharge(), resid);
424  }
425  }
426  )
427  )
428  );
429 
430 
431  // scatter plot: U,V intercept in cm VS U,V cell position
432  name = "hCoorU_vs_UDigit_" + sensorid;
433  title = "U intercept (cm) vs U Digit (ID) " + sensorid;
434  tmp2D = new TH2F(name.c_str(), title.c_str(), 1000, -5, 5, 1000, -5, 5);
435  tmp2D->GetXaxis()->SetTitle("intercept U coor (cm)");
436  tmp2D->GetYaxis()->SetTitle("digit U coor (cm)");
437  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
438  (
439  (Belle2::VxdID)*itSvdSensors,
441  tmp2D,
442  [this](TH1 * hPtr, const SVDIntercept * inter) {
443  StoreArray<SVDShaperDigit> SVDShaperDigits(this->m_SVDShaperDigitsName);
444 
445  for (auto& it : SVDShaperDigits)
446  if (((int)it.getSensorID() == (int)inter->getSensorID()) && (it.isUStrip())) {
447  const VXD::SensorInfoBase& aSensorInfo = m_geoCache.getSensorInfo(it.getSensorID());
448  hPtr->Fill(inter->getCoorU(), aSensorInfo.getUCellPosition(it.getCellID()));
449  // hPtr->Fill( inter->getCoorU(), it.getVCellID()*75e-4 );
450  }
451  }
452  )
453  )
454  );
455 
456  name = "hCoorV_vs_VDigit_" + sensorid;
457  title = "V intercept (cm) vs V Digit (ID) " + sensorid;
458  tmp2D = new TH2F(name.c_str(), title.c_str(), 1000, -5, 5, 1000, -5, 5);
459  tmp2D->GetXaxis()->SetTitle("intercept V coor (cm)");
460  tmp2D->GetYaxis()->SetTitle("digi V coor (cm)");
461  hInterDictionary.insert(pair< Belle2::VxdID, InterHistoAndFill >
462  (
463  (Belle2::VxdID)*itSvdSensors,
465  tmp2D,
466  [this](TH1 * hPtr, const SVDIntercept * inter) {
467  StoreArray<SVDShaperDigit> SVDShaperDigits(this->m_SVDShaperDigitsName);
468 
469  for (auto& it : SVDShaperDigits) {
470  if (((int)it.getSensorID() == (int)inter->getSensorID()) && (!it.isUStrip())) {
471  const VXD::SensorInfoBase& aSensorInfo = m_geoCache.getSensorInfo(it.getSensorID());
472  hPtr->Fill(inter->getCoorV(), aSensorInfo.getVCellPosition(it.getCellID()));
473  // hPtr->Fill( inter->getCoorV(), it.getUCellID()*50e-4 );
474  }
475  }
476  }
477  )
478  )
479  );
480 
481 
482 
483 
484 
485 
486  // ------ HISTOGRAMS WITH A FILL PER ROI -------
487  m_ROIDir->cd();
488 
489  // MIN in U and V
490  name = "hminU_" + sensorid;
491  title = "ROI min in U for sensor " + sensorid;
492  hROIDictionary.insert(pair< Belle2::VxdID, ROIHistoAndFill >
493  (
494  (Belle2::VxdID)*itSvdSensors,
496  new TH1F(name.c_str(), title.c_str(), nPixelsU, 0, nPixelsU),
497  [](TH1 * hPtr, const ROIid * roi) { hPtr->Fill(roi->getMinUid()); }
498  )
499  )
500  );
501  name = "hminV_" + sensorid;
502  title = "ROI min in V for sensor " + sensorid;
503  hROIDictionary.insert(pair< Belle2::VxdID, ROIHistoAndFill >
504  (
505  (Belle2::VxdID)*itSvdSensors,
507  new TH1F(name.c_str(), title.c_str(), nPixelsV, 0, nPixelsV),
508  [](TH1 * hPtr, const ROIid * roi) { hPtr->Fill(roi->getMinVid()); }
509  )
510  )
511  );
512  //--------------------------
513  // MAX in U and V
514  name = "hmaxU_" + sensorid;
515  title = "ROI max in U for sensor " + sensorid;
516  hROIDictionary.insert(pair< Belle2::VxdID, ROIHistoAndFill >
517  (
518  (Belle2::VxdID)*itSvdSensors,
520  new TH1F(name.c_str(), title.c_str(), nPixelsU, 0, nPixelsU),
521  [](TH1 * hPtr, const ROIid * roi) { hPtr->Fill(roi->getMaxUid()); }
522  )
523  )
524  );
525  name = "hmaxV_" + sensorid;
526  title = "ROI max in V for sensor " + sensorid;
527  hROIDictionary.insert(pair< Belle2::VxdID, ROIHistoAndFill >
528  (
529  (Belle2::VxdID)*itSvdSensors,
531  new TH1F(name.c_str(), title.c_str(), nPixelsV, 0, nPixelsV),
532  [](TH1 * hPtr, const ROIid * roi) { hPtr->Fill(roi->getMaxVid()); }
533  )
534  )
535  );
536  //--------------------------
537 
538  // WIDTH in U and V
539  name = "hwidthU_" + sensorid;
540  title = "ROI width in U for sensor " + sensorid;
541  hROIDictionary.insert(pair< Belle2::VxdID, ROIHistoAndFill >
542  (
543  (Belle2::VxdID)*itSvdSensors,
545  new TH1F(name.c_str(), title.c_str(), nPixelsU, 0, nPixelsU),
546  [](TH1 * hPtr, const ROIid * roi) { hPtr->Fill(roi->getMaxUid() - roi->getMinUid()); }
547  )
548  )
549  );
550  name = "hwidthV_" + sensorid;
551  title = "ROI width in V for sensor " + sensorid;
552  hROIDictionary.insert(pair< Belle2::VxdID, ROIHistoAndFill >
553  (
554  (Belle2::VxdID)*itSvdSensors,
556  new TH1F(name.c_str(), title.c_str(), nPixelsV, 0, nPixelsV),
557  [](TH1 * hPtr, const ROIid * roi) { hPtr->Fill(roi->getMaxVid() - roi->getMinVid()); }
558  )
559  )
560  );
561 
562  // ROI center
563  name = "hROIcenter_" + sensorid;
564  title = "ROI center " + sensorid;
565  tmp2D = new TH2F(name.c_str(), title.c_str(), nPixelsU, 0, nPixelsU, nPixelsV, 0, nPixelsV);
566  tmp2D->GetXaxis()->SetTitle(" U (ID)");
567  tmp2D->GetYaxis()->SetTitle(" V (ID)");
568  hROIDictionary.insert(pair< Belle2::VxdID, ROIHistoAndFill >
569  (
570  (Belle2::VxdID)*itSvdSensors,
572  tmp2D,
573  [](TH1 * hPtr, const ROIid * roi) { hPtr->Fill((roi->getMaxUid() + roi->getMinUid()) / 2, (roi->getMaxVid() + roi->getMinVid()) / 2); }
574  )
575  )
576  );
577 
578  //--------------------------
579 
580  ++itSvdSensors;
581  }
582  ++itSvdLadders;
583  }
584  ++itSvdLayers;
585  }
586 
587 }
588 
589 void SVDROIDQMModule::fillSensorInterHistos(const SVDIntercept* inter)
590 {
591 
592  auto its = hInterDictionary.equal_range(inter->getSensorID());
593 
594  for (auto it = its.first; it != its.second; ++it) {
595  InterHistoAndFill aInterHistoAndFill = it->second;
596  aInterHistoAndFill.second(aInterHistoAndFill.first, inter);
597  }
598 
599 }
600 
601 void SVDROIDQMModule::fillSensorROIHistos(const ROIid* roi)
602 {
603 
604  auto its = hROIDictionary.equal_range(roi->getSensorID());
605 
606  for (auto it = its.first; it != its.second; ++it) {
607  ROIHistoAndFill aROIHistoAndFill = it->second;
608  aROIHistoAndFill.second(aROIHistoAndFill.first, roi);
609  }
610 
611  auto itsEvt = hROIDictionaryEvt.equal_range(roi->getSensorID());
612  for (auto it = itsEvt.first; it != itsEvt.second; ++it)
613  (it->second).accumulate(roi, (it->second).value);
614 }
615 
616 void SVDROIDQMModule::endRun()
617 {
618 
619  hCellU->Scale((double)1 / n_events);
620  hCellV->Scale((double)1 / n_events);
621 
622  for (auto it = hROIDictionaryEvt.begin(); it != hROIDictionaryEvt.end(); ++it)
623  delete &(it->second);
624 }
Belle2::SVDIntercept
SVDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an SVD ...
Definition: SVDIntercept.h:32
Belle2::VXD::SensorInfoBase::getUCells
int getUCells() const
Return number of pixel/strips in u direction.
Definition: SensorInfoBase.h:223
Belle2::VxdID
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:43
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::VXD::SensorInfoBase
Base class to provide Sensor Information for PXD and SVD.
Definition: SensorInfoBase.h:40
Belle2::SVDROIDQMModule::ROIHistoAccumulateAndFill::value
double value
value used to fill
Definition: SVDROIDQMModule.h:94
Belle2::SVDROIDQMModule::ROIHistoAccumulateAndFill::hPtr
TH1 * hPtr
histogram pointer
Definition: SVDROIDQMModule.h:91
Belle2::SVDROIDQMModule
Creates basic DQM for ROI creation on ExpressReco
Definition: SVDROIDQMModule.h:48
Belle2::VXD::SensorInfoBase::getVCellPosition
double getVCellPosition(int vID) const
Return the position of a specific strip/pixel in v direction.
Definition: SensorInfoBase.h:191
Belle2::ROIid
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
Definition: ROIid.h:35
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SVDROIDQMModule::ROIHistoAndFill
std::pair< TH1 *, std::function< void(TH1 *, const ROIid *) > > ROIHistoAndFill
typedef: histograms to be filled once per roi + filling function
Definition: SVDROIDQMModule.h:85
Belle2::VXD::SensorInfoBase::getVCells
int getVCells() const
Return number of pixel/strips in v direction.
Definition: SensorInfoBase.h:225
Belle2::SVDROIDQMModule::InterHistoAndFill
std::pair< TH1 *, std::function< void(TH1 *, const SVDIntercept *) > > InterHistoAndFill
typedef: histograms to be filled once per intercept + filling function
Definition: SVDROIDQMModule.h:80
Belle2::SVDROIDQMModule::ROIHistoAccumulateAndFill::fill
std::function< void(TH1 *, double &) > fill
fill function
Definition: SVDROIDQMModule.h:93
Belle2::VXD::SensorInfoBase::getUCellPosition
double getUCellPosition(int uID, int vID=-1) const
Return the position of a specific strip/pixel in u direction.
Definition: SensorInfoBase.h:179
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::HistoModule
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Belle2::SVDROIDQMModule::ROIHistoAccumulateAndFill
struct: histograms to be filled once per event + filling fucntion + accumulate function
Definition: SVDROIDQMModule.h:90