ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMissingET_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// Implement the MissingET trigger object.
7
8// System include(s):
9#include <vector>
10#include <string>
11#include <stdexcept>
12
13// EDM include(s):
15
16// Local include(s):
18
19namespace xAOD {
20
21 // Default ctor
26
27 // Simple accessor functions for the "default variable" access pattern
28
33 setSumEt)
37 setRoiWord)
38
39 //
40 // Accessors used by multiple functions:
41 //
42 static const SG::AuxElement::Accessor< std::vector< std::string > >
43 nameAcc( "nameOfComponent" );
44 static const SG::AuxElement::Accessor< std::vector< float > >
45 exAcc( "exComponent" );
46 static const SG::AuxElement::Accessor< std::vector< float > >
47 eyAcc( "eyComponent" );
48 static const SG::AuxElement::Accessor< std::vector< float > >
49 ezAcc( "ezComponent" );
50 static const SG::AuxElement::Accessor< std::vector< float > >
51 sumEtAcc( "sumEtComponent" );
52 static const SG::AuxElement::Accessor< std::vector< float > >
53 sumEAcc( "sumEComponent" );
54 static const SG::AuxElement::Accessor< std::vector< float > >
55 calib0Acc( "calib0Component" );
56 static const SG::AuxElement::Accessor< std::vector< float > >
57 calib1Acc( "calib1Component" );
58 static const SG::AuxElement::Accessor< std::vector< float > >
59 sumOfSignsAcc( "sumOfSignsComponent" );
60 static const SG::AuxElement::Accessor< std::vector< short > >
61 statusAcc( "statusComponent" );
62 static const SG::AuxElement::Accessor< std::vector< unsigned short > >
63 usedchannelsAcc( "usedChannelsComponent" );
64
65 // Define a component name
67 defineComponents( const std::vector< std::string >& componentNames ) {
68
69 // Make sure that we aren't killing off something that already exists
70 if( !nameAcc( *this ).empty()) {
71 throw std::runtime_error( "Attempt to redefine component list for "
72 "xAOD::TrigMissingET object" );
73 }
74
75 // Assign the component names:
76 nameAcc( *this ) = componentNames;
77
78 // Initialise all the variables:
79 exAcc( *this ).resize( componentNames.size(), 0.0 );
80 eyAcc( *this ).resize( componentNames.size(), 0.0 );
81 ezAcc( *this ).resize( componentNames.size(), 0.0 );
82 sumEtAcc( *this ).resize( componentNames.size(), 0.0 );
83 sumEAcc( *this ).resize( componentNames.size(), 0.0 );
84 calib0Acc( *this ).resize( componentNames.size(), 0.0 );
85 calib1Acc( *this ).resize( componentNames.size(), 1.0 );
86 sumOfSignsAcc( *this ).resize( componentNames.size(), 1.0 );
87 statusAcc( *this ).resize( componentNames.size(), 0 );
88 usedchannelsAcc( *this ).resize( componentNames.size(), 1 );
89
90
91 return;
92 }
93
94 // Store the name of the component
96 const std::string& str ) {
97
98 nameAcc( *this ).at( index ) = str;
99 return;
100 }
101
102 // Give back the number of components
104 return nameAcc( *this ).size();
105 }
106
107 const std::string&
109
110 return nameAcc( *this ).at( index );
111 }
112
113 void TrigMissingET_v1::setExComponent( unsigned int index, float val ) {
114
115 exAcc( *this ).at( index ) = val;
116 return;
117 }
118
119 float TrigMissingET_v1::exComponent( unsigned int index ) const {
120
121 return exAcc( *this ).at( index );
122 }
123
124 void TrigMissingET_v1::setEyComponent( unsigned int index, float val ) {
125
126 eyAcc( *this ).at( index ) = val;
127 return;
128 }
129
130 float TrigMissingET_v1::eyComponent( unsigned int index ) const {
131
132 return eyAcc( *this ).at( index );
133 }
134
135 void TrigMissingET_v1::setEzComponent( unsigned int index, float val ) {
136
137 ezAcc( *this ).at( index ) = val;
138 return;
139 }
140
141 float TrigMissingET_v1::ezComponent( unsigned int index ) const {
142
143 return ezAcc( *this ).at( index );
144 }
145
146 void TrigMissingET_v1::setSumEtComponent( unsigned int index, float val ) {
147
148 sumEtAcc( *this ).at( index ) = val;
149 return;
150 }
151
152 float TrigMissingET_v1::sumEtComponent( unsigned int index ) const {
153
154 return sumEtAcc( *this ).at( index );
155 }
156
157 void TrigMissingET_v1::setSumEComponent( unsigned int index, float val ) {
158
159 sumEAcc( *this ).at( index ) = val;
160 return;
161 }
162
163 float TrigMissingET_v1::sumEComponent( unsigned int index ) const {
164
165 return sumEAcc( *this ).at( index );
166 }
167
168 void TrigMissingET_v1::setCalib0Component( unsigned int index, float val ) {
169
170 calib0Acc( *this ).at( index ) = val;
171 return;
172 }
173
174 float TrigMissingET_v1::calib0Component( unsigned int index ) const {
175
176 return calib0Acc( *this ).at( index );
177 }
178
179 void TrigMissingET_v1::setCalib1Component( unsigned int index, float val ) {
180
181 calib1Acc( *this ).at( index ) = val;
182 return;
183 }
184
185 float TrigMissingET_v1::calib1Component( unsigned int index ) const {
186
187 return calib1Acc( *this ).at( index );
188 }
189
190 void TrigMissingET_v1::setSumOfSignsComponent( unsigned int index, float val ) {
191
192 sumOfSignsAcc( *this ).at( index ) = val;
193 return;
194 }
195
196 float TrigMissingET_v1::sumOfSignsComponent( unsigned int index ) const {
197
198 return sumOfSignsAcc( *this ).at( index );
199 }
200
201 void TrigMissingET_v1::setStatusComponent( unsigned int index, float val ) {
202
203 statusAcc( *this ).at( index ) = val;
204 return;
205 }
206
207 short TrigMissingET_v1::statusComponent( unsigned int index ) const {
208
209 return statusAcc( *this ).at( index );
210 }
211
212 void TrigMissingET_v1::setUsedChannelsComponent( unsigned int index, float val ) {
213
214 usedchannelsAcc( *this ).at( index ) = val;
215 return;
216 }
217
218 unsigned short TrigMissingET_v1::usedChannelsComponent( unsigned int index ) const {
219
220 return usedchannelsAcc( *this ).at( index );
221 }
222
223
224} // namespace xAOD
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
AuxElement()
Default constructor.
Class holding the Missing ET trigger fex results.
void setSumEtComponent(unsigned int index, float value)
Set SumEt.
void setExComponent(unsigned int index, float value)
Set the x component fo the energy of a component.
void setNameOfComponent(unsigned int index, const std::string &str)
Set the name of a component.
void setUsedChannelsComponent(unsigned int index, float value)
Set used Channels.
void setSumOfSignsComponent(unsigned int index, float value)
Set SumOfSigns.
float exComponent(unsigned int index) const
Get the x component fo the energy of a component.
const std::string & nameOfComponent(unsigned int index) const
Get the name of a component.
float eyComponent(unsigned int index) const
Get the y component fo the energy of a component.
void setCalib1Component(unsigned int index, float value)
Set Calib1.
float calib0Component(unsigned int index) const
Get Calib0.
float calib1Component(unsigned int index) const
Get Calib1.
unsigned int getNumberOfComponents() const
Get the number of components.
float ezComponent(unsigned int index) const
Get the z component fo the energy of a component.
void setSumEComponent(unsigned int index, float value)
Set SumE.
void setCalib0Component(unsigned int index, float value)
Set Calib0.
short statusComponent(unsigned int index) const
Get Status.
TrigMissingET_v1()
Defaut constructor.
void setStatusComponent(unsigned int index, float value)
Set Status.
float sumOfSignsComponent(unsigned int index) const
Get SumOfSigns.
float sumEComponent(unsigned int index) const
Get SumE.
void setEyComponent(unsigned int index, float value)
Set the y component fo the energy of a component.
void defineComponents(const std::vector< std::string > &componentNames)
Define each of the components by name.
void setEzComponent(unsigned int index, float value)
Set the z component fo the energy of a component.
float sumEtComponent(unsigned int index) const
Get SumEt.
unsigned short usedChannelsComponent(unsigned int index) const
Get used Channels.
Forward declaration.
Definition index.py:1
STL namespace.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
static const SG::AuxElement::Accessor< std::vector< float > > calib0Acc("calib0Component")
static const SG::AuxElement::Accessor< std::string > nameAcc("name")
static const SG::AuxElement::Accessor< std::vector< float > > sumEtAcc("sumEtComponent")
static const SG::AuxElement::Accessor< std::vector< unsigned short > > usedchannelsAcc("usedChannelsComponent")
static const SG::AuxElement::Accessor< std::vector< float > > exAcc("exComponent")
static const SG::AuxElement::Accessor< std::vector< float > > calib1Acc("calib1Component")
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
static const SG::AuxElement::Accessor< std::vector< float > > ezAcc("ezComponent")
static const SG::AuxElement::Accessor< std::vector< float > > sumOfSignsAcc("sumOfSignsComponent")
static const SG::AuxElement::Accessor< std::vector< float > > sumEAcc("sumEComponent")
static const SG::AuxElement::Accessor< std::vector< short > > statusAcc("statusComponent")
setEventNumber uint32_t
static const SG::AuxElement::Accessor< std::vector< float > > eyAcc("eyComponent")