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

◆ setAux()

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

Definition at line 9 of file HFRecHitAuxSetter.cc.

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

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

Member Data Documentation

◆ MASK_ADC

const unsigned HFRecHitAuxSetter::MASK_ADC = 0xffffff
static

Definition at line 12 of file HFRecHitAuxSetter.h.

◆ MASK_CAPID

const unsigned HFRecHitAuxSetter::MASK_CAPID = 0x3
static

Definition at line 25 of file HFRecHitAuxSetter.h.

Referenced by setAux().

◆ MASK_SOI

const unsigned HFRecHitAuxSetter::MASK_SOI = 0x3
static

Definition at line 19 of file HFRecHitAuxSetter.h.

Referenced by setAux().

◆ MASK_STATUS

const unsigned HFRecHitAuxSetter::MASK_STATUS = 0xf
static

Definition at line 31 of file HFRecHitAuxSetter.h.

Referenced by HFFlexibleTimeCheck::reconstruct(), and setAux().

◆ OFF_ADC

const unsigned HFRecHitAuxSetter::OFF_ADC = 0
static

Definition at line 13 of file HFRecHitAuxSetter.h.

◆ OFF_CAPID

const unsigned HFRecHitAuxSetter::OFF_CAPID = 26
static

Definition at line 26 of file HFRecHitAuxSetter.h.

Referenced by setAux().

◆ OFF_SOI

const unsigned HFRecHitAuxSetter::OFF_SOI = 24
static

Definition at line 20 of file HFRecHitAuxSetter.h.

Referenced by setAux().

◆ OFF_STATUS

const unsigned HFRecHitAuxSetter::OFF_STATUS = 28
static

Definition at line 32 of file HFRecHitAuxSetter.h.

Referenced by HFFlexibleTimeCheck::reconstruct(), and setAux().

CaloRecHitAuxSetter::setField
constexpr void setField(uint32_t *u, const unsigned mask, const unsigned offset, const unsigned value)
Definition: CaloRecHitAuxSetter.h:8
HFQIE10Info
Definition: HFQIE10Info.h:15
HFAnodeStatus::N_POSSIBLE_STATES
Definition: HFAnodeStatus.h:14
HFPreRecHit::getHFQIE10Info
constexpr HFQIE10Info const * getHFQIE10Info(unsigned index) const
Definition: HFPreRecHit.h:39
HFRecHitAuxSetter::OFF_STATUS
static const unsigned OFF_STATUS
Definition: HFRecHitAuxSetter.h:32
HFRecHitAuxSetter::MASK_SOI
static const unsigned MASK_SOI
Definition: HFRecHitAuxSetter.h:19
HFRecHitAuxSetter::MASK_CAPID
static const unsigned MASK_CAPID
Definition: HFRecHitAuxSetter.h:25
CaloRecHit::setAux
constexpr void setAux(uint32_t value)
Definition: CaloRecHit.h:49
HFRecHitAuxSetter::MASK_STATUS
static const unsigned MASK_STATUS
Definition: HFRecHitAuxSetter.h:31
HFQIE10Info::getRaw
constexpr raw_type getRaw(const unsigned which) const
Definition: HFQIE10Info.h:85
HFQIE10Info::nRaw
constexpr unsigned nRaw() const
Definition: HFQIE10Info.h:83
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
HFRecHit::setAuxHF
constexpr void setAuxHF(const uint32_t u)
Definition: HFRecHit.h:28
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
HFRecHitAuxSetter::OFF_SOI
static const unsigned OFF_SOI
Definition: HFRecHitAuxSetter.h:20
HFRecHitAuxSetter::OFF_CAPID
static const unsigned OFF_CAPID
Definition: HFRecHitAuxSetter.h:26
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
QIE10DataFrame::Sample
Definition: QIE10DataFrame.h:20
CaloRecHitAuxSetter
Definition: CaloRecHitAuxSetter.h:7
HFQIE10Info::soi
constexpr unsigned soi() const
Definition: HFQIE10Info.h:84