CMS 3D CMS Logo

PackerHelp.h
Go to the documentation of this file.
1 #ifndef EventFilter_HcalRawToDigi_PackerHelp_h
2 #define EventFilter_HcalRawToDigi_PackerHelp_h
3 
11 
12 #include <iostream>
13 #include <cstdio>
14 #include <vector>
15 #include <map>
16 #include <cmath>
17 
18 namespace CDFHeaderSpec {
19  static const int OFFSET_H = 0;
20  static const int MASK_H = 0x8;
21  static const int OFFSET_FOV = 4;
22  static const int MASK_FOV = 0xF;
23  static const int OFFSET_SOURCE_ID = 8;
24  static const int MASK_SOURCE_ID = 0xFFF;
25  static const int OFFSET_BX_ID = 20;
26  static const int MASK_BX_ID = 0xFFF;
27  static const uint64_t OFFSET_LV1_ID = 32;
28  static const int MASK_LV1_ID = 0xFFFFFF;
29  static const int OFFSET_EVT_TY = 56;
30  static const int MASK_EVT_TY = 0xF;
31  static const int OFFSET_FIXED_MSB = 60;
32  static const int MASK_FIXED_MSB = 0xF;
33  static const uint64_t FIXED_MSB = 0x5;
34 } // namespace CDFHeaderSpec
35 
36 namespace AMC13HeaderSpec {
37  static const int OFFSET_FIXED_LSB = 0;
38  static const int MASK_FIXED_LSB = 0xF;
39  static const int FIXED_LSB = 0x0;
40  static const int OFFSET_ORN = 4;
41  static const int MASK_ORN = 0xFFFFFFFF;
42  static const int OFFSET_RESERVED = 36;
43  static const int MASK_RESERVED = 0xFFFF;
44  static const int OFFSET_NAMC = 52;
45  static const int MASK_NAMC = 0xF;
46  static const int OFFSET_RES = 56;
47  static const int MASK_RES = 0xF;
48  static const int OFFSET_UFOV = 60;
49  static const int MASK_UFOV = 0xF;
50 } // namespace AMC13HeaderSpec
51 
52 namespace AMCHeaderSpec {
53  static const int OFFSET_CRATE_ID = 0;
54  static const int MASK_CRATE_ID = 0xFF;
55  static const int OFFSET_SLOT_ID = 8;
56  static const int MASK_SLOT_ID = 0xF;
57  static const int OFFSET_PRESAMPLES = 12;
58  static const int MASK_PRESAMPLES = 0xF;
59  static const int OFFSET_AMC_NO = 16;
60  static const int MASK_AMC_NO = 0xF;
61  static const int OFFSET_BLK_NO = 20;
62  static const int MASK_BLK_NO = 0xFF;
63  static const int OFFSET_FIXED = 28;
64  static const int MASK_FIXED = 0xF;
65  static const int OFFSET_AMCN_SIZE = 32;
66  static const int MASK_AMCN_SIZE = 0xFFFFFF;
67  static const int OFFSET_C = 56;
68  static const int MASK_C = 0x1;
69  static const int OFFSET_V = 57;
70  static const int MASK_V = 0x1;
71  static const int OFFSET_P = 58;
72  static const int MASK_P = 0x1;
73  static const int OFFSET_E = 59;
74  static const int MASK_E = 0x1;
75  static const int OFFSET_S = 60;
76  static const int MASK_S = 0x1;
77  static const int OFFSET_M = 61;
78  static const int MASK_M = 0x1;
79  static const int OFFSET_L = 62;
80  static const int MASK_L = 0x1;
81 } // namespace AMCHeaderSpec
82 
83 namespace QIE8HeaderSpec {
84  static const int OFFSET_FIBERCHAN = 0;
85  static const int MASK_FIBERCHAN = 0x3;
86  static const int OFFSET_FIBER = 2;
87  static const int MASK_FIBER = 0x1F;
88  static const int OFFSET_CAPID = 8;
89  static const int MASK_CAPID = 0x3;
90  static const int OFFSET_FIBERERR = 10;
91  static const int MASK_FIBERERR = 0x3;
92  static const int OFFSET_FLAVOR = 12;
93  static const int MASK_FLAVOR = 0x7;
94  static const int OFFSET_HEADER_BIT = 15;
95  static const int MASK_HEADER_BIT = 0x1;
96  static const int OFFSET_TECHNICAL_DATA_TYPE = 8;
97  static const int MASK_TECHNICAL_DATA_TYPE = 0xF;
98 } // namespace QIE8HeaderSpec
99 
100 namespace QIE10HeaderSpec {
101  static const int OFFSET_FIBERCHAN = 0;
102  static const int MASK_FIBERCHAN = 0x7;
103  static const int OFFSET_FIBER = 3;
104  static const int MASK_FIBER = 0x1F;
105  static const int OFFSET_MP = 8; // mark-and-pass
106  static const int MASK_MP = 0x1;
107  static const int OFFSET_RESERV = 9; // reserved
108  static const int MASK_RESERV = 0x3;
109  static const int OFFSET_LE = 11; // link error
110  static const int MASK_LE = 0x1;
111  static const int OFFSET_FLAVOR = 12;
112  static const int MASK_FLAVOR = 0x7;
113  static const int OFFSET_HEADER_BIT = 15;
114  static const int MASK_HEADER_BIT = 0x1;
115 } // namespace QIE10HeaderSpec
116 
117 // QIE11 specifications for various flavors
118 
119 namespace QIE11HeaderSpec0 {
120  static const int OFFSET_FIBERCHAN = 0;
121  static const int MASK_FIBERCHAN = 0x7;
122  static const int OFFSET_FIBER = 3;
123  static const int MASK_FIBER = 0x1F;
124  static const int OFFSET_CAPID = 8;
125  static const int MASK_CAPID = 0x3;
126  static const int OFFSET_FIBERERR = 10;
127  static const int MASK_FIBERERR = 0x3;
128  static const int OFFSET_FLAVOR = 12;
129  static const int MASK_FLAVOR = 0x7;
130  static const int OFFSET_HEADER_BIT = 15;
131  static const int MASK_HEADER_BIT = 0x1;
132 } // namespace QIE11HeaderSpec0
133 
134 namespace QIE11HeaderSpec3 {
135  static const int OFFSET_FIBERCHAN = 0;
136  static const int MASK_FIBERCHAN = 0x7;
137  static const int OFFSET_FIBER = 3;
138  static const int MASK_FIBER = 0x1F;
139  static const int OFFSET_MP = 8;
140  static const int MASK_MP = 0x1;
141  static const int OFFSET_LINKERROR = 11;
142  static const int MASK_LINKERROR = 0x1;
143  static const int OFFSET_FLAVOR = 12;
144  static const int MASK_FLAVOR = 0x7;
145  static const int OFFSET_HEADER_BIT = 15;
146  static const int MASK_HEADER_BIT = 0x1;
147 } // namespace QIE11HeaderSpec3
148 
149 namespace TPHeaderSpec {
150  static const int OFFSET_TOWER = 0;
151  static const int MASK_TOWER = 0xF;
152  static const int OFFSET_LINK = 4;
153  static const int MASK_LINK = 0xF;
154  static const int OFFSET_CHANID = 0;
155  static const int MASK_CHANID = 0xFF;
156  static const int OFFSET_RESV = 8;
157  static const int MASK_RESV = 0x3;
158  static const int OFFSET_TPERR = 10;
159  static const int MASK_TPERR = 0x3;
160  static const int OFFSET_FLAVOR = 12;
161  static const int MASK_FLAVOR = 0x7;
162  static const int OFFSET_HEADER_BIT = 15;
163  static const int MASK_HEADER_BIT = 0x1;
164  static const int OFFSET_SOI_BIT = 14;
165  static const int MASK_SOI_BIT = 0x1;
166 } // namespace TPHeaderSpec
167 
168 namespace QIE8SampleSpec {
169  static const int OFFSET_ADC = 0;
170  static const int MASK_ADC = 0x7F;
171  static const int OFFSET_CAPID = 8;
172  static const int MASK_CAPID = 0x3;
173  static const int OFFSET_DV = 10;
174  static const int MASK_DV = 0x1;
175  static const int OFFSET_ER = 11;
176  static const int MASK_ER = 0x1;
177 } // namespace QIE8SampleSpec
178 
179 class HCalFED {
180 public:
181  typedef std::vector<uint16_t> uhtrData;
182 
183  std::vector<unsigned char> fedData;
184  std::vector<uint64_t> AMCHeaders;
185  std::vector<uhtrData> uhtrs;
186  int fedId;
192 
193  unsigned char cdfh[8];
195 
196  HCalFED(int fedId_, uint64_t EventNum_ = 9999, uint64_t OrbitNum_ = 999, uint64_t BxNum_ = 99) {
197  fedId = fedId_;
198  OrbitNum = OrbitNum_;
199  EventNum = EventNum_;
200  BxNum = BxNum_;
202 
203  setCDFHeader();
204  setAMC13Header();
205  };
206 
207  inline void split64bitTo8bit(std::vector<unsigned char>& outVec, const uint64_t& var64bit) {
208  for (int is = 0; is < 8; is++) { // 64/8 = 8
209  outVec.push_back((var64bit >> (is * 8)) & 0xFF);
210  }
211  }
212 
213  void setCDFHeader() {
214  cdfHeader = 0;
218  << CDFHeaderSpec::OFFSET_SOURCE_ID; // needs to be configurable
219  cdfHeader |= (BxNum & CDFHeaderSpec::MASK_BX_ID) << CDFHeaderSpec::OFFSET_BX_ID; // needs to be configurable
223  }
224 
225  void setAMC13Header() {
226  AMC13Header = 0;
233  }
234 
236 
237  void addAMCHeader(uint64_t crate, uint64_t slot, uint64_t AMCsize, uint64_t presamples = 10, uint64_t blockNum = 0) {
238  uint64_t header = 0;
243  header |= (blockNum & AMCHeaderSpec::MASK_BLK_NO) << AMCHeaderSpec::OFFSET_BLK_NO; // Block No.
245  header |= uint64_t(0x1) << AMCHeaderSpec::OFFSET_C; // CRC is valid
246  header |= uint64_t(0x1) << AMCHeaderSpec::OFFSET_V; // EvN, BcN match
247  header |= uint64_t(0x1) << AMCHeaderSpec::OFFSET_P; // Present, header is only made if data is present
248  header |= uint64_t(0x1) << AMCHeaderSpec::OFFSET_E; // Enabled, header is only made if AMC is enabled
249  header |= uint64_t(0x0) << AMCHeaderSpec::OFFSET_S; // Segmented, always zero for unsegmented data
250  header |= uint64_t(0x0) << AMCHeaderSpec::OFFSET_M; // More data
251  header |= uint64_t(0x0) << AMCHeaderSpec::OFFSET_L; // Indicates length error
252 
253  AMCHeaders.push_back(header);
254  }
255 
256  void addUHTR(uhtrData uhtr, uint64_t crate, uint64_t slot) {
257  // push uhtr data into FED container
258  uhtrs.push_back(uhtr);
259  // create the corresponding AMC header
260  addAMCHeader(crate, slot, uhtr.size() / 4);
261  };
262 
263  // does not include HEADER and TRAILER
265  //std::vector<unsigned char> output;
266  if (uhtrs.size() != AMCHeaders.size()) {
267  return;
268  }
269 
270  // put common data format header in fed container
272 
273  // set the number of AMCs in the AMC13 header
274  setNAMC(uhtrs.size());
275  // put the AMC13 header into the fed container
277 
278  // fill fedData with AMC headers
279  for (unsigned int iAMC = 0; iAMC < AMCHeaders.size(); ++iAMC) {
280  // adjust the AMCsize bits to match uhtr header
281  //AMCHeaders[iAMC] |= uint64_t(uhtrs[iAMC][1]&0xF)<<51 ;
282  //AMCHeaders[iAMC] |= uint64_t(uhtrs[iAMC][0]&0xFFFF)<<47 ;
284  }
285 
286  // fill fedData with AMC data
287  for (unsigned int iAMC = 0; iAMC < uhtrs.size(); ++iAMC) {
288  unsigned int nWords16 = uhtrs[iAMC].size();
289  for (unsigned int amcWord = 0; amcWord < nWords16; ++amcWord) {
290  fedData.push_back((uhtrs[iAMC][amcWord] >> 0) & 0xFF); // split 16-bit words into 8-bit
291  fedData.push_back((uhtrs[iAMC][amcWord] >> 8) & 0xFF);
292  } // end loop over uhtr words
293  } // end loop over uhtrs
294 
295  // fedData should be a integer number of 64 bit words
296  while (fedData.size() % 8 != 0)
297  fedData.push_back(0);
298 
299  // convert to the correct format
300  rawData.resize(fedData.size());
301  unsigned char* words = reinterpret_cast<unsigned char*>(rawData.data());
302 
303  for (unsigned int i = 0; i < fedData.size(); ++i) {
304  *words = fedData[i];
305  words++;
306  }
307  };
308 };
309 
310 class UHTRpacker {
311 public:
312  typedef std::vector<uint16_t> uhtrData;
313  typedef std::map<int, uhtrData> UHTRMap; // the int here is intended to be the raw electronics ID
314 
316 
317  // FIRST WORD
318  static const int OFFSET_DATA_LENGTH = 0;
319  static const int MASK_DATA_LENGTH = 0xFFFFF;
320  static const int OFFSET_BCN = 20;
321  static const int MASK_BCN = 0xFFF;
322  static const int OFFSET_EVN = 32;
323  static const int MASK_EVN = 0xFFFFFF;
324  static const int OFFSET_FILED_BY_AMC13 = 56;
325  static const int MASK_FILED_BY_AMC13 = 0xFF;
326  // SECOND WORD
327  static const int OFFSET_CRATE_ID = 0;
328  static const int MASK_CRATE_ID = 0xFFFFFF;
329  static const int OFFSET_SLOT_ID = 8;
330  static const int MASK_SLOT_ID = 0xF;
331  static const int OFFSET_PRESAMPLES = 12;
332  static const int MASK_PRESAMPLES = 0xF;
333  static const int OFFSET_ORN = 16;
334  static const int MASK_ORN = 0xFFFF;
335  static const int OFFSET_FW_FLAVOR = 32;
336  static const int MASK_FW_FLAVOR = 0xFF;
337  static const int OFFSET_EVENT_TYPE = 40;
338  static const int MASK_EVENT_TYPE = 0xF;
339  static const int OFFSET_PAYLOAD_FORMAT = 44;
340  static const int MASK_PAYLOAD_FORMAT = 0xF;
341  static const int OFFSET_FW_VERSION = 48;
342  static const int MASK_FW_VERSION = 0xFFFF;
343 
345 
346  bool exist(int uhtrIndex) { return uhtrs.count(uhtrIndex) != 0; };
347 
348  // flavor should be 5, or 7 (only for premixing in sim)
349  uint16_t packQIE8header(const HcalQIESample& qieSample, const HcalElectronicsId& eid, int flavor) {
350  uint16_t header = 0;
351 
352  int fiber = eid.fiberIndex() + 1;
353  int fiberchan = eid.fiberChanId();
354 
357  if (flavor == 7) {
359  } else {
360  int fiberErr = qieSample.er();
361  int capid0 = qieSample.capid();
364  }
367 
368  return header;
369  }
370 
371  uint16_t packQIE8sample(const HcalQIESample& qieSample) {
372  uint16_t sample = 0;
373 
374  int adc = qieSample.adc();
375  int capid = qieSample.capid();
376  int dv = qieSample.dv();
377  int er = qieSample.er();
378 
383 
384  return sample;
385  }
386 
387  uint16_t packTPheader(const HcalTriggerPrimitiveSample& tpSample, int channelid) {
388  uint16_t header = 0;
389 
395 
396  return header;
397  }
398 
400  uint16_t header = 0;
401 
402  int fiber = eid.fiberIndex();
403  int fiberchan = eid.fiberChanId();
404 
412 
413  return header;
414  }
415 
416  uint16_t packQIE11header(const QIE11DataFrame& qiedf, const HcalElectronicsId& eid) {
417  uint16_t header = 0;
418 
419  int fiber = eid.fiberIndex();
420  int fiberchan = eid.fiberChanId();
421  int flavor = qiedf[0].flavor();
422 
423  if (flavor == 3) {
430  } else {
431  int capid0 = qiedf[0].capid();
438  }
439 
440  return header;
441  }
442 
443  uhtrData* newUHTR(int uhtrIndex, int ps = 0, int orn = 0, int bcn = 0, uint64_t evt = 0) {
444  // initialize vector of 16-bit words
445  uhtrs[uhtrIndex] = uhtrData(8);
446  // build header -- some information will be updated at the end
447 
448  uint64_t presamples = std::max(ps, 0);
449  uint64_t uhtrCrate = uhtrIndex & 0xFF;
450  uint64_t uhtrSlot = (uhtrIndex & 0xF00) >> 8;
451  // From Jeremy:
452  // Set the firmware to zero, the firmware flavor to 0, the payload format to 1, and the event type to 1.
453  uint64_t fwFlavor = 0;
454  uint64_t eventType = 1;
455  uint64_t payloadFormat = 1;
456  uint64_t fwVersion = 0;
457 
458  uint64_t uhtrHeader1 = 0;
459  uhtrHeader1 |= (uint64_t(0x0) & MASK_DATA_LENGTH) << OFFSET_DATA_LENGTH;
460  uhtrHeader1 |= (bcn & MASK_BCN) << OFFSET_BCN;
461  uhtrHeader1 |= (evt & MASK_EVN) << OFFSET_EVN;
462  uhtrHeader1 |= (uint64_t(0x0) & MASK_FILED_BY_AMC13) << OFFSET_FILED_BY_AMC13;
463 
464  uint64_t uhtrHeader2 = 0;
465  uhtrHeader2 |= (uhtrCrate & MASK_CRATE_ID) << OFFSET_CRATE_ID;
466  uhtrHeader2 |= (uhtrSlot & MASK_SLOT_ID) << OFFSET_SLOT_ID;
467  uhtrHeader2 |= (presamples & MASK_PRESAMPLES) << OFFSET_PRESAMPLES;
468  uhtrHeader2 |= (orn & MASK_ORN) << OFFSET_ORN;
469  uhtrHeader2 |= (fwFlavor & MASK_FW_FLAVOR) << OFFSET_FW_FLAVOR;
470  uhtrHeader2 |= (eventType & MASK_EVENT_TYPE) << OFFSET_EVENT_TYPE;
471  uhtrHeader2 |= (payloadFormat & MASK_PAYLOAD_FORMAT) << OFFSET_PAYLOAD_FORMAT;
472  uhtrHeader2 |= (fwVersion & MASK_FW_VERSION) << OFFSET_FW_VERSION;
473 
474  // push header into vector of 16-bit words
475  for (unsigned int i = 0; i < 4; ++i) {
476  uhtrs[uhtrIndex][i] = (uhtrHeader1 >> (i * 16)) & 0xFFFF;
477  uhtrs[uhtrIndex][i + 4] = (uhtrHeader2 >> (i * 16)) & 0xFFFF;
478  }
479 
480  return &(uhtrs[uhtrIndex]);
481  };
482 
483  void finalizeHeadTail(uhtrData* uhtr, bool verbosity) {
484  uint64_t uhtr_size = uhtr->size() - 8;
485 
486  // adjust the size bits
487  uhtr->at(0) = uhtr_size & 0xFFFF;
488  uhtr->at(1) |= (uhtr_size >> 16) & 0xF;
489 
490  unsigned int toAdd = 4 - uhtr->size() % 4;
491  for (unsigned int ia = 0; ia < toAdd; ia++) {
492  uhtr->push_back(0xD07F);
493  }
494 
495  // add trailer
496  uhtr->push_back(uhtr_size & 0xFFFF);
497  uhtr->push_back((uhtr_size >> 16) & 0xF);
498  // this is ignoring the event number... I am not sure what this should be
499 
500  // adding some blank stuff for the CRC bits
501  uhtr->push_back(0);
502  uhtr->push_back(0);
503  };
504 
505  void addChannel(int uhtrIndex,
507  const HcalElectronicsMap* readoutMap,
508  bool premix,
509  int verbosity = 0) {
510  if (qiedf->size() == 0)
511  return;
512  DetId detid = qiedf->id();
513  HcalElectronicsId eid(readoutMap->lookup(detid));
514  uint16_t header = packQIE8header(qiedf->sample(0), eid, premix ? 7 : 5);
515  uhtrs[uhtrIndex].push_back(header);
516  // loop over words in dataframe
517  if (premix) {
518  for (int iTS = 0; iTS < qiedf->size(); ++iTS) {
519  uhtrs[uhtrIndex].push_back(packQIE8sample(qiedf->sample(iTS)));
520  }
521  } else {
522  for (int iTS = 0; iTS < qiedf->size(); iTS += 2) {
523  uint16_t cont = 0;
524  int adc0 = qiedf->sample(iTS).adc();
525  int adc1 = qiedf->sample(iTS + 1).adc();
526  cont |= adc0 & 0xFF;
527  cont |= (adc1 & 0xFF) << 8;
528  uhtrs[uhtrIndex].push_back(cont);
529  }
530  } // end loop over dataframe words
531  };
532 
533  void addChannel(int uhtrIndex,
535  const HcalElectronicsMap* readoutMap,
536  bool premix,
537  int verbosity = 0) {
538  if (qiedf->size() == 0)
539  return;
540  DetId detid = qiedf->id();
541  HcalElectronicsId eid(readoutMap->lookup(detid));
542  uint16_t header = packQIE8header(qiedf->sample(0), eid, premix ? 7 : 5);
543  uhtrs[uhtrIndex].push_back(header);
544  // loop over words in dataframe
545  if (premix) {
546  for (int iTS = 0; iTS < qiedf->size(); ++iTS) {
547  uhtrs[uhtrIndex].push_back(packQIE8sample(qiedf->sample(iTS)));
548  }
549  } else {
550  for (int iTS = 0; iTS < qiedf->size(); iTS += 2) {
551  uint16_t cont = 0;
552  int adc0 = qiedf->sample(iTS).adc();
553  int adc1 = qiedf->sample(iTS + 1).adc();
554  cont |= adc0 & 0xFF;
555  cont |= (adc1 & 0xFF) << 8;
556  uhtrs[uhtrIndex].push_back(cont);
557  }
558  } // end loop over dataframe words
559  };
560 
561  void addChannel(int uhtrIndex,
563  int channelid,
564  int verbosity = 0) {
565  if (qiedf->size() == 0)
566  return;
567  uint16_t header = packTPheader(qiedf->sample(0), channelid);
568  uhtrs[uhtrIndex].push_back(header);
569  // loop over words in dataframe
570  for (int iTS = 0; iTS < qiedf->size(); iTS++) {
571  // push data into uhtr data container
572  auto raw = qiedf->sample(iTS).raw();
573  // Add SOI information
574  if (iTS == qiedf->presamples())
576  uhtrs[uhtrIndex].push_back(raw);
577  } // end loop over dataframe words
578  };
579 
580  void addChannel(int uhtrIndex, QIE11DataFrame qiedf, const HcalElectronicsMap* readoutMap, int verbosity = 0) {
581  DetId detid = qiedf.detid();
582  HcalElectronicsId eid(readoutMap->lookup(detid));
583  // loop over words in dataframe
584  for (edm::DataFrame::iterator dfi = qiedf.begin(); dfi != qiedf.end(); ++dfi) {
585  if (dfi >= qiedf.end() - QIE11DataFrame::FLAG_WORDS) {
586  continue;
587  }
588  if (dfi == qiedf.begin() && QIE11DataFrame::HEADER_WORDS == 1) {
589  uint16_t header = packQIE11header(qiedf, eid);
590  uhtrs[uhtrIndex].push_back(header);
591  continue;
592  }
593  // push data into uhtr data container
594  uhtrs[uhtrIndex].push_back(dfi[0]);
595  } // end loop over dataframe words
596  };
597 
598  void addChannel(int uhtrIndex, QIE10DataFrame qiedf, const HcalElectronicsMap* readoutMap, int verbosity = 0) {
599  DetId detid = qiedf.detid();
600  HcalElectronicsId eid(readoutMap->lookup(detid));
601  // loop over words in dataframe
602  for (edm::DataFrame::iterator dfi = qiedf.begin(); dfi != qiedf.end(); ++dfi) {
603  if (dfi >= qiedf.end() - QIE10DataFrame::FLAG_WORDS) {
604  continue;
605  }
606  if (dfi == qiedf.begin() && QIE10DataFrame::HEADER_WORDS == 1) {
607  uint16_t header = packQIE10header(eid);
608  uhtrs[uhtrIndex].push_back(header);
609  continue;
610  }
611  // push data into uhtr data container
612  uhtrs[uhtrIndex].push_back(dfi[0]);
613  } // end loop over dataframe words
614  };
615 };
616 
617 // converts HE QIE digies to HB data format
618 
619 QIE11DataFrame convertHB(QIE11DataFrame qiehe, int tdc1, int tdc2, int tdcmax) {
620  QIE11DataFrame qiehb = qiehe;
621  int adc, tdc;
622  bool soi;
623  int is = 0;
624 
625  // flavor for HB digies is hardcoded here
626  static const int hbflavor = 3;
627 
628  // iterator over samples
629  for (edm::DataFrame::const_iterator it = qiehe.begin(); it != qiehe.end(); ++it) {
630  if (it == qiehe.begin())
631  continue;
632  adc = qiehe[is].adc();
633  tdc = qiehe[is].tdc();
634  soi = qiehe[is].soi();
635 
636  if (tdc >= 0 && tdc <= tdc1)
637  tdc = 0;
638  else if (tdc > tdc1 && tdc <= tdc2)
639  tdc = 1;
640  else if (tdc > tdc2 && tdc <= tdcmax)
641  tdc = 2;
642  else
643  tdc = 3;
644 
645  qiehb.setSample(is, adc, tdc, soi);
646  is++;
647  };
648 
649  // puting flavor is safe here because flavor is stored in the same bits for all flavors
650  qiehb.setFlavor(hbflavor);
651  int capid = qiehe[0].capid();
652  qiehb.setCapid0(capid);
653 
654  return qiehb;
655 }
656 
657 #endif
QIE11DataFrame::begin
constexpr edm::DataFrame::iterator begin()
iterators
Definition: QIE11DataFrame.h:72
HcalElectronicsMap.h
HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition: HIPAlignmentAlgorithm_cfi.py:7
FEDNumbering.h
AMCHeaderSpec::MASK_BLK_NO
static const int MASK_BLK_NO
Definition: PackerHelp.h:62
QIE8SampleSpec::MASK_DV
static const int MASK_DV
Definition: PackerHelp.h:174
AMCHeaderSpec::OFFSET_BLK_NO
static const int OFFSET_BLK_NO
Definition: PackerHelp.h:61
UHTRpacker::packQIE8header
uint16_t packQIE8header(const HcalQIESample &qieSample, const HcalElectronicsId &eid, int flavor)
Definition: PackerHelp.h:349
AMC13HeaderSpec::MASK_RES
static const int MASK_RES
Definition: PackerHelp.h:47
UHTRpacker::MASK_DATA_LENGTH
static const int MASK_DATA_LENGTH
Definition: PackerHelp.h:319
amcDumpToRaw_cfi.fwVersion
fwVersion
Definition: amcDumpToRaw_cfi.py:11
QIE8HeaderSpec::OFFSET_FIBERERR
static const int OFFSET_FIBERERR
Definition: PackerHelp.h:90
UHTRpacker::OFFSET_PAYLOAD_FORMAT
static const int OFFSET_PAYLOAD_FORMAT
Definition: PackerHelp.h:339
UHTRpacker::packQIE10header
uint16_t packQIE10header(const HcalElectronicsId &eid)
Definition: PackerHelp.h:399
QIE8SampleSpec::OFFSET_ER
static const int OFFSET_ER
Definition: PackerHelp.h:175
HCalFED::addUHTR
void addUHTR(uhtrData uhtr, uint64_t crate, uint64_t slot)
Definition: PackerHelp.h:256
QIE8HeaderSpec::MASK_FLAVOR
static const int MASK_FLAVOR
Definition: PackerHelp.h:93
HCalFED::AMC13Header
uint64_t AMC13Header
Definition: PackerHelp.h:187
mps_fire.i
i
Definition: mps_fire.py:428
UHTRpacker::OFFSET_EVENT_TYPE
static const int OFFSET_EVENT_TYPE
Definition: PackerHelp.h:337
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
HCalFED::BxNum
uint64_t BxNum
Definition: PackerHelp.h:190
QIE10HeaderSpec::MASK_FIBER
static const int MASK_FIBER
Definition: PackerHelp.h:104
QIE11HeaderSpec3::OFFSET_FIBER
static const int OFFSET_FIBER
Definition: PackerHelp.h:137
UHTRpacker::UHTRMap
std::map< int, uhtrData > UHTRMap
Definition: PackerHelp.h:313
AMCHeaderSpec::MASK_AMCN_SIZE
static const int MASK_AMCN_SIZE
Definition: PackerHelp.h:66
QIE8HeaderSpec::OFFSET_FIBERCHAN
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:84
CDFHeaderSpec::MASK_H
static const int MASK_H
Definition: PackerHelp.h:20
HCalFED::Crate
uint64_t Crate
Definition: PackerHelp.h:191
AMCHeaderSpec::MASK_L
static const int MASK_L
Definition: PackerHelp.h:80
QIE11HeaderSpec0::MASK_FLAVOR
static const int MASK_FLAVOR
Definition: PackerHelp.h:129
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
AMCHeaderSpec::OFFSET_FIXED
static const int OFFSET_FIXED
Definition: PackerHelp.h:63
UHTRpacker::MASK_ORN
static const int MASK_ORN
Definition: PackerHelp.h:334
CDFHeaderSpec::OFFSET_LV1_ID
static const uint64_t OFFSET_LV1_ID
Definition: PackerHelp.h:27
TPHeaderSpec::OFFSET_RESV
static const int OFFSET_RESV
Definition: PackerHelp.h:156
UHTRpacker::packQIE11header
uint16_t packQIE11header(const QIE11DataFrame &qiedf, const HcalElectronicsId &eid)
Definition: PackerHelp.h:416
AMC13HeaderSpec::MASK_ORN
static const int MASK_ORN
Definition: PackerHelp.h:41
HcalTriggerPrimitiveSample
Definition: HcalTriggerPrimitiveSample.h:11
QIE11HeaderSpec3
Definition: PackerHelp.h:134
HcalQIESample::adc
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:43
QIE11HeaderSpec0::MASK_HEADER_BIT
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:131
TPHeaderSpec::OFFSET_LINK
static const int OFFSET_LINK
Definition: PackerHelp.h:152
QIE11DataFrame::end
constexpr edm::DataFrame::iterator end()
Definition: QIE11DataFrame.h:73
UHTRpacker::OFFSET_EVN
static const int OFFSET_EVN
Definition: PackerHelp.h:322
UHTRpacker::OFFSET_FW_FLAVOR
static const int OFFSET_FW_FLAVOR
Definition: PackerHelp.h:335
TPHeaderSpec
Definition: PackerHelp.h:149
UHTRpacker::addChannel
void addChannel(int uhtrIndex, edm::SortedCollection< HBHEDataFrame >::const_iterator qiedf, const HcalElectronicsMap *readoutMap, bool premix, int verbosity=0)
Definition: PackerHelp.h:533
TPHeaderSpec::OFFSET_TOWER
static const int OFFSET_TOWER
Definition: PackerHelp.h:150
QIE11DataFrame::setCapid0
constexpr void setCapid0(int cap0)
Definition: QIE11DataFrame.h:109
AMCHeaderSpec::MASK_M
static const int MASK_M
Definition: PackerHelp.h:78
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:162
UHTRpacker::addChannel
void addChannel(int uhtrIndex, QIE11DataFrame qiedf, const HcalElectronicsMap *readoutMap, int verbosity=0)
Definition: PackerHelp.h:580
AMCHeaderSpec::OFFSET_M
static const int OFFSET_M
Definition: PackerHelp.h:77
AMCHeaderSpec::MASK_PRESAMPLES
static const int MASK_PRESAMPLES
Definition: PackerHelp.h:58
generateEDF.cont
cont
load Luminosity info ##
Definition: generateEDF.py:629
UHTRpacker::MASK_PAYLOAD_FORMAT
static const int MASK_PAYLOAD_FORMAT
Definition: PackerHelp.h:340
QIE11HeaderSpec3::MASK_FIBER
static const int MASK_FIBER
Definition: PackerHelp.h:138
QIE8SampleSpec::MASK_ADC
static const int MASK_ADC
Definition: PackerHelp.h:170
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
TPHeaderSpec::MASK_RESV
static const int MASK_RESV
Definition: PackerHelp.h:157
AMCHeaderSpec::OFFSET_CRATE_ID
static const int OFFSET_CRATE_ID
Definition: PackerHelp.h:53
TPHeaderSpec::OFFSET_HEADER_BIT
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:162
HCalFED::setNAMC
void setNAMC(uint64_t NAMC)
Definition: PackerHelp.h:235
HCalFED::setCDFHeader
void setCDFHeader()
Definition: PackerHelp.h:213
UHTRpacker::MASK_CRATE_ID
static const int MASK_CRATE_ID
Definition: PackerHelp.h:328
QIE8HeaderSpec::MASK_CAPID
static const int MASK_CAPID
Definition: PackerHelp.h:89
AMCHeaderSpec::MASK_FIXED
static const int MASK_FIXED
Definition: PackerHelp.h:64
FEDRawData.h
QIE10HeaderSpec
Definition: PackerHelp.h:100
HCalFED::HCalFED
HCalFED(int fedId_, uint64_t EventNum_=9999, uint64_t OrbitNum_=999, uint64_t BxNum_=99)
Definition: PackerHelp.h:196
CDFHeaderSpec::OFFSET_FOV
static const int OFFSET_FOV
Definition: PackerHelp.h:21
QIE11HeaderSpec0::OFFSET_HEADER_BIT
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:130
HcalQIESample
Definition: HcalQIESample.h:32
AMC13HeaderSpec::MASK_RESERVED
static const int MASK_RESERVED
Definition: PackerHelp.h:43
AMCHeaderSpec::MASK_CRATE_ID
static const int MASK_CRATE_ID
Definition: PackerHelp.h:54
QIE10HeaderSpec::MASK_LE
static const int MASK_LE
Definition: PackerHelp.h:110
FEDRawData
Definition: FEDRawData.h:19
HcalQIESample::er
constexpr bool er() const
is the error bit set?
Definition: HcalQIESample.h:51
UHTRpacker::OFFSET_PRESAMPLES
static const int OFFSET_PRESAMPLES
Definition: PackerHelp.h:331
CDFHeaderSpec::MASK_SOURCE_ID
static const int MASK_SOURCE_ID
Definition: PackerHelp.h:24
QIE10HeaderSpec::MASK_FLAVOR
static const int MASK_FLAVOR
Definition: PackerHelp.h:112
CDFHeaderSpec::OFFSET_FIXED_MSB
static const int OFFSET_FIXED_MSB
Definition: PackerHelp.h:31
ecalLiteDTU::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalLiteDTUSample.h:12
QIE11HeaderSpec0::MASK_FIBERCHAN
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:121
UHTRpacker::OFFSET_FILED_BY_AMC13
static const int OFFSET_FILED_BY_AMC13
Definition: PackerHelp.h:324
QIE11HeaderSpec3::MASK_FLAVOR
static const int MASK_FLAVOR
Definition: PackerHelp.h:144
UHTRpacker::MASK_SLOT_ID
static const int MASK_SLOT_ID
Definition: PackerHelp.h:330
AMCHeaderSpec
Definition: PackerHelp.h:52
DetId
Definition: DetId.h:17
QIE8HeaderSpec::OFFSET_FIBER
static const int OFFSET_FIBER
Definition: PackerHelp.h:86
CDFHeaderSpec::OFFSET_SOURCE_ID
static const int OFFSET_SOURCE_ID
Definition: PackerHelp.h:23
QIE8HeaderSpec::MASK_TECHNICAL_DATA_TYPE
static const int MASK_TECHNICAL_DATA_TYPE
Definition: PackerHelp.h:97
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
UHTRpacker::MASK_FILED_BY_AMC13
static const int MASK_FILED_BY_AMC13
Definition: PackerHelp.h:325
QIE8SampleSpec::MASK_ER
static const int MASK_ER
Definition: PackerHelp.h:176
QIE8SampleSpec
Definition: PackerHelp.h:168
QIE10DataFrame::end
constexpr edm::DataFrame::iterator end()
Definition: QIE10DataFrame.h:82
QIE11HeaderSpec3::OFFSET_FLAVOR
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:143
AMCHeaderSpec::OFFSET_PRESAMPLES
static const int OFFSET_PRESAMPLES
Definition: PackerHelp.h:57
QIE10DataFrame::detid
constexpr DetId detid() const
Get the detector id.
Definition: QIE10DataFrame.h:76
AMC13HeaderSpec::OFFSET_ORN
static const int OFFSET_ORN
Definition: PackerHelp.h:40
TPHeaderSpec::MASK_HEADER_BIT
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:163
QIE8SampleSpec::MASK_CAPID
static const int MASK_CAPID
Definition: PackerHelp.h:172
HcalDigiCollections.h
QIE8HeaderSpec
Definition: PackerHelp.h:83
QIE10HeaderSpec::OFFSET_RESERV
static const int OFFSET_RESERV
Definition: PackerHelp.h:107
UHTRpacker::OFFSET_CRATE_ID
static const int OFFSET_CRATE_ID
Definition: PackerHelp.h:327
AMCHeaderSpec::OFFSET_E
static const int OFFSET_E
Definition: PackerHelp.h:73
AMCHeaderSpec::OFFSET_AMC_NO
static const int OFFSET_AMC_NO
Definition: PackerHelp.h:59
convertHB
QIE11DataFrame convertHB(QIE11DataFrame qiehe, int tdc1, int tdc2, int tdcmax)
Definition: PackerHelp.h:619
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
UHTRpacker::UHTRpacker
UHTRpacker()
Definition: PackerHelp.h:344
HCalFED::split64bitTo8bit
void split64bitTo8bit(std::vector< unsigned char > &outVec, const uint64_t &var64bit)
Definition: PackerHelp.h:207
QIE11HeaderSpec0::MASK_FIBER
static const int MASK_FIBER
Definition: PackerHelp.h:123
TPHeaderSpec::MASK_TOWER
static const int MASK_TOWER
Definition: PackerHelp.h:151
QIE8HeaderSpec::OFFSET_TECHNICAL_DATA_TYPE
static const int OFFSET_TECHNICAL_DATA_TYPE
Definition: PackerHelp.h:96
edm::DataFrame::iterator
data_type * iterator
Definition: DataFrame.h:20
CDFHeaderSpec::OFFSET_EVT_TY
static const int OFFSET_EVT_TY
Definition: PackerHelp.h:29
hcalTTPDigis_cfi.presamples
presamples
Definition: hcalTTPDigis_cfi.py:9
AMC13HeaderSpec::OFFSET_NAMC
static const int OFFSET_NAMC
Definition: PackerHelp.h:44
UHTRpacker::addChannel
void addChannel(int uhtrIndex, edm::SortedCollection< HcalTriggerPrimitiveDigi >::const_iterator qiedf, int channelid, int verbosity=0)
Definition: PackerHelp.h:561
QIE10HeaderSpec::OFFSET_MP
static const int OFFSET_MP
Definition: PackerHelp.h:105
QIE11DataFrame::setFlavor
constexpr void setFlavor(int flavor)
Definition: QIE11DataFrame.h:104
QIE10HeaderSpec::OFFSET_LE
static const int OFFSET_LE
Definition: PackerHelp.h:109
UHTRpacker::MASK_FW_VERSION
static const int MASK_FW_VERSION
Definition: PackerHelp.h:342
UHTRpacker::OFFSET_FW_VERSION
static const int OFFSET_FW_VERSION
Definition: PackerHelp.h:341
AMCHeaderSpec::MASK_C
static const int MASK_C
Definition: PackerHelp.h:68
UHTRpacker::uhtrs
UHTRMap uhtrs
Definition: PackerHelp.h:315
QIE11DataFrame::setSample
constexpr void setSample(edm::DataFrame::size_type isample, int adc, int tdc, bool soi=false)
set the sample contents
Definition: QIE11DataFrame.h:121
QIE10HeaderSpec::MASK_FIBERCHAN
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:102
HCalFED::fedId
int fedId
Definition: PackerHelp.h:186
AMCHeaderSpec::OFFSET_C
static const int OFFSET_C
Definition: PackerHelp.h:67
QIE11HeaderSpec3::MASK_FIBERCHAN
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:136
TPHeaderSpec::OFFSET_SOI_BIT
static const int OFFSET_SOI_BIT
Definition: PackerHelp.h:164
QIE11DataFrame::HEADER_WORDS
static const int HEADER_WORDS
Definition: QIE11DataFrame.h:14
QIE11HeaderSpec0::OFFSET_FIBER
static const int OFFSET_FIBER
Definition: PackerHelp.h:122
HCalFED::formatFEDdata
void formatFEDdata(FEDRawData &rawData)
Definition: PackerHelp.h:264
QIE8HeaderSpec::OFFSET_FLAVOR
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:92
UHTRpacker::MASK_PRESAMPLES
static const int MASK_PRESAMPLES
Definition: PackerHelp.h:332
CDFHeaderSpec
Definition: PackerHelp.h:18
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
QIE11HeaderSpec3::OFFSET_FIBERCHAN
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:135
HCalFED::cdfHeader
uint64_t cdfHeader
Definition: PackerHelp.h:187
TPHeaderSpec::OFFSET_TPERR
static const int OFFSET_TPERR
Definition: PackerHelp.h:158
QIE11HeaderSpec3::MASK_HEADER_BIT
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:146
AMC13HeaderSpec::MASK_FIXED_LSB
static const int MASK_FIXED_LSB
Definition: PackerHelp.h:38
QIE8HeaderSpec::MASK_FIBER
static const int MASK_FIBER
Definition: PackerHelp.h:87
QIE11HeaderSpec3::MASK_LINKERROR
static const int MASK_LINKERROR
Definition: PackerHelp.h:142
QIE10DataFrame.h
AMCHeaderSpec::MASK_V
static const int MASK_V
Definition: PackerHelp.h:70
HCalFED::uhtrs
std::vector< uhtrData > uhtrs
Definition: PackerHelp.h:185
UHTRpacker::MASK_EVENT_TYPE
static const int MASK_EVENT_TYPE
Definition: PackerHelp.h:338
AMCHeaderSpec::MASK_S
static const int MASK_S
Definition: PackerHelp.h:76
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
HCalFED::cdfh
unsigned char cdfh[8]
Definition: PackerHelp.h:193
QIE10HeaderSpec::MASK_HEADER_BIT
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:114
QIE10HeaderSpec::OFFSET_FLAVOR
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:111
CDFHeaderSpec::MASK_BX_ID
static const int MASK_BX_ID
Definition: PackerHelp.h:26
QIE10HeaderSpec::OFFSET_HEADER_BIT
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:113
HcalQIESample::capid
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47
QIE11HeaderSpec0::MASK_FIBERERR
static const int MASK_FIBERERR
Definition: PackerHelp.h:127
TPHeaderSpec::MASK_TPERR
static const int MASK_TPERR
Definition: PackerHelp.h:159
QIE11HeaderSpec3::OFFSET_MP
static const int OFFSET_MP
Definition: PackerHelp.h:139
AMCHeaderSpec::OFFSET_AMCN_SIZE
static const int OFFSET_AMCN_SIZE
Definition: PackerHelp.h:65
QIE11HeaderSpec3::MASK_MP
static const int MASK_MP
Definition: PackerHelp.h:140
AMCHeaderSpec::MASK_E
static const int MASK_E
Definition: PackerHelp.h:74
UHTRpacker::MASK_EVN
static const int MASK_EVN
Definition: PackerHelp.h:323
AMCHeaderSpec::MASK_AMC_NO
static const int MASK_AMC_NO
Definition: PackerHelp.h:60
QIE11HeaderSpec0::OFFSET_FLAVOR
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:128
QIE11HeaderSpec0::OFFSET_CAPID
static const int OFFSET_CAPID
Definition: PackerHelp.h:124
edm::DataFrame::const_iterator
const data_type * const_iterator
Definition: DataFrame.h:21
QIE8SampleSpec::OFFSET_DV
static const int OFFSET_DV
Definition: PackerHelp.h:173
QIE11DataFrame::detid
constexpr DetId detid() const
Get the detector id.
Definition: QIE11DataFrame.h:67
QIE11HeaderSpec3::OFFSET_LINKERROR
static const int OFFSET_LINKERROR
Definition: PackerHelp.h:141
HcalElectronicsId.h
HCalFED::EventNum
uint64_t EventNum
Definition: PackerHelp.h:189
AMC13HeaderSpec::OFFSET_RES
static const int OFFSET_RES
Definition: PackerHelp.h:46
FEDNumbering::MINHCALuTCAFEDID
Definition: FEDNumbering.h:103
QIE11HeaderSpec3::OFFSET_HEADER_BIT
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:145
hcalcalib_dqm_sourceclient-live_cfg.eventType
eventType
Definition: hcalcalib_dqm_sourceclient-live_cfg.py:205
CDFHeaderSpec::MASK_EVT_TY
static const int MASK_EVT_TY
Definition: PackerHelp.h:30
HcalElectronicsMap
Definition: HcalElectronicsMap.h:31
UHTRpacker::addChannel
void addChannel(int uhtrIndex, QIE10DataFrame qiedf, const HcalElectronicsMap *readoutMap, int verbosity=0)
Definition: PackerHelp.h:598
HcalQIESample::dv
constexpr bool dv() const
is the Data Valid bit set?
Definition: HcalQIESample.h:49
AMC13HeaderSpec
Definition: PackerHelp.h:36
QIE10HeaderSpec::MASK_RESERV
static const int MASK_RESERV
Definition: PackerHelp.h:108
TPHeaderSpec::OFFSET_FLAVOR
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:160
AMCHeaderSpec::OFFSET_SLOT_ID
static const int OFFSET_SLOT_ID
Definition: PackerHelp.h:55
TPHeaderSpec::OFFSET_CHANID
static const int OFFSET_CHANID
Definition: PackerHelp.h:154
CDFHeaderSpec::OFFSET_H
static const int OFFSET_H
Definition: PackerHelp.h:19
CDFHeaderSpec::FIXED_MSB
static const uint64_t FIXED_MSB
Definition: PackerHelp.h:33
UHTRpacker::uhtrData
std::vector< uint16_t > uhtrData
Definition: PackerHelp.h:312
QIE8HeaderSpec::OFFSET_CAPID
static const int OFFSET_CAPID
Definition: PackerHelp.h:88
HcalElectronicsMap::lookup
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
Definition: HcalElectronicsMap.cc:70
QIE11HeaderSpec0
Definition: PackerHelp.h:119
QIE8HeaderSpec::MASK_FIBERCHAN
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:85
AMCHeaderSpec::OFFSET_P
static const int OFFSET_P
Definition: PackerHelp.h:71
AMC13HeaderSpec::OFFSET_UFOV
static const int OFFSET_UFOV
Definition: PackerHelp.h:48
QIE10DataFrame
Definition: QIE10DataFrame.h:11
UHTRpacker::OFFSET_ORN
static const int OFFSET_ORN
Definition: PackerHelp.h:333
HCalFED::fedData
std::vector< unsigned char > fedData
Definition: PackerHelp.h:183
CDFHeaderSpec::OFFSET_BX_ID
static const int OFFSET_BX_ID
Definition: PackerHelp.h:25
UHTRpacker::OFFSET_BCN
static const int OFFSET_BCN
Definition: PackerHelp.h:320
TPHeaderSpec::MASK_FLAVOR
static const int MASK_FLAVOR
Definition: PackerHelp.h:161
UHTRpacker::packTPheader
uint16_t packTPheader(const HcalTriggerPrimitiveSample &tpSample, int channelid)
Definition: PackerHelp.h:387
QIE11DataFrame
Definition: QIE11DataFrame.h:11
HCalFED
Definition: PackerHelp.h:179
AMCHeaderSpec::MASK_SLOT_ID
static const int MASK_SLOT_ID
Definition: PackerHelp.h:56
UHTRpacker
Definition: PackerHelp.h:310
QIE11DataFrame::flavor
constexpr int flavor() const
get the flavor of the frame
Definition: QIE11DataFrame.h:87
QIE11HeaderSpec0::OFFSET_FIBERCHAN
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:120
UHTRpacker::exist
bool exist(int uhtrIndex)
Definition: PackerHelp.h:346
UHTRpacker::OFFSET_DATA_LENGTH
static const int OFFSET_DATA_LENGTH
Definition: PackerHelp.h:318
AMCHeaderSpec::OFFSET_L
static const int OFFSET_L
Definition: PackerHelp.h:79
UHTRpacker::OFFSET_SLOT_ID
static const int OFFSET_SLOT_ID
Definition: PackerHelp.h:329
UHTRpacker::packQIE8sample
uint16_t packQIE8sample(const HcalQIESample &qieSample)
Definition: PackerHelp.h:371
AMCHeaderSpec::OFFSET_S
static const int OFFSET_S
Definition: PackerHelp.h:75
TPHeaderSpec::MASK_SOI_BIT
static const int MASK_SOI_BIT
Definition: PackerHelp.h:165
QIE10DataFrame::begin
constexpr edm::DataFrame::iterator begin()
iterators
Definition: QIE10DataFrame.h:81
UHTRpacker::MASK_FW_FLAVOR
static const int MASK_FW_FLAVOR
Definition: PackerHelp.h:336
UHTRpacker::newUHTR
uhtrData * newUHTR(int uhtrIndex, int ps=0, int orn=0, int bcn=0, uint64_t evt=0)
Definition: PackerHelp.h:443
QIE11HeaderSpec0::MASK_CAPID
static const int MASK_CAPID
Definition: PackerHelp.h:125
QIE8SampleSpec::OFFSET_CAPID
static const int OFFSET_CAPID
Definition: PackerHelp.h:171
HCalFED::AMCHeaders
std::vector< uint64_t > AMCHeaders
Definition: PackerHelp.h:184
QIE10HeaderSpec::MASK_MP
static const int MASK_MP
Definition: PackerHelp.h:106
AMC13HeaderSpec::MASK_NAMC
static const int MASK_NAMC
Definition: PackerHelp.h:45
QIE8SampleSpec::OFFSET_ADC
static const int OFFSET_ADC
Definition: PackerHelp.h:169
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
cond::uint64_t
unsigned long long uint64_t
Definition: Time.h:13
TPHeaderSpec::MASK_CHANID
static const int MASK_CHANID
Definition: PackerHelp.h:155
HCalFED::rawFEDHeader
FEDHeader * rawFEDHeader
Definition: PackerHelp.h:194
AMCHeaderSpec::OFFSET_V
static const int OFFSET_V
Definition: PackerHelp.h:69
HCalFED::setAMC13Header
void setAMC13Header()
Definition: PackerHelp.h:225
QIE8HeaderSpec::OFFSET_HEADER_BIT
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:94
AMCHeaderSpec::MASK_P
static const int MASK_P
Definition: PackerHelp.h:72
QIE10DataFrame::FLAG_WORDS
static const int FLAG_WORDS
Definition: QIE10DataFrame.h:15
AMC13HeaderSpec::OFFSET_RESERVED
static const int OFFSET_RESERVED
Definition: PackerHelp.h:42
QIE8HeaderSpec::MASK_FIBERERR
static const int MASK_FIBERERR
Definition: PackerHelp.h:91
HCalFED::OrbitNum
uint64_t OrbitNum
Definition: PackerHelp.h:188
HCalFED::uhtrData
std::vector< uint16_t > uhtrData
Definition: PackerHelp.h:181
FEDHeader
Definition: FEDHeader.h:14
TPHeaderSpec::MASK_LINK
static const int MASK_LINK
Definition: PackerHelp.h:153
QIE10DataFrame::HEADER_WORDS
static const int HEADER_WORDS
Definition: QIE10DataFrame.h:14
CDFHeaderSpec::MASK_LV1_ID
static const int MASK_LV1_ID
Definition: PackerHelp.h:28
FEDHeader.h
QIE10HeaderSpec::OFFSET_FIBERCHAN
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:101
AMC13HeaderSpec::FIXED_LSB
static const int FIXED_LSB
Definition: PackerHelp.h:39
HLT_FULL_cff.toAdd
toAdd
Definition: HLT_FULL_cff.py:52187
QIE10HeaderSpec::OFFSET_FIBER
static const int OFFSET_FIBER
Definition: PackerHelp.h:103
AMC13HeaderSpec::OFFSET_FIXED_LSB
static const int OFFSET_FIXED_LSB
Definition: PackerHelp.h:37
CDFHeaderSpec::MASK_FOV
static const int MASK_FOV
Definition: PackerHelp.h:22
QIE11DataFrame::FLAG_WORDS
static const int FLAG_WORDS
Definition: QIE11DataFrame.h:15
UHTRpacker::MASK_BCN
static const int MASK_BCN
Definition: PackerHelp.h:321
HCalFED::addAMCHeader
void addAMCHeader(uint64_t crate, uint64_t slot, uint64_t AMCsize, uint64_t presamples=10, uint64_t blockNum=0)
Definition: PackerHelp.h:237
AMC13HeaderSpec::MASK_UFOV
static const int MASK_UFOV
Definition: PackerHelp.h:49
QIE11HeaderSpec0::OFFSET_FIBERERR
static const int OFFSET_FIBERERR
Definition: PackerHelp.h:126
CDFHeaderSpec::MASK_FIXED_MSB
static const int MASK_FIXED_MSB
Definition: PackerHelp.h:32
QIE8HeaderSpec::MASK_HEADER_BIT
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:95
UHTRpacker::finalizeHeadTail
void finalizeHeadTail(uhtrData *uhtr, bool verbosity)
Definition: PackerHelp.h:483
UHTRpacker::addChannel
void addChannel(int uhtrIndex, edm::SortedCollection< HFDataFrame >::const_iterator &qiedf, const HcalElectronicsMap *readoutMap, bool premix, int verbosity=0)
Definition: PackerHelp.h:505