Belle II Software development
PXDUnpackerOldModule.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 <pxd/dataobjects/PXDRawHit.h>
13#include <pxd/dataobjects/PXDRawAdc.h>
14#include <pxd/dataobjects/PXDRawROIs.h>
15#include <vxd/dataobjects/VxdID.h>
16#include <rawdata/dataobjects/RawPXD.h>
17#include <framework/datastore/StoreArray.h>
18#include <framework/datastore/StoreObjPtr.h>
19#include <framework/dataobjects/EventMetaData.h>
20
21#include <pxd/dataobjects/PXDErrorFlags.h>
22#include <pxd/dataobjects/PXDDAQStatus.h>
23
24namespace Belle2 {
30 namespace PXD {
31
39
40 public:
43
44 private:
45
47 void initialize() override final;
49 void event() override final;
51 void terminate() override final;
52
53 std::string m_RawPXDsName;
55 std::string m_PXDRawHitsName;
56 std::string m_PXDRawAdcsName;
57 std::string m_PXDRawROIsName;
60 bool m_doNotStore{false};
62 bool m_checkPaddingCRC{false};
64 bool m_forceMapping{false};
66 bool m_forceNoMapping{false};
68 unsigned int m_maxDHPFrameDiff{0};
69
71 PXDError::PXDErrorFlags m_criticalErrorMask{};
73 PXDError::PXDErrorFlags m_suppressErrorMask{};
75 PXDError::PXDErrorFlags m_errorSkipPacketMask{};
76
78 unsigned long m_meta_event_nr{0};
80 unsigned long m_meta_run_nr{0};
82 unsigned long m_meta_subrun_nr{0};
84 unsigned long m_meta_experiment{0};
86 unsigned long long int m_meta_time{0};
88 unsigned int m_meta_sec{0};
90 unsigned int m_meta_ticks{0};
91
93 unsigned int m_unpackedEventsCount{0};
95 unsigned int m_errorCounter[PXDError::ONSEN_MAX_TYPE_ERR] {};
97 bool m_verbose{false};
99 bool m_continueOnError{false};
100
113
118 void unpack_rawpxd(RawPXD& px, int inx);
119
127 void unpack_dhc_frame(void* data, const int len, const int Frame_Number, const int Frames_in_event, PXDDAQPacketStatus& daqpktstat);
128
139 void unpack_dhp(void* data, unsigned int len, unsigned int dhe_first_readout_frame_lo, unsigned int dhe_ID, unsigned dhe_DHPport,
140 unsigned dhe_reformat, VxdID vxd_id, PXDDAQPacketStatus& daqpktstat);
141
149 void unpack_dhp_raw(void* data, unsigned int len, unsigned int dhe_ID, unsigned dhe_DHPport, VxdID vxd_id);
150
157 void unpack_fce(unsigned short* data, unsigned int length, VxdID vxd_id);
158
160 PXDError::PXDErrorFlags m_errorMask{0};
162 PXDError::PXDErrorFlags m_errorMaskDHE{0};
164 PXDError::PXDErrorFlags m_errorMaskDHC{0};
166 PXDError::PXDErrorFlags m_errorMaskPacket{0};
168 PXDError::PXDErrorFlags m_errorMaskEvent{0};
169
171 unsigned int m_notaccepted{0};
173 unsigned int m_sendrois{0};
175 unsigned int m_sendunfiltered{0};
177 bool m_formatBonnDAQ{false};
178
180 int m_last_dhp_readout_frame_lo[4] { -1}; // signed because -1 means undefined
181
182 public:
186 static int nr5bits(int i);
187
190 static void dump_dhp(void* data, unsigned int frame_len);
191
194 static void dump_roi(void* data, unsigned int frame_len);
195
196 };//end class declaration
197
198
199 } //end PXD namespace;
201} // end namespace Belle2
Base class for Modules.
Definition: Module.h:72
The PXD DAQ Packet Status class.
PXDUnpackerOldModule()
Constructor defining the parameters.
std::string m_PXDRawHitsName
The name of the StoreArray of PXDRawHits to be generated.
void initialize() override final
Initialize the module.
unsigned long m_meta_experiment
Experiment from MetaInfo.
PXDError::PXDErrorFlags m_errorMaskEvent
Error Mask set per packet / event.
StoreObjPtr< PXDDAQStatus > m_storeDAQEvtStats
Output array for DAQ Status.
bool m_doNotStore
Only unpack, but Do Not Store anything to file.
StoreArray< RawPXD > m_storeRawPXD
Input array for PXD Raw.
bool m_forceNoMapping
Force No Mapping even if DHH bit is requesting it.
std::string m_PXDDAQEvtStatsName
The name of the StoreObjPtr of PXDDAQStatus to be generated.
static void dump_roi(void *data, unsigned int frame_len)
dump to a file, helper function for debugging.
PXDError::PXDErrorFlags m_suppressErrorMask
Mask for suppressing selected error messages.
bool m_formatBonnDAQ
flag ONSEN or BonnDAQ format
unsigned int m_errorCounter[PXDError::ONSEN_MAX_TYPE_ERR]
Error counters.
StoreArray< PXDRawROIs > m_storeROIs
Output array for Raw ROIs.
unsigned int m_sendunfiltered
counter for send unfiltered
PXDError::PXDErrorFlags m_errorMaskDHC
Error Mask set per packet / DHC.
PXDError::PXDErrorFlags m_errorMaskPacket
Error Mask set per packet / packet.
std::string m_RawPXDsName
The name of the StoreArray of processed RawPXDs.
void unpack_dhp(void *data, unsigned int len, unsigned int dhe_first_readout_frame_lo, unsigned int dhe_ID, unsigned dhe_DHPport, unsigned dhe_reformat, VxdID vxd_id, PXDDAQPacketStatus &daqpktstat)
Unpack DHP data within one DHE frame.
void terminate() override final
Terminate the module.
StoreObjPtr< EventMetaData > m_eventMetaData
Input ptr for EventMetaData.
int m_last_dhp_readout_frame_lo[4]
some workaround check for continouous frame ids
unsigned long m_meta_subrun_nr
Subrun Number from MetaInfo.
void event() override final
do the unpacking
StoreArray< PXDRawAdc > m_storeRawAdc
Output array for Raw Adcs.
unsigned long m_meta_event_nr
Event Number from MetaInfo.
PXDError::PXDErrorFlags m_errorSkipPacketMask
Mask for error which stop package unpacking directly.
static int nr5bits(int i)
helper function to "count" nr of set bits within lower 5 bits.
void unpack_fce(unsigned short *data, unsigned int length, VxdID vxd_id)
Unpack DHP/FCE data within one DHE frame Not fully implemented as cluster format not 100% fixed.
std::string m_PXDRawAdcsName
The name of the StoreArray of PXDRawAdcs to be generated.
unsigned long m_meta_run_nr
Run Number from MetaInfo.
bool m_continueOnError
flag continue unpacking of frames even after error (for debugging)
unsigned int m_notaccepted
counter for not accepted events... should not happen TODO discussion ongoing with DAQ group
unsigned int m_meta_sec
Time(Tag) from MetaInfo, seconds (masked to lower bits)
void unpack_dhp_raw(void *data, unsigned int len, unsigned int dhe_ID, unsigned dhe_DHPport, VxdID vxd_id)
Unpack DHP RAW data within one DHE frame (pedestals, etc)
PXDError::PXDErrorFlags m_criticalErrorMask
Critical error mask which defines return value of task.
unsigned int m_sendrois
counter for send debug rois
static void dump_dhp(void *data, unsigned int frame_len)
dump to a file, helper function for debugging.
void unpack_rawpxd(RawPXD &px, int inx)
Unpack one event (several frames) stored in RawPXD object.
unsigned long long int m_meta_time
Time(Tag) from MetaInfo.
unsigned int m_maxDHPFrameDiff
Maximum DHP frame difference until error is reported.
PXDError::PXDErrorFlags m_errorMask
Error Mask set per packet / frame.
unsigned int m_unpackedEventsCount
Event counter.
StoreArray< PXDRawHit > m_storeRawHits
Output array for Raw Hits.
void unpack_dhc_frame(void *data, const int len, const int Frame_Number, const int Frames_in_event, PXDDAQPacketStatus &daqpktstat)
Unpack one frame (within an event).
bool m_forceMapping
Force Mapping even if DHH bit is not requesting it.
unsigned int m_meta_ticks
Time(Tag) from MetaInfo, Ticks of 127MHz.
bool m_verbose
give verbose unpacking information
PXDError::PXDErrorFlags m_errorMaskDHE
Error Mask set per packet / DHE.
std::string m_PXDRawROIsName
The name of the StoreArray of PXDRawROIs to be generated.
The Raw PXD class.
Definition: RawPXD.h:27
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Type-safe access to single objects in the data store.
Definition: StoreObjPtr.h:96
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.