CMS 3D CMS Logo

List of all members | Static Public Member Functions | Static Public Attributes
HBHERecHitAuxSetter Struct Reference

#include <HBHERecHitAuxSetter.h>

Static Public Member Functions

static void setAux (const HBHEChannelInfo &info, HBHERecHit *rechit)
 

Static Public Attributes

static const unsigned MASK_ADC = 0xffff
 
static const unsigned MASK_CAPID = 0x3
 
static const unsigned MASK_NSAMPLES = 0xf
 
static const unsigned MASK_SOI = 0xf
 
static const unsigned OFF_ADC = 0
 
static const unsigned OFF_CAPID = 24
 
static const unsigned OFF_CAPID_ERR = 29
 
static const unsigned OFF_COMBINED = 30
 
static const unsigned OFF_DROPPED = 27
 
static const unsigned OFF_LINK_ERR = 28
 
static const unsigned OFF_NSAMPLES = 16
 
static const unsigned OFF_SOI = 20
 
static const unsigned OFF_TDC_TIME = 26
 

Detailed Description

Definition at line 18 of file HBHERecHitAuxSetter.h.

Member Function Documentation

void HBHERecHitAuxSetter::setAux ( const HBHEChannelInfo info,
HBHERecHit rechit 
)
static

Definition at line 49 of file HBHERecHitAuxSetter.h.

References printConversionInfo::aux, HBHEChannelInfo::capid(), HBHEChannelInfo::hasCapidError(), HBHEChannelInfo::hasLinkError(), HBHEChannelInfo::hasTimeInfo(), mps_fire::i, HBHEChannelInfo::isDropped(), MASK_CAPID, MASK_NSAMPLES, MASK_SOI, hgc_digi::nSamples, HBHEChannelInfo::nSamples(), OFF_CAPID, OFF_CAPID_ERR, OFF_DROPPED, OFF_LINK_ERR, OFF_NSAMPLES, OFF_SOI, OFF_TDC_TIME, CaloRecHit::setAux(), HBHERecHit::setAuxHBHE(), HBHERecHit::setAuxPhase1(), setBit(), CaloRecHitAuxSetter::setField(), HBHEChannelInfo::soi(), and HBHEChannelInfo::tsAdc().

Referenced by SimpleHBHEPhase1Algo::reconstruct().

51 {
52  using namespace CaloRecHitAuxSetter;
53 
54  uint32_t aux = 0, auxHBHE = 0, auxPhase1 = 0;
55 
56  // Pack ADC values
57  unsigned nSamples = info.nSamples();
58  if (nSamples > 10)
59  nSamples = 10;
60  for (unsigned i=0; i<4 && i<nSamples; ++i)
61  setField(&aux, 0xff, i*8, info.tsAdc(i));
62  for (unsigned i=4; i<8 && i<nSamples; ++i)
63  setField(&auxHBHE, 0xff, (i-4)*8, info.tsAdc(i));
64  for (unsigned i=8; i<nSamples; ++i)
65  setField(&auxPhase1, 0xff, (i-8)*8, info.tsAdc(i));
66 
67  // Pack other fields
68  setField(&auxPhase1, MASK_NSAMPLES, OFF_NSAMPLES, nSamples);
69  unsigned soi = info.soi();
70  if (soi > 10)
71  soi = 10;
72  setField(&auxPhase1, MASK_SOI, OFF_SOI, soi);
73  setField(&auxPhase1, MASK_CAPID, OFF_CAPID, info.capid());
74 
75  // Pack status bits
76  setBit(&auxPhase1, OFF_TDC_TIME, info.hasTimeInfo());
77  setBit(&auxPhase1, OFF_DROPPED, info.isDropped());
78  setBit(&auxPhase1, OFF_LINK_ERR, info.hasLinkError());
79  setBit(&auxPhase1, OFF_CAPID_ERR, info.hasCapidError());
80 
81  // Copy the aux words into the rechit
82  rechit->setAux(aux);
83  rechit->setAuxHBHE(auxHBHE);
84  rechit->setAuxPhase1(auxPhase1);
85 }
static const unsigned MASK_NSAMPLES
constexpr void setField(uint32_t *u, const unsigned mask, const unsigned offset, const unsigned value)
bool hasTimeInfo() const
static const unsigned OFF_SOI
static const unsigned MASK_CAPID
unsigned soi() const
static const unsigned OFF_NSAMPLES
static const unsigned OFF_DROPPED
static const unsigned OFF_CAPID
static const unsigned OFF_TDC_TIME
static const unsigned OFF_CAPID_ERR
static const unsigned OFF_LINK_ERR
static const unsigned MASK_SOI
void setAuxHBHE(const uint32_t aux)
Definition: HBHERecHit.h:53
constexpr size_t nSamples
void setBit(int &_bitArray, unsigned _iBit)
bool hasLinkError() const
bool isDropped() const
constexpr void setAux(uint32_t value)
Definition: CaloRecHit.h:51
unsigned nSamples() const
int capid() const
uint8_t tsAdc(const unsigned ts) const
void setAuxPhase1(const uint32_t aux)
Definition: HBHERecHit.h:56
bool hasCapidError() const

Member Data Documentation

const unsigned HBHERecHitAuxSetter::MASK_ADC = 0xffff
static

Definition at line 20 of file HBHERecHitAuxSetter.h.

const unsigned HBHERecHitAuxSetter::MASK_CAPID = 0x3
static

Definition at line 32 of file HBHERecHitAuxSetter.h.

Referenced by SimplePlan1RechitCombiner::combineAuxInfo(), and setAux().

const unsigned HBHERecHitAuxSetter::MASK_NSAMPLES = 0xf
static
const unsigned HBHERecHitAuxSetter::MASK_SOI = 0xf
static

Definition at line 28 of file HBHERecHitAuxSetter.h.

Referenced by SimplePlan1RechitCombiner::combineAuxInfo(), and setAux().

const unsigned HBHERecHitAuxSetter::OFF_ADC = 0
static

Definition at line 21 of file HBHERecHitAuxSetter.h.

Referenced by SimplePlan1RechitCombiner::combineAuxInfo().

const unsigned HBHERecHitAuxSetter::OFF_CAPID = 24
static

Definition at line 33 of file HBHERecHitAuxSetter.h.

Referenced by SimplePlan1RechitCombiner::combineAuxInfo(), and setAux().

const unsigned HBHERecHitAuxSetter::OFF_CAPID_ERR = 29
static

Definition at line 39 of file HBHERecHitAuxSetter.h.

Referenced by SimplePlan1RechitCombiner::combineAuxInfo(), and setAux().

const unsigned HBHERecHitAuxSetter::OFF_COMBINED = 30
static
const unsigned HBHERecHitAuxSetter::OFF_DROPPED = 27
static

Definition at line 37 of file HBHERecHitAuxSetter.h.

Referenced by SimplePlan1RechitCombiner::add(), and setAux().

const unsigned HBHERecHitAuxSetter::OFF_LINK_ERR = 28
static

Definition at line 38 of file HBHERecHitAuxSetter.h.

Referenced by SimplePlan1RechitCombiner::combineAuxInfo(), and setAux().

const unsigned HBHERecHitAuxSetter::OFF_NSAMPLES = 16
static
const unsigned HBHERecHitAuxSetter::OFF_SOI = 20
static

Definition at line 29 of file HBHERecHitAuxSetter.h.

Referenced by SimplePlan1RechitCombiner::combineAuxInfo(), and setAux().

const unsigned HBHERecHitAuxSetter::OFF_TDC_TIME = 26
static