CMS 3D CMS Logo

HcalHTRData.cc
Go to the documentation of this file.
1 //#include "Utilities/Configuration/interface/Architecture.h"
2 /*
3  * \author J. Mans -- UMD
4  */
5 #ifndef HTBDAQ_DATA_STANDALONE
7 #else
8 #include "HcalHTRData.h"
11 #endif
12 #include <cstring>
13 #include <cstdio>
14 
15 HcalHTRData::HcalHTRData() : m_formatVersion(-2), m_rawLength(0), m_rawConst(nullptr), m_ownData(nullptr) {}
16 HcalHTRData::HcalHTRData(const unsigned short* data, int length) {
17  adoptData(data, length);
18  m_ownData = nullptr;
19 }
21  : m_formatVersion(hd.m_formatVersion), m_rawLength(hd.m_rawLength), m_rawConst(hd.m_rawConst), m_ownData(nullptr) {}
22 
23 HcalHTRData::HcalHTRData(int version_to_create) : m_formatVersion(version_to_create) { allocate(version_to_create); }
24 
25 void HcalHTRData::allocate(int version_to_create) {
26  m_formatVersion = version_to_create;
27  // the needed space is for the biggest possible event...
28  const int needed = 0x200;
29  // create a buffer big enough...
30  m_ownData = new unsigned short[needed];
31  // clear isn't really necessary, but it makes valgrind happy
32  memset(m_ownData, 0, sizeof(unsigned short) * needed);
33  m_rawLength = 0;
35 }
36 
38  if (m_ownData == nullptr) {
42  }
43  return (*this);
44 }
45 
46 void HcalHTRData::adoptData(const unsigned short* data, int length) {
47  m_rawLength = length;
48  m_rawConst = data;
49  if (m_rawLength < 5) {
50  m_formatVersion = -2; // invalid!
51  } else {
52  // determine format version
53  if ((m_rawConst[2] & 0x8000) == 0)
54  m_formatVersion = -1; // original format before versions
55  else
56  m_formatVersion = (m_rawConst[4] >> 12) & 0xF;
57  }
58 }
59 
60 // check :: not EE, length is reasonable, length matches wordcount
61 // length required for tp+daq is correct
62 
63 bool HcalHTRData::check() const {
64  if (m_formatVersion == -1) {
65  // length checks
66  // minimum length
67  if (m_rawLength < 6 + 12)
68  return false;
69  // matches wordcount
71  return false;
72  // empty event check
73  if (m_rawConst[2] & 0x20)
74  return false;
75  } else {
76  // length checks
77  // minimum length
78  if (m_rawLength < 8 + 4)
79  return false;
80  if (m_formatVersion <= 3) {
81  // matches wordcount
82  if (m_rawLength != m_rawConst[m_rawLength - 3]) {
83  if (isHistogramEvent() && m_rawConst[m_rawLength - 3] == 786) {
84  // known bug!
85  } else
86  return false;
87  }
88  } else {
89  // eventually add CRC check
90  }
91  // empty event check (redundant...)
92  if (m_rawConst[2] & 0x4)
93  return false;
94  }
95 
96  if (!isHistogramEvent()) {
97  // daq/tp length check
98  int tp, daq, header, trailer;
99  determineSectionLengths(tp, daq, header, trailer);
100  if (tp + daq + header + trailer > m_rawLength)
101  return false;
102  }
103 
104  return true;
105 }
106 
108  if (m_formatVersion == -1) {
109  return (m_rawConst[2] & 0x20) != 0;
110  } else {
111  return (m_rawConst[2] & 0x4) != 0;
112  }
113 }
114 
116  if (m_formatVersion == -1) {
117  return false; // too old to care.
118  } else {
119  return (m_rawConst[2] & 0x1) != 0;
120  }
121 }
122 
123 bool HcalHTRData::isBusy() const {
124  if (m_formatVersion == -1) {
125  return false; // too old to care.
126  } else {
127  return (m_rawConst[2] & 0x2) != 0;
128  }
129 }
130 
131 void HcalHTRData::determineSectionLengths(int& tpWords, int& daqWords, int& headerWords, int& trailerWords) const {
132  if (m_formatVersion == -1) {
133  tpWords = m_rawConst[5] >> 8;
134  daqWords = CHANNELS_PER_SPIGOT * (m_rawConst[m_rawLength - 4] >> 8); // always 24 channels, no zero suppresion
135  headerWords = 6;
136  trailerWords = 12;
137  } else {
138  tpWords = m_rawConst[5] >> 8;
139  if (m_rawLength > 4)
140  daqWords = m_rawConst[m_rawLength - 4] & 0x7FF; // zero suppression supported
141  else
142  daqWords = 0; //should there be a warning as well?
143  headerWords = 8;
144  trailerWords = 4; // minimum, may be more...
145  }
146 }
147 
148 void HcalHTRData::determineStaticLengths(int& headerWords, int& trailerWords) const {
149  if (m_formatVersion == -1) {
150  headerWords = 6;
151  trailerWords = 12;
152  } else if (m_formatVersion < 5) {
153  headerWords = 8;
154  trailerWords = 4; // minimum, may be more...
155  } else {
156  headerWords = 8;
157  trailerWords = 12; // minimum, may be more...
158  }
159 }
160 
161 void HcalHTRData::dataPointers(const unsigned short** daq_first,
162  const unsigned short** daq_last,
163  const unsigned short** tp_first,
164  const unsigned short** tp_last) const {
165  int tp_words_total, daq_words_total, headerLen, trailerLen;
166  determineSectionLengths(tp_words_total, daq_words_total, headerLen, trailerLen);
167 
168  *tp_first = m_rawConst + headerLen;
169  *tp_last = *tp_first + (tp_words_total - 1);
170  *daq_first = *tp_last + 1;
171  *daq_last = *daq_first + (daq_words_total - 1);
172 }
173 
174 /* using FiberAd[2:0] ChanId[1:0] */
175 static const int channelDecoder[32] = {0, 1, 2, 99, 3, 4, 5, 99, 6, 7, 8, 99, 9, 10, 11, 99,
176  12, 13, 14, 99, 15, 16, 17, 99, 18, 19, 20, 99, 21, 22, 23, 99};
177 
178 void HcalHTRData::unpack(unsigned char* daq_lengths,
179  unsigned short* daq_samples,
180  unsigned char* tp_lengths,
181  unsigned short* tp_samples) const {
182  if (daq_lengths != nullptr)
183  memset(daq_lengths, 0, CHANNELS_PER_SPIGOT);
184  if (tp_lengths != nullptr)
185  memset(tp_lengths, 0, CHANNELS_PER_SPIGOT);
186 
187  // currently, the major differences between the versions are
188  // -1 : 6 word header, no zero suppression, trailer setup
189  // 0 : 8 word header, zero suppression,
190 
191  int tp_words_total, daq_words_total, headerLen, trailerLen;
192  determineSectionLengths(tp_words_total, daq_words_total, headerLen, trailerLen);
193 
194  // printf("%d %d %d %d\n",tp_words_total,daq_words_total,headerLen,trailerLen);
195  int wordPtr;
196  const unsigned short* tpBase = m_rawConst + headerLen;
197  // process the trigger primitive words
198  if (tp_lengths != nullptr) {
199  for (wordPtr = 0; wordPtr < tp_words_total; wordPtr++) {
200  int ichan = channelDecoder[tpBase[wordPtr] >> 11];
201  if (ichan >= 24)
202  continue;
203  tp_samples[ichan * MAXIMUM_SAMPLES_PER_CHANNEL + tp_lengths[ichan]] = tpBase[wordPtr] & 0x3ff;
204  tp_lengths[ichan]++;
205  }
206  }
207 
208  const unsigned short* daqBase = m_rawConst + headerLen + tp_words_total;
209  // process the DAQ words [ assumes that data from one channel will always be together ]
210  int lastChan = -1;
211  int lastCapid = 0;
212  if (daq_lengths != nullptr) {
213  for (wordPtr = 0; wordPtr < daq_words_total; wordPtr++) {
214  int ichan = channelDecoder[daqBase[wordPtr] >> 11];
215  if (ichan >= 24)
216  continue;
217  int capid = (daqBase[wordPtr] & 0x180) >> 7;
218  int erdv = (daqBase[wordPtr] & 0x600) >> 9;
219  if (erdv != 0x1 || (lastChan == ichan && (capid != ((lastCapid + 1) % 4)))) {
220  daq_lengths[ichan] |= 0x80;
221  }
222  lastChan = ichan;
223  lastCapid = capid;
224 
225  int useLength = daq_lengths[ichan] & 0x1F;
226  // printf("%d %d\n",ichan,useLength);
227  daq_samples[ichan * MAXIMUM_SAMPLES_PER_CHANNEL + useLength] = daqBase[wordPtr] & 0x3ff;
228  daq_lengths[ichan] = (useLength + 1) | (daq_lengths[ichan] & 0xE0); // keep the error bits
229  }
230  }
231 }
232 
233 void HcalHTRData::pack(unsigned char* daq_lengths,
234  unsigned short* daq_samples,
235  unsigned char* tp_lengths,
236  unsigned short* tp_samples,
237  bool do_capid) {
238  int tp_words_total = 0, daq_words_total = 0, headerLen, trailerLen;
239  determineStaticLengths(headerLen, trailerLen);
240 
241  tp_words_total = 0;
242  daq_words_total = 0;
243  int ichan, isample;
244 
245  // trigger primitive words
246  unsigned short* ptr = m_ownData + headerLen;
247  if (tp_samples != nullptr && tp_lengths != nullptr) {
248  for (ichan = 0; ichan < 24; ichan++) {
249  unsigned short chanid = ((ichan % 4) + (((ichan / 4) + 1) << 2)) << 11;
250  for (isample = 0; isample < tp_lengths[ichan] && isample < MAXIMUM_SAMPLES_PER_CHANNEL; isample++) {
251  ptr[tp_words_total] = chanid | (tp_samples[ichan * MAXIMUM_SAMPLES_PER_CHANNEL + isample] & 0x3FF);
252  tp_words_total++;
253  }
254  }
255  }
256 
257  // daq words
258  ptr = m_ownData + headerLen + tp_words_total;
259  for (ichan = 0; ichan < 24; ichan++) {
260  unsigned short chanid = ((ichan % 3) + ((ichan / 3) << 2)) << 11;
261  for (isample = 0; isample < daq_lengths[ichan] && isample < MAXIMUM_SAMPLES_PER_CHANNEL; isample++) {
262  unsigned short basedata = daq_samples[ichan * MAXIMUM_SAMPLES_PER_CHANNEL + isample] & 0x7FF;
263  if (do_capid)
264  basedata = (basedata & 0x7F) | (0x200) | ((isample % 4) << 7);
265  ptr[daq_words_total] = chanid | basedata;
266  daq_words_total++;
267  }
268  }
269  unsigned short totalLen;
270  if (m_formatVersion == -1) {
271  m_ownData[5] = (tp_words_total << 8) | 0x1;
272  totalLen = headerLen + tp_words_total + daq_words_total + trailerLen;
273  m_rawLength = totalLen;
274  m_ownData[totalLen - 3] = totalLen;
275  m_ownData[totalLen - 4] = (tp_words_total / CHANNELS_PER_SPIGOT) | ((daq_words_total / CHANNELS_PER_SPIGOT) << 8);
276  } else {
277  m_ownData[5] = (tp_words_total << 8) | 0x1;
278  totalLen = headerLen + tp_words_total + daq_words_total + trailerLen;
279  if ((totalLen % 2) == 1) {
280  m_ownData[totalLen - 4] = 0xFFFF; // parity word
281  totalLen++; // round to even number of 16-bit words
282  }
283  m_rawLength = totalLen;
284  m_ownData[totalLen - 2] = totalLen / 2; // 32-bit words
285  m_ownData[totalLen - 3] = totalLen;
286  m_ownData[totalLen - 4] = daq_words_total;
287  }
288  if (trailerLen == 12) { // initialize extra trailer words if present
289  for (int i = 12; i > 4; i--)
290  m_ownData[totalLen - i] = 0;
291  }
292 }
293 
295  int bcn,
296  int submodule,
297  int orbitn,
298  int pipeline,
299  int ndd,
300  int nps,
301  int firmwareRev,
302  int firmwareFlav) {
303  m_ownData[0] = L1Anumber & 0xFF;
304  m_ownData[1] = (L1Anumber & 0xFFFF00) >> 8;
305  if (m_formatVersion == -1) {
306  m_ownData[2] = ((pipeline & 0x7F) << 8); // no error bits
307  m_ownData[3] = ((orbitn & 0xFF) << 8) | (submodule & 0xFF);
308  m_ownData[4] = bcn & 0xFFF;
309  // m_ownData[5]&=0xFF01;
310  } else {
311  m_ownData[2] = 0x8000; // Version is valid, no error bits
312  if (m_formatVersion == 0)
313  m_ownData[3] = ((orbitn & 0x3F) << 10) | (submodule & 0x3FF);
314  else
315  m_ownData[3] = ((orbitn & 0x1F) << 11) | (submodule & 0x7FF);
316  m_ownData[4] = ((m_formatVersion & 0xF) << 12) | (bcn & 0xFFF);
317  m_ownData[5] |= ((nps & 0x1F) << 3) | 0x1;
318  m_ownData[6] = ((firmwareRev & 0x70000) >> 3) | (firmwareRev & 0x1FFF);
319  m_ownData[7] = (pipeline & 0xFF) | ((firmwareFlav & 0x3F) << 8);
320  m_ownData[m_rawLength - 4] &= 0x7FF;
321  m_ownData[m_rawLength - 4] |= (ndd & 0x1F) << 11;
322  }
323  m_ownData[m_rawLength - 2] = m_rawLength / 2; // 32-bit words
324  m_ownData[m_rawLength - 1] = (L1Anumber & 0xFF) << 8;
325 }
326 
327 void HcalHTRData::packUnsuppressed(const bool* mp) {
328  if (m_formatVersion < 4)
329  return;
330 
331  for (int fiber = 1; fiber <= 8; fiber++) {
332  for (int fiberchan = 0; fiberchan <= 2; fiberchan++) {
333  int linchan = (fiber - 1) * 3 + fiberchan;
334 
335  unsigned short& val = m_ownData[m_rawLength - 12 + (linchan / 8)];
336  if (mp[linchan])
337  val |= 1 << (linchan % 8);
338  }
339  }
340 
341  // set the unsupressed bit
342  m_ownData[6] |= 0x8000;
343 }
344 
345 unsigned int HcalHTRData::getOrbitNumber() const {
346  switch (m_formatVersion) {
347  case (-1):
348  return (m_rawConst[3] >> 8);
349  case (0):
350  return (m_rawConst[3] >> 10);
351  default:
352  return (m_rawConst[3] >> 11);
353  }
354 }
355 unsigned int HcalHTRData::getSubmodule() const {
356  switch (m_formatVersion) {
357  case (-1):
358  return (m_rawConst[3] & 0xFF);
359  case (0):
360  return (m_rawConst[3] & 0x3FF);
361  default:
362  return (m_rawConst[3] & 0x7FF);
363  }
364 }
365 unsigned int HcalHTRData::htrSlot() const {
366  const unsigned int smid = getSubmodule();
367  return ((smid >> 1) & 0x1F);
368 }
369 unsigned int HcalHTRData::htrTopBottom() const {
370  const unsigned int smid = getSubmodule();
371  return (smid & 0x01);
372 }
373 unsigned int HcalHTRData::readoutVMECrateId() const {
374  const unsigned int smid = getSubmodule();
375  return ((smid >> 6) & 0x1F);
376 }
377 bool HcalHTRData::isCalibrationStream() const { return (m_formatVersion == -1) ? (false) : (m_rawConst[2] & 0x4000); }
378 bool HcalHTRData::isUnsuppressed() const { return (m_formatVersion < 4) ? (false) : (m_rawConst[6] & 0x8000); }
379 bool HcalHTRData::wasMarkAndPassZS(int fiber, int fiberchan) const {
380  if (fiber < 1 || fiber > 8 || fiberchan < 0 || fiberchan > 2)
381  return false;
382  if (!isUnsuppressed() || m_formatVersion < 5)
383  return false;
384  int linchan = (fiber - 1) * 3 + fiberchan;
385 
386  unsigned short val = m_rawConst[m_rawLength - 12 + (linchan / 8)];
387  return ((val >> (linchan % 8)) & 0x1) != 0;
388 }
389 bool HcalHTRData::wasMarkAndPassZSTP(int slb, int slbchan) const {
390  if (slb < 1 || slb > 6 || slbchan < 0 || slbchan > 3)
391  return false;
392  if (!isUnsuppressed() || m_formatVersion < 5)
393  return false;
394  int linchan = (slb - 1) * 4 + slbchan;
395 
396  unsigned short val = m_rawConst[m_rawLength - 12 + (linchan / 8)];
397  return ((val >> (linchan % 8)) & 0x100) != 0;
398 }
399 
400 uint32_t HcalHTRData::zsBunchMask() const {
401  uint32_t mask = 0;
402  if (isUnsuppressed() && m_formatVersion >= 5) {
403  mask = m_rawConst[m_rawLength - 5] | ((m_rawConst[m_rawLength - 6] & 0xF000) << 4);
404  }
405  return mask;
406 }
407 
408 bool HcalHTRData::isPatternRAMEvent() const { return (m_formatVersion == -1) ? (false) : (m_rawConst[2] & 0x1000); }
410  return (m_formatVersion == -1) ? (m_rawConst[2] & 0x2) : (m_rawConst[2] & 0x2000);
411 }
412 int HcalHTRData::getNDD() const {
413  return (m_formatVersion == -1) ? (m_rawConst[m_rawLength - 4] >> 8) : (m_rawConst[m_rawLength - 4] >> 11);
414 }
415 int HcalHTRData::getNTP() const {
416  int retval = -1;
417  if (m_formatVersion == -1)
418  retval = m_rawConst[m_rawLength - 4] & 0xFF;
419  else if (m_formatVersion < 3)
420  retval = m_rawConst[m_rawLength - 4] >> 11;
421  return retval;
422 }
424  return (m_formatVersion == -1) ? (m_rawConst[m_rawLength - 4] & 0xFF) : (m_rawConst[m_rawLength - 4] & 0x7FF);
425 }
426 int HcalHTRData::getNPS() const { return (m_formatVersion == -1) ? (0) : ((m_rawConst[5] >> 3) & 0x1F); }
427 unsigned int HcalHTRData::getPipelineLength() const {
428  return (m_formatVersion == -1) ? (m_rawConst[2] >> 8) : (m_rawConst[7] & 0xFF);
429 }
430 unsigned int HcalHTRData::getFirmwareRevision() const {
431  return (m_formatVersion == -1) ? (0) : ((m_rawConst[6] & 0x1FFF) + ((m_rawConst[6] & 0xE000) << 3));
432 }
433 int HcalHTRData::getFirmwareFlavor() const { return (m_formatVersion < 2) ? (-1) : ((m_rawConst[7] >> 8) & 0xFF); }
434 
435 void HcalHTRData::getHistogramFibers(int& a, int& b) const {
436  a = -1;
437  b = -1;
438  if (m_formatVersion == -1) {
439  a = ((m_rawConst[2] & 0x0F00) >> 8);
440  b = ((m_rawConst[2] & 0xF000) >> 12);
441  } else {
442  a = ((m_rawConst[5] & 0x0F00) >> 8) + 1;
443  b = ((m_rawConst[5] & 0xF000) >> 12) + 1;
444  }
445 }
446 
447 bool HcalHTRData::wasHistogramError(int ifiber) const {
448  bool retval = !isHistogramEvent();
449  if (!retval) {
450  retval = ((m_rawConst[7]) & (1 << ifiber)) != 0;
451  }
452  return retval;
453 }
454 
456  unsigned short header, int& flav, int& error_flags, int& capid0, int& channelid) {
457  flav = (header >> 12) & 0x7;
458  error_flags = (header >> 10) & 0x3;
459  capid0 = (header >> 8) & 0x3;
460  channelid = (header)&0xFF;
461  return (header & 0x8000) != 0;
462 }
463 
464 bool HcalHTRData::unpackHistogram(int myfiber, int mysc, int capid, unsigned short* histogram) const {
465  // check for histogram mode
466  if (!isHistogramEvent())
467  return false;
468 
469  int fiber1, fiber2;
470  getHistogramFibers(fiber1, fiber2);
471  if (fiber1 != myfiber && fiber2 != myfiber)
472  return false;
473 
474  if (m_formatVersion == -1) {
475  int offset = 6 + mysc * 4 * 32 + capid * 32;
476  if (myfiber == fiber2)
477  offset += 3 * 4 * 32; // skip to the second half...
478  for (int i = 0; i < 32; i++)
479  histogram[i] = m_rawConst[offset + i];
480  return true;
481  } else {
482  int offset = 8 + mysc * 4 * 32 + capid * 32;
483  if (myfiber == fiber2)
484  offset += 3 * 4 * 32; // skip to the second half...
485  for (int i = 0; i < 32; i++)
486  histogram[i] = m_rawConst[offset + i];
487  return true;
488  }
489 }
unsigned short * m_ownData
Definition: HcalHTRData.h:247
unsigned int getFirmwareRevision() const
Get the HTR firmware version.
Definition: HcalHTRData.cc:430
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition: HcalHTRData.cc:409
bool wasMarkAndPassZS(int fiber, int fiberchan) const
Was this channel passed as part of Mark&Pass ZS?
Definition: HcalHTRData.cc:379
bool wasHistogramError(int ifiber) const
Was there an error on the given fiber for this event (only in histogram mode!)
Definition: HcalHTRData.cc:447
static int slb(const HcalTriggerPrimitiveSample &theSample)
int m_formatVersion
Definition: HcalHTRData.h:244
void determineStaticLengths(int &headerWords, int &trailerWords) const
Definition: HcalHTRData.cc:148
void packUnsuppressed(const bool *mp)
pack trailer with Mark and Pass bits
Definition: HcalHTRData.cc:327
bool isCalibrationStream() const
Is this event a calibration-stream event?
Definition: HcalHTRData.cc:377
const unsigned short * m_rawConst
Definition: HcalHTRData.h:246
int getNPS() const
Get the number of presamples in daq data.
Definition: HcalHTRData.cc:426
bool unpackHistogram(int fiber, int fiberchan, int capid, unsigned short *histogram) const
Unpack special histogramming mode data.
Definition: HcalHTRData.cc:464
static const int CHANNELS_PER_SPIGOT
Definition: HcalHTRData.h:18
uint32_t zsBunchMask() const
ZS Bunch Mask (if available)
Definition: HcalHTRData.cc:400
static bool unpack_per_channel_header(unsigned short, int &flav, int &error_flags, int &capid0, int &channelid)
Unpack a per-channel header word (compact format)
Definition: HcalHTRData.cc:455
static const int MAXIMUM_SAMPLES_PER_CHANNEL
Definition: HcalHTRData.h:19
HcalHTRData & operator=(const HcalHTRData &)
Definition: HcalHTRData.cc:37
int getNTP() const
Get the number of trigger data samples when not zero-suppressed (not available after FW 4) ...
Definition: HcalHTRData.cc:415
int getFirmwareFlavor() const
Get the HTR firmware flavor.
Definition: HcalHTRData.cc:433
bool isOverflowWarning() const
Definition: HcalHTRData.cc:115
void unpack(unsigned char *daq_lengths, unsigned short *daq_samples, unsigned char *tp_lengths, unsigned short *tp_samples) const
Unpack the HTR data into TP and DAQ data sorted by channel.
Definition: HcalHTRData.cc:178
void dataPointers(const unsigned short **daq_first, const unsigned short **daq_last, const unsigned short **tp_first, const unsigned short **tp_last) const
Obtain the starting and ending pointers for external unpacking of the data.
Definition: HcalHTRData.cc:161
void allocate(int version_to_create=0)
Definition: HcalHTRData.cc:25
int getNPrecisionWords() const
Get the total number of precision data 16-bit words.
Definition: HcalHTRData.cc:423
unsigned int getPipelineLength() const
Get the pipeline length used for this event.
Definition: HcalHTRData.cc:427
unsigned int htrSlot() const
HcalElectronicsId-style HTR slot.
Definition: HcalHTRData.cc:365
unsigned int htrTopBottom() const
HcalElectronicsId-style HTR top/bottom (1=top/0=bottom)
Definition: HcalHTRData.cc:369
bool isPatternRAMEvent() const
Is this event a pattern-ram event?
Definition: HcalHTRData.cc:408
bool wasMarkAndPassZSTP(int slb, int slbchan) const
Was this channel passed as part of Mark&Pass ZS?
Definition: HcalHTRData.cc:389
void determineSectionLengths(int &tpWords, int &daqWords, int &headerWords, int &trailerWords) const
Definition: HcalHTRData.cc:131
void getHistogramFibers(int &a, int &b) const
Get the fiber numbers for the data present in this event (only in histogram mode!) ...
Definition: HcalHTRData.cc:435
unsigned int getOrbitNumber() const
Get the HTR orbit number.
Definition: HcalHTRData.cc:345
void pack(unsigned char *daq_lengths, unsigned short *daq_samples, unsigned char *tp_lengths, unsigned short *tp_samples, bool do_capid=false)
Unpack the HTR data into TP and DAQ data sorted by channel.
Definition: HcalHTRData.cc:233
static const int channelDecoder[32]
Definition: HcalHTRData.cc:175
bool isBusy() const
Definition: HcalHTRData.cc:123
double b
Definition: hdecay.h:120
int getNDD() const
Get the number of daq data samples per channel when not zero-suppressed.
Definition: HcalHTRData.cc:412
void packHeaderTrailer(int L1Anumber, int bcn, int submodule, int orbitn, int pipeline, int ndd, int nps, int firmwareRev=0, int firmwareFlav=0)
pack header and trailer (call after pack)
Definition: HcalHTRData.cc:294
void adoptData(const unsigned short *data, int length)
Definition: HcalHTRData.cc:46
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
double a
Definition: hdecay.h:121
unsigned int getSubmodule() const
Get the HTR submodule number.
Definition: HcalHTRData.cc:355
unsigned int readoutVMECrateId() const
HcalElectronicsId-style VME crate number.
Definition: HcalHTRData.cc:373
bool isEmptyEvent() const
Definition: HcalHTRData.cc:107
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event...
Definition: HcalHTRData.cc:63
bool isUnsuppressed() const
Is this event an unsuppresed event?
Definition: HcalHTRData.cc:378