 |
Belle II Software
release-05-01-25
|
12 #include <dqm/analysis/modules/DQMHistAnalysisARICH.h>
15 #include <dqm/analysis/modules/DQMHistAnalysis.h>
37 DQMHistAnalysisARICHModule::DQMHistAnalysisARICHModule()
41 setDescription(
"Modify and analyze the data quality histograms of ARICH");
56 for (
int i = 0; i < 5; i++) {
66 m_apdPoly->SetTitle(
"# of hits/APD/event");
70 B2DEBUG(20,
"DQMHistAnalysisARICH: initialized.");
82 TH1* m_h_mergerHit =
findHist(
"ARICH/mergerHit");
87 m_h_mergerHit->SetMinimum(0);
88 m_h_mergerHit->Draw(
"hist");
92 double mean = m_h_mergerHit->Integral() / 72;
93 for (
int i = 0; i < 72; i++) {
94 int hit = m_h_mergerHit->GetBinContent(i + 1);
95 if ((
bool)hit ^ (
bool)m_h_mergerHit->GetEntries()) {
103 if (hit > mean * 100 && alertMerger < 1) alertMerger = 1;
108 for (
int i = 0; i < 5; i++) {
109 m_LineForMB[i]->DrawLine(12 * (i + 1) + 0.5, 0, 12 * (i + 1) + 0.5, gPad->GetUymax());
114 B2INFO(
"Histogram/canvas named mergerHit is not found.");
119 TH1* m_h_bits =
findHist(
"ARICH/bits");
121 if (m_h_bits != NULL &&
m_c_bits != NULL) {
124 m_h_bits->SetMinimum(0);
125 m_h_bits->Draw(
"hist");
130 double side = m_h_bits->GetBinContent(2) + m_h_bits->GetBinContent(5);
131 double center = m_h_bits->GetBinContent(3) + m_h_bits->GetBinContent(4);
132 if (center / side < 2) alertBits = 1;
133 if (center / side < 1.5) alertBits = 2;
138 B2INFO(
"Histogram/canvas named bits is not found.");
142 TH1* m_h_hitsPerEvent =
findHist(
"ARICH/hitsPerEvent");
147 m_h_hitsPerEvent->SetMinimum(0);
148 m_h_hitsPerEvent->Draw(
"hist");
151 int alertHitsPerEvent = 0;
152 double mean = m_h_hitsPerEvent->GetMean();
153 if (mean < 1) alertHitsPerEvent = 1;
154 double entry = m_h_hitsPerEvent->GetEntries();
155 if (entry == 0) alertHitsPerEvent = 2;
160 B2INFO(
"Histogram/canvas named hitsPerEvent is not found.");
164 TH1* m_h_chHit =
findHist(
"ARICH/chipHit");
165 if (m_h_chHit != NULL) {
167 TH1* htmp =
findHist(
"ARICH/hitsPerEvent");
168 if (htmp) nevt = htmp->GetEntries();
170 if (nevt)
m_apdHist->Scale(1. /
float(nevt));
182 B2INFO(
"Histogram named chipHit is not found.");
189 B2DEBUG(20,
"DQMHistAnalysisARICH : endRun called");
195 B2DEBUG(20,
"terminate called");
200 TIter nextckey(gROOT->GetListOfCanvases());
201 TObject* cobj = NULL;
203 while ((cobj = (TObject*)nextckey())) {
204 if (cobj->IsA()->InheritsFrom(
"TCanvas")) {
205 if (cobj->GetName() == canvas_name)
209 return (TCanvas*)cobj;
virtual void event() override
Event processor.
TCanvas * m_c_bits
Canvas for modified bits histogram.
TCanvas * m_c_apdHist
Canvas for 2D hit map of APDs.
TCanvas * m_c_mergerHit
Canvas for modified mergerHit histogram.
int alertColor[3]
Alert color of canvases.
ARICH histogram with HAPD plane 3 options for bin segmentation are available type 0 - one bin per HAP...
void setDescription(const std::string &description)
Sets the description of the module.
bool m_enableAlert
Enable alert by base color of canvases.
TCanvas * m_c_hitsPerEvent
Canvas for modified hitsPerTrack histogram.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Belle2::ARICHChannelHist * m_apdHist
ARICH TObject to draw hit map for each APD.
TLine * m_LineForMB[5]
Lines to divide the sectors on mergerHit histogram.
virtual void terminate() override
Termination action.
static TH1 * findHist(const std::string &histname)
Find histogram.
TCanvas * find_canvas(TString cname)
Find canvas by name.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Abstract base class for different kinds of events.
virtual void initialize() override
Initialize the Module.
void setPoly(TH2Poly *poly)
Fill pure TH2Poly from ARICHChannelHist, makes bins and fills content.
virtual ~DQMHistAnalysisARICHModule()
Destructor.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
void fillFromTH1(TH1 *hist)
Fill the channelHist from the histogram Type 0 channelHist has to be filled with 420*144bin TH1 (each...
virtual void endRun() override
End-of-run action.
std::vector< int > maskedMergers
The id numbers of masked merger boards to avoid unnecessary alert.
virtual void beginRun() override
Called when entering a new run.
TH2Poly * m_apdPoly
hit map for each APD
The base class for the histogram analysis module.