Belle II Software  release-05-01-25
DQMHistDeltaHisto.h
1 //+
2 // File : DQMHistDeltaHisto.h
3 // Description :
4 //
5 // Author : Boqun Wang, MPI for Physics
6 // Date : yesterday
7 //-
8 
9 #pragma once
10 
11 #include <framework/datastore/StoreObjPtr.h>
12 #include <framework/dataobjects/EventMetaData.h>
13 #include <dqm/analysis/modules/DQMHistAnalysis.h>
14 #include <TH1.h>
15 #include <TCanvas.h>
16 #include <time.h>
17 #include <map>
18 #include <queue>
19 #include <vector>
20 
21 namespace Belle2 {
29 
33  typedef struct {
35  TH1* histo;
37  TH1* diff_histo;
39  time_t time_modified;
40  } SSNODE;
41 
42  // Public functions
43  public:
44 
47  virtual ~DQMHistDeltaHistoModule();
48 
50  virtual void initialize() override;
51 
53  virtual void beginRun() override;
54  virtual void event() override;
55  virtual void endRun() override;
56  virtual void terminate() override;
62  TCanvas* find_canvas(TString s);
67  void clear_node(SSNODE* n);
68 
69  // Data members
70  private:
72  std::vector<std::string> m_monitored_histos;
74  std::map<std::string, std::queue<SSNODE*> > m_histos_queues;
79 
80  };
82 } // end namespace Belle2
83 
Belle2::DQMHistDeltaHistoModule::event
virtual void event() override
This method is the core of the module.
Definition: DQMHistDeltaHisto.cc:87
Belle2::DQMHistDeltaHistoModule::SSNODE::diff_histo
TH1 * diff_histo
The histogram for snapshot.
Definition: DQMHistDeltaHisto.h:37
Belle2::DQMHistDeltaHistoModule::terminate
virtual void terminate() override
This method is called at the end of the event processing.
Definition: DQMHistDeltaHisto.cc:156
Belle2::DQMHistDeltaHistoModule
Class for generating snapshots for histograms.
Definition: DQMHistDeltaHisto.h:28
Belle2::DQMHistDeltaHistoModule::endRun
virtual void endRun() override
This method is called if the current run ends.
Definition: DQMHistDeltaHisto.cc:150
Belle2::DQMHistDeltaHistoModule::m_evtMetaDataPtr
StoreObjPtr< EventMetaData > m_evtMetaDataPtr
The metadata for each event.
Definition: DQMHistDeltaHisto.h:78
Belle2::DQMHistDeltaHistoModule::m_interval
int m_interval
Interval between checks in second.
Definition: DQMHistDeltaHisto.h:76
Belle2::DQMHistDeltaHistoModule::beginRun
virtual void beginRun() override
Module functions to be called from event process.
Definition: DQMHistDeltaHisto.cc:53
Belle2::DQMHistDeltaHistoModule::SSNODE
The struct for the snapshots.
Definition: DQMHistDeltaHisto.h:33
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::DQMHistDeltaHistoModule::find_canvas
TCanvas * find_canvas(TString s)
Find canvas by name.
Definition: DQMHistDeltaHisto.cc:67
Belle2::DQMHistDeltaHistoModule::m_histos_queues
std::map< std::string, std::queue< SSNODE * > > m_histos_queues
Map of histogram names to queues of monitoring objects.
Definition: DQMHistDeltaHisto.h:74
Belle2::DQMHistDeltaHistoModule::clear_node
void clear_node(SSNODE *n)
Clear content of SSNODE.
Definition: DQMHistDeltaHisto.cc:81
Belle2::DQMHistDeltaHistoModule::SSNODE::histo
TH1 * histo
The histogram for snapshot.
Definition: DQMHistDeltaHisto.h:35
Belle2::DQMHistDeltaHistoModule::initialize
virtual void initialize() override
Module functions to be called from main process.
Definition: DQMHistDeltaHisto.cc:41
Belle2::DQMHistDeltaHistoModule::DQMHistDeltaHistoModule
DQMHistDeltaHistoModule()
Constructor / Destructor.
Definition: DQMHistDeltaHisto.cc:30
Belle2::DQMHistDeltaHistoModule::SSNODE::time_modified
time_t time_modified
Whether the histogram is not updated for a long time.
Definition: DQMHistDeltaHisto.h:39
Belle2::DQMHistDeltaHistoModule::m_monitored_histos
std::vector< std::string > m_monitored_histos
Names of the histograms that should be monitored.
Definition: DQMHistDeltaHisto.h:72
Belle2::DQMHistAnalysisModule
The base class for the histogram analysis module.
Definition: DQMHistAnalysis.h:27