ATLAS Offline Software
Loading...
Searching...
No Matches
CP::AsgPtEtaSelectionTool Class Referencefinal

an IAsgSelectionTool that performs basic pt and eta cut (with an optional eta gap) More...

#include <AsgPtEtaSelectionTool.h>

Inheritance diagram for CP::AsgPtEtaSelectionTool:
Collaboration diagram for CP::AsgPtEtaSelectionTool:

Public Member Functions

virtual StatusCode initialize () override
 Dummy implementation of the initialisation function.
virtual const asg::AcceptInfo & getAcceptInfo () const override
 Declare the interface ID for this pure-virtual interface class to the Athena framework.
virtual asg::AcceptData accept (const xAOD::IParticle *particle) const override
 The main accept method: the actual cuts are applied here.
 AsgTool (const std::string &name)
 standard constructor
 AsgTool (const AsgTool &)=delete
 standard constructor
virtual void print () const
 Print the state of the tool.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Additional helper functions, not directly mimicking Athena
template<class T>
const T * getProperty (const std::string &name) const
 Get one of the tool's properties.
const std::string & msg_level_name () const __attribute__((deprecated))
 A deprecated function for getting the message level's name.
const std::string & getName (const void *ptr) const
 Get the name of an object that is / should be in the event store.
SG::sgkey_t getKey (const void *ptr) const
 Get the (hashed) key of an object that is in the event store.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

int m_minPtCutIndex { -1 }
 Index for the minimum pT selection.
int m_maxPtCutIndex { -1 }
 Index for the maximum pT selection.
int m_minEtaCutIndex { -1 }
 Index for the minimum eta selection.
int m_maxEtaCutIndex { -1 }
 Index for the maximum eta selection.
int m_etaGapCutIndex { -1 }
 Index for the eta gap selection.
int m_minRapidityCutIndex { -1 }
 Index for the minimum rapidity selection.
int m_maxRapidityCutIndex { -1 }
 Index for the maximum rapidity selection.
int m_egammaCastCutIndex { -1 }
 Index for the e/gamma casting.
int m_egammaClusterCutIndex { -1 }
 Index for the e/gamma calo-cluster.
int m_dressedPropertiesIndex { -1 }
 Index for the existence of dressed properties.
int m_jetCastCutIndex { -1 }
 Index for the jet casting.
std::atomic< bool > m_shouldPrintCastWarning {true}
 a version of m_printCastWarning that we modify once we printed the warning
std::atomic< bool > m_shouldPrintClusterWarning {true}
 a version of m_printClusterWarning that we modify once we printed the warning
std::atomic< bool > m_shouldPrintDressedWarning {true}
 whether we still need to print the warning about missing dressed decorations
std::atomic< bool > m_shouldPrintPtWarning {true}
 whether we still need to print the warning about an invalid pt value
asg::AcceptInfo m_accept
 the asg::AcceptInfo we are using
std::unique_ptr< SG::ConstAccessor< float > > m_dressedPtAccessor {}
 dressed pt and eta accessors
std::unique_ptr< SG::ConstAccessor< float > > m_dressedEtaAccessor {}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared
Gaudi::Property< float > m_minPt {this, "minPt", 0, "minimum pt to require (or 0 for no pt cut)"}
 tool properties
Gaudi::Property< float > m_maxPt {this, "maxPt", 0, "maximum pt to require (or 0 for no pt cut)"}
Gaudi::Property< float > m_minEta {this, "minEta", 0, "minimum abs(eta) to allow (or 0 for no eta cut)"}
Gaudi::Property< float > m_maxEta {this, "maxEta", 0, "maximum abs(eta) to allow (or 0 for no eta cut)"}
Gaudi::Property< float > m_etaGapLow {this, "etaGapLow", 0, "low end of the eta gap"}
Gaudi::Property< float > m_etaGapHigh {this, "etaGapHigh", 0, "high end of the eta gap (or 0 for no eta gap)"}
Gaudi::Property< float > m_minRapidity {this, "minRapidity", 0, "minimum abs(rapidity) to allow (or 0 for no eta cut)"}
Gaudi::Property< float > m_maxRapidity {this, "maxRapidity", 0, "maximum abs(rapidity) to allow (or 0 for no eta cut)"}
Gaudi::Property< bool > m_useClusterEta {this, "useClusterEta", false, "whether to use the cluster eta (for electrons only)"}
Gaudi::Property< bool > m_useDressedProperties {this, "useDressedProperties", false, "whether to use the dressed kinematic properties (for truth particles only)"}
Gaudi::Property< bool > m_useConstituentMomentum {this, "useConstituentMomentum", false, "whether to use the constituent momentum (for jets only) (not for pt)"}
Gaudi::Property< bool > m_printCastWarning {this, "printCastWarning", true, "whether to print a warning/error when the cast fails"}
Gaudi::Property< bool > m_printClusterWarning {this, "printClusterWarning", true, "whether to print a warning/error when the cluster is missing"}

Detailed Description

an IAsgSelectionTool that performs basic pt and eta cut (with an optional eta gap)

This is a very basic selection that needs to happen on all object types to some degree. Instead of doing this separately for each type, it is just one basic tool for all IParticle implementations. Also, this is a tool, not an algorithm, because we already have an algorithm wrapping generic selection tools and there is no benefit to making it an algorithm.

There may be some overlap with the individual selectors for the given object types, but having a tool for this allows to apply it at any point in the algorithm sequence.

Definition at line 34 of file AsgPtEtaSelectionTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Member Function Documentation

◆ accept()

asg::AcceptData CP::AsgPtEtaSelectionTool::accept ( const xAOD::IParticle * particle) const
overridevirtual

The main accept method: the actual cuts are applied here.

Implements IAsgSelectionTool.

Definition at line 162 of file AsgPtEtaSelectionTool.cxx.

164 {
165 asg::AcceptData accept (&m_accept);
166
167 // Check if dressed properties exist if needed
169 if (!m_dressedPtAccessor->isAvailable(*particle)) {
171 ANA_MSG_WARNING ("dressed decorations not available");
173 return accept;
174 }
175 accept.setCutResult (m_dressedPropertiesIndex, true);
176 }
177
178 // Perform the tranverse momentum cuts.
179 if (m_minPtCutIndex >= 0 || m_maxPtCutIndex >= 0)
180 {
181 float pt = particle->pt();
183 pt = (*m_dressedPtAccessor) (*particle);
184 }
185
186 if (m_minPtCutIndex >= 0) {
187 if (!std::isfinite(pt) || pt < 0.)
188 {
190 ANA_MSG_WARNING ("invalid pt value, setting object to fail pt-cut: " << pt);
192 accept.setCutResult (m_minPtCutIndex, false);
193 } else
194 {
195 accept.setCutResult (m_minPtCutIndex, pt >= m_minPt);
196 }
197 }
198 if (m_maxPtCutIndex >= 0) {
199 accept.setCutResult (m_maxPtCutIndex, pt < m_maxPt);
200 }
201 }
202
203 // Perform the eta cut(s).
204 if (m_minEtaCutIndex >= 0 || m_maxEtaCutIndex >= 0 || m_etaGapCutIndex >= 0)
205 {
206 float absEta = 0;
207
208 if (m_useClusterEta == true)
209 {
210 const xAOD::Egamma *egamma
211 = dynamic_cast<const xAOD::Egamma*>(particle);
212 if (egamma == nullptr)
213 {
215 ANA_MSG_ERROR ("failed to cast input particle to electron");
217 return accept;
218 }
219 accept.setCutResult (m_egammaCastCutIndex, true);
220 const xAOD::CaloCluster *const caloCluster {egamma->caloCluster()};
221 if (!caloCluster)
222 {
224 ANA_MSG_ERROR ("no calo-cluster associated with e-gamma object");
226 return accept;
227 }
228 accept.setCutResult (m_egammaClusterCutIndex, true);
229 absEta = std::abs (caloCluster->etaBE(2));
230 } else if (m_useDressedProperties)
231 {
232 absEta = std::abs ((*m_dressedEtaAccessor) (*particle));
233 } else if (m_useConstituentMomentum == true)
234 {
235 const xAOD::Jet *jet
236 = dynamic_cast<const xAOD::Jet*>(particle);
237 if (jet == nullptr)
238 {
240 ANA_MSG_ERROR ("failed to cast input particle to jet");
242 return accept;
243 }
244 accept.setCutResult (m_jetCastCutIndex, true);
245 absEta = std::abs (jet->getAttribute<xAOD::JetFourMom_t>("JetConstitScaleMomentum").eta());
246 } else
247 {
248 absEta = std::abs (particle->eta());
249 }
250
251 if (m_minEtaCutIndex >= 0) {
252 accept.setCutResult (m_minEtaCutIndex, absEta > m_minEta);
253 }
254 if (m_maxEtaCutIndex >= 0) {
255 accept.setCutResult (m_maxEtaCutIndex, absEta <= m_maxEta);
256 }
257 if (m_etaGapCutIndex >= 0) {
258 accept.setCutResult (m_etaGapCutIndex, (absEta < m_etaGapLow ||
259 absEta > m_etaGapHigh));
260 }
261 }
262
263 // Perform the rapdity cut(s).
265 {
266 float absRapidity = 0;
267
268 if (m_useConstituentMomentum == true)
269 {
270 const xAOD::Jet *jet
271 = dynamic_cast<const xAOD::Jet*>(particle);
272 if (jet == nullptr)
273 {
275 ANA_MSG_ERROR ("failed to cast input particle to jet");
277 return accept;
278 }
279 accept.setCutResult (m_jetCastCutIndex, true);
280 absRapidity = std::abs (jet->getAttribute<xAOD::JetFourMom_t>("JetConstitScaleMomentum").Rapidity());
281 } else
282 {
283 absRapidity = std::abs (particle->rapidity());
284 }
285
286 if (m_minRapidityCutIndex >= 0) {
287 accept.setCutResult (m_minRapidityCutIndex, absRapidity > m_minRapidity);
288 }
289 if (m_maxRapidityCutIndex >= 0) {
290 accept.setCutResult (m_maxRapidityCutIndex, absRapidity <= m_maxRapidity);
291 }
292 }
293
294 return accept;
295 }
#define ANA_MSG_ERROR(xmsg,...)
Macro printing error messages.
#define ANA_MSG_WARNING(xmsg,...)
Macro printing warning messages.
int m_jetCastCutIndex
Index for the jet casting.
Gaudi::Property< float > m_maxPt
int m_etaGapCutIndex
Index for the eta gap selection.
std::unique_ptr< SG::ConstAccessor< float > > m_dressedPtAccessor
dressed pt and eta accessors
int m_egammaCastCutIndex
Index for the e/gamma casting.
Gaudi::Property< float > m_etaGapLow
std::atomic< bool > m_shouldPrintDressedWarning
whether we still need to print the warning about missing dressed decorations
int m_maxEtaCutIndex
Index for the maximum eta selection.
int m_maxPtCutIndex
Index for the maximum pT selection.
virtual asg::AcceptData accept(const xAOD::IParticle *particle) const override
The main accept method: the actual cuts are applied here.
Gaudi::Property< float > m_minEta
Gaudi::Property< bool > m_useDressedProperties
Gaudi::Property< float > m_minRapidity
std::unique_ptr< SG::ConstAccessor< float > > m_dressedEtaAccessor
std::atomic< bool > m_shouldPrintPtWarning
whether we still need to print the warning about an invalid pt value
int m_egammaClusterCutIndex
Index for the e/gamma calo-cluster.
int m_minPtCutIndex
Index for the minimum pT selection.
Gaudi::Property< bool > m_useClusterEta
int m_maxRapidityCutIndex
Index for the maximum rapidity selection.
std::atomic< bool > m_shouldPrintClusterWarning
a version of m_printClusterWarning that we modify once we printed the warning
Gaudi::Property< float > m_minPt
tool properties
int m_dressedPropertiesIndex
Index for the existence of dressed properties.
int m_minRapidityCutIndex
Index for the minimum rapidity selection.
asg::AcceptInfo m_accept
the asg::AcceptInfo we are using
std::atomic< bool > m_shouldPrintCastWarning
a version of m_printCastWarning that we modify once we printed the warning
Gaudi::Property< bool > m_useConstituentMomentum
Gaudi::Property< float > m_maxEta
Gaudi::Property< float > m_etaGapHigh
int m_minEtaCutIndex
Index for the minimum eta selection.
Gaudi::Property< float > m_maxRapidity
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
bool absEta(const xAOD::TauJet &tau, float &out)
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Jet_v1 Jet
Definition of the current "jet version".
setRcore setEtHad setFside pt
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Egamma_v1 Egamma
Definition of the current "egamma version".
Definition Egamma.h:17
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition JetTypes.h:17

◆ AsgTool() [1/2]

asg::AsgTool::AsgTool ( const AsgTool & )
delete

standard constructor

Guarantee
strong
Failures
out of memory II

◆ AsgTool() [2/2]

asg::AsgTool::AsgTool ( const std::string & name)

standard constructor

Guarantee
strong
Failures
out of memory II

Definition at line 51 of file AsgTool.cxx.

60#ifndef XAOD_STANDALONE
61 ::getType(name), ::getName(name), ::getParent(name)
62#else // not XAOD_STANDALONE
63 name
64#endif // not XAOD_STANDALONE
65 )
66#ifdef XAOD_STANDALONE
67 , m_event()
68#endif // XAOD_STANDALONE
69 {
70 ToolStore::put( this ).ignore(); // Register the tool in the ToolStore
71 }
const std::string & getName(const void *ptr) const
Get the name of an object that is / should be in the event store.
Definition AsgTool.cxx:106
::AthAlgTool AsgToolBase
Definition AsgTool.h:33

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getAcceptInfo()

const asg::AcceptInfo & CP::AsgPtEtaSelectionTool::getAcceptInfo ( ) const
overridevirtual

Declare the interface ID for this pure-virtual interface class to the Athena framework.

Method to get the AcceptInfo to query what cuts are defined.

Implements IAsgSelectionTool.

Definition at line 154 of file AsgPtEtaSelectionTool.cxx.

156 {
157 return m_accept;
158 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void * ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119 {
120
121#ifdef XAOD_STANDALONE
122 // In case we use @c xAOD::Event, we have a direct function call
123 // for this.
124 return evtStore()->event()->getKey( ptr );
125#else
126 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127 return ( proxy == nullptr ? 0 : proxy->sgkey() );
128#endif // XAOD_STANDALONE
129 }
ServiceHandle< StoreGateSvc > & evtStore()

◆ getName()

const std::string & asg::AsgTool::getName ( const void * ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::Event both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106 {
107
108#ifdef XAOD_STANDALONE
109 // In case we use @c xAOD::Event, we have a direct function call
110 // for this.
111 return evtStore()->event()->getName( ptr );
112#else
113 const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114 static const std::string dummy = "";
115 return ( proxy == nullptr ? dummy : proxy->name() );
116#endif // XAOD_STANDALONE
117 }

◆ getProperty()

template<class T>
const T * asg::AsgTool::getProperty ( const std::string & name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode CP::AsgPtEtaSelectionTool::initialize ( void )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 27 of file AsgPtEtaSelectionTool.cxx.

29 {
31 {
32 ATH_MSG_ERROR ("only one of 'useDressedProperties', 'useClusterEta' and 'useConstituentMomentum' can be used at the same time");
33 return StatusCode::FAILURE;
34 }
35 if (m_minPt < 0 || !std::isfinite (m_minPt))
36 {
37 ATH_MSG_ERROR ("invalid value of minPt: " << m_minPt);
38 return StatusCode::FAILURE;
39 }
40 if (m_maxPt < 0 || !std::isfinite (m_maxPt))
41 {
42 ATH_MSG_ERROR ("invalid value of maxPt: " << m_maxPt);
43 return StatusCode::FAILURE;
44 }
45 if (m_minEta < 0 || !std::isfinite (m_minEta))
46 {
47 ATH_MSG_ERROR ("invalid value of minEta: " << m_minEta);
48 return StatusCode::FAILURE;
49 }
50 if (m_maxEta < 0 || !std::isfinite (m_maxEta))
51 {
52 ATH_MSG_ERROR ("invalid value of maxEta: " << m_maxEta);
53 return StatusCode::FAILURE;
54 }
55 if (m_etaGapLow < 0 || !std::isfinite (m_etaGapLow))
56 {
57 ATH_MSG_ERROR ("invalid value of etaGapLow: " << m_etaGapLow);
58 return StatusCode::FAILURE;
59 }
60 if (m_etaGapHigh < 0 || !std::isfinite (m_etaGapHigh))
61 {
62 ATH_MSG_ERROR ("invalid value of etaGapHigh: " << m_etaGapHigh);
63 return StatusCode::FAILURE;
64 }
66 {
67 ATH_MSG_ERROR ("invalid eta gap: " << m_etaGapLow << " to " << m_etaGapHigh);
68 return StatusCode::FAILURE;
69 }
70 if (m_etaGapLow > 0 && m_minEta > 0 && m_etaGapLow <= m_minEta)
71 {
72 ATH_MSG_ERROR ("etaGapLow=" << m_etaGapLow << " <= minEta=" << m_minEta);
73 return StatusCode::FAILURE;
74 }
75 if (m_etaGapHigh > 0 && m_maxEta > 0 && m_etaGapHigh >= m_maxEta)
76 {
77 ATH_MSG_ERROR ("etaGapHigh=" << m_etaGapHigh << " >= maxEta=" << m_maxEta);
78 return StatusCode::FAILURE;
79 }
80 if (m_minRapidity < 0 || !std::isfinite (m_minRapidity))
81 {
82 ATH_MSG_ERROR ("invalid value of minRapidity: " << m_minRapidity);
83 return StatusCode::FAILURE;
84 }
85 if (m_maxRapidity < 0 || !std::isfinite (m_maxRapidity))
86 {
87 ATH_MSG_ERROR ("invalid value of maxRapidity: " << m_maxRapidity);
88 return StatusCode::FAILURE;
89 }
90 if ((m_minRapidity > 0 && m_maxRapidity > 0) &&
92 {
93 ATH_MSG_ERROR ("invalid rapidity range: " << m_minRapidity << " to " << m_maxRapidity);
94 return StatusCode::FAILURE;
95 }
96 if ((m_minEta > 0 || m_maxEta > 0) && (m_minRapidity > 0 || m_maxRapidity > 0))
97 {
98 ATH_MSG_ERROR ("cannot use both eta and rapidity cuts at the same time");
99 return StatusCode::FAILURE;
100 }
101
103 ATH_MSG_DEBUG( "Performing pt and eta cuts on the dressed properties" );
104 m_dressedPropertiesIndex = m_accept.addCut ("dressedProperties", "has dressed properties");
105 m_dressedPtAccessor = std::make_unique<SG::ConstAccessor<float>> ("pt_dressed");
106 m_dressedEtaAccessor = std::make_unique<SG::ConstAccessor<float>> ("eta_dressed");
107 }
108 if (m_minPt > 0) {
109 ATH_MSG_DEBUG( "Performing pt >= " << m_minPt << " MeV selection" );
110 m_minPtCutIndex = m_accept.addCut ("minPt", "minimum pt cut");
111 }
112 if (m_maxPt > 0) {
113 ATH_MSG_DEBUG( "Performing pt < " << m_maxPt << " MeV selection" );
114 m_maxPtCutIndex = m_accept.addCut ("maxPt", "maximum pt cut");
115 }
116 if (m_useClusterEta) {
117 ATH_MSG_DEBUG( "Performing eta cut on the e/gamma cluster" );
118 m_egammaCastCutIndex = m_accept.addCut ("castEgamma", "cast to egamma");
119 m_egammaClusterCutIndex = m_accept.addCut ("caloCluster", "egamma object has cluster");
120 }
122 ATH_MSG_DEBUG( "Performing eta/rapidity cut on the jet constituent momentum" );
123 m_jetCastCutIndex = m_accept.addCut ("castJet", "cast to jet");
124 }
125 if (m_minEta > 0) {
126 ATH_MSG_DEBUG( "Performing |eta| > " << m_minEta << " selection");
127 m_minEtaCutIndex = m_accept.addCut ("minEta", "minimum eta cut");
128 }
129 if (m_maxEta > 0) {
130 ATH_MSG_DEBUG( "Performing |eta| <= " << m_maxEta << " selection" );
131 m_maxEtaCutIndex = m_accept.addCut ("maxEta", "maximum eta cut");
132 }
133 if (m_etaGapHigh > 0) {
134 ATH_MSG_DEBUG( "Performing !( " << m_etaGapLow << " <= |eta| <= "
135 << m_etaGapHigh << " ) selection" );
136 m_etaGapCutIndex = m_accept.addCut ("etaGap", "eta gap cut");
137 }
138 if (m_minRapidity > 0) {
139 ATH_MSG_DEBUG( "Performing |rapidity| > " << m_minRapidity << " selection");
140 m_minRapidityCutIndex = m_accept.addCut ("minRapidity", "minimum rapidity cut");
141 }
142 if (m_maxRapidity > 0) {
143 ATH_MSG_DEBUG( "Performing |rapidity| <= " << m_maxRapidity << " selection" );
144 m_maxRapidityCutIndex = m_accept.addCut ("maxRapidity", "maximum rapidity cut");
145 }
148
149 return StatusCode::SUCCESS;
150 }
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
Gaudi::Property< bool > m_printClusterWarning
Gaudi::Property< bool > m_printCastWarning

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101 {
102
103 return MSG::name( msg().level() );
104 }
MsgStream & msg() const
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition MsgLevel.cxx:19

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, and AthCheckedComponent<::AthAlgTool >.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_accept

asg::AcceptInfo CP::AsgPtEtaSelectionTool::m_accept
private

the asg::AcceptInfo we are using

Definition at line 141 of file AsgPtEtaSelectionTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_dressedEtaAccessor

std::unique_ptr<SG::ConstAccessor<float> > CP::AsgPtEtaSelectionTool::m_dressedEtaAccessor {}
private

Definition at line 146 of file AsgPtEtaSelectionTool.h.

146{};

◆ m_dressedPropertiesIndex

int CP::AsgPtEtaSelectionTool::m_dressedPropertiesIndex { -1 }
private

Index for the existence of dressed properties.

Definition at line 109 of file AsgPtEtaSelectionTool.h.

109{ -1 };

◆ m_dressedPtAccessor

std::unique_ptr<SG::ConstAccessor<float> > CP::AsgPtEtaSelectionTool::m_dressedPtAccessor {}
private

dressed pt and eta accessors

Definition at line 145 of file AsgPtEtaSelectionTool.h.

145{};

◆ m_egammaCastCutIndex

int CP::AsgPtEtaSelectionTool::m_egammaCastCutIndex { -1 }
private

Index for the e/gamma casting.

Definition at line 105 of file AsgPtEtaSelectionTool.h.

105{ -1 };

◆ m_egammaClusterCutIndex

int CP::AsgPtEtaSelectionTool::m_egammaClusterCutIndex { -1 }
private

Index for the e/gamma calo-cluster.

Definition at line 107 of file AsgPtEtaSelectionTool.h.

107{ -1 };

◆ m_etaGapCutIndex

int CP::AsgPtEtaSelectionTool::m_etaGapCutIndex { -1 }
private

Index for the eta gap selection.

Definition at line 99 of file AsgPtEtaSelectionTool.h.

99{ -1 };

◆ m_etaGapHigh

Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_etaGapHigh {this, "etaGapHigh", 0, "high end of the eta gap (or 0 for no eta gap)"}
private

Definition at line 79 of file AsgPtEtaSelectionTool.h.

79{this, "etaGapHigh", 0, "high end of the eta gap (or 0 for no eta gap)"};

◆ m_etaGapLow

Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_etaGapLow {this, "etaGapLow", 0, "low end of the eta gap"}
private

Definition at line 78 of file AsgPtEtaSelectionTool.h.

78{this, "etaGapLow", 0, "low end of the eta gap"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_jetCastCutIndex

int CP::AsgPtEtaSelectionTool::m_jetCastCutIndex { -1 }
private

Index for the jet casting.

Definition at line 111 of file AsgPtEtaSelectionTool.h.

111{ -1 };

◆ m_maxEta

Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_maxEta {this, "maxEta", 0, "maximum abs(eta) to allow (or 0 for no eta cut)"}
private

Definition at line 77 of file AsgPtEtaSelectionTool.h.

77{this, "maxEta", 0, "maximum abs(eta) to allow (or 0 for no eta cut)"};

◆ m_maxEtaCutIndex

int CP::AsgPtEtaSelectionTool::m_maxEtaCutIndex { -1 }
private

Index for the maximum eta selection.

Definition at line 97 of file AsgPtEtaSelectionTool.h.

97{ -1 };

◆ m_maxPt

Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_maxPt {this, "maxPt", 0, "maximum pt to require (or 0 for no pt cut)"}
private

Definition at line 75 of file AsgPtEtaSelectionTool.h.

75{this, "maxPt", 0, "maximum pt to require (or 0 for no pt cut)"};

◆ m_maxPtCutIndex

int CP::AsgPtEtaSelectionTool::m_maxPtCutIndex { -1 }
private

Index for the maximum pT selection.

Definition at line 93 of file AsgPtEtaSelectionTool.h.

93{ -1 };

◆ m_maxRapidity

Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_maxRapidity {this, "maxRapidity", 0, "maximum abs(rapidity) to allow (or 0 for no eta cut)"}
private

Definition at line 81 of file AsgPtEtaSelectionTool.h.

81{this, "maxRapidity", 0, "maximum abs(rapidity) to allow (or 0 for no eta cut)"};

◆ m_maxRapidityCutIndex

int CP::AsgPtEtaSelectionTool::m_maxRapidityCutIndex { -1 }
private

Index for the maximum rapidity selection.

Definition at line 103 of file AsgPtEtaSelectionTool.h.

103{ -1 };

◆ m_minEta

Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_minEta {this, "minEta", 0, "minimum abs(eta) to allow (or 0 for no eta cut)"}
private

Definition at line 76 of file AsgPtEtaSelectionTool.h.

76{this, "minEta", 0, "minimum abs(eta) to allow (or 0 for no eta cut)"};

◆ m_minEtaCutIndex

int CP::AsgPtEtaSelectionTool::m_minEtaCutIndex { -1 }
private

Index for the minimum eta selection.

Definition at line 95 of file AsgPtEtaSelectionTool.h.

95{ -1 };

◆ m_minPt

Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_minPt {this, "minPt", 0, "minimum pt to require (or 0 for no pt cut)"}
private

tool properties

Definition at line 74 of file AsgPtEtaSelectionTool.h.

74{this, "minPt", 0, "minimum pt to require (or 0 for no pt cut)"};

◆ m_minPtCutIndex

int CP::AsgPtEtaSelectionTool::m_minPtCutIndex { -1 }
private

Index for the minimum pT selection.

Definition at line 91 of file AsgPtEtaSelectionTool.h.

91{ -1 };

◆ m_minRapidity

Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_minRapidity {this, "minRapidity", 0, "minimum abs(rapidity) to allow (or 0 for no eta cut)"}
private

Definition at line 80 of file AsgPtEtaSelectionTool.h.

80{this, "minRapidity", 0, "minimum abs(rapidity) to allow (or 0 for no eta cut)"};

◆ m_minRapidityCutIndex

int CP::AsgPtEtaSelectionTool::m_minRapidityCutIndex { -1 }
private

Index for the minimum rapidity selection.

Definition at line 101 of file AsgPtEtaSelectionTool.h.

101{ -1 };

◆ m_printCastWarning

Gaudi::Property<bool> CP::AsgPtEtaSelectionTool::m_printCastWarning {this, "printCastWarning", true, "whether to print a warning/error when the cast fails"}
private

Definition at line 85 of file AsgPtEtaSelectionTool.h.

85{this, "printCastWarning", true, "whether to print a warning/error when the cast fails"};

◆ m_printClusterWarning

Gaudi::Property<bool> CP::AsgPtEtaSelectionTool::m_printClusterWarning {this, "printClusterWarning", true, "whether to print a warning/error when the cluster is missing"}
private

Definition at line 86 of file AsgPtEtaSelectionTool.h.

86{this, "printClusterWarning", true, "whether to print a warning/error when the cluster is missing"};

◆ m_shouldPrintCastWarning

std::atomic<bool> CP::AsgPtEtaSelectionTool::m_shouldPrintCastWarning {true}
mutableprivate

a version of m_printCastWarning that we modify once we printed the warning

I don't like modifying property values in the tool itself, so I copy it over here and then modify once I print out.

Definition at line 119 of file AsgPtEtaSelectionTool.h.

119{true};

◆ m_shouldPrintClusterWarning

std::atomic<bool> CP::AsgPtEtaSelectionTool::m_shouldPrintClusterWarning {true}
mutableprivate

a version of m_printClusterWarning that we modify once we printed the warning

I don't like modifying property values in the tool itself, so I copy it over here and then modify once I print out.

Definition at line 127 of file AsgPtEtaSelectionTool.h.

127{true};

◆ m_shouldPrintDressedWarning

std::atomic<bool> CP::AsgPtEtaSelectionTool::m_shouldPrintDressedWarning {true}
mutableprivate

whether we still need to print the warning about missing dressed decorations

Definition at line 132 of file AsgPtEtaSelectionTool.h.

132{true};

◆ m_shouldPrintPtWarning

std::atomic<bool> CP::AsgPtEtaSelectionTool::m_shouldPrintPtWarning {true}
mutableprivate

whether we still need to print the warning about an invalid pt value

Definition at line 137 of file AsgPtEtaSelectionTool.h.

137{true};

◆ m_useClusterEta

Gaudi::Property<bool> CP::AsgPtEtaSelectionTool::m_useClusterEta {this, "useClusterEta", false, "whether to use the cluster eta (for electrons only)"}
private

Definition at line 82 of file AsgPtEtaSelectionTool.h.

82{this, "useClusterEta", false, "whether to use the cluster eta (for electrons only)"};

◆ m_useConstituentMomentum

Gaudi::Property<bool> CP::AsgPtEtaSelectionTool::m_useConstituentMomentum {this, "useConstituentMomentum", false, "whether to use the constituent momentum (for jets only) (not for pt)"}
private

Definition at line 84 of file AsgPtEtaSelectionTool.h.

84{this, "useConstituentMomentum", false, "whether to use the constituent momentum (for jets only) (not for pt)"};

◆ m_useDressedProperties

Gaudi::Property<bool> CP::AsgPtEtaSelectionTool::m_useDressedProperties {this, "useDressedProperties", false, "whether to use the dressed kinematic properties (for truth particles only)"}
private

Definition at line 83 of file AsgPtEtaSelectionTool.h.

83{this, "useDressedProperties", false, "whether to use the dressed kinematic properties (for truth particles only)"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: