CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Static Public Attributes
UHTRpacker Class Reference

#include <PackerHelp.h>

Public Types

typedef std::vector< uint16_t > uhtrData
 
typedef std::map< int, uhtrDataUHTRMap
 

Public Member Functions

void addChannel (int uhtrIndex, edm::SortedCollection< HFDataFrame >::const_iterator &qiedf, const HcalElectronicsMap *readoutMap, bool premix, int verbosity=0)
 
void addChannel (int uhtrIndex, edm::SortedCollection< HBHEDataFrame >::const_iterator qiedf, const HcalElectronicsMap *readoutMap, bool premix, int verbosity=0)
 
void addChannel (int uhtrIndex, edm::SortedCollection< HcalTriggerPrimitiveDigi >::const_iterator qiedf, int channelid, int verbosity=0)
 
void addChannel (int uhtrIndex, QIE11DataFrame qiedf, const HcalElectronicsMap *readoutMap, int verbosity=0)
 
void addChannel (int uhtrIndex, QIE10DataFrame qiedf, const HcalElectronicsMap *readoutMap, int verbosity=0)
 
bool exist (int uhtrIndex)
 
void finalizeHeadTail (uhtrData *uhtr, bool verbosity)
 
uhtrDatanewUHTR (int uhtrIndex, int ps=0, int orn=0, int bcn=0, uint64_t evt=0)
 
uint16_t packQIE10header (const HcalElectronicsId &eid)
 
uint16_t packQIE11header (const QIE11DataFrame &qiedf, const HcalElectronicsId &eid)
 
uint16_t packQIE8header (const HcalQIESample &qieSample, const HcalElectronicsId &eid, int flavor)
 
uint16_t packQIE8sample (const HcalQIESample &qieSample)
 
uint16_t packTPheader (const HcalTriggerPrimitiveSample &tpSample, int channelid)
 
 UHTRpacker ()
 

Public Attributes

UHTRMap uhtrs
 

Static Public Attributes

static const int MASK_BCN = 0xFFF
 
static const int MASK_CRATE_ID = 0xFFFFFF
 
static const int MASK_DATA_LENGTH = 0xFFFFF
 
static const int MASK_EVENT_TYPE = 0xF
 
static const int MASK_EVN = 0xFFFFFF
 
static const int MASK_FILED_BY_AMC13 = 0xFF
 
static const int MASK_FW_FLAVOR = 0xFF
 
static const int MASK_FW_VERSION = 0xFFFF
 
static const int MASK_ORN = 0xFFFF
 
static const int MASK_PAYLOAD_FORMAT = 0xF
 
static const int MASK_PRESAMPLES = 0xF
 
static const int MASK_SLOT_ID = 0xF
 
static const int OFFSET_BCN = 20
 
static const int OFFSET_CRATE_ID = 0
 
static const int OFFSET_DATA_LENGTH = 0
 
static const int OFFSET_EVENT_TYPE = 40
 
static const int OFFSET_EVN = 32
 
static const int OFFSET_FILED_BY_AMC13 = 56
 
static const int OFFSET_FW_FLAVOR = 32
 
static const int OFFSET_FW_VERSION = 48
 
static const int OFFSET_ORN = 16
 
static const int OFFSET_PAYLOAD_FORMAT = 44
 
static const int OFFSET_PRESAMPLES = 12
 
static const int OFFSET_SLOT_ID = 8
 

Detailed Description

Definition at line 311 of file PackerHelp.h.

Member Typedef Documentation

◆ uhtrData

typedef std::vector<uint16_t> UHTRpacker::uhtrData

Definition at line 313 of file PackerHelp.h.

◆ UHTRMap

typedef std::map<int, uhtrData> UHTRpacker::UHTRMap

Definition at line 314 of file PackerHelp.h.

Constructor & Destructor Documentation

◆ UHTRpacker()

UHTRpacker::UHTRpacker ( )
inline

Definition at line 345 of file PackerHelp.h.

345 {}

Member Function Documentation

◆ addChannel() [1/5]

void UHTRpacker::addChannel ( int  uhtrIndex,
edm::SortedCollection< HFDataFrame >::const_iterator &  qiedf,
const HcalElectronicsMap readoutMap,
bool  premix,
int  verbosity = 0 
)
inline

Definition at line 506 of file PackerHelp.h.

References generateEDF::cont, runTauDisplay::eid, RecoTauValidation_cfi::header, HcalElectronicsMap::lookup(), packQIE8header(), packQIE8sample(), edm::SortedCollection< T, SORT >::size(), and uhtrs.

Referenced by HcalDigiToRawuHTR::produce().

510  {
511  if (qiedf->size() == 0)
512  return;
513  DetId detid = qiedf->id();
514  HcalElectronicsId eid(readoutMap->lookup(detid));
515  uint16_t header = packQIE8header(qiedf->sample(0), eid, premix ? 7 : 5);
516  uhtrs[uhtrIndex].push_back(header);
517  // loop over words in dataframe
518  if (premix) {
519  for (int iTS = 0; iTS < qiedf->size(); ++iTS) {
520  uhtrs[uhtrIndex].push_back(packQIE8sample(qiedf->sample(iTS)));
521  }
522  } else {
523  for (int iTS = 0; iTS < qiedf->size(); iTS += 2) {
524  uint16_t cont = 0;
525  int adc0 = qiedf->sample(iTS).adc();
526  int adc1 = qiedf->sample(iTS + 1).adc();
527  cont |= adc0 & 0xFF;
528  cont |= (adc1 & 0xFF) << 8;
529  uhtrs[uhtrIndex].push_back(cont);
530  }
531  } // end loop over dataframe words
532  };
uint16_t packQIE8header(const HcalQIESample &qieSample, const HcalElectronicsId &eid, int flavor)
Definition: PackerHelp.h:350
size_type size() const
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
UHTRMap uhtrs
Definition: PackerHelp.h:316
Definition: DetId.h:17
uint16_t packQIE8sample(const HcalQIESample &qieSample)
Definition: PackerHelp.h:372
Readout chain identification for Hcal.
cont
load Luminosity info ##
Definition: generateEDF.py:620

◆ addChannel() [2/5]

void UHTRpacker::addChannel ( int  uhtrIndex,
edm::SortedCollection< HBHEDataFrame >::const_iterator  qiedf,
const HcalElectronicsMap readoutMap,
bool  premix,
int  verbosity = 0 
)
inline

Definition at line 534 of file PackerHelp.h.

References generateEDF::cont, runTauDisplay::eid, RecoTauValidation_cfi::header, HcalElectronicsMap::lookup(), packQIE8header(), packQIE8sample(), edm::SortedCollection< T, SORT >::size(), and uhtrs.

538  {
539  if (qiedf->size() == 0)
540  return;
541  DetId detid = qiedf->id();
542  HcalElectronicsId eid(readoutMap->lookup(detid));
543  uint16_t header = packQIE8header(qiedf->sample(0), eid, premix ? 7 : 5);
544  uhtrs[uhtrIndex].push_back(header);
545  // loop over words in dataframe
546  if (premix) {
547  for (int iTS = 0; iTS < qiedf->size(); ++iTS) {
548  uhtrs[uhtrIndex].push_back(packQIE8sample(qiedf->sample(iTS)));
549  }
550  } else {
551  for (int iTS = 0; iTS < qiedf->size(); iTS += 2) {
552  uint16_t cont = 0;
553  int adc0 = qiedf->sample(iTS).adc();
554  int adc1 = qiedf->sample(iTS + 1).adc();
555  cont |= adc0 & 0xFF;
556  cont |= (adc1 & 0xFF) << 8;
557  uhtrs[uhtrIndex].push_back(cont);
558  }
559  } // end loop over dataframe words
560  };
uint16_t packQIE8header(const HcalQIESample &qieSample, const HcalElectronicsId &eid, int flavor)
Definition: PackerHelp.h:350
size_type size() const
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
UHTRMap uhtrs
Definition: PackerHelp.h:316
Definition: DetId.h:17
uint16_t packQIE8sample(const HcalQIESample &qieSample)
Definition: PackerHelp.h:372
Readout chain identification for Hcal.
cont
load Luminosity info ##
Definition: generateEDF.py:620

◆ addChannel() [3/5]

void UHTRpacker::addChannel ( int  uhtrIndex,
edm::SortedCollection< HcalTriggerPrimitiveDigi >::const_iterator  qiedf,
int  channelid,
int  verbosity = 0 
)
inline

Definition at line 562 of file PackerHelp.h.

References RecoTauValidation_cfi::header, TPHeaderSpec::MASK_SOI_BIT, TPHeaderSpec::OFFSET_SOI_BIT, packTPheader(), edm::SortedCollection< T, SORT >::size(), and uhtrs.

565  {
566  if (qiedf->size() == 0)
567  return;
568  uint16_t header = packTPheader(qiedf->sample(0), channelid);
569  uhtrs[uhtrIndex].push_back(header);
570  // loop over words in dataframe
571  for (int iTS = 0; iTS < qiedf->size(); iTS++) {
572  // push data into uhtr data container
573  auto raw = qiedf->sample(iTS).raw();
574  // Add SOI information
575  if (iTS == qiedf->presamples())
577  uhtrs[uhtrIndex].push_back(raw);
578  } // end loop over dataframe words
579  };
size_type size() const
static const int MASK_SOI_BIT
Definition: PackerHelp.h:166
uint16_t packTPheader(const HcalTriggerPrimitiveSample &tpSample, int channelid)
Definition: PackerHelp.h:388
UHTRMap uhtrs
Definition: PackerHelp.h:316
static const int OFFSET_SOI_BIT
Definition: PackerHelp.h:165

◆ addChannel() [4/5]

void UHTRpacker::addChannel ( int  uhtrIndex,
QIE11DataFrame  qiedf,
const HcalElectronicsMap readoutMap,
int  verbosity = 0 
)
inline

Definition at line 581 of file PackerHelp.h.

References QIE11DataFrame::begin(), QIE11DataFrame::detid(), runTauDisplay::eid, QIE11DataFrame::end(), QIE11DataFrame::FLAG_WORDS, RecoTauValidation_cfi::header, QIE11DataFrame::HEADER_WORDS, HcalElectronicsMap::lookup(), packQIE11header(), and uhtrs.

581  {
582  DetId detid = qiedf.detid();
583  HcalElectronicsId eid(readoutMap->lookup(detid));
584  // loop over words in dataframe
585  for (edm::DataFrame::iterator dfi = qiedf.begin(); dfi != qiedf.end(); ++dfi) {
586  if (dfi >= qiedf.end() - QIE11DataFrame::FLAG_WORDS) {
587  continue;
588  }
589  if (dfi == qiedf.begin() && QIE11DataFrame::HEADER_WORDS == 1) {
590  uint16_t header = packQIE11header(qiedf, eid);
591  uhtrs[uhtrIndex].push_back(header);
592  continue;
593  }
594  // push data into uhtr data container
595  uhtrs[uhtrIndex].push_back(dfi[0]);
596  } // end loop over dataframe words
597  };
static const int FLAG_WORDS
static const int HEADER_WORDS
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
constexpr DetId detid() const
Get the detector id.
uint16_t packQIE11header(const QIE11DataFrame &qiedf, const HcalElectronicsId &eid)
Definition: PackerHelp.h:417
constexpr edm::DataFrame::iterator end()
UHTRMap uhtrs
Definition: PackerHelp.h:316
Definition: DetId.h:17
constexpr edm::DataFrame::iterator begin()
iterators
data_type * iterator
Definition: DataFrame.h:20
Readout chain identification for Hcal.

◆ addChannel() [5/5]

void UHTRpacker::addChannel ( int  uhtrIndex,
QIE10DataFrame  qiedf,
const HcalElectronicsMap readoutMap,
int  verbosity = 0 
)
inline

Definition at line 599 of file PackerHelp.h.

References QIE10DataFrame::begin(), QIE10DataFrame::detid(), runTauDisplay::eid, QIE10DataFrame::end(), QIE10DataFrame::FLAG_WORDS, RecoTauValidation_cfi::header, QIE10DataFrame::HEADER_WORDS, HcalElectronicsMap::lookup(), packQIE10header(), and uhtrs.

599  {
600  DetId detid = qiedf.detid();
601  HcalElectronicsId eid(readoutMap->lookup(detid));
602  // loop over words in dataframe
603  for (edm::DataFrame::iterator dfi = qiedf.begin(); dfi != qiedf.end(); ++dfi) {
604  if (dfi >= qiedf.end() - QIE10DataFrame::FLAG_WORDS) {
605  continue;
606  }
607  if (dfi == qiedf.begin() && QIE10DataFrame::HEADER_WORDS == 1) {
608  uint16_t header = packQIE10header(eid);
609  uhtrs[uhtrIndex].push_back(header);
610  continue;
611  }
612  // push data into uhtr data container
613  uhtrs[uhtrIndex].push_back(dfi[0]);
614  } // end loop over dataframe words
615  };
constexpr DetId detid() const
Get the detector id.
constexpr edm::DataFrame::iterator end()
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
constexpr edm::DataFrame::iterator begin()
iterators
uint16_t packQIE10header(const HcalElectronicsId &eid)
Definition: PackerHelp.h:400
UHTRMap uhtrs
Definition: PackerHelp.h:316
Definition: DetId.h:17
static const int FLAG_WORDS
static const int HEADER_WORDS
data_type * iterator
Definition: DataFrame.h:20
Readout chain identification for Hcal.

◆ exist()

bool UHTRpacker::exist ( int  uhtrIndex)
inline

Definition at line 347 of file PackerHelp.h.

References uhtrs.

Referenced by HcalDigiToRawuHTR::produce().

347 { return uhtrs.count(uhtrIndex) != 0; };
UHTRMap uhtrs
Definition: PackerHelp.h:316

◆ finalizeHeadTail()

void UHTRpacker::finalizeHeadTail ( uhtrData uhtr,
bool  verbosity 
)
inline

Definition at line 484 of file PackerHelp.h.

References HLT_2024v10_cff::toAdd.

Referenced by HcalDigiToRawuHTR::produce().

484  {
485  uint64_t uhtr_size = uhtr->size() - 8;
486 
487  // adjust the size bits
488  uhtr->at(0) = uhtr_size & 0xFFFF;
489  uhtr->at(1) |= (uhtr_size >> 16) & 0xF;
490 
491  unsigned int toAdd = 4 - uhtr->size() % 4;
492  for (unsigned int ia = 0; ia < toAdd; ia++) {
493  uhtr->push_back(0xD07F);
494  }
495 
496  // add trailer
497  uhtr->push_back(uhtr_size & 0xFFFF);
498  uhtr->push_back((uhtr_size >> 16) & 0xF);
499  // this is ignoring the event number... I am not sure what this should be
500 
501  // adding some blank stuff for the CRC bits
502  uhtr->push_back(0);
503  uhtr->push_back(0);
504  };
unsigned long long uint64_t
Definition: Time.h:13

◆ newUHTR()

uhtrData* UHTRpacker::newUHTR ( int  uhtrIndex,
int  ps = 0,
int  orn = 0,
int  bcn = 0,
uint64_t  evt = 0 
)
inline

Definition at line 444 of file PackerHelp.h.

References QIE11Task_cfi::eventType, amcDumpToRaw_cfi::fwVersion, mps_fire::i, MASK_BCN, MASK_CRATE_ID, MASK_DATA_LENGTH, MASK_EVENT_TYPE, MASK_EVN, MASK_FILED_BY_AMC13, MASK_FW_FLAVOR, MASK_FW_VERSION, MASK_ORN, MASK_PAYLOAD_FORMAT, MASK_PRESAMPLES, MASK_SLOT_ID, SiStripPI::max, OFFSET_BCN, OFFSET_CRATE_ID, OFFSET_DATA_LENGTH, OFFSET_EVENT_TYPE, OFFSET_EVN, OFFSET_FILED_BY_AMC13, OFFSET_FW_FLAVOR, OFFSET_FW_VERSION, OFFSET_ORN, OFFSET_PAYLOAD_FORMAT, OFFSET_PRESAMPLES, OFFSET_SLOT_ID, hcalTTPDigis_cfi::presamples, and uhtrs.

Referenced by HcalDigiToRawuHTR::produce().

444  {
445  // initialize vector of 16-bit words
446  uhtrs[uhtrIndex] = uhtrData(8);
447  // build header -- some information will be updated at the end
448 
449  uint64_t presamples = std::max(ps, 0);
450  uint64_t uhtrCrate = uhtrIndex & 0xFF;
451  uint64_t uhtrSlot = (uhtrIndex & 0xF00) >> 8;
452  // From Jeremy:
453  // Set the firmware to zero, the firmware flavor to 0, the payload format to 1, and the event type to 1.
454  uint64_t fwFlavor = 0;
455  uint64_t eventType = 1;
456  uint64_t payloadFormat = 1;
457  uint64_t fwVersion = 0;
458 
459  uint64_t uhtrHeader1 = 0;
460  uhtrHeader1 |= (uint64_t(0x0) & MASK_DATA_LENGTH) << OFFSET_DATA_LENGTH;
461  uhtrHeader1 |= (bcn & MASK_BCN) << OFFSET_BCN;
462  uhtrHeader1 |= (evt & MASK_EVN) << OFFSET_EVN;
463  uhtrHeader1 |= (uint64_t(0x0) & MASK_FILED_BY_AMC13) << OFFSET_FILED_BY_AMC13;
464 
465  uint64_t uhtrHeader2 = 0;
466  uhtrHeader2 |= (uhtrCrate & MASK_CRATE_ID) << OFFSET_CRATE_ID;
467  uhtrHeader2 |= (uhtrSlot & MASK_SLOT_ID) << OFFSET_SLOT_ID;
468  uhtrHeader2 |= (presamples & MASK_PRESAMPLES) << OFFSET_PRESAMPLES;
469  uhtrHeader2 |= (orn & MASK_ORN) << OFFSET_ORN;
470  uhtrHeader2 |= (fwFlavor & MASK_FW_FLAVOR) << OFFSET_FW_FLAVOR;
471  uhtrHeader2 |= (eventType & MASK_EVENT_TYPE) << OFFSET_EVENT_TYPE;
472  uhtrHeader2 |= (payloadFormat & MASK_PAYLOAD_FORMAT) << OFFSET_PAYLOAD_FORMAT;
473  uhtrHeader2 |= (fwVersion & MASK_FW_VERSION) << OFFSET_FW_VERSION;
474 
475  // push header into vector of 16-bit words
476  for (unsigned int i = 0; i < 4; ++i) {
477  uhtrs[uhtrIndex][i] = (uhtrHeader1 >> (i * 16)) & 0xFFFF;
478  uhtrs[uhtrIndex][i + 4] = (uhtrHeader2 >> (i * 16)) & 0xFFFF;
479  }
480 
481  return &(uhtrs[uhtrIndex]);
482  };
static const int OFFSET_PRESAMPLES
Definition: PackerHelp.h:332
static const int OFFSET_ORN
Definition: PackerHelp.h:334
static const int OFFSET_PAYLOAD_FORMAT
Definition: PackerHelp.h:340
static const int MASK_ORN
Definition: PackerHelp.h:335
static const int OFFSET_EVENT_TYPE
Definition: PackerHelp.h:338
static const int MASK_SLOT_ID
Definition: PackerHelp.h:331
static const int OFFSET_FILED_BY_AMC13
Definition: PackerHelp.h:325
static const int MASK_FW_VERSION
Definition: PackerHelp.h:343
static const int OFFSET_CRATE_ID
Definition: PackerHelp.h:328
static const int MASK_PRESAMPLES
Definition: PackerHelp.h:333
std::vector< uint16_t > uhtrData
Definition: PackerHelp.h:313
static const int OFFSET_FW_FLAVOR
Definition: PackerHelp.h:336
static const int MASK_PAYLOAD_FORMAT
Definition: PackerHelp.h:341
static const int MASK_EVN
Definition: PackerHelp.h:324
static const int OFFSET_FW_VERSION
Definition: PackerHelp.h:342
UHTRMap uhtrs
Definition: PackerHelp.h:316
unsigned long long uint64_t
Definition: Time.h:13
static const int MASK_BCN
Definition: PackerHelp.h:322
static const int OFFSET_SLOT_ID
Definition: PackerHelp.h:330
static const int MASK_FILED_BY_AMC13
Definition: PackerHelp.h:326
static const int OFFSET_EVN
Definition: PackerHelp.h:323
static const int OFFSET_BCN
Definition: PackerHelp.h:321
static const int OFFSET_DATA_LENGTH
Definition: PackerHelp.h:319
static const int MASK_EVENT_TYPE
Definition: PackerHelp.h:339
static const int MASK_FW_FLAVOR
Definition: PackerHelp.h:337
static const int MASK_CRATE_ID
Definition: PackerHelp.h:329
static const int MASK_DATA_LENGTH
Definition: PackerHelp.h:320

◆ packQIE10header()

uint16_t UHTRpacker::packQIE10header ( const HcalElectronicsId eid)
inline

Definition at line 400 of file PackerHelp.h.

References runTauDisplay::eid, FCDTask_cfi::fiber, RecoTauValidation_cfi::header, QIE10HeaderSpec::MASK_FIBER, QIE10HeaderSpec::MASK_FIBERCHAN, QIE10HeaderSpec::MASK_FLAVOR, QIE10HeaderSpec::MASK_HEADER_BIT, QIE10HeaderSpec::MASK_LE, QIE10HeaderSpec::MASK_MP, QIE10HeaderSpec::MASK_RESERV, QIE10HeaderSpec::OFFSET_FIBER, QIE10HeaderSpec::OFFSET_FIBERCHAN, QIE10HeaderSpec::OFFSET_FLAVOR, QIE10HeaderSpec::OFFSET_HEADER_BIT, QIE10HeaderSpec::OFFSET_LE, QIE10HeaderSpec::OFFSET_MP, and QIE10HeaderSpec::OFFSET_RESERV.

Referenced by addChannel().

400  {
401  uint16_t header = 0;
402 
403  int fiber = eid.fiberIndex();
404  int fiberchan = eid.fiberChanId();
405 
413 
414  return header;
415  }
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:112
static const int MASK_RESERV
Definition: PackerHelp.h:109
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:114
static const int MASK_MP
Definition: PackerHelp.h:107
static const int MASK_FIBER
Definition: PackerHelp.h:105
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:103
static const int OFFSET_LE
Definition: PackerHelp.h:110
static const int OFFSET_RESERV
Definition: PackerHelp.h:108
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:115
static const int MASK_LE
Definition: PackerHelp.h:111
static const int OFFSET_MP
Definition: PackerHelp.h:106
static const int MASK_FLAVOR
Definition: PackerHelp.h:113
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:102
static const int OFFSET_FIBER
Definition: PackerHelp.h:104

◆ packQIE11header()

uint16_t UHTRpacker::packQIE11header ( const QIE11DataFrame qiedf,
const HcalElectronicsId eid 
)
inline

Definition at line 417 of file PackerHelp.h.

References runTauDisplay::eid, FCDTask_cfi::fiber, QIE11DataFrame::flavor(), RecoTauValidation_cfi::header, QIE11HeaderSpec0::MASK_CAPID, QIE11HeaderSpec0::MASK_FIBER, QIE11HeaderSpec3::MASK_FIBER, QIE11HeaderSpec0::MASK_FIBERCHAN, QIE11HeaderSpec3::MASK_FIBERCHAN, QIE11HeaderSpec0::MASK_FIBERERR, QIE11HeaderSpec0::MASK_FLAVOR, QIE11HeaderSpec3::MASK_FLAVOR, QIE11HeaderSpec0::MASK_HEADER_BIT, QIE11HeaderSpec3::MASK_HEADER_BIT, QIE11HeaderSpec3::MASK_LINKERROR, QIE11HeaderSpec3::MASK_MP, QIE11HeaderSpec0::OFFSET_CAPID, QIE11HeaderSpec0::OFFSET_FIBER, QIE11HeaderSpec3::OFFSET_FIBER, QIE11HeaderSpec0::OFFSET_FIBERCHAN, QIE11HeaderSpec3::OFFSET_FIBERCHAN, QIE11HeaderSpec0::OFFSET_FIBERERR, QIE11HeaderSpec0::OFFSET_FLAVOR, QIE11HeaderSpec3::OFFSET_FLAVOR, QIE11HeaderSpec0::OFFSET_HEADER_BIT, QIE11HeaderSpec3::OFFSET_HEADER_BIT, QIE11HeaderSpec3::OFFSET_LINKERROR, and QIE11HeaderSpec3::OFFSET_MP.

Referenced by addChannel().

417  {
418  uint16_t header = 0;
419 
420  int fiber = eid.fiberIndex();
421  int fiberchan = eid.fiberChanId();
422  int flavor = qiedf[0].flavor();
423 
424  if (flavor == 3) {
431  } else {
432  int capid0 = qiedf[0].capid();
439  }
440 
441  return header;
442  }
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:132
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:146
static const int MASK_MP
Definition: PackerHelp.h:141
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:131
static const int MASK_LINKERROR
Definition: PackerHelp.h:143
static const int OFFSET_CAPID
Definition: PackerHelp.h:125
constexpr int flavor() const
get the flavor of the frame
static const int OFFSET_MP
Definition: PackerHelp.h:140
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:137
static const int OFFSET_LINKERROR
Definition: PackerHelp.h:142
static const int MASK_FIBERERR
Definition: PackerHelp.h:128
static const int MASK_CAPID
Definition: PackerHelp.h:126
static const int OFFSET_FIBER
Definition: PackerHelp.h:138
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:121
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:129
static const int MASK_FIBER
Definition: PackerHelp.h:139
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:122
static const int OFFSET_FIBERERR
Definition: PackerHelp.h:127
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:147
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:144
static const int MASK_FLAVOR
Definition: PackerHelp.h:130
static const int MASK_FLAVOR
Definition: PackerHelp.h:145
static const int MASK_FIBER
Definition: PackerHelp.h:124
static const int OFFSET_FIBER
Definition: PackerHelp.h:123
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:136

◆ packQIE8header()

uint16_t UHTRpacker::packQIE8header ( const HcalQIESample qieSample,
const HcalElectronicsId eid,
int  flavor 
)
inline

Definition at line 350 of file PackerHelp.h.

References HcalQIESample::capid(), runTauDisplay::eid, HcalQIESample::er(), FCDTask_cfi::fiber, RecoTauValidation_cfi::header, QIE8HeaderSpec::MASK_CAPID, QIE8HeaderSpec::MASK_FIBER, QIE8HeaderSpec::MASK_FIBERCHAN, QIE8HeaderSpec::MASK_FIBERERR, QIE8HeaderSpec::MASK_FLAVOR, QIE8HeaderSpec::MASK_HEADER_BIT, QIE8HeaderSpec::MASK_TECHNICAL_DATA_TYPE, QIE8HeaderSpec::OFFSET_CAPID, QIE8HeaderSpec::OFFSET_FIBER, QIE8HeaderSpec::OFFSET_FIBERCHAN, QIE8HeaderSpec::OFFSET_FIBERERR, QIE8HeaderSpec::OFFSET_FLAVOR, QIE8HeaderSpec::OFFSET_HEADER_BIT, and QIE8HeaderSpec::OFFSET_TECHNICAL_DATA_TYPE.

Referenced by addChannel().

350  {
351  uint16_t header = 0;
352 
353  int fiber = eid.fiberIndex() + 1;
354  int fiberchan = eid.fiberChanId();
355 
358  if (flavor == 7) {
360  } else {
361  int fiberErr = qieSample.er();
362  int capid0 = qieSample.capid();
365  }
368 
369  return header;
370  }
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:96
static const int MASK_FIBER
Definition: PackerHelp.h:88
static const int OFFSET_FIBER
Definition: PackerHelp.h:87
static const int MASK_FIBERERR
Definition: PackerHelp.h:92
static const int MASK_FLAVOR
Definition: PackerHelp.h:94
static const int MASK_TECHNICAL_DATA_TYPE
Definition: PackerHelp.h:98
static const int MASK_CAPID
Definition: PackerHelp.h:90
static const int OFFSET_TECHNICAL_DATA_TYPE
Definition: PackerHelp.h:97
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:93
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:95
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:85
static const int OFFSET_CAPID
Definition: PackerHelp.h:89
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47
constexpr bool er() const
is the error bit set?
Definition: HcalQIESample.h:51
static const int OFFSET_FIBERERR
Definition: PackerHelp.h:91
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:86

◆ packQIE8sample()

uint16_t UHTRpacker::packQIE8sample ( const HcalQIESample qieSample)
inline

Definition at line 372 of file PackerHelp.h.

References gpuClustering::adc, HcalQIESample::adc(), HcalQIESample::capid(), HcalQIESample::dv(), HcalQIESample::er(), QIE8SampleSpec::MASK_ADC, QIE8SampleSpec::MASK_CAPID, QIE8SampleSpec::MASK_DV, QIE8SampleSpec::MASK_ER, QIE8SampleSpec::OFFSET_ADC, QIE8SampleSpec::OFFSET_CAPID, QIE8SampleSpec::OFFSET_DV, QIE8SampleSpec::OFFSET_ER, and ecalGpuTask_cfi::sample.

Referenced by addChannel().

372  {
373  uint16_t sample = 0;
374 
375  int adc = qieSample.adc();
376  int capid = qieSample.capid();
377  int dv = qieSample.dv();
378  int er = qieSample.er();
379 
384 
385  return sample;
386  }
static const int OFFSET_CAPID
Definition: PackerHelp.h:172
static const int MASK_DV
Definition: PackerHelp.h:175
constexpr bool dv() const
is the Data Valid bit set?
Definition: HcalQIESample.h:49
static const int OFFSET_ADC
Definition: PackerHelp.h:170
static const int MASK_ER
Definition: PackerHelp.h:177
static const int OFFSET_DV
Definition: PackerHelp.h:174
static const int MASK_CAPID
Definition: PackerHelp.h:173
static const int OFFSET_ER
Definition: PackerHelp.h:176
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:47
constexpr bool er() const
is the error bit set?
Definition: HcalQIESample.h:51
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:43
uint16_t *__restrict__ uint16_t const *__restrict__ adc
static const int MASK_ADC
Definition: PackerHelp.h:171

◆ packTPheader()

uint16_t UHTRpacker::packTPheader ( const HcalTriggerPrimitiveSample tpSample,
int  channelid 
)
inline

Definition at line 388 of file PackerHelp.h.

References RecoTauValidation_cfi::header, TPHeaderSpec::MASK_CHANID, TPHeaderSpec::MASK_FLAVOR, TPHeaderSpec::MASK_HEADER_BIT, TPHeaderSpec::MASK_RESV, TPHeaderSpec::MASK_TPERR, TPHeaderSpec::OFFSET_CHANID, TPHeaderSpec::OFFSET_FLAVOR, TPHeaderSpec::OFFSET_HEADER_BIT, TPHeaderSpec::OFFSET_RESV, and TPHeaderSpec::OFFSET_TPERR.

Referenced by addChannel().

388  {
389  uint16_t header = 0;
390 
396 
397  return header;
398  }
static const int OFFSET_TPERR
Definition: PackerHelp.h:159
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:161
static const int MASK_TPERR
Definition: PackerHelp.h:160
static const int OFFSET_CHANID
Definition: PackerHelp.h:155
static const int MASK_FLAVOR
Definition: PackerHelp.h:162
static const int MASK_CHANID
Definition: PackerHelp.h:156
static const int OFFSET_RESV
Definition: PackerHelp.h:157
static const int MASK_RESV
Definition: PackerHelp.h:158
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:163
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:164

Member Data Documentation

◆ MASK_BCN

const int UHTRpacker::MASK_BCN = 0xFFF
static

Definition at line 322 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_CRATE_ID

const int UHTRpacker::MASK_CRATE_ID = 0xFFFFFF
static

Definition at line 329 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_DATA_LENGTH

const int UHTRpacker::MASK_DATA_LENGTH = 0xFFFFF
static

Definition at line 320 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_EVENT_TYPE

const int UHTRpacker::MASK_EVENT_TYPE = 0xF
static

Definition at line 339 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_EVN

const int UHTRpacker::MASK_EVN = 0xFFFFFF
static

Definition at line 324 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_FILED_BY_AMC13

const int UHTRpacker::MASK_FILED_BY_AMC13 = 0xFF
static

Definition at line 326 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_FW_FLAVOR

const int UHTRpacker::MASK_FW_FLAVOR = 0xFF
static

Definition at line 337 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_FW_VERSION

const int UHTRpacker::MASK_FW_VERSION = 0xFFFF
static

Definition at line 343 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_ORN

const int UHTRpacker::MASK_ORN = 0xFFFF
static

Definition at line 335 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_PAYLOAD_FORMAT

const int UHTRpacker::MASK_PAYLOAD_FORMAT = 0xF
static

Definition at line 341 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_PRESAMPLES

const int UHTRpacker::MASK_PRESAMPLES = 0xF
static

Definition at line 333 of file PackerHelp.h.

Referenced by newUHTR().

◆ MASK_SLOT_ID

const int UHTRpacker::MASK_SLOT_ID = 0xF
static

Definition at line 331 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_BCN

const int UHTRpacker::OFFSET_BCN = 20
static

Definition at line 321 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_CRATE_ID

const int UHTRpacker::OFFSET_CRATE_ID = 0
static

Definition at line 328 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_DATA_LENGTH

const int UHTRpacker::OFFSET_DATA_LENGTH = 0
static

Definition at line 319 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_EVENT_TYPE

const int UHTRpacker::OFFSET_EVENT_TYPE = 40
static

Definition at line 338 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_EVN

const int UHTRpacker::OFFSET_EVN = 32
static

Definition at line 323 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_FILED_BY_AMC13

const int UHTRpacker::OFFSET_FILED_BY_AMC13 = 56
static

Definition at line 325 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_FW_FLAVOR

const int UHTRpacker::OFFSET_FW_FLAVOR = 32
static

Definition at line 336 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_FW_VERSION

const int UHTRpacker::OFFSET_FW_VERSION = 48
static

Definition at line 342 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_ORN

const int UHTRpacker::OFFSET_ORN = 16
static

Definition at line 334 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_PAYLOAD_FORMAT

const int UHTRpacker::OFFSET_PAYLOAD_FORMAT = 44
static

Definition at line 340 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_PRESAMPLES

const int UHTRpacker::OFFSET_PRESAMPLES = 12
static

Definition at line 332 of file PackerHelp.h.

Referenced by newUHTR().

◆ OFFSET_SLOT_ID

const int UHTRpacker::OFFSET_SLOT_ID = 8
static

Definition at line 330 of file PackerHelp.h.

Referenced by newUHTR().

◆ uhtrs

UHTRMap UHTRpacker::uhtrs

Definition at line 316 of file PackerHelp.h.

Referenced by addChannel(), exist(), newUHTR(), and HcalDigiToRawuHTR::produce().