Belle II Software prerelease-11-00-00a
DQMHistAnalysisPXDER.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 <dqm/analysis/modules/DQMHistAnalysisPXDER.h>
10
11#include <pxd/geometry/SensorInfo.h>
12#include <vxd/geometry/SensorInfoBase.h>
13#include <vxd/geometry/GeoCache.h>
14
15#include <boost/format.hpp>
16
17#include <TROOT.h>
18
19using namespace std;
20using boost::format;
21using namespace Belle2;
22
23//-----------------------------------------------------------------
24// Register the Module
25//-----------------------------------------------------------------
26REG_MODULE(DQMHistAnalysisPXDER);
27
28
29//-----------------------------------------------------------------
30// Implementation
31//-----------------------------------------------------------------
32
34{
35 // This module CAN NOT be run in parallel!
36 setDescription("PXD DQM analysis module for Express Reco ");
37
38 // Set module properties
39 addParam("histogramDirectoryName", m_histogramDirectoryName, "Name of the directory where histograms were placed",
40 std::string("PXDER"));
41 addParam("RefHistoFile", m_refFileName, "Reference histrogram file name", std::string("refHisto.root"));
42}
43
44
48
50{
51 m_refFile = NULL;
52 if (m_refFileName != "") {
53 m_refFile = new TFile(m_refFileName.data());// default is read only
54 }
55
56 gROOT->cd(); // this seems to be important, or strange things happen
57 // basic constants presets:
59 c_nVXDLayers = geo.getLayers().size();
60 c_firstVXDLayer = 1; // counting start from 1...
68
69 c_nPXDSensors = 0;
70 for (VxdID layer : geo.getLayers()) {
71 for (VxdID ladder : geo.getLadders(layer)) {
72 if (layer.getLayerNumber() <= c_lastPXDLayer) { // PXD
73 c_nPXDSensors += geo.getLadders(layer).size() * geo.getSensors(ladder).size();
74 }
75 break;
76 }
77 }
78
79// m_hitMapCounts = "DQMER_PXD_PixelHitmapCounts";
80// m_hitMapClCounts = "DQMER_PXD_ClusterHitmapCounts";
81
82 for (int i = 0; i < c_nPXDSensors; i++) {
83 int iLayer = 0;
84 int iLadder = 0;
85 int iSensor = 0;
86 getIDsFromIndex(i, iLayer, iLadder, iSensor);
87 VxdID sensorID(iLayer, iLadder, iSensor);
88 string sensorDescr = str(format("%1%_%2%_%3%") % iLayer % iLadder % iSensor);
89 //----------------------------------------------------------------
90 // Number of fired pixels per frame
91 //----------------------------------------------------------------
92 m_fired.emplace_back(str(format("DQMER_PXD_%1%_Fired") % sensorDescr));
93 m_ref_fired.emplace_back(m_fired.back());
94 //----------------------------------------------------------------
95 // Number of clusters per frame
96 //----------------------------------------------------------------
97 m_clusters.emplace_back(str(format("DQMER_PXD_%1%_Clusters") % sensorDescr));
98 m_ref_clusters.emplace_back(m_clusters.back());
99 //----------------------------------------------------------------
100 // Start row distribution
101 //----------------------------------------------------------------
102 m_startRow.emplace_back(str(format("DQMER_PXD_%1%_StartRow") % sensorDescr));
103 m_ref_startRow.emplace_back(m_startRow.back());
104 //----------------------------------------------------------------
105 // Cluster seed charge by distance from the start row
106 //----------------------------------------------------------------
107 m_chargStartRow.emplace_back(str(format("DQMER_PXD_%1%_AverageSeedByStartRow") % sensorDescr));
108 m_ref_chargStartRow.emplace_back(m_chargStartRow.back());
109
110
111 m_startRowCount.emplace_back(str(format("DQMER_PXD_%1%_SeedCountsByStartRow") % sensorDescr));
112 m_ref_startRowCount.emplace_back(m_startRowCount.back());
113 //----------------------------------------------------------------
114 // Cluster Charge
115 //----------------------------------------------------------------
116 m_clusterCharge.emplace_back(str(format("DQMER_PXD_%1%_ClusterCharge") % sensorDescr));
117 m_ref_clusterCharge.emplace_back(m_clusterCharge.back());
118 //----------------------------------------------------------------
119 // Pixel Signal
120 //----------------------------------------------------------------
121 m_pixelSignal.emplace_back(str(format("DQMER_PXD_%1%_PixelSignal") % sensorDescr));
122 m_ref_pixelSignal.emplace_back(m_pixelSignal.back());
123 //----------------------------------------------------------------
124 // Cluster Size in U
125 //----------------------------------------------------------------
126 m_clusterSizeU.emplace_back(str(format("DQMER_PXD_%1%_ClusterSizeU") % sensorDescr));
127 m_ref_clusterSizeU.emplace_back(m_clusterSizeU.back());
128 //----------------------------------------------------------------
129 // Cluster Size in V
130 //----------------------------------------------------------------
131 m_clusterSizeV.emplace_back(str(format("DQMER_PXD_%1%_ClusterSizeV") % sensorDescr));
132 m_ref_clusterSizeV.emplace_back(m_clusterSizeV.back());
133 //----------------------------------------------------------------
134 // Cluster Size in U+V
135 //----------------------------------------------------------------
136 m_clusterSizeUV.emplace_back(str(format("DQMER_PXD_%1%_ClusterSizeUV") % sensorDescr));
137 m_ref_clusterSizeUV.emplace_back(m_clusterSizeUV.back());
138 }
139// m_fHitMapCountsFlag = NULL;
140// m_fHitMapClCountsFlag = NULL;
141// m_hitMapCounts = NULL;
142// m_hitMapClCounts = NULL;
143
144// Create flag histograms:
145// DirPXDFlags->cd();
146 m_fFiredFlag = new TH1I("DQMER_PXD_FiredFlag", "DQM ER PXD Fired Flag",
148 m_fFiredFlag->GetXaxis()->SetTitle("Sensor ID");
149 m_fFiredFlag->GetYaxis()->SetTitle("flag");
150 m_fClustersFlag = new TH1I("DQMER_PXD_ClustersFlag", "DQM ER PXD Clusters Flag",
152 m_fClustersFlag->GetXaxis()->SetTitle("Sensor ID");
153 m_fClustersFlag->GetYaxis()->SetTitle("flag");
154 m_fStartRowFlag = new TH1I("DQMER_PXD_StartRowFlag", "DQM ER PXD Start Row Flag",
156 m_fStartRowFlag->GetXaxis()->SetTitle("Sensor ID");
157 m_fStartRowFlag->GetYaxis()->SetTitle("flag");
158 m_fChargStartRowFlag = new TH1I("DQMER_PXD_ChargStartRowFlag", "DQM ER PXD Charg Start Row Flag",
160 m_fChargStartRowFlag->GetXaxis()->SetTitle("Sensor ID");
161 m_fChargStartRowFlag->GetYaxis()->SetTitle("flag");
162 m_fStartRowCountFlag = new TH1I("DQMER_PXD_StartRowCountFlag", "DQM ER PXD Row Count Flag",
164 m_fStartRowCountFlag->GetXaxis()->SetTitle("Sensor ID");
165 m_fStartRowCountFlag->GetYaxis()->SetTitle("flag");
166// m_fHitMapCountsFlag = new TH1I("DQMER_PXD_PixelHitmapCountsFlag", "DQM ER PXD Pixel Hitmaps Counts Flag",
167// c_nPXDSensors, 0, c_nPXDSensors);
168// m_fHitMapCountsFlag->GetXaxis()->SetTitle("Sensor ID");
169// m_fHitMapCountsFlag->GetYaxis()->SetTitle("flag");
170// m_fHitMapClCountsFlag = new TH1I("DQMER_PXD_ClusterHitmapCountsFlag", "DQM ER PXD Cluster Hitmaps Counts Flag",
171// c_nPXDSensors, 0, c_nPXDSensors);
172// m_fHitMapClCountsFlag->GetXaxis()->SetTitle("Sensor ID");
173// m_fHitMapClCountsFlag->GetYaxis()->SetTitle("flag");
174 m_fClusterChargeFlag = new TH1I("DQMER_PXD_ClusterChargeFlag", "DQM ER PXD Cluster Charge Flag",
176 m_fClusterChargeFlag->GetXaxis()->SetTitle("Sensor ID");
177 m_fClusterChargeFlag->GetYaxis()->SetTitle("flag");
178 m_fPixelSignalFlag = new TH1I("DQMER_PXD_PixelSignalFlag", "DQM ER PXD Pixel Signal Flag",
180 m_fPixelSignalFlag->GetXaxis()->SetTitle("Sensor ID");
181 m_fPixelSignalFlag->GetYaxis()->SetTitle("flag");
182 m_fClusterSizeUFlag = new TH1I("DQMER_PXD_ClasterSizeUFlag", "DQM ER PXD Cluster Size U Flag",
184 m_fClusterSizeUFlag->GetXaxis()->SetTitle("Sensor ID");
185 m_fClusterSizeUFlag->GetYaxis()->SetTitle("flag");
186 m_fClusterSizeVFlag = new TH1I("DQMER_PXD_ClasterSizeVFlag", "DQM ER PXD Cluster Size V Flag",
188 m_fClusterSizeVFlag->GetXaxis()->SetTitle("Sensor ID");
189 m_fClusterSizeVFlag->GetYaxis()->SetTitle("flag");
190 m_fClusterSizeUVFlag = new TH1I("DQMER_PXD_ClasterSizeUVFlag", "DQM ER PXD Cluster Size UV Flag",
192 m_fClusterSizeUVFlag->GetXaxis()->SetTitle("Sensor ID");
193 m_fClusterSizeUVFlag->GetYaxis()->SetTitle("flag");
194
195 for (int i = 0; i < c_nPXDSensors; i++) {
196 int iLayer = 0;
197 int iLadder = 0;
198 int iSensor = 0;
199 getIDsFromIndex(i, iLayer, iLadder, iSensor);
200 TString AxisTicks = Form("%i_%i_%i", iLayer, iLadder, iSensor);
201// m_hitMapCounts->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
202// m_hitMapClCounts->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
203 m_fFiredFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
204 m_fClustersFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
205 m_fStartRowFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
206 m_fChargStartRowFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
207 m_fStartRowCountFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
208// m_fHitMapCountsFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
209// m_fHitMapClCountsFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
210 m_fClusterChargeFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
211 m_fPixelSignalFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
212 m_fClusterSizeUFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
213 m_fClusterSizeVFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
214 m_fClusterSizeUVFlag->GetXaxis()->SetBinLabel(i + 1, AxisTicks.Data());
215 }
216// m_oldDir->cd();
217}
218
220{
221 // Just to make sure, reset all the histograms.
222// if (m_fHitMapCountsFlag != NULL) m_fHitMapCountsFlag->Reset();
223// if (m_fHitMapClCountsFlag != NULL) m_fHitMapClCountsFlag->Reset();
224 if (m_fFiredFlag != NULL) m_fFiredFlag->Reset();
225 if (m_fClustersFlag != NULL) m_fClustersFlag->Reset();
226 if (m_fStartRowFlag != NULL) m_fStartRowFlag->Reset();
227 if (m_fChargStartRowFlag != NULL) m_fChargStartRowFlag->Reset();
228 if (m_fStartRowCountFlag != NULL) m_fStartRowCountFlag->Reset();
229 if (m_fClusterChargeFlag != NULL) m_fClusterChargeFlag->Reset();
230 if (m_fPixelSignalFlag != NULL) m_fPixelSignalFlag->Reset();
231 if (m_fClusterSizeUFlag != NULL) m_fClusterSizeUFlag->Reset();
232 if (m_fClusterSizeVFlag != NULL) m_fClusterSizeVFlag->Reset();
233 if (m_fClusterSizeUVFlag != NULL) m_fClusterSizeUVFlag->Reset();
234
235// if (m_hitMapCounts != NULL) m_hitMapCounts->Reset();
236// if (m_hitMapClCounts != NULL) m_hitMapClCounts->Reset();
237
238}
239
240
242{
243
244 // Dont sum up!
245// if (m_fHitMapCountsFlag != NULL) m_fHitMapCountsFlag->Reset();
246// if (m_fHitMapClCountsFlag != NULL) m_fHitMapClCountsFlag->Reset();
247 if (m_fFiredFlag != NULL) m_fFiredFlag->Reset();
248 if (m_fClustersFlag != NULL) m_fClustersFlag->Reset();
249 if (m_fStartRowFlag != NULL) m_fStartRowFlag->Reset();
250 if (m_fChargStartRowFlag != NULL) m_fChargStartRowFlag->Reset();
251 if (m_fStartRowCountFlag != NULL) m_fStartRowCountFlag->Reset();
252 if (m_fClusterChargeFlag != NULL) m_fClusterChargeFlag->Reset();
253 if (m_fPixelSignalFlag != NULL) m_fPixelSignalFlag->Reset();
254 if (m_fClusterSizeUFlag != NULL) m_fClusterSizeUFlag->Reset();
255 if (m_fClusterSizeVFlag != NULL) m_fClusterSizeVFlag->Reset();
256 if (m_fClusterSizeUVFlag != NULL) m_fClusterSizeUVFlag->Reset();
257
258 // Compare histograms with reference histograms and create flags:
259 for (int i = 0; i < c_nPXDSensors; i++) {
260 double pars[2];
261 pars[0] = 0.01;// Probability value error?
262 pars[1] = 0.05;// Probability value warning?
263
264 double m_NoOfEvents = 1., m_NoOfEventsRef = 1.; // workaround
265
266// SetFlag(9, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
267// m_hitMapCounts, r_hitMapCounts, m_fHitMapCountsFlag);
268// SetFlag(9, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
269// m_hitMapClCounts, r_hitMapClCounts, m_fHitMapClCountsFlag);
270 SetFlag(2, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
271 m_fired.at(i), m_ref_fired.at(i), m_fFiredFlag);
272 SetFlag(2, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
274 SetFlag(100, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
276 SetFlag(100, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
278 SetFlag(100, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
280 SetFlag(5, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
282 SetFlag(5, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
284 SetFlag(2, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
286 SetFlag(2, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
288 SetFlag(2, i, pars, (double)m_NoOfEvents / m_NoOfEventsRef,
290
291 }
292}
293
294
295void DQMHistAnalysisPXDERModule::getIDsFromIndex(const int Index, int& Layer, int& Ladder, int& Sensor) const
296{
298 int tempcounter = 0;
299 for (VxdID layer : geo.getLayers()) {
300 if (layer.getLayerNumber() > c_lastPXDLayer) continue; // need PXD
301 for (VxdID ladder : geo.getLadders(layer)) {
302 for (VxdID sensor : geo.getSensors(ladder)) {
303 if (tempcounter == Index) {
304 Layer = layer.getLayerNumber();
305 Ladder = ladder.getLadderNumber();
306 Sensor = sensor.getSensorNumber();
307 return;
308 }
309 tempcounter++;
310 }
311 }
312 }
313}
314
315int DQMHistAnalysisPXDERModule::SetFlag(int Type, int bin, const double* pars, double ratio, const std::string& name_hist,
316 const std::string& name_refhist, TH1I* flaghist)
317{
318 int iret = 0;
319 float WarningLevel = 6.0;
320 float ErrorLevel = 10.0;
321
322 TH1* hist = nullptr, *refhist = nullptr;
323
324 hist = findHist(m_histogramDirectoryName, name_hist);
325 if (!hist) return -1;
326 // assumes that ref file has no sub dirs
327 refhist = findHistInFile(m_refFile, name_refhist);
328 if (!refhist) return -1;
329
330 // What happens if they are TH1I, TH1D and not TH1F
331
332 auto temp = std::unique_ptr<TH1F>(new TH1F("temp", "temp", hist->GetNbinsX(), hist->GetXaxis()->GetXmin(),
333 hist->GetXaxis()->GetXmax()));
334 double NEvents = 0;
335 double flagInt = 0;
336 double flagrInt = 0;
337 for (int j = 0; j < hist->GetNbinsX(); j++) {
338 double val = hist->GetBinContent(j + 1);
339 NEvents += val;
340 val = val / ratio;
341 temp->SetBinContent(j + 1, val);
342 flagInt += temp->GetBinContent(j + 1);
343 flagrInt += refhist->GetBinContent(j + 1);
344 }
345 if (NEvents < 100) { // not enough information for comparison
346 iret = -1;
347 flaghist->SetBinContent(bin + 1, -1);
348 return iret;
349 }
350 double flag = temp->GetMean();
351 double flagErr = temp->GetMeanError();
352 double flagRMS = temp->GetRMS();
353 double flagRMSErr = temp->GetRMSError();
354 double flagr = refhist->GetMean();
355 double flagrErr = refhist->GetMeanError();
356 double flagrRMS = refhist->GetRMS();
357 double flagrRMSErr = refhist->GetRMSError();
358 TString strDebugInfo = Form("Conditions for Flag--->\n source %f %f+-%f %f+-%f\n referen %f %f+-%f %f+-%f\n",
359 flagInt, flag, flagErr, flagRMS, flagRMSErr,
360 flagrInt, flagr, flagrErr, flagrRMS, flagrRMSErr
361 );
362 B2DEBUG(130, strDebugInfo.Data());
363 if (Type == 1) { // counts+mean+RMS use
364 if ((fabs(flag - flagr) > ErrorLevel * (flagErr + flagrErr)) ||
365 (fabs(flagRMS - flagrRMS) > ErrorLevel * (flagRMSErr + flagrRMSErr)) ||
366 (fabs(flagInt - flagrInt) > ErrorLevel * (sqrt(flagInt) + sqrt(flagrInt)))
367 ) {
368 flaghist->SetBinContent(bin + 1, 2);
369 } else if ((fabs(flag - flagr) > WarningLevel * (flagErr + flagrErr)) ||
370 (fabs(flagRMS - flagrRMS) > WarningLevel * (flagRMSErr + flagrRMSErr)) ||
371 (fabs(flagInt - flagrInt) > WarningLevel * (sqrt(flagInt) + sqrt(flagrInt)))
372 ) {
373 flaghist->SetBinContent(bin + 1, 1);
374 } else {
375 flaghist->SetBinContent(bin + 1, 0);
376 }
377 iret = 1;
378 } else if (Type == 2) { // counts use
379 if (fabs(flagInt - flagrInt) > ErrorLevel * (sqrt(flagInt) + sqrt(flagrInt))) {
380 flaghist->SetBinContent(bin + 1, 2);
381 } else if (fabs(flagInt - flagrInt) > WarningLevel * (sqrt(flagInt) + sqrt(flagrInt))) {
382 flaghist->SetBinContent(bin + 1, 1);
383 } else {
384 flaghist->SetBinContent(bin + 1, 0);
385 }
386 iret = 1;
387 } else if (Type == 3) { // mean use
388 if (fabs(flag - flagr) > ErrorLevel * (flagErr + flagrErr)) {
389 flaghist->SetBinContent(bin + 1, 2);
390 } else if (fabs(flag - flagr) > WarningLevel * (flagErr + flagrErr)) {
391 flaghist->SetBinContent(bin + 1, 1);
392 } else {
393 flaghist->SetBinContent(bin + 1, 0);
394 }
395 iret = 1;
396 } else if (Type == 4) { // RMS use
397 if (fabs(flagRMS - flagrRMS) > ErrorLevel * (flagRMSErr + flagrRMSErr)) {
398 flaghist->SetBinContent(bin + 1, 2);
399 } else if (fabs(flagRMS - flagrRMS) > WarningLevel * (flagRMSErr + flagrRMSErr)) {
400 flaghist->SetBinContent(bin + 1, 1);
401 } else {
402 flaghist->SetBinContent(bin + 1, 0);
403 }
404 iret = 1;
405 } else if (Type == 5) { // counts+mean use
406 if ((fabs(flag - flagr) > ErrorLevel * (flagErr + flagrErr)) ||
407 (fabs(flagInt - flagrInt) > ErrorLevel * (sqrt(flagInt) + sqrt(flagrInt)))
408 ) {
409 flaghist->SetBinContent(bin + 1, 2);
410 } else if ((fabs(flag - flagr) > WarningLevel * (flagErr + flagrErr)) ||
411 (fabs(flagInt - flagrInt) > WarningLevel * (sqrt(flagInt) + sqrt(flagrInt)))
412 ) {
413 flaghist->SetBinContent(bin + 1, 1);
414 } else {
415 flaghist->SetBinContent(bin + 1, 0);
416 }
417 iret = 1;
418 } else if (Type == 9) { // bin content use
419 flagInt = temp->GetBinContent(bin + 1);
420 flagrInt = refhist->GetBinContent(bin + 1);
421 if (fabs(flagInt - flagrInt) > ErrorLevel * (sqrt(flagInt) + sqrt(flagrInt))) {
422 flaghist->SetBinContent(bin + 1, 2);
423 } else if (fabs(flagInt - flagrInt) > WarningLevel * (sqrt(flagInt) + sqrt(flagrInt))) {
424 flaghist->SetBinContent(bin + 1, 1);
425 } else {
426 flaghist->SetBinContent(bin + 1, 0);
427 }
428 iret = 1;
429 } else if (Type == 10) {
430 float flag2 = refhist->Chi2Test(temp.get());
431 flaghist->SetBinContent(bin + 1, 0);
432 if (flag2 > pars[1])
433 flaghist->SetBinContent(bin + 1, 2);
434 if (flag2 > pars[0])
435 flaghist->SetBinContent(bin + 1, 1);
436 iret = 1;
437 } else if (Type == 100) {
438 flaghist->SetBinContent(bin + 1, 0);
439 iret = 1;
440 } else {
441 flaghist->SetBinContent(bin + 1, -3);
442 iret = -1;
443 }
444 strDebugInfo = Form("SetFlag---> %f, type %i\n", flaghist->GetBinContent(bin + 1), Type);
445 B2DEBUG(130, strDebugInfo.Data());
446 return iret;
447}
448
449// int DQMHistAnalysisPXDERModule::SetFlag(int Type, int bin, double* pars, double ratio, std::string name_hist, std::string name_refhist, TH1I* flaghist)
450// {
451//
452// TH1F* histF = new TH1F("histF", "histF", hist->GetNbinsX(), hist->GetXaxis()->GetXmin(), hist->GetXaxis()->GetXmax());
453// TH1F* refhistF = new TH1F("refhistF", "refhistF", refhist->GetNbinsX(), refhist->GetXaxis()->GetXmin(),
454// refhist->GetXaxis()->GetXmax());
455// for (int j = 0; j < hist->GetNbinsX(); j++) {
456// histF->SetBinContent(j + 1, hist->GetBinContent(j + 1));
457// refhistF->SetBinContent(j + 1, refhist->GetBinContent(j + 1));
458// }
459// int ret = SetFlag(Type, bin, pars, ratio, histF, refhistF, flaghist);
460// delete histF;
461// delete refhistF;
462// return ret;
463// }
464
static TH1 * findHistInFile(TFile *file, const std::string &histname)
Find histogram in specific TFile (e.g.
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
DQMHistAnalysisModule()
Constructor / Destructor.
int c_nPXDLayers
Number of PXD layers on Belle II.
void terminate(void) override final
Terminator.
std::string m_refFileName
Reference Histogram Root file name.
void initialize() override final
Initializer.
std::vector< std::string > m_chargStartRow
Cluster seed charge by distance from the start row.
std::vector< std::string > m_startRow
Start row distribution.
std::vector< std::string > m_ref_clusterCharge
Charge of clusters.
TH1I * m_fClusterSizeUFlag
Flags of u cluster size.
int c_firstVXDLayer
First VXD layer on Belle II.
std::vector< std::string > m_ref_clusterSizeV
v cluster size
int c_lastVXDLayer
Last VXD layer on Belle II.
std::vector< std::string > m_clusterSizeU
u cluster size
TH1I * m_fPixelSignalFlag
Flags of Charge of pixels.
std::vector< std::string > m_ref_startRow
Start row distribution.
int c_lastPXDLayer
Last PXD layer on Belle II.
std::vector< std::string > m_ref_clusterSizeU
u cluster size
std::vector< std::string > m_clusters
Clusters per event.
std::vector< std::string > m_ref_startRowCount
counter for Cluster seed charge by distance from the start row
TH1I * m_fStartRowFlag
Flags of Start row distribution.
TH1I * m_fClusterSizeUVFlag
Flags of Cluster size.
std::vector< std::string > m_clusterSizeUV
Cluster size.
int c_firstPXDLayer
First PXD layer on Belle II.
TH1I * m_fStartRowCountFlag
Flags of counter for Cluster seed charge by distance from the start row.
TH1I * m_fChargStartRowFlag
Flags of Cluster seed charge by distance from the start row.
void event() override final
This method is called for each event.
TH1I * m_fClusterSizeVFlag
Flags of v cluster size.
TH1I * m_fClustersFlag
Flags of Clusters per event.
std::vector< std::string > m_startRowCount
counter for Cluster seed charge by distance from the start row
std::string m_histogramDirectoryName
Function return flag histogram filled based on condition from TH1I source.
std::vector< std::string > m_clusterSizeV
v cluster size
std::vector< std::string > m_pixelSignal
Charge of pixels.
std::vector< std::string > m_ref_clusterSizeUV
Cluster size.
std::vector< std::string > m_ref_clusters
Clusters per event.
void beginRun() override final
Called when entering a new run.
TH1I * m_fClusterChargeFlag
Flags of Charge of clusters.
int SetFlag(int Type, int bin, const double *pars, double ratio, const std::string &name_hist, const std::string &name_refhist, TH1I *flaghist)
Function return flag histogram filled based on condition from TH1F source.
std::vector< std::string > m_fired
Hitmaps of Digits.
TH1I * m_fFiredFlag
Basic Directory in output file.
std::vector< std::string > m_ref_chargStartRow
Cluster seed charge by distance from the start row.
std::vector< std::string > m_ref_pixelSignal
Charge of pixels.
int c_nPXDSensors
Number of PXD sensors on Belle II.
std::vector< std::string > m_clusterCharge
Charge of clusters.
void getIDsFromIndex(const int Index, int &Layer, int &Ladder, int &Sensor) const
Function return index of sensor in plots.
int c_nVXDLayers
Number of pixels on PXD v direction.
std::vector< std::string > m_ref_fired
Fired pixels per event.
int c_firstSVDLayer
First SVD layer on Belle II.
int c_nSVDLayers
Number of SVD layers on Belle II.
int c_lastSVDLayer
Last SVD layer on Belle II.
TFile * m_refFile
The pointer to the reference file.
void setDescription(const std::string &description)
Sets the description of the module.
Definition Module.cc:214
Class to facilitate easy access to sensor information of the VXD like coordinate transformations or p...
Definition GeoCache.h:38
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
Class to uniquely identify a any structure of the PXD and SVD.
Definition VxdID.h:32
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:559
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition Module.h:649
double sqrt(double a)
sqrt for double
Definition beamHelpers.h:28
Abstract base class for different kinds of events.
STL namespace.