ATLAS Offline Software
EnergySumRoI_v2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // xAOD include(s):
8 
9 // Local include(s):
11 
12 namespace xAOD {
13 
15  : SG::AuxElement() {
16  }
17 
25  void EnergySumRoI_v2::initialize( uint32_t roiword0, uint32_t roiword1,
26  uint32_t roiword2,
27  float energyX, float energyY,
28  float energyT ) {
29 
30  bool restricted = ((roiword0&s_Run2TruncRoIBit) != 0);
31 
32  if (restricted) {
33  setRoIWord3( roiword0 );
34  setRoIWord4( roiword1 );
35  setRoIWord5( roiword2 );
39  }
40  else {
41  setRoIWord0( roiword0 );
42  setRoIWord1( roiword1 );
43  setRoIWord2( roiword2 );
47  }
48 
49  return;
50  }
51 
53 
55 
56  bool word0 = ((roiword&s_RoIType) == s_Word0);
57  bool word1 = ((roiword&s_RoIType) == s_Word1);
58  bool word2 = ((roiword&s_RoIType) == s_Word2);
59  bool restricted = ((roiword&s_Run2TruncRoIBit) != 0);
60 
61  if (!restricted) {
62  if (word0) setRoIWord0(roiword);
63  else if (word1) setRoIWord1(roiword);
64  else if (word2) setRoIWord2(roiword);
65  }
66  else {
67  if (word0) setRoIWord3(roiword);
68  else if (word1) setRoIWord4(roiword);
69  else if (word2) setRoIWord5(roiword);
70  }
71 
72  return;
73 
74  }
75 
77  //
78  // Implementation for the RoI word accessor functions
79  //
80 
82  setRoIWord0 )
84  setRoIWord1 )
86  setRoIWord2 )
88  setRoIWord3 )
90  setRoIWord4 )
92  setRoIWord5 )
93 
94  //
96 
98  //
99  // Implementation of the threshold pattern helper functions
100  //
101 
102  uint32_t EnergySumRoI_v2::thrPatSumET(bool restricted) const {
103 
104  if (restricted) return ( ( roiWord3() >> 16 ) & 0xff );
105  else return ( ( roiWord0() >> 16 ) & 0xff );
106  }
107 
108  uint32_t EnergySumRoI_v2::thrPatMET(bool restricted) const {
109 
110  if (restricted) return ( ( roiWord4() >> 16 ) & 0xff );
111  else return ( ( roiWord1() >> 16 ) & 0xff );
112  }
113 
115 
116  return ( ( roiWord2() >> 16 ) & 0xff );
117  }
118 
119  //
121 
123  //
124  // Implementation of the overflow helper functions
125  //
126 
127  bool EnergySumRoI_v2::overflowX(bool restricted) const {
128 
129  if (restricted) return ( ( roiWord3() >> 15 ) & 0x1 );
130  else return ( ( roiWord0() >> 15 ) & 0x1 );
131  }
132 
133  bool EnergySumRoI_v2::overflowY(bool restricted) const {
134 
135  if (restricted) return ( ( roiWord4() >> 15 ) & 0x1 );
136  else return ( ( roiWord1() >> 15 ) & 0x1 );
137  }
138 
139  bool EnergySumRoI_v2::overflowT(bool restricted) const {
140 
141  if (restricted) return ( ( roiWord5() >> 15 ) & 0x1 );
142  else return ( ( roiWord2() >> 15 ) & 0x1 );
143  }
144 
145  //
147 
149  //
150  // Implementation of the threshold accessor functions
151  //
152 
155  names( "thrNames" );
156 
157  void EnergySumRoI_v2::addThreshold( const std::string& name ) {
158 
159  names( *this ).push_back( name );
160  return;
161  }
162 
164 
165  names( *this ).clear();
166  return;
167  }
168 
169  const std::vector< std::string >& EnergySumRoI_v2::thrNames() const {
170 
171  return names( *this );
172  }
173 
174  //
176 
178  //
179  // Implementation for the energy accessor functions
180  //
181 
183  setEnergyX )
185  setEnergyY )
187  setEnergyT )
189  setEnergyXRestricted )
191  setEnergyYRestricted )
193  setEnergyTRestricted )
194 
195 
196  // User functions for setting and getting either full or restricted ET
197  //void EnergySumRoI_v2::setEnergyX( float value, bool restricted ) {
198 
199  // if (restricted) setEnergyXTrunc(value);
200  // else setEnergyXFull(value);
201  //}
202 
203  //void EnergySumRoI_v2::setEnergyY( float value, bool restricted ) {
204 
205  // if (restricted) setEnergyYTrunc(value);
206  // else setEnergyYFull(value);
207  //}
208 
209  //void EnergySumRoI_v2::setEnergyT( float value, bool restricted ) {
210 
211  // if (restricted) setEnergyTTrunc(value);
212  // else setEnergyTFull(value);
213  //}
214 
215  //float EnergySumRoI_v2::energyX( bool restricted ) const {
216 
217  // if (restricted) return energyXTrunc();
218  // else return energyXFull();
219  //}
220 
221  //float EnergySumRoI_v2::energyY( bool restricted ) const {
222 
223  // if (restricted) return energyYTrunc();
224  // else return energyYFull();
225  //}
226 
227  //float EnergySumRoI_v2::energyT( bool restricted ) const {
228 
229  // if (restricted) return energyTTrunc();
230  // else return energyTFull();
231  //}
232 
233  //
235 
236 } // namespace xAOD
xAOD::EnergySumRoI_v2::thrPatMETSig
uint32_t thrPatMETSig() const
The bit-pattern describing the passed missing-ET significance thresholds.
Definition: EnergySumRoI_v2.cxx:114
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
xAOD::name
name
Definition: TriggerMenuJson_v1.cxx:29
xAOD::energyTRestricted
setEnergyY setEnergyXRestricted energyTRestricted
Definition: EnergySumRoI_v2.cxx:192
xAOD::word1
word1
Definition: eFexEMRoI_v1.cxx:82
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::EnergySumRoI_v2::overflowX
bool overflowX(bool restricted=false) const
The overflow flag for the EX calculation.
Definition: EnergySumRoI_v2.cxx:127
xAOD::EnergySumRoI_v2::overflowT
bool overflowT(bool restricted=false) const
The overflow flag for the ET calculation.
Definition: EnergySumRoI_v2.cxx:139
xAOD::EnergySumRoI_v2::setEnergyX
void setEnergyX(float value)
Set the total energy deposited in the X direction.
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
AuxStoreAccessorMacros.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD::EnergySumRoI_v2::setRoIWord2
void setRoIWord2(uint32_t value)
Set the third "raw" RoI word describing the energy-sum RoI.
xAOD::EnergySumRoI_v2::energyT
float energyT() const
The deposited total transverse energy.
xAOD::EnergySumRoI_v2::s_Run2TruncRoIBit
static const unsigned int s_Run2TruncRoIBit
The basic setters and getters for the xAOD class.
Definition: EnergySumRoI_v2.h:156
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::EnergySumRoI_v2::energyY
float energyY() const
The total energy deposited in the Y direction.
xAOD::EnergySumRoI_v2::setRoIWord4
void setRoIWord4(uint32_t value)
Set the second "raw" RoI word describing the energy-sum RoI.
xAOD::energyY
energyY
Definition: EnergySumRoI_v1.cxx:139
xAOD::EnergySumRoI_v2::setEnergyXRestricted
void setEnergyXRestricted(float value)
xAOD::EnergySumRoI_v2::roiWord4
uint32_t roiWord4() const
The fifth RoI word produced by the L1Calo hardware.
xAOD::EnergySumRoI_v2::roiWord3
uint32_t roiWord3() const
The fourth RoI word produced by the L1Calo hardware.
EnergySumRoI_v2.h
xAOD::EnergySumRoI_v2::s_Word0
static const unsigned int s_Word0
Definition: EnergySumRoI_v2.h:158
xAOD::EnergySumRoI_v2::setEnergyYRestricted
void setEnergyYRestricted(float value)
xAOD::EnergySumRoI_v2::setRoIWord5
void setRoIWord5(uint32_t value)
Set the third "raw" RoI word describing the energy-sum RoI.
xAOD::EnergySumRoI_v2::energyX
float energyX() const
The total energy deposited in the X direction.
xAOD::EnergySumRoI_v2::setEnergyTRestricted
void setEnergyTRestricted(float value)
xAOD::EnergySumRoI_v2::setEnergyY
void setEnergyY(float value)
Set the total energy deposited in the Y direction.
xAOD::EnergySumRoI_v2::EnergySumRoI_v2
EnergySumRoI_v2()
Default constructor.
Definition: EnergySumRoI_v2.cxx:14
xAOD::EnergySumRoI_v2::roiWord0
uint32_t roiWord0() const
The first RoI word produced by the L1Calo hardware.
xAOD::EnergySumRoI_v2::clearThresholds
void clearThresholds()
Remove all the passed thresholds.
Definition: EnergySumRoI_v2.cxx:163
xAOD::roiWord3
setRoIWord1 roiWord3
Definition: EnergySumRoI_v2.cxx:87
xAOD::EnergySumRoI_v2::thrPatMET
uint32_t thrPatMET(bool restricted=false) const
The bit-pattern describing the passed missing-ET thresholds.
Definition: EnergySumRoI_v2.cxx:108
xAOD::EnergySumRoI_v2::roiWord5
uint32_t roiWord5() const
The sixth RoI word produced by the L1Calo hardware.
xAOD::EnergySumRoI_v2::setRoIWord0
void setRoIWord0(uint32_t value)
Set the first "raw" RoI word describing the energy-sum RoI.
xAOD::EnergySumRoI_v2::roiWord2
uint32_t roiWord2() const
The third RoI word produced by the L1Calo hardware.
xAOD::EnergySumRoI_v2::setEnergyT
void setEnergyT(float value)
Set the deposited total transverse energy.
xAOD::EnergySumRoI_v2::overflowY
bool overflowY(bool restricted=false) const
The overflow flag for the EY calculation.
Definition: EnergySumRoI_v2.cxx:133
xAOD::EnergySumRoI_v2::initialize
void initialize(uint32_t roiword0, uint32_t roiword1, uint32_t roiword2, float energyX, float energyY, float energyT)
Initialise the object with its most important properties from a single RoI.
Definition: EnergySumRoI_v2.cxx:25
xAOD::roiWord5
setRoIWord1 setRoIWord3 roiWord5
Definition: EnergySumRoI_v2.cxx:91
xAOD::EnergySumRoI_v2::s_Word1
static const unsigned int s_Word1
Definition: EnergySumRoI_v2.h:159
xAOD::energyXRestricted
setEnergyY energyXRestricted
Definition: EnergySumRoI_v2.cxx:188
xAOD::EnergySumRoI_v2::addThreshold
void addThreshold(const std::string &name)
Add a new threshold that was passed.
Definition: EnergySumRoI_v2.cxx:157
xAOD::EnergySumRoI_v2::s_Word2
static const unsigned int s_Word2
Definition: EnergySumRoI_v2.h:160
xAOD::EnergySumRoI_v2::s_RoIType
static const unsigned int s_RoIType
Definition: EnergySumRoI_v2.h:157
xAOD::EnergySumRoI_v2
Class describing a LVL1 energy-sum "RoI".
Definition: EnergySumRoI_v2.h:35
xAOD::roiWord1
roiWord1
Definition: EnergySumRoI_v1.cxx:49
xAOD::EnergySumRoI_v2::setRoIWord
void setRoIWord(uint32_t value)
Generic RoI word adding: the function will identify which word it is.
Definition: EnergySumRoI_v2.cxx:54
xAOD::EnergySumRoI_v2::roiWord1
uint32_t roiWord1() const
The second RoI word produced by the L1Calo hardware.
xAOD::EnergySumRoI_v2::thrNames
const std::vector< std::string > & thrNames() const
The names of the thresholds passed.
Definition: EnergySumRoI_v2.cxx:169
xAOD::EnergySumRoI_v2::setRoIWord3
void setRoIWord3(uint32_t value)
Set the first "raw" RoI word describing the energy-sum RoI.
xAOD::EnergySumRoI_v2::setRoIWord1
void setRoIWord1(uint32_t value)
Set the second "raw" RoI word describing the energy-sum RoI.