Belle II Software  release-05-02-19
SeqRootInputModule.h
1 //+
2 // Author : Ryosuke Itoh, IPNS, KEK
3 // Date : 13 - Aug - 2010
4 //-
5 
6 #pragma once
7 
8 #include <framework/core/Module.h>
9 #include <framework/pcore/DataStoreStreamer.h>
10 #include <framework/pcore/SeqFile.h>
11 
12 #include <string>
13 
14 #include <sys/time.h>
15 
16 namespace Belle2 {
22  class SeqRootInputModule : public Module {
23  public:
24 
27  virtual ~SeqRootInputModule();
28 
30  virtual void initialize() override;
31 
33  virtual void beginRun() override;
34  virtual void event() override;
35  virtual void endRun() override;
36  virtual void terminate() override;
37 
38  private:
40  std::string m_inputFileName{""};
42  std::vector<std::string> m_filelist;
43 
45  bool m_fileNameIsPattern{false};
46 
48  bool m_realData{false};
49 
51  SeqFile* m_file{nullptr};
52 
54  int m_nfile{0};
56  int m_fileptr{0};
57 
59  int m_nevt{ -1};
60 
63 
65  struct timeval m_t0;
66  struct timeval m_tend;
68  // Data flow
69  double m_size{0};
70  double m_size2{0};
71  };
73 } // end namespace Belle2
Belle2::SeqRootInputModule::m_realData
bool m_realData
Is the input real data?
Definition: SeqRootInputModule.h:48
Belle2::SeqRootInputModule::m_filelist
std::vector< std::string > m_filelist
List of all file names to read.
Definition: SeqRootInputModule.h:42
Belle2::SeqRootInputModule::m_fileptr
int m_fileptr
Index of current file in m_filelist.
Definition: SeqRootInputModule.h:56
Belle2::SeqRootInputModule::m_streamer
DataStoreStreamer * m_streamer
DataStoreStreamer.
Definition: SeqRootInputModule.h:62
Belle2::SeqRootInputModule::event
virtual void event() override
This method is the core of the module.
Definition: SeqRootInputModule.cc:138
Belle2::SeqRootInputModule::SeqRootInputModule
SeqRootInputModule()
Constructor / Destructor.
Definition: SeqRootInputModule.cc:31
Belle2::SeqRootInputModule::m_inputFileName
std::string m_inputFileName
File name.
Definition: SeqRootInputModule.h:40
Belle2::SeqRootInputModule::m_tend
struct timeval m_tend
time at end of current run.
Definition: SeqRootInputModule.h:66
Belle2::SeqRootInputModule::m_nevt
int m_nevt
Total nr. of events in the file.
Definition: SeqRootInputModule.h:59
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::SeqRootInputModule::m_size2
double m_size2
sum of squares of data transferred in each event, in kB^2.
Definition: SeqRootInputModule.h:70
Belle2::SeqRootInputModule::m_nfile
int m_nfile
Number of files to read (aka m_filelist.size())
Definition: SeqRootInputModule.h:54
Belle2::SeqRootInputModule::m_t0
struct timeval m_t0
Time.
Definition: SeqRootInputModule.h:65
Belle2::SeqRootInputModule
Module to read files produced by SeqRootOutputModule.
Definition: SeqRootInputModule.h:22
Belle2::SeqRootInputModule::m_file
SeqFile * m_file
Blocked file handler.
Definition: SeqRootInputModule.h:51
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SeqRootInputModule::beginRun
virtual void beginRun() override
Module functions to be called from event process.
Definition: SeqRootInputModule.cc:128
Belle2::SeqRootInputModule::endRun
virtual void endRun() override
This method is called if the current run ends.
Definition: SeqRootInputModule.cc:213
Belle2::SeqRootInputModule::m_size
double m_size
total transferred data, in kB.
Definition: SeqRootInputModule.h:69
Belle2::SeqRootInputModule::initialize
virtual void initialize() override
Module functions to be called from main process.
Definition: SeqRootInputModule.cc:53
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::SeqRootInputModule::m_fileNameIsPattern
bool m_fileNameIsPattern
If true the output filename will be interpreted as a boost::format pattern.
Definition: SeqRootInputModule.h:45
Belle2::SeqRootInputModule::terminate
virtual void terminate() override
This method is called at the end of the event processing.
Definition: SeqRootInputModule.cc:241