4 #ifndef HTBDAQ_DATA_STANDALONE 27 const int needed=0x200;
68 unsigned char* tp_lengths,
unsigned short* tp_samples)
const {
70 if (tp_lengths!=0) memset(tp_lengths,0,1);
72 int tp_words_total,headerLen,trailerLen;
76 const unsigned short* tpBase=
m_rawConst+headerLen;
79 for (wordPtr=0; wordPtr<tp_words_total; wordPtr++) {
80 tp_samples[tp_lengths[0]]=tpBase[wordPtr];
99 unsigned char* tp_lengths,
unsigned short* tp_samples) {
101 int tp_words_total=0, headerLen, trailerLen;
109 if (tp_samples!=0 && tp_lengths!=0) {
110 for (isample=0; isample<tp_lengths[0] && isample<12; isample++) {
111 ptr[tp_words_total]=tp_samples[isample];
117 unsigned short totalLen=headerLen+tp_words_total+trailerLen;
131 m_ownData[3]=((orbitn&0x1F)<<11)|(submodule&0x7FF);
134 m_ownData[6]=((firmwareRev&0x70000)>>3)|(firmwareRev&0x1FFF);
135 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