Belle II Software  release-05-02-19
SeqRootOutputModule.h
1 //+
2 // Description : Sequential ROOT I/O output module
3 //
4 // Author : Ryosuke Itoh, IPNS, KEK
5 // Date : 13 - Aug - 2010
6 //-
7 
8 #pragma once
9 
10 #include <framework/core/Module.h>
11 #include <framework/pcore/MsgHandler.h>
12 #include <framework/pcore/SeqFile.h>
13 #include <framework/pcore/DataStoreStreamer.h>
14 
15 #include <string>
16 
17 #include <sys/time.h>
18 
19 namespace Belle2 {
28  class SeqRootOutputModule : public Module {
29 
30  // Public functions
31  public:
32 
35  virtual ~SeqRootOutputModule();
36 
38  virtual void initialize() override;
39 
41  virtual void beginRun() override;
42  virtual void event() override;
43  virtual void endRun() override;
44  virtual void terminate() override;
45 
46  private:
47 
49  void getStreamerInfos();
50 
52  std::string m_outputFileName;
53 
56 
59 
62 
64  int m_nevt;
65 
68 
71 
74 
77 
79  struct timeval m_t0;
80  struct timeval m_tend;
82  // Data flow
83  double m_size;
84  double m_size2;
87  std::vector<std::string> m_saveObjs;
88 
89  };
91 } // end namespace Belle2
Belle2::SeqRootOutputModule::event
virtual void event() override
This method is the core of the module.
Definition: SeqRootOutputModule.cc:94
Belle2::SeqRootOutputModule::m_outputFileName
std::string m_outputFileName
File name.
Definition: SeqRootOutputModule.h:52
Belle2::SeqRootOutputModule::m_size
double m_size
total transferred data, in kB.
Definition: SeqRootOutputModule.h:83
Belle2::SeqRootOutputModule::endRun
virtual void endRun() override
This method is called if the current run ends.
Definition: SeqRootOutputModule.cc:112
Belle2::SeqRootOutputModule::initialize
virtual void initialize() override
Module functions to be called from main process.
Definition: SeqRootOutputModule.cc:57
Belle2::SeqRootOutputModule::terminate
virtual void terminate() override
This method is called at the end of the event processing.
Definition: SeqRootOutputModule.cc:138
Belle2::SeqRootOutputModule::m_saveObjs
std::vector< std::string > m_saveObjs
List of objects to be saved.
Definition: SeqRootOutputModule.h:87
Belle2::SeqRootOutputModule::SeqRootOutputModule
SeqRootOutputModule()
Constructor / Destructor.
Definition: SeqRootOutputModule.cc:29
Belle2::SeqRootOutputModule::m_msghandler
MsgHandler * m_msghandler
Messaage handler.
Definition: SeqRootOutputModule.h:67
Belle2::SeqRootOutputModule::m_file
SeqFile * m_file
Blocked file handler.
Definition: SeqRootOutputModule.h:61
Belle2::SeqRootOutputModule::m_size2
double m_size2
sum of squares of data transferred in each event, in kB^2.
Definition: SeqRootOutputModule.h:84
Belle2::SeqRootOutputModule
Output module for sequential ROOT I/O.
Definition: SeqRootOutputModule.h:28
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::SeqRootOutputModule::m_compressionLevel
int m_compressionLevel
Compression level.
Definition: SeqRootOutputModule.h:58
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SeqRootOutputModule::m_fileNameIsPattern
bool m_fileNameIsPattern
If true the output filename will be interpreted as a boost::format pattern.
Definition: SeqRootOutputModule.h:55
Belle2::SeqRootOutputModule::m_streamerinfo_size
int m_streamerinfo_size
The size of the StreamerInfo.
Definition: SeqRootOutputModule.h:76
Belle2::SeqRootOutputModule::m_t0
struct timeval m_t0
Time.
Definition: SeqRootOutputModule.h:79
Belle2::SeqRootOutputModule::getStreamerInfos
void getStreamerInfos()
! Write StreamerInfos to a file
Definition: SeqRootOutputModule.cc:148
Belle2::SeqRootOutputModule::beginRun
virtual void beginRun() override
Module functions to be called from event process.
Definition: SeqRootOutputModule.cc:82
Belle2::SeqRootOutputModule::m_streamer
DataStoreStreamer * m_streamer
DataStoreStreamer.
Definition: SeqRootOutputModule.h:70
Belle2::SeqRootOutputModule::m_nevt
int m_nevt
Total nr. of events in the file.
Definition: SeqRootOutputModule.h:64
Belle2::DataStoreStreamer
Stream/restore DataStore objects to/from EvtMessage.
Definition: DataStoreStreamer.h:33
Belle2::SeqFile
A class to manage I/O for a chain of blocked files.
Definition: SeqFile.h:22
Belle2::MsgHandler
A class to encode/decode an EvtMessage.
Definition: MsgHandler.h:104
Belle2::SeqRootOutputModule::m_tend
struct timeval m_tend
time at end of current run.
Definition: SeqRootOutputModule.h:80
Belle2::SeqRootOutputModule::m_streamerinfo
char * m_streamerinfo
StreamerInfo to be written.
Definition: SeqRootOutputModule.h:73