Belle II Software  release-06-01-15
DQMHistSnapshots.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 // 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 <time.h>
23 
24 namespace Belle2 {
32 
36  typedef struct {
38  TH1* histo;
40  TCanvas* canvas;
42  int stale;
43  } SSNODE;
44 
45  // Public functions
46  public:
47 
52 
56  virtual ~DQMHistSnapshotsModule();
57 
61  virtual void initialize() override;
62 
66  virtual void beginRun() override;
67 
71  virtual void event() override;
72 
76  virtual void endRun() override;
77 
81  virtual void terminate() override;
82 
88  SSNODE* find_snapshot(TString a);
89 
90  // Data members
91  private:
93  std::vector<SSNODE*> m_ssnode;
97  time_t m_last_check = 0;
98 
99  };
101 } // end namespace Belle2
102 
The base class for the histogram analysis module.
Class for generating snapshots for histograms.
virtual ~DQMHistSnapshotsModule()
Destructor.
virtual void initialize() override
Initializer.
virtual void event() override
This method is called 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.
int m_check_interval
Interval between checks in second.
std::vector< SSNODE * > m_ssnode
List of snapshots.
virtual void beginRun() override
Called when entering a new run.
time_t m_last_check
The time for the last check.
SSNODE * find_snapshot(TString a)
Find a snapshot by the histogram's name.
Abstract base class for different kinds of events.
The struct for the snapshots.
TH1 * histo
The histogram for snapshot.
TCanvas * canvas
The canvas for the histogram to be showed.
int stale
Whether the histogram is not updated for a long time.