Belle II Software  release-05-02-19
DQMHistComparitor.h
1 //+
2 // File : DQMHistComparitor.h
3 // Description :
4 //
5 // Author : Bjoern Spruck, Uni Mainz
6 // Date : yesterday
7 //-
8 
9 #pragma once
10 
11 // EPICS
12 #ifdef _BELLE2_EPICS
13 #include "cadef.h"
14 // #include "dbDefs.h"
15 // #include "epicsString.h"
16 // #include "cantProceed.h"
17 #endif
18 
19 #include <dqm/analysis/modules/DQMHistAnalysis.h>
20 #include <TH1.h>
21 #include <TCanvas.h>
22 #include <TFile.h>
23 #include <TString.h>
24 
25 namespace Belle2 {
33 
37  typedef struct {
38 #ifdef _BELLE2_EPICS
39  chid mychid;
40 #endif
41 
42  bool epicsflag;
44  TString histo1;
46  TString histo2;
48  TCanvas* canvas;
50  float warning;
52  float error;
55  } CMPNODE;
56 
57  // Public functions
58  public:
59 
63 
69  TH1* find_histo_in_canvas(TString);
71  void initialize() override final;
72 
74  void beginRun() override final;
75  void event() override final;
76  void endRun() override final;
77  void terminate() override final;
78 
79  // Data members
80  private:
82  std::vector< std::vector<std::string>> m_histlist;
84  std::vector<CMPNODE*> m_pnode;
86  std::string m_refFileName;
88  TFile* m_refFile = nullptr;
90  bool m_color = true;
91 
97  TH1* GetHisto(TString histoname);
98 
99  };
101 } // end namespace Belle2
102 
Belle2::DQMHistComparitorModule::CMPNODE::histo2
TString histo2
The name of the reference histogram.
Definition: DQMHistComparitor.h:46
Belle2::DQMHistComparitorModule::endRun
void endRun() override final
This method is called if the current run ends.
Definition: DQMHistComparitor.cc:320
Belle2::DQMHistComparitorModule::m_refFileName
std::string m_refFileName
Reference Histogram Root file name.
Definition: DQMHistComparitor.h:86
Belle2::DQMHistComparitorModule::m_histlist
std::vector< std::vector< std::string > > m_histlist
Parameter list for histograms.
Definition: DQMHistComparitor.h:82
Belle2::DQMHistComparitorModule::m_pnode
std::vector< CMPNODE * > m_pnode
Struct for extracted parameters + EPICS PV.
Definition: DQMHistComparitor.h:84
Belle2::DQMHistComparitorModule::CMPNODE
The struct for reference histogram comparison.
Definition: DQMHistComparitor.h:37
Belle2::DQMHistComparitorModule::m_refFile
TFile * m_refFile
The pointer to the reference file.
Definition: DQMHistComparitor.h:88
Belle2::DQMHistComparitorModule::beginRun
void beginRun() override final
Module functions to be called from event process.
Definition: DQMHistComparitor.cc:232
Belle2::DQMHistComparitorModule::CMPNODE::error
float error
The error level for the histogram difference.
Definition: DQMHistComparitor.h:52
Belle2::DQMHistComparitorModule::CMPNODE::min_entries
int min_entries
The mininum entries for histogram comparison.
Definition: DQMHistComparitor.h:54
Belle2::DQMHistComparitorModule::event
void event() override final
This method is the core of the module.
Definition: DQMHistComparitor.cc:237
Belle2::DQMHistComparitorModule::GetHisto
TH1 * GetHisto(TString histoname)
Get histogram by its name.
Definition: DQMHistComparitor.cc:80
Belle2::DQMHistComparitorModule::DQMHistComparitorModule
DQMHistComparitorModule()
Constructor / Destructor.
Definition: DQMHistComparitor.cc:33
Belle2::DQMHistComparitorModule::find_histo_in_canvas
TH1 * find_histo_in_canvas(TString)
Find histogram corresponding to canvas.
Definition: DQMHistComparitor.cc:50
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::DQMHistComparitorModule
Class definition for the reference histogram display.
Definition: DQMHistComparitor.h:32
Belle2::DQMHistComparitorModule::m_color
bool m_color
Whether to use the color code for warnings and errors.
Definition: DQMHistComparitor.h:90
Belle2::DQMHistComparitorModule::CMPNODE::canvas
TCanvas * canvas
The canvas to display both original and reference histograms.
Definition: DQMHistComparitor.h:48
Belle2::DQMHistComparitorModule::initialize
void initialize() override final
Module functions to be called from main process.
Definition: DQMHistComparitor.cc:181
Belle2::DQMHistComparitorModule::terminate
void terminate() override final
This method is called at the end of the event processing.
Definition: DQMHistComparitor.cc:326
Belle2::DQMHistComparitorModule::CMPNODE::warning
float warning
The warning level for the histogram difference.
Definition: DQMHistComparitor.h:50
Belle2::DQMHistComparitorModule::CMPNODE::epicsflag
bool epicsflag
Whether to use EPICS.
Definition: DQMHistComparitor.h:42
Belle2::DQMHistComparitorModule::CMPNODE::histo1
TString histo1
The name of the histogram to be compared.
Definition: DQMHistComparitor.h:44
Belle2::DQMHistAnalysisModule
The base class for the histogram analysis module.
Definition: DQMHistAnalysis.h:27