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 307 of file PackerHelp.h.

Member Typedef Documentation

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

Definition at line 311 of file PackerHelp.h.

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

Definition at line 312 of file PackerHelp.h.

Constructor & Destructor Documentation

UHTRpacker::UHTRpacker ( )
inline

Definition at line 343 of file PackerHelp.h.

343 {}

Member Function Documentation

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

Definition at line 499 of file PackerHelp.h.

References runTauDisplay::eid, RecoTauValidation_cfi::header, HcalElectronicsMap::lookup(), edm::SortedCollection< T, SORT >::push_back(), and edm::SortedCollection< T, SORT >::size().

Referenced by HcalDigiToRawuHTR::produce().

499  {
500  if( qiedf->size() == 0 ) return;
501  DetId detid = qiedf->id();
502  HcalElectronicsId eid(readoutMap->lookup(detid));
503  uint16_t header = packQIE8header(qiedf->sample(0), eid, premix ? 7 : 5);
504  uhtrs[uhtrIndex].push_back(header);
505  // loop over words in dataframe
506  if(premix){
507  for(int iTS = 0; iTS < qiedf->size(); ++iTS){
508  uhtrs[uhtrIndex].push_back(packQIE8sample(qiedf->sample(iTS)));
509  }
510  }
511  else {
512  for(int iTS = 0; iTS < qiedf->size(); iTS +=2 ){
513  uint16_t cont =0;
514  int adc0 = qiedf->sample(iTS).adc();
515  int adc1 = qiedf->sample(iTS+1).adc();
516  cont |= adc0&0xFF;
517  cont |= (adc1&0xFF)<<8;
518  uhtrs[uhtrIndex].push_back(cont);
519  }
520  }// end loop over dataframe words
521  };
uint16_t packQIE8header(const HcalQIESample &qieSample, const HcalElectronicsId &eid, int flavor)
Definition: PackerHelp.h:350
UHTRMap uhtrs
Definition: PackerHelp.h:314
Definition: DetId.h:18
uint16_t packQIE8sample(const HcalQIESample &qieSample)
Definition: PackerHelp.h:373
size_type size() const
Readout chain identification for Hcal.
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void UHTRpacker::addChannel ( int  uhtrIndex,
edm::SortedCollection< HBHEDataFrame >::const_iterator  qiedf,
const HcalElectronicsMap readoutMap,
bool  premix,
int  verbosity = 0 
)
inline

Definition at line 523 of file PackerHelp.h.

References runTauDisplay::eid, RecoTauValidation_cfi::header, HcalElectronicsMap::lookup(), edm::SortedCollection< T, SORT >::push_back(), and edm::SortedCollection< T, SORT >::size().

523  {
524  if( qiedf->size() == 0 ) return;
525  DetId detid = qiedf->id();
526  HcalElectronicsId eid(readoutMap->lookup(detid));
527  uint16_t header = packQIE8header(qiedf->sample(0), eid, premix ? 7 : 5);
528  uhtrs[uhtrIndex].push_back(header);
529  // loop over words in dataframe
530  if(premix){
531  for(int iTS = 0; iTS < qiedf->size(); ++iTS){
532  uhtrs[uhtrIndex].push_back(packQIE8sample(qiedf->sample(iTS)));
533  }
534  }
535  else {
536  for(int iTS = 0; iTS < qiedf->size(); iTS +=2 ){
537  uint16_t cont =0;
538  int adc0 = qiedf->sample(iTS).adc();
539  int adc1 = qiedf->sample(iTS+1).adc();
540  cont |= adc0&0xFF;
541  cont |= (adc1&0xFF)<<8;
542  uhtrs[uhtrIndex].push_back(cont);
543  }
544  }// end loop over dataframe words
545  };
uint16_t packQIE8header(const HcalQIESample &qieSample, const HcalElectronicsId &eid, int flavor)
Definition: PackerHelp.h:350
UHTRMap uhtrs
Definition: PackerHelp.h:314
Definition: DetId.h:18
uint16_t packQIE8sample(const HcalQIESample &qieSample)
Definition: PackerHelp.h:373
size_type size() const
Readout chain identification for Hcal.
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void UHTRpacker::addChannel ( int  uhtrIndex,
edm::SortedCollection< HcalTriggerPrimitiveDigi >::const_iterator  qiedf,
int  channelid,
int  verbosity = 0 
)
inline

Definition at line 547 of file PackerHelp.h.

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

547  {
548  if( qiedf->size() ==0 ) return;
549  uint16_t header = packTPheader(qiedf->sample(0), channelid);
550  uhtrs[uhtrIndex].push_back(header);
551  // loop over words in dataframe
552  for( int iTS = 0 ; iTS < qiedf->size() ; iTS++ ){
553  // push data into uhtr data container
554  auto raw = qiedf->sample(iTS).raw();
555  // Add SOI information
556  if (iTS == qiedf->presamples())
558  uhtrs[uhtrIndex].push_back(raw);
559  }// end loop over dataframe words
560  };
static const int MASK_SOI_BIT
Definition: PackerHelp.h:148
uint16_t packTPheader(const HcalTriggerPrimitiveSample &tpSample, int channelid)
Definition: PackerHelp.h:389
UHTRMap uhtrs
Definition: PackerHelp.h:314
size_type size() const
static const int OFFSET_SOI_BIT
Definition: PackerHelp.h:147
void UHTRpacker::addChannel ( int  uhtrIndex,
QIE11DataFrame  qiedf,
const HcalElectronicsMap readoutMap,
int  verbosity = 0 
)
inline

Definition at line 562 of file PackerHelp.h.

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

562  {
563  DetId detid = qiedf.detid();
564  HcalElectronicsId eid(readoutMap->lookup(detid));
565  // loop over words in dataframe
566  for(edm::DataFrame::iterator dfi=qiedf.begin() ; dfi!=qiedf.end(); ++dfi){
567  if( dfi >= qiedf.end()-QIE11DataFrame::FLAG_WORDS ){
568  continue;
569  }
570  if( dfi == qiedf.begin() && QIE11DataFrame::HEADER_WORDS == 1 ){
571  uint16_t header = packQIE11header(qiedf, eid);
572  uhtrs[uhtrIndex].push_back(header);
573  continue;
574  }
575  // push data into uhtr data container
576  uhtrs[uhtrIndex].push_back(dfi[0]);
577  }// end loop over dataframe words
578  };
DetId detid() const
Get the detector id.
static const int FLAG_WORDS
static const int HEADER_WORDS
uint16_t packQIE11header(const QIE11DataFrame &qiedf, const HcalElectronicsId &eid)
Definition: PackerHelp.h:418
UHTRMap uhtrs
Definition: PackerHelp.h:314
Definition: DetId.h:18
data_type * iterator
Definition: DataFrame.h:21
edm::DataFrame::iterator begin()
iterators
edm::DataFrame::iterator end()
Readout chain identification for Hcal.
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void UHTRpacker::addChannel ( int  uhtrIndex,
QIE10DataFrame  qiedf,
const HcalElectronicsMap readoutMap,
int  verbosity = 0 
)
inline

Definition at line 580 of file PackerHelp.h.

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

580  {
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()-QIE10DataFrame::FLAG_WORDS ){
586  continue;
587  }
588  if( dfi == qiedf.begin() && QIE10DataFrame::HEADER_WORDS == 1 ){
589  uint16_t header = packQIE10header(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  };
edm::DataFrame::iterator begin()
iterators
uint16_t packQIE10header(const HcalElectronicsId &eid)
Definition: PackerHelp.h:401
DetId detid() const
Get the detector id.
edm::DataFrame::iterator end()
UHTRMap uhtrs
Definition: PackerHelp.h:314
Definition: DetId.h:18
static const int FLAG_WORDS
static const int HEADER_WORDS
data_type * iterator
Definition: DataFrame.h:21
Readout chain identification for Hcal.
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
bool UHTRpacker::exist ( int  uhtrIndex)
inline

Definition at line 345 of file PackerHelp.h.

Referenced by HcalDigiToRawuHTR::produce().

345  {
346  return uhtrs.count(uhtrIndex) != 0 ;
347  };
UHTRMap uhtrs
Definition: PackerHelp.h:314
void UHTRpacker::finalizeHeadTail ( uhtrData uhtr,
bool  verbosity 
)
inline

Definition at line 476 of file PackerHelp.h.

References pfDeepCMVAJetTags_cfi::toAdd.

Referenced by HcalDigiToRawuHTR::produce().

476  {
477 
478  uint64_t uhtr_size = uhtr->size()-8;
479 
480  // adjust the size bits
481  uhtr->at(0) = uhtr_size&0xFFFF ;
482  uhtr->at(1) |= (uhtr_size>>16)&0xF ;
483 
484  unsigned int toAdd = 4-uhtr->size()%4;
485  for(unsigned int ia=0; ia<toAdd; ia++){
486  uhtr->push_back(0xD07F);
487  }
488 
489  // add trailer
490  uhtr->push_back( uhtr_size&0xFFFF );
491  uhtr->push_back( (uhtr_size>>16)&0xF );
492  // this is ignoring the event number... I am not sure what this should be
493 
494  // adding some blank stuff for the CRC bits
495  uhtr->push_back( 0 );
496  uhtr->push_back( 0 );
497  };
unsigned long long uint64_t
Definition: Time.h:15
uhtrData* UHTRpacker::newUHTR ( int  uhtrIndex,
int  ps = 0,
int  orn = 0,
int  bcn = 0,
uint64_t  evt = 0 
)
inline

Definition at line 435 of file PackerHelp.h.

References hgcalDigitizer_cfi::fwVersion, mps_fire::i, AMCHeaderSpec::MASK_CRATE_ID, AMC13HeaderSpec::MASK_ORN, AMCHeaderSpec::MASK_PRESAMPLES, AMCHeaderSpec::MASK_SLOT_ID, SiStripPI::max, and hcalTTPDigis_cfi::presamples.

Referenced by HcalDigiToRawuHTR::produce().

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

Definition at line 401 of file PackerHelp.h.

References HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), 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.

401  {
402  uint16_t header =0;
403 
404  int fiber = eid.fiberIndex();
405  int fiberchan = eid.fiberChanId();
406 
414 
415  return header;
416  }
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:111
static const int MASK_RESERV
Definition: PackerHelp.h:108
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:113
static const int MASK_MP
Definition: PackerHelp.h:106
static const int MASK_FIBER
Definition: PackerHelp.h:104
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:102
static const int OFFSET_LE
Definition: PackerHelp.h:109
static const int OFFSET_RESERV
Definition: PackerHelp.h:107
constexpr int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:114
constexpr int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
static const int MASK_LE
Definition: PackerHelp.h:110
static const int OFFSET_MP
Definition: PackerHelp.h:105
static const int MASK_FLAVOR
Definition: PackerHelp.h:112
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:101
static const int OFFSET_FIBER
Definition: PackerHelp.h:103
uint16_t UHTRpacker::packQIE11header ( const QIE11DataFrame qiedf,
const HcalElectronicsId eid 
)
inline

Definition at line 418 of file PackerHelp.h.

References HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), RecoTauValidation_cfi::header, QIE11HeaderSpec::MASK_CAPID, QIE11HeaderSpec::MASK_FIBER, QIE11HeaderSpec::MASK_FIBERCHAN, QIE11HeaderSpec::MASK_FIBERERR, QIE11HeaderSpec::MASK_FLAVOR, QIE11HeaderSpec::MASK_HEADER_BIT, QIE11HeaderSpec::OFFSET_CAPID, QIE11HeaderSpec::OFFSET_FIBER, QIE11HeaderSpec::OFFSET_FIBERCHAN, QIE11HeaderSpec::OFFSET_FIBERERR, QIE11HeaderSpec::OFFSET_FLAVOR, QIE11HeaderSpec::OFFSET_HEADER_BIT, and QIE11DataFrame::samples().

418  {
419  uint16_t header =0;
420 
421  int fiber = eid.fiberIndex();
422  int fiberchan = eid.fiberChanId();
423  int capid0 = qiedf.samples() == 0? 0 : qiedf[0].capid(); // capacitor id for the first sample
424 
431 
432  return header;
433  }
static const int MASK_CAPID
Definition: PackerHelp.h:123
static const int MASK_FIBERERR
Definition: PackerHelp.h:125
static const int MASK_FIBER
Definition: PackerHelp.h:121
static const int MASK_FLAVOR
Definition: PackerHelp.h:127
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:129
static const int OFFSET_FIBER
Definition: PackerHelp.h:120
static const int OFFSET_CAPID
Definition: PackerHelp.h:122
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:119
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:128
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:118
constexpr int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:126
constexpr int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
static const int OFFSET_FIBERERR
Definition: PackerHelp.h:124
int samples() const
total number of samples in the digi
uint16_t UHTRpacker::packQIE8header ( const HcalQIESample qieSample,
const HcalElectronicsId eid,
int  flavor 
)
inline

Definition at line 350 of file PackerHelp.h.

References HcalQIESample::capid(), HcalQIESample::er(), HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), 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.

350  {
351  uint16_t header =0;
352 
353  int fiber = eid.fiberIndex()+1;
354  int fiberchan = eid.fiberChanId();
355  int fiberErr = qieSample.er();
356  int capid0 = qieSample.capid();
357 
360  if(flavor==7){
362  }
363  else {
366  }
367  header |= (flavor & QIE8HeaderSpec::MASK_FLAVOR)<<QIE8HeaderSpec::OFFSET_FLAVOR; //flavor
369 
370  return header;
371  }
constexpr bool er() const
is the error bit set?
Definition: HcalQIESample.h:69
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:95
static const int MASK_FIBER
Definition: PackerHelp.h:87
static const int OFFSET_FIBER
Definition: PackerHelp.h:86
static const int MASK_FIBERERR
Definition: PackerHelp.h:91
static const int MASK_FLAVOR
Definition: PackerHelp.h:93
static const int MASK_TECHNICAL_DATA_TYPE
Definition: PackerHelp.h:97
static const int MASK_CAPID
Definition: PackerHelp.h:89
constexpr int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
static const int OFFSET_TECHNICAL_DATA_TYPE
Definition: PackerHelp.h:96
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:92
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:94
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:84
static const int OFFSET_CAPID
Definition: PackerHelp.h:88
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:65
static const int OFFSET_FIBERERR
Definition: PackerHelp.h:90
constexpr int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:85
uint16_t UHTRpacker::packQIE8sample ( const HcalQIESample qieSample)
inline

Definition at line 373 of file PackerHelp.h.

References ecalMGPA::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 simplePhotonAnalyzer_cfi::sample.

373  {
374  uint16_t sample = 0;
375 
376  int adc = qieSample.adc();
377  int capid = qieSample.capid();
378  int dv = qieSample.dv();
379  int er = qieSample.er();
380 
385 
386  return sample;
387  }
static const int OFFSET_CAPID
Definition: PackerHelp.h:154
constexpr bool er() const
is the error bit set?
Definition: HcalQIESample.h:69
static const int MASK_DV
Definition: PackerHelp.h:157
static const int OFFSET_ADC
Definition: PackerHelp.h:152
static const int MASK_ER
Definition: PackerHelp.h:159
static const int OFFSET_DV
Definition: PackerHelp.h:156
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:59
static const int MASK_CAPID
Definition: PackerHelp.h:155
constexpr bool dv() const
is the Data Valid bit set?
Definition: HcalQIESample.h:67
static const int OFFSET_ER
Definition: PackerHelp.h:158
constexpr int capid() const
get the Capacitor id
Definition: HcalQIESample.h:65
static const int MASK_ADC
Definition: PackerHelp.h:153
uint16_t UHTRpacker::packTPheader ( const HcalTriggerPrimitiveSample tpSample,
int  channelid 
)
inline

Definition at line 389 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.

389  {
390  uint16_t header =0;
391 
395  header |= (0x4 & TPHeaderSpec::MASK_FLAVOR)<<TPHeaderSpec::OFFSET_FLAVOR; //flavor
397 
398  return header;
399  }
static const int OFFSET_TPERR
Definition: PackerHelp.h:141
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:143
static const int MASK_TPERR
Definition: PackerHelp.h:142
static const int OFFSET_CHANID
Definition: PackerHelp.h:137
static const int MASK_FLAVOR
Definition: PackerHelp.h:144
static const int MASK_CHANID
Definition: PackerHelp.h:138
static const int OFFSET_RESV
Definition: PackerHelp.h:139
static const int MASK_RESV
Definition: PackerHelp.h:140
static const int OFFSET_HEADER_BIT
Definition: PackerHelp.h:145
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:146

Member Data Documentation

const int UHTRpacker::MASK_BCN = 0xFFF
static

Definition at line 320 of file PackerHelp.h.

const int UHTRpacker::MASK_CRATE_ID = 0xFFFFFF
static

Definition at line 327 of file PackerHelp.h.

const int UHTRpacker::MASK_DATA_LENGTH = 0xFFFFF
static

Definition at line 318 of file PackerHelp.h.

const int UHTRpacker::MASK_EVENT_TYPE = 0xF
static

Definition at line 337 of file PackerHelp.h.

const int UHTRpacker::MASK_EVN = 0xFFFFFF
static

Definition at line 322 of file PackerHelp.h.

const int UHTRpacker::MASK_FILED_BY_AMC13 = 0xFF
static

Definition at line 324 of file PackerHelp.h.

const int UHTRpacker::MASK_FW_FLAVOR = 0xFF
static

Definition at line 335 of file PackerHelp.h.

const int UHTRpacker::MASK_FW_VERSION = 0xFFFF
static

Definition at line 341 of file PackerHelp.h.

const int UHTRpacker::MASK_ORN = 0xFFFF
static

Definition at line 333 of file PackerHelp.h.

const int UHTRpacker::MASK_PAYLOAD_FORMAT = 0xF
static

Definition at line 339 of file PackerHelp.h.

const int UHTRpacker::MASK_PRESAMPLES = 0xF
static

Definition at line 331 of file PackerHelp.h.

const int UHTRpacker::MASK_SLOT_ID = 0xF
static

Definition at line 329 of file PackerHelp.h.

const int UHTRpacker::OFFSET_BCN = 20
static

Definition at line 319 of file PackerHelp.h.

const int UHTRpacker::OFFSET_CRATE_ID = 0
static

Definition at line 326 of file PackerHelp.h.

const int UHTRpacker::OFFSET_DATA_LENGTH = 0
static

Definition at line 317 of file PackerHelp.h.

const int UHTRpacker::OFFSET_EVENT_TYPE = 40
static

Definition at line 336 of file PackerHelp.h.

const int UHTRpacker::OFFSET_EVN = 32
static

Definition at line 321 of file PackerHelp.h.

const int UHTRpacker::OFFSET_FILED_BY_AMC13 = 56
static

Definition at line 323 of file PackerHelp.h.

const int UHTRpacker::OFFSET_FW_FLAVOR = 32
static

Definition at line 334 of file PackerHelp.h.

const int UHTRpacker::OFFSET_FW_VERSION = 48
static

Definition at line 340 of file PackerHelp.h.

const int UHTRpacker::OFFSET_ORN = 16
static

Definition at line 332 of file PackerHelp.h.

const int UHTRpacker::OFFSET_PAYLOAD_FORMAT = 44
static

Definition at line 338 of file PackerHelp.h.

const int UHTRpacker::OFFSET_PRESAMPLES = 12
static

Definition at line 330 of file PackerHelp.h.

const int UHTRpacker::OFFSET_SLOT_ID = 8
static

Definition at line 328 of file PackerHelp.h.

UHTRMap UHTRpacker::uhtrs

Definition at line 314 of file PackerHelp.h.

Referenced by HcalDigiToRawuHTR::produce().