Belle II Software  release-05-01-25
PXDReadRawBonnDAQMatched.h
1 //+
2 // File : PXDReadRawBonnDAQMatched.h
3 // Description : Module to Load BonnDAQ file and store it as RawPXD in Data Store
4 // This is meant for lab use (standalone testing, debugging) without an event builder.
5 //
6 // Author : Bjoern Spruck
7 // Date : 16.05.2019
8 //-
9 
10 #pragma once
11 
12 #include <framework/core/Module.h>
13 #include <framework/datastore/StoreObjPtr.h>
14 #include <framework/datastore/StoreArray.h>
15 
16 #include <framework/dataobjects/EventMetaData.h>
17 #include <rawdata/dataobjects/RawPXD.h>
18 
19 #include <string>
20 #include <map>
21 #include <stdlib.h>
22 
23 
24 namespace Belle2 {
30  namespace PXD {
31 
37  enum {MAXEVTSIZE = 4 * 1024 * 1024 + 256 * 4 + 16};
38  // Public functions
39  public:
40 
43 
44  private:
45 
46  ~PXDReadRawBonnDAQMatchedModule() override final;
47 
48  void initialize() override final;
49  void event() override final;
50  void terminate() override final;
51 
52 
53  // Data members
54 
55  // Parallel processing parameters
56 
59 
62 
64  std::string m_filename;
65 
66  std::string m_RawPXDsName;
68  int* m_buffer;
70 
72  FILE* fh;
73 
74  int readOneEvent(unsigned int& tnr);
75  int read_data(char* data, size_t len);
76 
77  std::map <unsigned int, off_t> m_event_offset;
78  off_t m_last_offset{0};
79  };
80 
81  } // end namespace PXD
83 } // end namespace Belle2
84 
Belle2::PXD::PXDReadRawBonnDAQMatchedModule
Module to Load BonnDAQ file and store it as RawPXD in Data Store This is meant for lab use (standalon...
Definition: PXDReadRawBonnDAQMatched.h:36
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::event
void event() override final
This method is the core of the module.
Definition: PXDReadRawBonnDAQMatched.cc:229
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::PXDReadRawBonnDAQMatchedModule
PXDReadRawBonnDAQMatchedModule()
Constructor / Destructor.
Definition: PXDReadRawBonnDAQMatched.cc:33
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::readOneEvent
int readOneEvent(unsigned int &tnr)
Read event and store it in datastore if trigger nr matches.
Definition: PXDReadRawBonnDAQMatched.cc:80
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::m_event_offset
std::map< unsigned int, off_t > m_event_offset
map event nr to offsets
Definition: PXDReadRawBonnDAQMatched.h:77
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::initialize
void initialize() override final
Initialize the Module.
Definition: PXDReadRawBonnDAQMatched.cc:54
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::StoreObjPtr
Type-safe access to single objects in the data store.
Definition: ParticleList.h:33
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::terminate
void terminate() override final
This method is called at the end of the event processing.
Definition: PXDReadRawBonnDAQMatched.cc:261
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::m_buffer
int * m_buffer
buffer
Definition: PXDReadRawBonnDAQMatched.h:69
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::m_filename
std::string m_filename
File Name.
Definition: PXDReadRawBonnDAQMatched.h:64
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::m_RawPXDsName
std::string m_RawPXDsName
The name of the StoreArray RawPXDs to create.
Definition: PXDReadRawBonnDAQMatched.h:66
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::read_data
int read_data(char *data, size_t len)
Read amount of data (len bytes) from file to ptr data.
Definition: PXDReadRawBonnDAQMatched.cc:72
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::fh
FILE * fh
File handle.
Definition: PXDReadRawBonnDAQMatched.h:72
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::m_eventMetaDataPtr
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
Event Meta Data.
Definition: PXDReadRawBonnDAQMatched.h:58
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::m_last_offset
off_t m_last_offset
last checked file offset
Definition: PXDReadRawBonnDAQMatched.h:78
Belle2::PXD::PXDReadRawBonnDAQMatchedModule::m_rawPXD
StoreArray< RawPXD > m_rawPXD
DHH Data.
Definition: PXDReadRawBonnDAQMatched.h:61