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

Member Typedef Documentation

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

Definition at line 309 of file PackerHelp.h.

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

Definition at line 310 of file PackerHelp.h.

Constructor & Destructor Documentation

UHTRpacker::UHTRpacker ( )
inline

Definition at line 341 of file PackerHelp.h.

341 {}

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 497 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().

497  {
498  if( qiedf->size() == 0 ) return;
499  DetId detid = qiedf->id();
500  HcalElectronicsId eid(readoutMap->lookup(detid));
501  uint16_t header = packQIE8header(qiedf->sample(0), eid, premix ? 7 : 5);
502  uhtrs[uhtrIndex].push_back(header);
503  // loop over words in dataframe
504  if(premix){
505  for(int iTS = 0; iTS < qiedf->size(); ++iTS){
506  uhtrs[uhtrIndex].push_back(packQIE8sample(qiedf->sample(iTS)));
507  }
508  }
509  else {
510  for(int iTS = 0; iTS < qiedf->size(); iTS +=2 ){
511  uint16_t cont =0;
512  int adc0 = qiedf->sample(iTS).adc();
513  int adc1 = qiedf->sample(iTS+1).adc();
514  cont |= adc0&0xFF;
515  cont |= (adc1&0xFF)<<8;
516  uhtrs[uhtrIndex].push_back(cont);
517  }
518  }// end loop over dataframe words
519  };
uint16_t packQIE8header(const HcalQIESample &qieSample, const HcalElectronicsId &eid, int flavor)
Definition: PackerHelp.h:348
UHTRMap uhtrs
Definition: PackerHelp.h:312
Definition: DetId.h:18
uint16_t packQIE8sample(const HcalQIESample &qieSample)
Definition: PackerHelp.h:371
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 521 of file PackerHelp.h.

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

521  {
522  if( qiedf->size() == 0 ) return;
523  DetId detid = qiedf->id();
524  HcalElectronicsId eid(readoutMap->lookup(detid));
525  uint16_t header = packQIE8header(qiedf->sample(0), eid, premix ? 7 : 5);
526  uhtrs[uhtrIndex].push_back(header);
527  // loop over words in dataframe
528  if(premix){
529  for(int iTS = 0; iTS < qiedf->size(); ++iTS){
530  uhtrs[uhtrIndex].push_back(packQIE8sample(qiedf->sample(iTS)));
531  }
532  }
533  else {
534  for(int iTS = 0; iTS < qiedf->size(); iTS +=2 ){
535  uint16_t cont =0;
536  int adc0 = qiedf->sample(iTS).adc();
537  int adc1 = qiedf->sample(iTS+1).adc();
538  cont |= adc0&0xFF;
539  cont |= (adc1&0xFF)<<8;
540  uhtrs[uhtrIndex].push_back(cont);
541  }
542  }// end loop over dataframe words
543  };
uint16_t packQIE8header(const HcalQIESample &qieSample, const HcalElectronicsId &eid, int flavor)
Definition: PackerHelp.h:348
UHTRMap uhtrs
Definition: PackerHelp.h:312
Definition: DetId.h:18
uint16_t packQIE8sample(const HcalQIESample &qieSample)
Definition: PackerHelp.h:371
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 545 of file PackerHelp.h.

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

545  {
546  if( qiedf->size() ==0 ) return;
547  uint16_t header = packTPheader(qiedf->sample(0), channelid);
548  uhtrs[uhtrIndex].push_back(header);
549  // loop over words in dataframe
550  for( int iTS = 0 ; iTS < qiedf->size() ; iTS++ ){
551  // push data into uhtr data container
552  uhtrs[uhtrIndex].push_back(qiedf->sample(iTS).raw());
553  }// end loop over dataframe words
554  };
uint16_t packTPheader(const HcalTriggerPrimitiveSample &tpSample, int channelid)
Definition: PackerHelp.h:387
UHTRMap uhtrs
Definition: PackerHelp.h:312
size_type size() const
void UHTRpacker::addChannel ( int  uhtrIndex,
QIE11DataFrame  qiedf,
const HcalElectronicsMap readoutMap,
int  verbosity = 0 
)
inline

Definition at line 556 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().

556  {
557  DetId detid = qiedf.detid();
558  HcalElectronicsId eid(readoutMap->lookup(detid));
559  // loop over words in dataframe
560  for(edm::DataFrame::iterator dfi=qiedf.begin() ; dfi!=qiedf.end(); ++dfi){
561  if( dfi >= qiedf.end()-QIE11DataFrame::FLAG_WORDS ){
562  continue;
563  }
564  if( dfi == qiedf.begin() && QIE11DataFrame::HEADER_WORDS == 1 ){
565  uint16_t header = packQIE11header(qiedf, eid);
566  uhtrs[uhtrIndex].push_back(header);
567  continue;
568  }
569  // push data into uhtr data container
570  uhtrs[uhtrIndex].push_back(dfi[0]);
571  }// end loop over dataframe words
572  };
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:416
UHTRMap uhtrs
Definition: PackerHelp.h:312
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 574 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().

574  {
575  DetId detid = qiedf.detid();
576  HcalElectronicsId eid(readoutMap->lookup(detid));
577  // loop over words in dataframe
578  for(edm::DataFrame::iterator dfi=qiedf.begin() ; dfi!=qiedf.end(); ++dfi){
579  if( dfi >= qiedf.end()-QIE10DataFrame::FLAG_WORDS ){
580  continue;
581  }
582  if( dfi == qiedf.begin() && QIE10DataFrame::HEADER_WORDS == 1 ){
583  uint16_t header = packQIE10header(eid);
584  uhtrs[uhtrIndex].push_back(header);
585  continue;
586  }
587  // push data into uhtr data container
588  uhtrs[uhtrIndex].push_back(dfi[0]);
589  }// end loop over dataframe words
590  };
edm::DataFrame::iterator begin()
iterators
uint16_t packQIE10header(const HcalElectronicsId &eid)
Definition: PackerHelp.h:399
DetId detid() const
Get the detector id.
edm::DataFrame::iterator end()
UHTRMap uhtrs
Definition: PackerHelp.h:312
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 343 of file PackerHelp.h.

Referenced by HcalDigiToRawuHTR::produce().

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

Definition at line 474 of file PackerHelp.h.

References pfDeepCMVAJetTags_cfi::toAdd.

Referenced by HcalDigiToRawuHTR::produce().

474  {
475 
476  uint64_t uhtr_size = uhtr->size()-8;
477 
478  // adjust the size bits
479  uhtr->at(0) = uhtr_size&0xFFFF ;
480  uhtr->at(1) |= (uhtr_size>>16)&0xF ;
481 
482  unsigned int toAdd = 4-uhtr->size()%4;
483  for(unsigned int ia=0; ia<toAdd; ia++){
484  uhtr->push_back(0xD07F);
485  }
486 
487  // add trailer
488  uhtr->push_back( uhtr_size&0xFFFF );
489  uhtr->push_back( (uhtr_size>>16)&0xF );
490  // this is ignoring the event number... I am not sure what this should be
491 
492  // adding some blank stuff for the CRC bits
493  uhtr->push_back( 0 );
494  uhtr->push_back( 0 );
495  };
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 433 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, hpstanc_transforms::max, and hcalTTPDigis_cfi::presamples.

Referenced by HcalDigiToRawuHTR::produce().

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

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

399  {
400  uint16_t header =0;
401 
402  int fiber = eid.fiberIndex();
403  int fiberchan = eid.fiberChanId();
404 
412 
413  return header;
414  }
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:111
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_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
int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
static const int OFFSET_RESERV
Definition: PackerHelp.h:107
static const int MASK_HEADER_BIT
Definition: PackerHelp.h:114
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 416 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().

416  {
417  uint16_t header =0;
418 
419  int fiber = eid.fiberIndex();
420  int fiberchan = eid.fiberChanId();
421  int capid0 = qiedf.samples() == 0? 0 : qiedf[0].capid(); // capacitor id for the first sample
422 
429 
430  return header;
431  }
static const int MASK_CAPID
Definition: PackerHelp.h:123
static const int MASK_FIBERERR
Definition: PackerHelp.h:125
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_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
int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
static const int OFFSET_FIBERCHAN
Definition: PackerHelp.h:118
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:126
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 348 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.

348  {
349  uint16_t header =0;
350 
351  int fiber = eid.fiberIndex()+1;
352  int fiberchan = eid.fiberChanId();
353  int fiberErr = qieSample.er();
354  int capid0 = qieSample.capid();
355 
358  if(flavor==7){
360  }
361  else {
364  }
365  header |= (flavor & QIE8HeaderSpec::MASK_FLAVOR)<<QIE8HeaderSpec::OFFSET_FLAVOR; //flavor
367 
368  return header;
369  }
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: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
int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
static const int OFFSET_TECHNICAL_DATA_TYPE
Definition: PackerHelp.h:96
static const int OFFSET_FLAVOR
Definition: PackerHelp.h:92
int capid() const
get the Capacitor id
Definition: HcalQIESample.h:26
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
static const int OFFSET_FIBERERR
Definition: PackerHelp.h:90
static const int MASK_FIBERCHAN
Definition: PackerHelp.h:85
bool er() const
is the error bit set?
Definition: HcalQIESample.h:30
uint16_t UHTRpacker::packQIE8sample ( const HcalQIESample qieSample)
inline

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

371  {
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  }
int adc(sample_type sample)
get the ADC sample (12 bits)
static const int OFFSET_CAPID
Definition: PackerHelp.h:152
int adc() const
get the ADC sample
Definition: HcalQIESample.h:22
static const int MASK_DV
Definition: PackerHelp.h:155
bool dv() const
is the Data Valid bit set?
Definition: HcalQIESample.h:28
static const int OFFSET_ADC
Definition: PackerHelp.h:150
static const int MASK_ER
Definition: PackerHelp.h:157
static const int OFFSET_DV
Definition: PackerHelp.h:154
static const int MASK_CAPID
Definition: PackerHelp.h:153
int capid() const
get the Capacitor id
Definition: HcalQIESample.h:26
static const int OFFSET_ER
Definition: PackerHelp.h:156
bool er() const
is the error bit set?
Definition: HcalQIESample.h:30
static const int MASK_ADC
Definition: PackerHelp.h:151
uint16_t UHTRpacker::packTPheader ( const HcalTriggerPrimitiveSample tpSample,
int  channelid 
)
inline

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

387  {
388  uint16_t header =0;
389 
393  header |= (0x4 & TPHeaderSpec::MASK_FLAVOR)<<TPHeaderSpec::OFFSET_FLAVOR; //flavor
395 
396  return header;
397  }
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 318 of file PackerHelp.h.

const int UHTRpacker::MASK_CRATE_ID = 0xFFFFFF
static

Definition at line 325 of file PackerHelp.h.

const int UHTRpacker::MASK_DATA_LENGTH = 0xFFFFF
static

Definition at line 316 of file PackerHelp.h.

const int UHTRpacker::MASK_EVENT_TYPE = 0xF
static

Definition at line 335 of file PackerHelp.h.

const int UHTRpacker::MASK_EVN = 0xFFFFFF
static

Definition at line 320 of file PackerHelp.h.

const int UHTRpacker::MASK_FILED_BY_AMC13 = 0xFF
static

Definition at line 322 of file PackerHelp.h.

const int UHTRpacker::MASK_FW_FLAVOR = 0xFF
static

Definition at line 333 of file PackerHelp.h.

const int UHTRpacker::MASK_FW_VERSION = 0xFFFF
static

Definition at line 339 of file PackerHelp.h.

const int UHTRpacker::MASK_ORN = 0xFFFF
static

Definition at line 331 of file PackerHelp.h.

const int UHTRpacker::MASK_PAYLOAD_FORMAT = 0xF
static

Definition at line 337 of file PackerHelp.h.

const int UHTRpacker::MASK_PRESAMPLES = 0xF
static

Definition at line 329 of file PackerHelp.h.

const int UHTRpacker::MASK_SLOT_ID = 0xF
static

Definition at line 327 of file PackerHelp.h.

const int UHTRpacker::OFFSET_BCN = 20
static

Definition at line 317 of file PackerHelp.h.

const int UHTRpacker::OFFSET_CRATE_ID = 0
static

Definition at line 324 of file PackerHelp.h.

const int UHTRpacker::OFFSET_DATA_LENGTH = 0
static

Definition at line 315 of file PackerHelp.h.

const int UHTRpacker::OFFSET_EVENT_TYPE = 40
static

Definition at line 334 of file PackerHelp.h.

const int UHTRpacker::OFFSET_EVN = 32
static

Definition at line 319 of file PackerHelp.h.

const int UHTRpacker::OFFSET_FILED_BY_AMC13 = 56
static

Definition at line 321 of file PackerHelp.h.

const int UHTRpacker::OFFSET_FW_FLAVOR = 32
static

Definition at line 332 of file PackerHelp.h.

const int UHTRpacker::OFFSET_FW_VERSION = 48
static

Definition at line 338 of file PackerHelp.h.

const int UHTRpacker::OFFSET_ORN = 16
static

Definition at line 330 of file PackerHelp.h.

const int UHTRpacker::OFFSET_PAYLOAD_FORMAT = 44
static

Definition at line 336 of file PackerHelp.h.

const int UHTRpacker::OFFSET_PRESAMPLES = 12
static

Definition at line 328 of file PackerHelp.h.

const int UHTRpacker::OFFSET_SLOT_ID = 8
static

Definition at line 326 of file PackerHelp.h.

UHTRMap UHTRpacker::uhtrs

Definition at line 312 of file PackerHelp.h.

Referenced by HcalDigiToRawuHTR::produce().