CMS 3D CMS Logo

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

#include <HFRecHitAuxSetter.h>

Static Public Member Functions

static void setAux (const HFPreRecHit &prehit, const unsigned anodeStates[2], unsigned soiPhase, HFRecHit *rechit)
 

Static Public Attributes

static const unsigned MASK_ADC = 0xffffff
 
static const unsigned MASK_CAPID = 0x3
 
static const unsigned MASK_SOI = 0x3
 
static const unsigned MASK_STATUS = 0xf
 
static const unsigned OFF_ADC = 0
 
static const unsigned OFF_CAPID = 26
 
static const unsigned OFF_SOI = 24
 
static const unsigned OFF_STATUS = 28
 

Detailed Description

Definition at line 10 of file HFRecHitAuxSetter.h.

Member Function Documentation

void HFRecHitAuxSetter::setAux ( const HFPreRecHit prehit,
const unsigned  anodeStates[2],
unsigned  soiPhase,
HFRecHit rechit 
)
static

Definition at line 10 of file HFRecHitAuxSetter.cc.

References printConversionInfo::aux, HFPreRecHit::getHFQIE10Info(), HFQIE10Info::getRaw(), MASK_CAPID, MASK_SOI, MASK_STATUS, HFAnodeStatus::N_POSSIBLE_STATES, HFQIE10Info::nRaw(), OFF_CAPID, OFF_SOI, OFF_STATUS, CaloRecHit::setAux(), HFRecHit::setAuxHF(), CaloRecHitAuxSetter::setField(), edm::shift, HFQIE10Info::soi(), and mitigatedMETSequence_cff::U.

Referenced by HFSimpleTimeCheck::reconstruct().

14 {
15  using namespace CaloRecHitAuxSetter;
16 
17  const int wantedPhase = u_soiPhase < 2U ? u_soiPhase : 2U;
18 
19  for (unsigned ianode=0; ianode<2; ++ianode)
20  {
21  uint32_t aux = 0;
22  const HFQIE10Info* anodeInfo = prehit.getHFQIE10Info(ianode);
23  if (anodeInfo)
24  {
25  const int nRaw = anodeInfo->nRaw();
26  const int soiStored = anodeInfo->soi();
27  if (soiStored < nRaw)
28  {
29  // SOI is in the raw data. Figure out a good
30  // way to map ADCs into the three bytes available.
31  int shift = 0;
32  int nStore = nRaw;
33  if (nRaw > 3)
34  {
35  nStore = 3;
36  if (soiStored > wantedPhase)
37  shift = soiStored - wantedPhase;
38  if (shift + nStore > nRaw)
39  shift = nRaw - nStore;
40  }
41 
42  // Fill out the ADC fields
43  for (int iadc=0; iadc<nStore; ++iadc)
44  {
45  const int istored = iadc + shift;
46  const QIE10DataFrame::Sample ts(anodeInfo->getRaw(istored));
47  setField(&aux, 0xff, iadc*8, ts.adc());
48  if (istored == soiStored)
49  setField(&aux, MASK_CAPID, OFF_CAPID, ts.capid());
50  }
51  setField(&aux, MASK_SOI, OFF_SOI, soiStored-shift);
52  }
53  else
54  setField(&aux, MASK_SOI, OFF_SOI, 3U);
55  }
56 
57  // Remember anode status
59  "Possible states enum must fit into the bit field");
60  setField(&aux, MASK_STATUS, OFF_STATUS, anodeStates[ianode]);
61 
62  // Fill the aux field in the rechit
63  if (ianode)
64  rechit->setAuxHF(aux);
65  else
66  rechit->setAux(aux);
67  }
68 }
static const unsigned OFF_CAPID
const HFQIE10Info * getHFQIE10Info(unsigned index) const
Definition: HFPreRecHit.cc:42
void setAuxHF(const uint32_t u)
Definition: HFRecHit.h:25
static const unsigned OFF_STATUS
void setField(uint32_t *u, const unsigned mask, const unsigned offset, const unsigned value)
unsigned nRaw() const
Definition: HFQIE10Info.h:38
static const unsigned MASK_STATUS
static const unsigned OFF_SOI
static const unsigned MASK_CAPID
static const unsigned MASK_SOI
raw_type getRaw(const unsigned which) const
Definition: HFQIE10Info.h:40
void setAux(uint32_t value)
Definition: CaloRecHit.h:26
unsigned soi() const
Definition: HFQIE10Info.h:39
static unsigned int const shift

Member Data Documentation

const unsigned HFRecHitAuxSetter::MASK_ADC = 0xffffff
static

Definition at line 13 of file HFRecHitAuxSetter.h.

const unsigned HFRecHitAuxSetter::MASK_CAPID = 0x3
static

Definition at line 26 of file HFRecHitAuxSetter.h.

Referenced by setAux().

const unsigned HFRecHitAuxSetter::MASK_SOI = 0x3
static

Definition at line 20 of file HFRecHitAuxSetter.h.

Referenced by setAux().

const unsigned HFRecHitAuxSetter::MASK_STATUS = 0xf
static

Definition at line 32 of file HFRecHitAuxSetter.h.

Referenced by setAux().

const unsigned HFRecHitAuxSetter::OFF_ADC = 0
static

Definition at line 14 of file HFRecHitAuxSetter.h.

const unsigned HFRecHitAuxSetter::OFF_CAPID = 26
static

Definition at line 27 of file HFRecHitAuxSetter.h.

Referenced by setAux().

const unsigned HFRecHitAuxSetter::OFF_SOI = 24
static

Definition at line 21 of file HFRecHitAuxSetter.h.

Referenced by setAux().

const unsigned HFRecHitAuxSetter::OFF_STATUS = 28
static

Definition at line 33 of file HFRecHitAuxSetter.h.

Referenced by setAux().