Belle II Software development
DQMHistAnalysisCDCEpics.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#pragma once
10
11#include <framework/database/DBArray.h>
12#include <framework/database/DBObjPtr.h>
13#include <dqm/core/DQMHistAnalysis.h>
14
15#include <TROOT.h>
16#include <TLine.h>
17#include <TH2Poly.h>
18#include <TH2F.h>
19#include <TH1F.h>
20#include <TStyle.h>
21#include <TLine.h>
22#include <TEllipse.h>
23#include <numeric>
24#include <iostream>
25
26namespace Belle2 {
36
37 public:
38
43
48
52 void initialize() override final;
53
57 void beginRun() override final;
58
62 void event() override final;
63
67 void endRun() override final;
68
72 void terminate() override final;
73
77 void getHistStyle(TH1F*& htemp, std::string label, double max) const
78 {
79 gStyle->SetOptStat("ne");
80 if (strcmp(label.data(), "adc") == 0)htemp->GetYaxis()->SetRangeUser(max * 0.25, max * 2.25);
81 else if (strcmp(label.data(), "tdc") == 0)htemp->GetYaxis()->SetRangeUser(max * 0.90, max * 1.10);
82 htemp->Sumw2(0);
83 };
84
88 float getHistMedian(TH1D* h) const;
89
93 TH2Poly* createEffiTH2Poly(const TString& name, const TString& title) ;
94
98 void fillEffiTH2Poly(TH2F* hist, TH2Poly* attached, TH2Poly* expected, TH2Poly* efficiency) ;
99
103 void fillEffiTH2(TH2F* hist, TH2F* attached, TH2F* expected, TH2F* efficiency) ;
104
105
106 protected:
107
108 //Canvas for DQM analysis IR plots
109 TCanvas* c_hist_adc = nullptr;
110 TH1F* m_hist_adc = nullptr;
112 TCanvas* c_hist_tdc = nullptr;
113 TH1F* m_hist_tdc = nullptr;
115 TCanvas* c_hist_crphi = nullptr;
116 TH1D* m_hist_crphi = nullptr;
118 TCanvas* c_hist_hitsphi = nullptr;
120 TCanvas* c_hist_effphi = nullptr;
121 TH1D* m_hist_effphi = nullptr;
123 TCanvas* c_hist_skimphi[8] = {nullptr};
124 TH1D* m_hist_skimphi[8] = {nullptr};
126 TCanvas* c_hist_attach_eff[4] = {nullptr};
127 TH2F* m_hist_attach_eff[3] = {nullptr};
128 TH2Poly* m_hist_attach_eff_Poly[3] = {nullptr};
130 double lbinEdges[56] = {0.0};
132 TLine* m_line_ladc = nullptr;
133 TLine* m_line_hadc = nullptr;
134 TLine* m_line_ltdc = nullptr;
135 TLine* m_line_htdc = nullptr;
137 std::string m_histoDir = "";
138 std::string m_histoADC = "";
139 std::string m_histoTDC = "";
140 std::string m_histoPhiIndex = "";
141 std::string m_histoPhiEff = "";
142 std::string m_histoHitsPhi = "";
143 std::string m_histoTrackingWireEff = "";
145 std::string m_pvPrefix = "";
146 std::string m_refDir = "";
147 std::string m_refNamePhi = "";
148 double m_firstEffBoundary = 0.08;
149 double m_secondEffBoundary = 0.72;
153 TFile* m_fileRefPhi = nullptr;
154 TH2F* m_histref_phiindex = nullptr;
155 TH1D* m_hist_refphi = nullptr;
158 double m_minadc;
159 double m_maxadc;
160 double m_mintdc;
161 double m_maxtdc;
162 double m_phistop;
164 double m_phiwarn;
166 TH1D* m_hADCs[300];
167 TH1D* m_hTDCs[300];
168 };
170} // Belle2 namespace
Make summary of data quality from reconstruction.
TCanvas * c_hist_adc
canvas for adc board median
TCanvas * c_hist_skimphi[8]
canvas for various phi distribution
std::string m_refDir
reference histogram dir of CDC DQMs
void initialize() override final
Initialize the Module.
double m_minadc
min adc median thershold accepted
double m_secondEffBoundary
The second boundary of the efficiency range.
TLine * m_line_hadc
line for higher ADC window
int m_minevt
min events for single intra-run point
TCanvas * c_hist_effphi
canvas for tracking efficiency
std::string m_histoADC
ADC histogram names of CDC DQMs.
std::string m_histoDir
histogram dir of CDC DQMs
void fillEffiTH2Poly(TH2F *hist, TH2Poly *attached, TH2Poly *expected, TH2Poly *efficiency)
Populate the efficiency histograms.
TH2Poly * createEffiTH2Poly(const TString &name, const TString &title)
Convenient function to create a TH2Poly based on CDC geometry.
std::string m_histoTDC
TDC histogram names of CDC DQMs.
double m_phiwarn
warn thershold for phi differences
std::string m_refNamePhi
reference histogram of phi
std::string m_histoTrackingWireEff
Wire Eff histogram names of CDC DQMs.
TFile * m_fileRefPhi
reference histogram file point
TLine * m_line_htdc
line for higher TDC window
double m_phialarm
alram thershold for phi differences
double m_maxadc
max adc median thershold accepted
TH1D * m_hTDCs[300]
TDC histograms with track associated hits for each board (0-299)
double m_maxtdc
max tdc median thershold accepted
void getHistStyle(TH1F *&htemp, std::string label, double max) const
get histogram styles
MonitoringObject * m_monObj
monitoring object
TCanvas * c_hist_crphi
canvas for control shifter phi
void terminate() override final
Termination action.
void event() override final
intra-run actions (EPICC PVs).
double lbinEdges[56]
vector for radius edge 56
std::string m_histoPhiEff
Phi Eff histogram names of CDC DQMs.
TCanvas * c_hist_tdc
canvas for tdc board median
TH1D * m_hADCs[300]
ADC histograms with track associated hits for each board (0-299)
double m_phistop
stop thershold for phi differences
bool m_doTH2PolyTrackingWireEff
If true, creates TH2Poly instead of TH2F for TrackingWireEff Histos.
TCanvas * c_hist_hitsphi
expert canvas for hits vs phi
TCanvas * c_hist_attach_eff[4]
canvas for layer efficiency
double m_firstEffBoundary
The first boundary of the efficiency range.
std::string m_histoHitsPhi
Phi Hits histogram names of CDC DQMs.
void endRun() override final
End-of-run action.
std::string m_histoPhiIndex
Phi Inedx histogram names of CDC DQMs.
TLine * m_line_ltdc
line for lower TDC window
TLine * m_line_ladc
line for lower ADC window
void beginRun() override final
Called when entering a new run.
float getHistMedian(TH1D *h) const
Get median of given histogram.
void fillEffiTH2(TH2F *hist, TH2F *attached, TH2F *expected, TH2F *efficiency)
Populate the efficiency histograms.
double m_mintdc
min tdc median thershold accepted
The base class for the histogram analysis module.
MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvas...
Abstract base class for different kinds of events.