ATLAS Offline Software
Loading...
Searching...
No Matches
CMXRoI.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace LVL1 {
8
9// Static constants
10
11const int CMXRoI::s_wordIdVal0;
12const int CMXRoI::s_wordIdVal1;
13const int CMXRoI::s_wordIdVal2;
14
15const int CMXRoI::s_wordIdBit;
19const int CMXRoI::s_energyBit;
20const int CMXRoI::s_overflowBit;
21const int CMXRoI::s_sumTypeBit;
22
23const int CMXRoI::s_wordIdMask;
27const int CMXRoI::s_energyMask;
29const int CMXRoI::s_sumTypeMask;
30
31const int CMXRoI::s_exOffset;
32const int CMXRoI::s_eyOffset;
33const int CMXRoI::s_etOffset;
34const int CMXRoI::s_maxRoiWords;
35
39
40CMXRoI::CMXRoI(uint32_t roiWord0, uint32_t roiWord1, uint32_t roiWord2,
41 uint32_t roiWord3, uint32_t roiWord4, uint32_t roiWord5)
43{
44 m_roiWords[0] = roiWord0;
45 m_roiWords[1] = roiWord1;
46 m_roiWords[2] = roiWord2;
47 m_roiWords[3] = roiWord3;
48 m_roiWords[4] = roiWord4;
49 m_roiWords[5] = roiWord5;
50}
51
52CMXRoI::CMXRoI(unsigned int ex, unsigned int ey, unsigned int et,
53 int exError, int eyError, int etError,
54 unsigned int sumEtHits, unsigned int missingEtHits,
55 unsigned int missingEtSigHits,
56 unsigned int exM, unsigned int eyM, unsigned int etM,
57 int exErrorM, int eyErrorM, int etErrorM,
58 unsigned int sumEtHitsM, unsigned int missingEtHitsM)
60{
61 int type = NORMAL;
62 int ix = s_exOffset + type;
69 type = MASKED;
70 ix = s_exOffset + type;
73 m_roiWords[ix] |= (exM & s_energyMask) << s_energyBit;
74 m_roiWords[ix] |= (exErrorM & s_overflowMask) << s_overflowBit;
75
76 type = NORMAL;
77 ix = s_eyOffset + type;
84 type = MASKED;
85 ix = s_eyOffset + type;
88 m_roiWords[ix] |= (eyM & s_energyMask) << s_energyBit;
89 m_roiWords[ix] |= (eyErrorM & s_overflowMask) << s_overflowBit;
90 m_roiWords[ix] |= (missingEtHitsM & s_missingEtHitsMask)
92 type = NORMAL;
93 ix = s_etOffset + type;
99
100 type = MASKED;
101 ix = s_etOffset + type;
103 m_roiWords[ix] |= type << s_sumTypeBit;
104 m_roiWords[ix] |= (etM & s_energyMask) << s_energyBit;
105 m_roiWords[ix] |= (etErrorM & s_overflowMask) << s_overflowBit;
106 m_roiWords[ix] |= (sumEtHitsM & s_sumEtHitsMask) << s_sumEtHitsBit;
107}
108
110{
111}
112
113// Set RoI word with ID check
114
116{
117 bool valid = true;
118 int wordId = (roiWord >> s_wordIdBit) & s_wordIdMask;
121 else if (wordId == s_wordIdVal1) m_roiWords[s_eyOffset+type] = roiWord;
122 else if (wordId == s_wordIdVal2) m_roiWords[s_etOffset+type] = roiWord;
123 else valid = false;
124 return valid;
125}
126
127} // end namespace
int eyError(SumType type=NORMAL) const
Return Ey error flags (bit 0 Overflow)
unsigned int missingEtHits(SumType type=NORMAL) const
Return Missing-ET hits.
unsigned int sumEtHits(SumType type=NORMAL) const
Return Sum-ET hits.
unsigned int missingEtSigHits() const
Return Missing-ET-Sig hits.
unsigned int ex(SumType type=NORMAL) const
Return Ex.
bool setRoiWord(uint32_t roiWord)
Set RoI word with ID check.
Definition CMXRoI.cxx:115
int exError(SumType type=NORMAL) const
Return Ex error flags (bit 0 Overflow)
int etError(SumType type=NORMAL) const
Return Et error flags (bit 0 Overflow)
unsigned int et(SumType type=NORMAL) const
Return Et.
uint32_t roiWord(int word) const
Return packed Energy RoI word (0-5)
unsigned int ey(SumType type=NORMAL) const
Return Ey.
eFexTowerBuilder creates xAOD::eFexTowerContainer from supercells (LATOME) and triggerTowers (TREX) i...