Belle II Software  release-06-00-14
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 
50  virtual ~DQMHistSnapshotsModule();
51 
53  virtual void initialize() override;
54 
56  virtual void beginRun() override;
57  virtual void event() override;
58  virtual void endRun() override;
59  virtual void terminate() override;
65  SSNODE* find_snapshot(TString a);
66 
67  // Data members
68  private:
70  std::vector<SSNODE*> m_ssnode;
74  time_t m_last_check = 0;
75 
76  };
78 } // end namespace Belle2
79 
The base class for the histogram analysis module.
Class for generating snapshots for histograms.
virtual void initialize() override
Module functions to be called from main process.
virtual void event() override
This method is the core of the module.
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.
DQMHistSnapshotsModule()
Constructor / Destructor.
virtual void beginRun() override
Module functions to be called from event process.
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.