ATLAS Offline Software
Loading...
Searching...
No Matches
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
12namespace xAOD {
13
17
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
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
AuxElement()
Default constructor.
Class describing a LVL1 energy-sum "RoI".
uint32_t roiWord5() const
The sixth RoI word produced by the L1Calo hardware.
uint32_t roiWord3() const
The fourth RoI word produced by the L1Calo hardware.
static const unsigned int s_Word2
static const unsigned int s_Run2TruncRoIBit
The basic setters and getters for the xAOD class.
uint32_t thrPatSumET(bool restricted=false) const
The bit-pattern describing the passed sum-ET thresholds.
void setRoIWord3(uint32_t value)
Set the first "raw" RoI word describing the energy-sum RoI.
void setEnergyTRestricted(float value)
bool overflowX(bool restricted=false) const
The overflow flag for the EX calculation.
float energyT() const
The deposited total transverse energy.
uint32_t roiWord1() const
The second RoI word produced by the L1Calo hardware.
static const unsigned int s_Word1
bool overflowT(bool restricted=false) const
The overflow flag for the ET calculation.
const std::vector< std::string > & thrNames() const
The names of the thresholds passed.
void setEnergyT(float value)
Set the deposited total transverse energy.
void setRoIWord5(uint32_t value)
Set the third "raw" RoI word describing the energy-sum RoI.
float energyX() const
The total energy deposited in the X direction.
void setRoIWord0(uint32_t value)
Set the first "raw" RoI word describing the energy-sum RoI.
void setEnergyXRestricted(float value)
void setEnergyYRestricted(float value)
uint32_t thrPatMETSig() const
The bit-pattern describing the passed missing-ET significance thresholds.
uint32_t roiWord4() const
The fifth RoI word produced by the L1Calo hardware.
void setEnergyY(float value)
Set the total energy deposited in the Y direction.
void setRoIWord4(uint32_t value)
Set the second "raw" RoI word describing the energy-sum RoI.
void addThreshold(const std::string &name)
Add a new threshold that was passed.
float energyY() const
The total energy deposited in the Y direction.
void setRoIWord2(uint32_t value)
Set the third "raw" RoI word describing the energy-sum RoI.
void clearThresholds()
Remove all the passed thresholds.
uint32_t thrPatMET(bool restricted=false) const
The bit-pattern describing the passed missing-ET thresholds.
void setRoIWord1(uint32_t value)
Set the second "raw" RoI word describing the energy-sum RoI.
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.
void setEnergyX(float value)
Set the total energy deposited in the X direction.
static const unsigned int s_RoIType
uint32_t roiWord0() const
The first RoI word produced by the L1Calo hardware.
uint32_t roiWord2() const
The third RoI word produced by the L1Calo hardware.
bool overflowY(bool restricted=false) const
The overflow flag for the EY calculation.
void setRoIWord(uint32_t value)
Generic RoI word adding: the function will identify which word it is.
EnergySumRoI_v2()
Default constructor.
static const unsigned int s_Word0
Forward declaration.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRoIWord1 roiWord3
setEnergyY energyXRestricted
setEnergyY setEnergyXRestricted energyTRestricted
static const SG::AuxElement::Accessor< std::vector< std::string > > names("thrNames")
Accessor for the names of the passed thresholds.
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
setRoIWord1 setRoIWord3 roiWord5
setEventNumber uint32_t