Belle II Software  release-06-01-15
DQMHistDeltaHisto.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 // File : DQMHistDeltaHisto.h
10 // Description :
11 //-
12 
13 #pragma once
14 
15 #include <framework/datastore/StoreObjPtr.h>
16 #include <framework/dataobjects/EventMetaData.h>
17 #include <dqm/analysis/modules/DQMHistAnalysis.h>
18 #include <TH1.h>
19 #include <TCanvas.h>
20 #include <time.h>
21 #include <map>
22 #include <queue>
23 #include <vector>
24 
25 namespace Belle2 {
33 
37  typedef struct {
39  TH1* histo;
41  TH1* diff_histo;
43  time_t time_modified;
44  } SSNODE;
45 
46  // Public functions
47  public:
48 
53 
57  virtual ~DQMHistDeltaHistoModule();
58 
62  virtual void initialize() override;
63 
67  virtual void beginRun() override;
68 
72  virtual void event() override;
73 
77  virtual void endRun() override;
78 
82  virtual void terminate() override;
83 
88  void clear_node(SSNODE* n);
89 
90  // Data members
91  private:
93  std::vector<std::string> m_monitored_histos;
95  std::map<std::string, std::queue<SSNODE*> > m_histos_queues;
100 
101  };
103 } // end namespace Belle2
104 
The base class for the histogram analysis module.
Class for generating snapshots for histograms.
virtual ~DQMHistDeltaHistoModule()
Destructor.
virtual void initialize() override
Initializer.
std::map< std::string, std::queue< SSNODE * > > m_histos_queues
Map of histogram names to queues of monitoring objects.
virtual void event() override
This method is called for each event.
StoreObjPtr< EventMetaData > m_evtMetaDataPtr
The metadata for each event.
virtual void endRun() override
This method is called if the current run ends.
virtual void terminate() override
This method is called at the end of the event processing.
std::vector< std::string > m_monitored_histos
Names of the histograms that should be monitored.
virtual void beginRun() override
Called when entering a new run.
void clear_node(SSNODE *n)
Clear content of SSNODE.
int m_interval
Interval between checks in second.
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:95
Abstract base class for different kinds of events.
The struct for the snapshots.
TH1 * diff_histo
The histogram for snapshot.
TH1 * histo
The histogram for snapshot.
time_t time_modified
Whether the histogram is not updated for a long time.