Belle II Software development
DQMHistAnalysisCDCDedx.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 <TROOT.h>
12
13#include <TLine.h>
14#include <TPaveText.h>
15#include <TStyle.h>
16#include <TGaxis.h>
17#include <TColor.h>
18#include <TLegend.h>
19
20#include <TF1.h>
21#include <TCanvas.h>
22#include <TH1.h>
23#include <TH2D.h>
24
25#include <dqm/core/DQMHistAnalysis.h>
26#include <cdc/geometry/CDCGeometryParConstants.h>
27
28namespace Belle2 {
33
39
40
42
43 // Public functions
44 public:
45
50
54 void initialize() override final;
55
59 void beginRun() override final;
60
64 void event() override final;
65
69 void endRun() override final;
70
74 void terminate() override final;
75
79 void getMetadata();
80
84 void drawDedxPR();
85
89 void drawDedxIR();
90
94 void drawWireStatus();
95
99 void drawDedxCosPhi();
100
104 void drawBandPlot();
105
109 void drawDedxInjTime();
110
114 void drawDedxInjTimeBin();
115
121 void fitHistogram(TH1*& temphist, std::string& status);
122
130 void setHistPars(TH2D*& hist, TH1F*& hmean, TH1F*& hsigma, int nbin);
131
135 void setPlotStyle();
136
141 void setTextStyle(TPaveText* obj);
142
147 void setHistStyle(TH1* obj);
148
156 void setPadStyle(double l, double r, double t, double b);
157
162 void setBEvtInfo(TPaveText* pt);
163
164 private:
165
166 std::string m_iexprun{""};
167 std::string m_status{""};
168 double m_mean{0.0};
169 double m_sigma{0.0};
170
171 int m_exp{0};
172 int m_run{0};
173 double m_dbrg{0.};
174 int m_nallevt{0};
176 int m_nhadevt{0};
177
178 std::string m_mode;
179
180 //DQM analysis and Mirabelle
181 TCanvas* m_c_pr_dedx = nullptr;
182 TCanvas* m_c_ir_dedx = nullptr;
183
184 TF1* f_gaus = nullptr;
185 TLine* l_line = nullptr;
186
187 TPaveText* m_text_dedx_fit = nullptr;
188 TPaveText* m_text_dedx = nullptr;
189 TPaveText* m_text_dedx_ir = nullptr;
190
191 TPaveText* m_text_bandplot = nullptr;
192 TPaveText* m_text_dedxWire = nullptr;
193
194 TPaveText* m_text_mean = nullptr;
195 TPaveText* m_text_sigma = nullptr;
196
197 TH1F* m_hdEdxIRMean = nullptr;
198 TH1F* m_hdEdxIRSigma = nullptr;
199 TH1F* m_hMeanHer = nullptr;
200 TH1F* m_hSigmaHer = nullptr;
201 TH1F* m_hMeanLer = nullptr;
202 TH1F* m_hSigmaLer = nullptr;
203 TH1* m_hdEdxIRInd = nullptr;
204
205 TLegend* m_lego = nullptr;
206 TLegend* m_legoI = nullptr;
207
208 unsigned m_first{0};
209 unsigned m_last{0};
210
212
213 static const Int_t m_NRGBs = 6;
214 static const Int_t m_NCont = 255;
215
216 Int_t m_pal = 0;
218 };
219
220} // end namespace Belle2
void drawDedxInjTime()
function to draw the dEdx vs injection time
void drawDedxCosPhi()
function to draw dEdx vs costh and phi
void initialize() override final
init function for default values
void drawBandPlot()
function to dedx bands P
void setTextStyle(TPaveText *obj)
function to add text style
void drawWireStatus()
function to draw ADC-based dead wire status of CDC
TH1F * m_hdEdxIRMean
histogram for dE/dx mean vs events per run
TPaveText * m_text_dedx_fit
add dE/dx fit information
void setHistStyle(TH1 *obj)
function to set the style of histogram
TPaveText * m_text_mean
add dE/dx mean information
TH1 * m_hdEdxIRInd
histogram to calculate dE/dx mean and sigma in bins
TLegend * m_legoI
legends for LER/HER for mean and sigma
MonitoringObject * m_monObj
MonitoringObject for mirabelle.
TH1F * m_hSigmaHer
histogram for dE/dx sigma vs injection time (HER)
void terminate() override final
terminating at the end of last run
void drawDedxInjTimeBin()
function to draw the mean/reso of dedx vs injection time
void event() override final
event by event function
TPaveText * m_text_sigma
add dE/dx sigma information
TCanvas * m_c_ir_dedx
intra-run dedx status
void setHistPars(TH2D *&hist, TH1F *&hmean, TH1F *&hsigma, int nbin)
function to set the mean and sigma histograms
static const Int_t m_NCont
Total number of colors in the table.
TPaveText * m_text_dedxWire
add Wire information
void endRun() override final
end of each run
TH1F * m_hSigmaLer
histogram for dE/dx sigma vs injection time (LER)
void setPadStyle(double l, double r, double t, double b)
function to reset pad margins
void getMetadata()
function to get metadata from histogram
void setBEvtInfo(TPaveText *pt)
function to set the bhabha event info
void fitHistogram(TH1 *&temphist, std::string &status)
function to fit gaussian dist.
void beginRun() override final
begin each run
TPaveText * m_text_dedx_ir
add dE/dx intra run information
void drawDedxPR()
function to draw dEdx+Fit
TPaveText * m_text_bandplot
add hadron event information
void drawDedxIR()
function to draw dEdx+Fit for run variation
TPaveText * m_text_dedx
add dE/dx bhabha event information
TH1F * m_hdEdxIRSigma
histogram for dE/dx sigma vs events per run
static const Int_t m_NRGBs
Number of end point colors that will form the gradients.
TH1F * m_hMeanLer
histogram for dE/dx mean vs injection time (LER)
TH1F * m_hMeanHer
histogram for dE/dx mean vs injection time (HER)
std::string m_mode
monitoring mode all/basic
void setPlotStyle()
function to add plot style
DQMHistAnalysisModule()
Constructor / Destructor.
MonitoringObject is a basic object to hold data for the run-dependency monitoring Run summary TCanvas...
Abstract base class for different kinds of events.