Belle II Software  release-05-02-19
FastRbuf2DsModule.h
1 //+
2 // File : FastRbuf2Ds.h
3 // Description : Module to restore DataStore in RingBuffer
4 //
5 // Author : Ryosuke Itoh, IPNS, KEK
6 // Date : 29 - Nov - 2013
7 //-
8 
9 #ifndef FASTRBUF2DSMODULE_H
10 #define FASTRBUF2DSMODULE_H
11 
12 #include <framework/core/Module.h>
13 #include <framework/pcore/RingBuffer.h>
14 
15 #include <pthread.h>
16 
17 #include <string>
18 
19 #include <framework/pcore/DataStoreStreamer.h>
20 //#include <framework/datastore/DataStore.h>
21 
22 #define RBUFSIZE 100000000
23 #define MAXEVTSIZE 400000000
24 
25 
26 namespace Belle2 {
34  class FastRbuf2DsModule : public Module {
35 
36  // Public functions
37  public:
38 
41  virtual ~FastRbuf2DsModule();
42 
44  virtual void initialize();
45 
47  virtual void beginRun();
48  virtual void event();
49  virtual void endRun();
50  virtual void terminate();
51 
53  void ReadRbufInThread();
54 
55  // Data members
56  private:
57 
59  std::string m_rbufname;
60  RingBuffer* m_rbuf;
61 
63  pthread_t m_thr_input;
64 
67 
70 
73 
75  int m_nrecv;
76 
77  };
78 
80 } // end namespace Belle2
81 
82 #endif // MODULEHELLO_H
Belle2::FastRbuf2DsModule
A class definition of an input module for Sequential ROOT I/O.
Definition: FastRbuf2DsModule.h:34
Belle2::FastRbuf2DsModule::initialize
virtual void initialize()
Module functions to be called from main process.
Definition: FastRbuf2DsModule.cc:64
Belle2::FastRbuf2DsModule::m_nrecv
int m_nrecv
No. of sent events.
Definition: FastRbuf2DsModule.h:75
Belle2::FastRbuf2DsModule::ReadRbufInThread
void ReadRbufInThread()
Function to read event from RB.
Definition: FastRbuf2DsModule.cc:123
Belle2::FastRbuf2DsModule::beginRun
virtual void beginRun()
Module functions to be called from event process.
Definition: FastRbuf2DsModule.cc:147
Belle2::FastRbuf2DsModule::m_thr_input
pthread_t m_thr_input
Input thread ID.
Definition: FastRbuf2DsModule.h:63
Belle2::FastRbuf2DsModule::FastRbuf2DsModule
FastRbuf2DsModule()
Constructor / Destructor.
Definition: FastRbuf2DsModule.cc:36
Belle2::FastRbuf2DsModule::m_streamer
DataStoreStreamer * m_streamer
DataStore streamer.
Definition: FastRbuf2DsModule.h:66
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::RingBuffer
Class to manage a Ring Buffer placed in an IPC shared memory.
Definition: RingBuffer.h:36
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::FastRbuf2DsModule::event
virtual void event()
This method is the core of the module.
Definition: FastRbuf2DsModule.cc:153
Belle2::FastRbuf2DsModule::endRun
virtual void endRun()
This method is called if the current run ends.
Definition: FastRbuf2DsModule.cc:167
Belle2::FastRbuf2DsModule::m_compressionLevel
int m_compressionLevel
Compression Level.
Definition: FastRbuf2DsModule.h:69
Belle2::FastRbuf2DsModule::m_rbufname
std::string m_rbufname
RingBuffer ID.
Definition: FastRbuf2DsModule.h:59
Belle2::DataStoreStreamer
Stream/restore DataStore objects to/from EvtMessage.
Definition: DataStoreStreamer.h:33
Belle2::FastRbuf2DsModule::m_numThread
int m_numThread
Number of decoder threads.
Definition: FastRbuf2DsModule.h:72
Belle2::FastRbuf2DsModule::terminate
virtual void terminate()
This method is called at the end of the event processing.
Definition: FastRbuf2DsModule.cc:175