Belle II Software development
SeqRootOutputModule.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#include <framework/core/Module.h>
12#include <framework/pcore/MsgHandler.h>
13#include <framework/pcore/SeqFile.h>
14#include <framework/pcore/DataStoreStreamer.h>
15
16#include <string>
17
18#include <sys/time.h>
19
20namespace Belle2 {
29 class SeqRootOutputModule : public Module {
30
31 // Public functions
32 public:
33
36 virtual ~SeqRootOutputModule();
37
39 virtual void initialize() override;
40
42 virtual void beginRun() override;
43 virtual void event() override;
44 virtual void endRun() override;
45 virtual void terminate() override;
46
47 private:
48
50 void getStreamerInfos();
51
53 std::string m_outputFileName;
54
57
60
63
65 int m_nevt;
66
69
72
75
78
80 struct timeval m_t0;
81 struct timeval m_tend;
83 // Data flow
84 double m_size;
85 double m_size2;
88 std::vector<std::string> m_saveObjs;
89
90 };
92} // end namespace Belle2
Stream/restore DataStore objects to/from EvtMessage.
Base class for Modules.
Definition: Module.h:72
A class to encode/decode an EvtMessage.
Definition: MsgHandler.h:103
A class to manage I/O for a chain of blocked files.
Definition: SeqFile.h:22
Output module for sequential ROOT I/O.
int m_nevt
Total nr. of events in the file.
DataStoreStreamer * m_streamer
DataStoreStreamer.
virtual void initialize() override
Module functions to be called from main process.
virtual void event() override
This method is the core of the module.
struct timeval m_tend
time at end of current run.
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.
bool m_fileNameIsPattern
If true the output filename will be interpreted as a boost::format pattern.
int m_streamerinfo_size
The size of the StreamerInfo.
SeqFile * m_file
Blocked file handler.
MsgHandler * m_msghandler
Messaage handler.
virtual void beginRun() override
Module functions to be called from event process.
std::vector< std::string > m_saveObjs
List of objects to be saved.
int m_compressionLevel
Compression level.
SeqRootOutputModule()
Constructor / Destructor.
double m_size
total transferred data, in kB.
void getStreamerInfos()
! Write StreamerInfos to a file
char * m_streamerinfo
StreamerInfo to be written.
std::string m_outputFileName
File name.
double m_size2
sum of squares of data transferred in each event, in kB^2.
Abstract base class for different kinds of events.