Belle II Software  release-08-02-06
DQMHistAnalysisSVDEfficiency.h
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 // File : DQMHistAnalysisSVDEfficiency.h
10 // Description : module for DQM histogram analysis of SVD sensors efficiencies
11 //-
12 
13 #pragma once
14 
15 #include <dqm/core/DQMHistAnalysis.h>
16 #include <svd/dataobjects/SVDSummaryPlots.h>
17 
18 #include <TFile.h>
19 #include <TPaveText.h>
20 #include <TCanvas.h>
21 #include <TText.h>
22 #include <TLine.h>
23 #include <TArrow.h>
24 
25 namespace Belle2 {
33 
34  // Public functions
35  public:
36 
41 
46 
50  void initialize() override final;
51 
55  void beginRun() override final;
56 
60  void event() override final;
61 
65  void endRun() override final;
66 
70  void terminate() override final;
71 
72  private:
73 
74  //parameters
75  double m_effError;
76  double m_effWarning;
77  double m_statThreshold;
78  bool m_3Samples;
81 
83  std::string m_refFileName;
85  TFile* m_refFile = nullptr;
86 
87  TCanvas* m_cEfficiencyU = nullptr;
88  TCanvas* m_cEfficiencyV = nullptr;
90  TCanvas* m_cEfficiencyErrU = nullptr;
91  TCanvas* m_cEfficiencyErrV = nullptr;
94  TCanvas* m_cEfficiencyU3Samples = nullptr;
95  TCanvas* m_cEfficiencyV3Samples = nullptr;
97  TCanvas* m_cEfficiencyErrU3Samples = nullptr;
98  TCanvas* m_cEfficiencyErrV3Samples = nullptr;
101  TCanvas* m_cEfficiencyRPhiViewU = nullptr;
102  TCanvas* m_cEfficiencyRPhiViewV = nullptr;
103  TCanvas* m_cEfficiencyErrRPhiViewU = nullptr;
104  TCanvas* m_cEfficiencyErrRPhiViewV = nullptr;
106  TCanvas* m_cEfficiencyRPhiViewU3Samples = nullptr;
107  TCanvas* m_cEfficiencyRPhiViewV3Samples = nullptr;
111  Int_t findBinY(Int_t layer, Int_t sensor);
112  std::tuple<std::vector<TText*>, std::vector<TText*>> textModuleNumbers();
113  void drawText();
114  void setStatusOfCanvas(int status, TCanvas* canvas, bool plotLeg);
116  std::vector<TText*> m_laddersText;
117  std::vector<TText*> m_sensorsText;
119  TLine* m_lx = nullptr;
120  TLine* m_ly = nullptr;
121  TArrow* m_arrowx = nullptr;
122  TArrow* m_arrowy = nullptr;
124  TPaveText* m_legProblem = nullptr;
125  TPaveText* m_legWarning = nullptr;
126  TPaveText* m_legNormal = nullptr;
127  TPaveText* m_legEmpty = nullptr;
129  int m_efficiencyMin = 0;
130  int m_efficiencyMax = -1111;
131  bool m_setEfficiencyRange = false;
134  enum effStatus {
135  good = 0,
136  warning = 1,
137  error = 2,
138  lowStat = 3
139  };
144  std::vector<VxdID> m_SVDModules;
145 
146  std::string m_pvPrefix;
149  };
151 } // end namespace Belle2
152 
The base class for the histogram analysis module.
Class definition for the output module of Sequential ROOT I/O.
TCanvas * m_cEfficiencyErrRPhiViewU
efficiency U error plot canvas
TCanvas * m_cEfficiencyErrRPhiViewV3Samples
efficiency V error plot canvas for 3 samples
SVDSummaryPlots * m_hEfficiency3Samples
efficiency histo for 3 samples
int m_efficiencyMin
Minimum of the efficiency histogram.
TCanvas * m_cEfficiencyErrV3Samples
efficiency V error plot canvas for 3 samples
TCanvas * m_cEfficiencyErrRPhiViewV
efficiency V error plot canvas
TPaveText * m_legEmpty
efficiency plot legend, empty
double m_statThreshold
minimal number of tracks per sensor to set green or red frame
TCanvas * m_cEfficiencyErrU
efficiency U error plot canvas
Int_t findBinY(Int_t layer, Int_t sensor)
find Y bin corresponding to sensor, efficiency plot
TCanvas * m_cEfficiencyRPhiViewV3Samples
efficiency V plot canvas for 3 samples
std::vector< VxdID > m_SVDModules
IDs of all SVD Modules to iterate over.
effStatus m_effUstatus
number representing the status of the efficiency U side
SVDSummaryPlots * m_hEfficiencyErr3Samples
efficiency error histo for 3 samples
std::string m_pvPrefix
string prefix for EPICS PVs
double m_effWarning
warning level of the efficiency
double m_effError
error level of the efficiency
void terminate() override final
This method is called at the end of the event processing.
TPaveText * m_legWarning
efficiency plot legend, warning
void event() override final
This method is called for each event.
bool m_3Samples
if true enable 3 samples histograms analysis
TCanvas * m_cEfficiencyU3Samples
efficiency U plot canvas for 3 samples
void endRun() override final
This method is called if the current run ends.
TCanvas * m_cEfficiencyErrU3Samples
efficiency U error plot canvas for 3 samples
void setStatusOfCanvas(int status, TCanvas *canvas, bool plotLeg)
set status of Canvas
bool m_setEfficiencyRange
set the range of the efficiency histogram
std::vector< TText * > m_sensorsText
list of sensors to write on the cancas
effStatus m_effVstatus
number representing the status of the efficiency V side
void beginRun() override final
Called when entering a new run.
TCanvas * m_cEfficiencyRPhiViewU
efficiency U plot canvas
TPaveText * m_legNormal
efficiency plot legend, normal
std::vector< TText * > m_laddersText
list of ladders to write on the canvas
TCanvas * m_cEfficiencyV3Samples
efficiency V plot canvas for 3 samples
TCanvas * m_cEfficiencyErrV
efficiency V error plot canvas
TCanvas * m_cEfficiencyRPhiViewV
efficiency V plot canvas
int m_efficiencyMax
Maximum of the efficiency histogram.
TPaveText * m_legProblem
efficiency plot legend, problem
std::tuple< std::vector< TText * >, std::vector< TText * > > textModuleNumbers()
create vectors of TText to write on the canvas
TCanvas * m_cEfficiencyErrRPhiViewU3Samples
efficiency U error plot canvas for 3 samples
SVDSummaryPlots * m_hEfficiencyErr
efficiency error histo
TCanvas * m_cEfficiencyRPhiViewU3Samples
efficiency U plot canvas for 3 samples
TFile * m_refFile
The pointer to the reference file.
class to summarize SVD quantities per sensor and side
Abstract base class for different kinds of events.