6 #ifndef HTBDAQ_DATA_STANDALONE
29 const int needed=0x200;
70 unsigned char* tp_lengths,
unsigned short* tp_samples)
const {
72 if (tp_lengths!=0) memset(tp_lengths,0,1);
74 int tp_words_total,headerLen,trailerLen;
78 const unsigned short* tpBase=
m_rawConst+headerLen;
81 for (wordPtr=0; wordPtr<tp_words_total; wordPtr++) {
82 tp_samples[tp_lengths[0]]=tpBase[wordPtr];
101 unsigned char* tp_lengths,
unsigned short* tp_samples) {
103 int tp_words_total=0, headerLen, trailerLen;
111 if (tp_samples!=0 && tp_lengths!=0) {
112 for (isample=0; isample<tp_lengths[0] && isample<12; isample++) {
113 ptr[tp_words_total]=tp_samples[isample];
119 unsigned short totalLen=headerLen+tp_words_total+trailerLen;
133 m_ownData[3]=((orbitn&0x1F)<<11)|(submodule&0x7FF);
136 m_ownData[6]=((firmwareRev&0x70000)>>3)|(firmwareRev&0x1FFF);
137 m_ownData[7]=(pipeline&0xFF) | ((ndd&0x1F)<<8);
void adoptData(const unsigned short *data, int length)
void allocate(int version_to_create=0)
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event...
CastorMergerData & operator=(const CastorMergerData &)
const unsigned short * m_rawConst
void unpack(unsigned char *tp_lengths, unsigned short *tp_samples) const
Unpack the HTR data into TP and DAQ data sorted by channel.
void packHeaderTrailer(int L1Anumber, int bcn, int submodule, int orbitn, int pipeline, int ndd, int nps, int firmwareRev=0)
pack header and trailer (call after pack)
unsigned int getOrbitNumber() const
Get the HTR orbit number.
unsigned int getFirmwareRevision() const
Get the Merger firmware version.
char data[epos_bytes_allocation]
unsigned short * m_ownData
void pack(unsigned char *tp_lengths, unsigned short *tp_samples)
Unpack the HTR data into TP and DAQ data sorted by channel.
void determineSectionLengths(int &tpWords, int &headerWords, int &trailerWords) const
void determineStaticLengths(int &headerWords, int &trailerWords) const