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 <numeric>
23#include <iostream>
24
25namespace Belle2 {
35
36 public:
37
42
47
51 void initialize() override final;
52
56 void beginRun() override final;
57
61 void event() override final;
62
66 void endRun() override final;
67
71 void terminate() override final;
72
76 void getHistStyle(TH1F*& htemp, std::string label, double max) const
77 {
78 gStyle->SetOptStat("ne");
79 if (strcmp(label.data(), "adc") == 0)htemp->GetYaxis()->SetRangeUser(max * 0.25, max * 2.25);
80 else if (strcmp(label.data(), "tdc") == 0)htemp->GetYaxis()->SetRangeUser(max * 0.90, max * 1.10);
81 htemp->Sumw2(0);
82 };
83
87 float getHistMedian(TH1D* h) const;
88
92 TH2Poly* createEffiTH2Poly(const TString& name, const TString& title) ;
93
97 void fillEffiTH2Poly(TH2F* hist, TH2Poly* attached, TH2Poly* expected, TH2Poly* efficiency) ;
98
102 void fillEffiTH2(TH2F* hist, TH2F* attached, TH2F* expected, TH2F* efficiency) ;
103
104
105 protected:
106
107 //Canvas for DQM analysis IR plots
108 TCanvas* c_hist_adc = nullptr;
109 TH1F* m_hist_adc = nullptr;
111 TCanvas* c_hist_tdc = nullptr;
112 TH1F* m_hist_tdc = nullptr;
114 TCanvas* c_hist_crphi = nullptr;
115 TH1D* m_hist_crphi = nullptr;
117 TCanvas* c_hist_hitsphi = nullptr;
119 TCanvas* c_hist_effphi = nullptr;
120 TH1D* m_hist_effphi = nullptr;
122 TCanvas* c_hist_skimphi[8] = {nullptr};
123 TH1D* m_hist_skimphi[8] = {nullptr};
125 TCanvas* c_hist_attach_eff[4] = {nullptr};
126 TH2F* m_hist_attach_eff[3] = {nullptr};
127 TH2Poly* m_hist_attach_eff_Poly[3] = {nullptr};
130 TLine* m_line_ladc = nullptr;
131 TLine* m_line_hadc = nullptr;
132 TLine* m_line_ltdc = nullptr;
133 TLine* m_line_htdc = nullptr;
135 std::string m_histoDir = "";
136 std::string m_histoADC = "";
137 std::string m_histoTDC = "";
138 std::string m_histoPhiIndex = "";
139 std::string m_histoPhiEff = "";
140 std::string m_histoHitsPhi = "";
141 std::string m_histoTrackingWireEff = "";
143 std::string m_pvPrefix = "";
144 std::string m_refDir = "";
145 std::string m_refNamePhi = "";
146 double m_firstEffBoundary = 0.08;
147 double m_secondEffBoundary = 0.72;
151 TFile* m_fileRefPhi = nullptr;
152 TH2F* m_histref_phiindex = nullptr;
153 TH1D* m_hist_refphi = nullptr;
156 double m_minadc;
157 double m_maxadc;
158 double m_mintdc;
159 double m_maxtdc;
160 double m_phistop;
162 double m_phiwarn;
164 TH1D* m_hADCs[300];
165 TH1D* m_hTDCs[300];
166 };
168} // 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).
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.