11 #include <tracking/dataobjects/ROIrawID.h>
14 #include <boost/endian/arithmetic.hpp>
36 enum { OFFSET_MAGIC = 0, OFFSET_LENGTH = 1, OFFSET_HEADER = 2, OFFSET_TRIGNR = 3, OFFSET_RUNNR = 4, OFFSET_ROIS = 5};
37 enum { HEADER_SIZE_WO_LENGTH = 3, HEADER_SIZE_WITH_LENGTH = 5, HEADER_SIZE_WITH_LENGTH_AND_CRC = 6};
66 void setHeader(
bool Accepted,
bool SendAll,
bool SendROIs);
81 void init(
int length);
88 return (
m_length - HEADER_SIZE_WITH_LENGTH_AND_CRC) / 2;
107 if (j < 0 || j >=
getNrROIs())
return -1;
109 2 * j + 1] & 0xFC000000) >> 26) ;
118 if (j < 0 || j >=
getNrROIs())
return -1;
128 if (j < 0 || j >=
getNrROIs())
return -1;
129 return (((
ubig32_t*)
m_rootdata)[HEADER_SIZE_WITH_LENGTH + 2 * j + 1] & 0x03FC0000) >> 18;
138 if (j < 0 || j >=
getNrROIs())
return -1;
148 if (j < 0 || j >=
getNrROIs())
return -1;
ROIpayload TODO: Better explanation, Is there a reason to inherit from TObject and not Relationsobjec...
int m_packetLengthByte
packet length in byte
void addROIraw(unsigned long int roiraw)
add a ROIrawID
int getMinVid(int j) const
Return MinVid (Row 1) of ROI j.
int m_length
packet length
int getDHHID(int j) const
Return DHH ID of ROI j.
void setHeader(bool Accepted, bool SendAll, bool SendROIs)
set header
uint32_t * m_data32
transient value
void setRunSubrunExpNumber(int run, int subrun, int exp)
set run/ subrun/exp number
int getNrROIs() const
Get the nr of ROIs.
int getMaxVid(int j) const
Return MaxVid (Row 2) of ROI j.
virtual ~ROIpayload()
destructor.
int getMinUid(int j) const
Return MinUid (Col 1) of ROI j.
int * m_rootdata
pointer to data packet of m_length words
int getType(int j) const
Return Type (Datcon or HLT) of ROI j.
ROIpayload(int rois=0)
Default constructor.
int getLength()
get packet length
int * getRootdata()
get pointer to the data packet
void setTriggerNumber(unsigned long int triggerNumber)
set trigger number
void init(int length)
initializer
void setPayloadLength()
set payload length
int m_index
transient index
int getPacketLengthByte()
get packet length in bytes
int getMaxUid(int j) const
Return MaxUid (Col 2) of ROI j.
boost::endian::big_uint32_t ubig32_t
Shorthand for 32-bit integer stored in big-endian format.
ROIrawID::baseType * m_data64
transient value
uint64_t baseType
base type
Abstract base class for different kinds of events.