Belle II Software  release-05-01-25
PXDReadRawBonnDAQ.h
1 //+
2 // File : PXDReadRawBonnDAQ.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 : 02.05.2018
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 <stdlib.h>
21 
22 
23 namespace Belle2 {
29  namespace PXD {
33  enum {MAXEVTSIZE = 4 * 1024 * 1024 + 256 * 4 + 16};
34 
35  public:
38 
39  private:
41  ~PXDReadRawBonnDAQModule() override final;
42 
43  void initialize() override final;
44  void event() override final;
45  void terminate() override final;
46 
47 
48  // Data members
49 
52 
55 
57  std::string m_filename;
58 
60  int* m_buffer;
61 
63  FILE* fh;
64 
65  unsigned int m_expNr;
66  unsigned int m_runNr;
67  unsigned int m_subRunNr;
68 
69  int readOneEvent(void);
70  int read_data(char* data, size_t len);
71  };
72 
73  } // end namespace PXD
75 } // end namespace Belle2
76 
Belle2::PXD::PXDReadRawBonnDAQModule::event
void event() override final
This method is the core of the module.
Definition: PXDReadRawBonnDAQ.cc:227
Belle2::PXD::PXDReadRawBonnDAQModule::fh
FILE * fh
File handle.
Definition: PXDReadRawBonnDAQ.h:63
Belle2::PXD::PXDReadRawBonnDAQModule::m_filename
std::string m_filename
File Name.
Definition: PXDReadRawBonnDAQ.h:57
Belle2::PXD::PXDReadRawBonnDAQModule::terminate
void terminate() override final
This method is called at the end of the event processing.
Definition: PXDReadRawBonnDAQ.cc:249
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::PXD::PXDReadRawBonnDAQModule::initialize
void initialize() override final
Initialize the Module.
Definition: PXDReadRawBonnDAQ.cc:54
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::PXDReadRawBonnDAQModule::m_expNr
unsigned int m_expNr
set by Param
Definition: PXDReadRawBonnDAQ.h:65
Belle2::PXD::PXDReadRawBonnDAQModule::m_rawPXD
StoreArray< RawPXD > m_rawPXD
DHH Data.
Definition: PXDReadRawBonnDAQ.h:54
Belle2::PXD::PXDReadRawBonnDAQModule::read_data
int read_data(char *data, size_t len)
Read data of one Event from File.
Definition: PXDReadRawBonnDAQ.cc:72
Belle2::PXD::PXDReadRawBonnDAQModule::PXDReadRawBonnDAQModule
PXDReadRawBonnDAQModule()
Constructor.
Definition: PXDReadRawBonnDAQ.cc:32
Belle2::PXD::PXDReadRawBonnDAQModule::m_eventMetaDataPtr
StoreObjPtr< EventMetaData > m_eventMetaDataPtr
Event Meta Data.
Definition: PXDReadRawBonnDAQ.h:51
Belle2::PXD::PXDReadRawBonnDAQModule::~PXDReadRawBonnDAQModule
~PXDReadRawBonnDAQModule() override final
Destructor.
Definition: PXDReadRawBonnDAQ.cc:49
Belle2::PXD::PXDReadRawBonnDAQModule::m_runNr
unsigned int m_runNr
set by Param
Definition: PXDReadRawBonnDAQ.h:66
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::PXD::PXDReadRawBonnDAQModule::m_buffer
int * m_buffer
buffer
Definition: PXDReadRawBonnDAQ.h:60
Belle2::PXD::PXDReadRawBonnDAQModule::readOneEvent
int readOneEvent(void)
Definition: PXDReadRawBonnDAQ.cc:80
Belle2::PXD::PXDReadRawBonnDAQModule::m_subRunNr
unsigned int m_subRunNr
set by Param
Definition: PXDReadRawBonnDAQ.h:67
Belle2::PXD::PXDReadRawBonnDAQModule
Module to Load Raw PXD Data from DHH network-dump file and store it as RawPXD in Data Store This is m...
Definition: PXDReadRawBonnDAQ.h:32