11#include <framework/core/Module.h>
12#include <vxd/dataobjects/VxdID.h>
13#include <framework/datastore/StoreArray.h>
14#include <framework/datastore/StoreObjPtr.h>
15#include <rawdata/dataobjects/RawPXD.h>
16#include <pxd/dataobjects/PXDDigit.h>
17#include <pxd/dataobjects/PXDInjectionBGTiming.h>
19#include <pxd/dbobjects/PXDDHHFirmwareVersionPar.h>
20#include <framework/database/DBObjPtr.h>
38 enum {PACKER_NUM_ROWS = 768};
39 enum {PACKER_NUM_COLS = 250};
51 void event()
override final;
117 void pack_dhc(
int dhc_id,
int dhe_mask,
int* dhe_ids);
121 void pack_dhe(
int dhe_id,
int dhp_mask);
125 void pack_dhp(
int dhp_id,
int dhe_id,
int dhe_reformat,
int startrow = 0);
140 void do_the_reverse_mapping(
unsigned int& row,
unsigned int& col,
unsigned short layer,
unsigned short sensor);
Optional DBObjPtr: This class behaves the same as the DBObjPtr except that it will not raise errors w...
void do_the_reverse_mapping(unsigned int &row, unsigned int &col, unsigned short layer, unsigned short sensor)
function still to be implemented
std::vector< std::vector< unsigned char > > m_onsen_payload
For one DHC event, we utilize one payload for all DHE/DHP frames.
int m_overrideFirmwareVersion
override firmware version from DB.
void initialize() override final
Initialize the module.
StoreObjPtr< PXDInjectionBGTiming > m_storeInjectionBGTiming
Input Obj InjectionBGTiming.
void add_frame_to_payload(void)
Add Frame to Event payload.
unsigned short m_run_nr_word2
Exp+Run Nr.
std::map< VxdID, int > startOfVxdID
Store start of Vxd Detector related digits.
void append_int16(unsigned short w)
cat 16bit value to frame
void pack_dhe(int dhe_id, int dhp_mask)
Pack one DHE (several DHP) to buffer.
void pack_dhp(int dhp_id, int dhe_id, int dhe_reformat, int startrow=0)
Pack one DHP to buffer.
void pack_dhp_raw(int dhp_id, int dhe_id)
Pack one DHP RAW to buffer.
std::string m_RawPXDsName
The name of the StoreArray of generated RawPXDs.
void pack_dhc(int dhc_id, int dhe_mask, int *dhe_ids)
Pack one DHC (several DHE) stored in one RawPXD object.
PXDPackerModule()
Constructor defining the parameters.
void pack_event(void)
Pack one event (several DHC) stored in seperate RawPXD object.
void terminate() override final
Terminate the module.
void event() override final
do the packing
std::string m_InjectionBGTimingName
The name of the StoreObj InjectionBGTiming.
unsigned int dhc_byte_count
Byte count in current DHC package.
std::vector< std::vector< int > > m_dhe_to_dhc
Parameter dhc<->dhe list, mapping from steering file.
bool m_Clusterize
Use clusterizer (FCE format)
unsigned short m_run_nr_word1
Run+Subrun Nr.
OptionalDBObjPtr< PXDDHHFirmwareVersionPar > m_firmwareFromDB
firmware version from DB.
std::vector< unsigned int > m_onsen_header
For one DHC event, we utilize one header (writing out, beware of endianess!)
int m_firmware
Firmware version, must be read from database on run change.
void append_int32(unsigned int w)
cat 32value value to frame
StoreArray< RawPXD > m_storeRaws
Output array for RawPxds.
unsigned int m_trigger_dhp_framenr
DHP Readout Frame Nr for DHP and DHE headers.
unsigned int dhe_byte_count
Byte count in current DHE package.
std::map< int, std::vector< int > > m_dhc_mapto_dhe
mapping calculated from m_dhe_to_dhc for easier handling
void start_frame(void)
Start with a new Frame.
void append_int8(unsigned char w)
cat 8bit value to frame
unsigned int m_trigger_dhe_gate
DHE Trigger Gate for DHE headers.
void beginRun() override final
begin run
unsigned int m_packed_events
Event counter.
bool m_InvertMapping
Flag if we invert mapping to DHP row/col or use premapped coordinates.
std::string m_PXDDigitsName
The name of the StoreArray of PXDDigits to be processed.
unsigned long long int m_meta_time
Time(Tag) from MetaInfo.
std::vector< unsigned char > m_current_frame
For current processed frames.
unsigned char halfladder_pixmap[PACKER_NUM_ROWS][PACKER_NUM_COLS]
temporary hitmap buffer for pixel to raw data conversion
unsigned int m_trigger_nr
Trigger Nr.
StoreArray< PXDDigit > m_storeDigits
Input array for Digits.
Accessor to arrays stored in the data store.
Type-safe access to single objects in the data store.
Abstract base class for different kinds of events.