Belle II Software  release-06-02-00
DqmHistoManagerModule.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 #ifndef DQM_HISTO_MANAGER_H
9 #define DQM_HISTO_MANAGER_H
10 
11 #include <framework/core/Module.h>
12 #include <daq/dataflow/EvtSocket.h>
13 
14 #include <framework/pcore/MsgHandler.h>
15 
16 #include "TH1.h"
17 #include "TDirectory.h"
18 
19 #include <string>
20 #include <time.h>
21 
22 #define DQM_SOCKET 9899
23 
24 namespace Belle2 {
34  class DqmHistoManagerModule : public Module {
35  public:
36 
39  virtual ~DqmHistoManagerModule();
40 
42  virtual void initialize();
43  virtual void beginRun();
44  virtual void endRun();
45  virtual void event();
46  virtual void terminate();
47 
48  private:
49  int StreamHistograms(TDirectory*, MsgHandler*);
50 
51  private:
52  std::string m_workdir;
53  std::string m_histfile;
54  std::string m_hostname;
55  int m_port;
56  int m_interval;
57  int m_dumpinterval;
58 
59  bool m_initmain;
60  bool m_initialized;
61  int m_nevent;
62  time_t m_ptime;
63  time_t m_dtime;
64  time_t m_pstep;
65  time_t m_dstep;
66 
67 
68  // Socket interface
69  EvtSocketSend* m_sock;
70  MsgHandler* m_msg;
71  int m_nobjs;
72 
73 
74 
75  };
77 } // Namaspace Belle2
78 
79 #endif /* HISTO_MANAGER_H */
Class definition of DqmHistoManager module.
virtual void event()
This method is the core of the module.
std::string m_histfile
Name of histogram output file.
virtual void initialize()
module functions
virtual void beginRun()
Called when entering a new run.
virtual void terminate()
This method is called at the end of the event processing.
virtual void endRun()
This method is called if the current run ends.
std::string m_workdir
Name of working directory.
bool m_initmain
True if initialize() was called.
std::string m_hostname
Host name to send histograms.
DqmHistoManagerModule()
Constructor and Destructor.
Base class for Modules.
Definition: Module.h:72
A class to encode/decode an EvtMessage.
Definition: MsgHandler.h:103
Abstract base class for different kinds of events.