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::AcceptInfogetAcceptInfo () 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< StoreGateSvcStoreGateSvc_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< boolm_shouldPrintCastWarning {true}
 a version of m_printCastWarning that we modify once we printed the warning
std::atomic< boolm_shouldPrintClusterWarning {true}
 a version of m_printClusterWarning that we modify once we printed the warning
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< floatm_minPt {this, "minPt", 0, "minimum pt to require (or 0 for no pt cut)"}
 tool properties
Gaudi::Property< floatm_maxPt {this, "maxPt", 0, "maximum pt to require (or 0 for no pt cut)"}
Gaudi::Property< floatm_minEta {this, "minEta", 0, "minimum abs(eta) to allow (or 0 for no eta cut)"}
Gaudi::Property< floatm_maxEta {this, "maxEta", 0, "maximum abs(eta) to allow (or 0 for no eta cut)"}
Gaudi::Property< floatm_etaGapLow {this, "etaGapLow", 0, "low end of the eta gap"}
Gaudi::Property< floatm_etaGapHigh {this, "etaGapHigh", 0, "high end of the eta gap (or 0 for no eta gap)"}
Gaudi::Property< floatm_minRapidity {this, "minRapidity", 0, "minimum abs(rapidity) to allow (or 0 for no eta cut)"}
Gaudi::Property< floatm_maxRapidity {this, "maxRapidity", 0, "maximum abs(rapidity) to allow (or 0 for no eta cut)"}
Gaudi::Property< boolm_useClusterEta {this, "useClusterEta", false, "whether to use the cluster eta (for electrons only)"}
Gaudi::Property< boolm_useDressedProperties {this, "useDressedProperties", false, "whether to use the dressed kinematic properties (for truth particles only)"}
Gaudi::Property< boolm_useConstituentMomentum {this, "useConstituentMomentum", false, "whether to use the constituent momentum (for jets only) (not for pt)"}
Gaudi::Property< boolm_printCastWarning {this, "printCastWarning", true, "whether to print a warning/error when the cast fails"}
Gaudi::Property< boolm_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 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ accept()

asg::AcceptData CP::AsgPtEtaSelectionTool::accept ( const xAOD::IParticle * ) 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)) {
170 ANA_MSG_WARNING ("dressed decorations not available");
171 return accept;
172 }
173 accept.setCutResult (m_dressedPropertiesIndex, true);
174 }
175
176 // Perform the tranverse momentum cuts.
177 if (m_minPtCutIndex >= 0 || m_maxPtCutIndex >= 0)
178 {
179 float pt = particle->pt();
181 pt = (*m_dressedPtAccessor) (*particle);
182 }
183
184 if (m_minPtCutIndex >= 0) {
185 if (!std::isfinite(pt) || pt < 0.)
186 {
187 ANA_MSG_WARNING ("invalid pt value, setting object to fail pt-cut: " << pt);
188 accept.setCutResult (m_minPtCutIndex, false);
189 } else
190 {
191 accept.setCutResult (m_minPtCutIndex, pt >= m_minPt);
192 }
193 }
194 if (m_maxPtCutIndex >= 0) {
195 accept.setCutResult (m_maxPtCutIndex, pt < m_maxPt);
196 }
197 }
198
199 // Perform the eta cut(s).
200 if (m_minEtaCutIndex >= 0 || m_maxEtaCutIndex >= 0 || m_etaGapCutIndex >= 0)
201 {
202 float absEta = 0;
203
204 if (m_useClusterEta == true)
205 {
206 const xAOD::Egamma *egamma
207 = dynamic_cast<const xAOD::Egamma*>(particle);
208 if (egamma == nullptr)
209 {
211 ANA_MSG_ERROR ("failed to cast input particle to electron");
213 return accept;
214 }
215 accept.setCutResult (m_egammaCastCutIndex, true);
216 const xAOD::CaloCluster *const caloCluster {egamma->caloCluster()};
217 if (!caloCluster)
218 {
220 ANA_MSG_ERROR ("no calo-cluster associated with e-gamma object");
222 return accept;
223 }
224 accept.setCutResult (m_egammaClusterCutIndex, true);
225 absEta = std::abs (caloCluster->etaBE(2));
226 } else if (m_useDressedProperties)
227 {
228 absEta = std::abs ((*m_dressedEtaAccessor) (*particle));
229 } else if (m_useConstituentMomentum == true)
230 {
231 const xAOD::Jet *jet
232 = dynamic_cast<const xAOD::Jet*>(particle);
233 if (jet == nullptr)
234 {
236 ANA_MSG_ERROR ("failed to cast input particle to jet");
238 return accept;
239 }
240 accept.setCutResult (m_jetCastCutIndex, true);
241 absEta = std::abs (jet->getAttribute<xAOD::JetFourMom_t>("JetConstitScaleMomentum").eta());
242 } else
243 {
244 absEta = std::abs (particle->eta());
245 }
246
247 if (m_minEtaCutIndex >= 0) {
248 accept.setCutResult (m_minEtaCutIndex, absEta > m_minEta);
249 }
250 if (m_maxEtaCutIndex >= 0) {
251 accept.setCutResult (m_maxEtaCutIndex, absEta <= m_maxEta);
252 }
253 if (m_etaGapCutIndex >= 0) {
254 accept.setCutResult (m_etaGapCutIndex, (absEta < m_etaGapLow ||
255 absEta > m_etaGapHigh));
256 }
257 }
258
259 // Perform the rapdity cut(s).
261 {
262 float absRapidity = 0;
263
264 if (m_useConstituentMomentum == true)
265 {
266 const xAOD::Jet *jet
267 = dynamic_cast<const xAOD::Jet*>(particle);
268 if (jet == nullptr)
269 {
271 ANA_MSG_ERROR ("failed to cast input particle to jet");
273 return accept;
274 }
275 accept.setCutResult (m_jetCastCutIndex, true);
276 absRapidity = std::abs (jet->getAttribute<xAOD::JetFourMom_t>("JetConstitScaleMomentum").Rapidity());
277 } else
278 {
279 absRapidity = std::abs (particle->rapidity());
280 }
281
282 if (m_minRapidityCutIndex >= 0) {
283 accept.setCutResult (m_minRapidityCutIndex, absRapidity > m_minRapidity);
284 }
285 if (m_maxRapidityCutIndex >= 0) {
286 accept.setCutResult (m_maxRapidityCutIndex, absRapidity <= m_maxRapidity);
287 }
288 }
289
290 return accept;
291 }
#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
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
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 getAttribute(AttributeID type, T &value) const
Retrieve attribute moment by enum.
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::TEvent 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::TEvent, 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::TEvent 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::TEvent, 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 eta cut");
141 }
142 if (m_maxRapidity > 0) {
143 ATH_MSG_DEBUG( "Performing |rapidity| < " << m_maxRapidity << " selection" );
144 m_maxRapidityCutIndex = m_accept.addCut ("maxRapidity", "maximum eta cut");
145 }
148
149 return StatusCode::SUCCESS;
150 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(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()

◆ 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 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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 364 of file AthCommonDataStore.h.

364 {
366 }

◆ 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 >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ 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 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
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 393 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 390 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.

Technically this tool isn't thread-safe due to the use of TAccept, but once we move to master this will be fixed, so this member is already made thread-safe so that we don't trip up on that later.

Definition at line 124 of file AsgPtEtaSelectionTool.h.

124{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.

Technically this tool isn't thread-safe due to the use of TAccept, but once we move to master this will be fixed, so this member is already made thread-safe so that we don't trip up on that later.

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 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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