Belle II Software  release-05-01-25
DqmHistoManagerModule.h
1 #ifndef DQM_HISTO_MANAGER_H
2 #define DQM_HISTO_MANAGER_H
3 //+
4 // File : DqmHistoManager.h
5 // Description : A module to manage histograms/ntuples/ttrees for DQM
6 //
7 // Author : Ryosuke Itoh, IPNS, KEK
8 // Date : 27 - Jul - 2010
9 //-
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 */
Belle2::EvtSocketSend
Definition: EvtSocket.h:26
Belle2::DqmHistoManagerModule::endRun
virtual void endRun()
This method is called if the current run ends.
Definition: DqmHistoManagerModule.cc:104
Belle2::DqmHistoManagerModule::event
virtual void event()
This method is the core of the module.
Definition: DqmHistoManagerModule.cc:114
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::DqmHistoManagerModule::terminate
virtual void terminate()
This method is called at the end of the event processing.
Definition: DqmHistoManagerModule.cc:161
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::DqmHistoManagerModule::DqmHistoManagerModule
DqmHistoManagerModule()
Constructor and Destructor.
Definition: DqmHistoManagerModule.cc:31
Belle2::DqmHistoManagerModule::m_hostname
std::string m_hostname
Host name to send histograms.
Definition: DqmHistoManagerModule.h:54
Belle2::DqmHistoManagerModule::m_initmain
bool m_initmain
True if initialize() was called.
Definition: DqmHistoManagerModule.h:59
Belle2::DqmHistoManagerModule::beginRun
virtual void beginRun()
Called when entering a new run.
Definition: DqmHistoManagerModule.cc:80
Belle2::DqmHistoManagerModule::initialize
virtual void initialize()
module functions
Definition: DqmHistoManagerModule.cc:62
Belle2::DqmHistoManagerModule
Class definition of DqmHistoManager module.
Definition: DqmHistoManagerModule.h:34
Belle2::DqmHistoManagerModule::m_workdir
std::string m_workdir
Name of working directory.
Definition: DqmHistoManagerModule.h:52
Belle2::DqmHistoManagerModule::m_histfile
std::string m_histfile
Name of histogram output file.
Definition: DqmHistoManagerModule.h:53
Belle2::MsgHandler
A class to encode/decode an EvtMessage.
Definition: MsgHandler.h:104