 |
ATLAS Offline Software
|
an IAsgSelectionTool that performs basic pt and eta cut (with an optional eta gap)
More...
#include <AsgPtEtaSelectionTool.h>
|
virtual StatusCode | initialize () override |
| Dummy implementation of the initialisation function. More...
|
|
virtual const asg::AcceptInfo & | getAcceptInfo () const override |
| Declare the interface ID for this pure-virtual interface class to the Athena framework. More...
|
|
virtual asg::AcceptData | accept (const xAOD::IParticle *particle) const override |
| The main accept method: the actual cuts are applied here. More...
|
|
virtual void | print () const |
| Print the state of the tool. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
int | m_minPtCutIndex { -1 } |
| Index for the minimum pT selection. More...
|
|
int | m_maxPtCutIndex { -1 } |
| Index for the maximum pT selection. More...
|
|
int | m_minEtaCutIndex { -1 } |
| Index for the minimum eta selection. More...
|
|
int | m_maxEtaCutIndex { -1 } |
| Index for the maximum eta selection. More...
|
|
int | m_etaGapCutIndex { -1 } |
| Index for the eta gap selection. More...
|
|
int | m_minRapidityCutIndex { -1 } |
| Index for the minimum rapidity selection. More...
|
|
int | m_maxRapidityCutIndex { -1 } |
| Index for the maximum rapidity selection. More...
|
|
int | m_egammaCastCutIndex { -1 } |
| Index for the e/gamma casting. More...
|
|
int | m_egammaClusterCutIndex { -1 } |
| Index for the e/gamma calo-cluster. More...
|
|
int | m_dressedPropertiesIndex { -1 } |
| Index for the existence of dressed properties. More...
|
|
int | m_jetCastCutIndex { -1 } |
| Index for the jet casting. More...
|
|
std::atomic< bool > | m_shouldPrintCastWarning {true} |
| a version of m_printCastWarning that we modify once we printed the warning More...
|
|
std::atomic< bool > | m_shouldPrintClusterWarning {true} |
| a version of m_printClusterWarning that we modify once we printed the warning More...
|
|
asg::AcceptInfo | m_accept |
| the asg::AcceptInfo we are using More...
|
|
std::unique_ptr< SG::ConstAccessor< float > > | m_dressedPtAccessor {} |
| dressed pt and eta accessors More...
|
|
std::unique_ptr< SG::ConstAccessor< float > > | m_dressedEtaAccessor {} |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
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 More...
|
|
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"} |
|
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.
◆ StoreGateSvc_t
◆ accept()
The main accept method: the actual cuts are applied here.
Implements IAsgSelectionTool.
Definition at line 162 of file AsgPtEtaSelectionTool.cxx.
181 pt = (*m_dressedPtAccessor) (*particle);
185 if (!std::isfinite(
pt) ||
pt < 0.)
220 ANA_MSG_ERROR (
"no calo-cluster associated with e-gamma object");
225 absEta = std::abs (caloCluster->etaBE(2));
262 float absRapidity = 0;
276 absRapidity = std::abs (
jet->getAttribute<
xAOD::JetFourMom_t>(
"JetConstitScaleMomentum").Rapidity());
279 absRapidity = std::abs (
particle->rapidity());
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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()
◆ getKey()
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
-
ptr | The 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.
121 #ifdef XAOD_STANDALONE
127 return (
proxy ==
nullptr ? 0 :
proxy->sgkey() );
128 #endif // XAOD_STANDALONE
◆ 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
-
ptr | The 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.
108 #ifdef XAOD_STANDALONE
114 static const std::string
dummy =
"";
116 #endif // XAOD_STANDALONE
◆ 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 |
( |
| ) |
|
|
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.
32 ATH_MSG_ERROR (
"only one of 'useDressedProperties', 'useClusterEta' and 'useConstituentMomentum' can be used at the same time");
33 return StatusCode::FAILURE;
38 return StatusCode::FAILURE;
43 return StatusCode::FAILURE;
48 return StatusCode::FAILURE;
53 return StatusCode::FAILURE;
58 return StatusCode::FAILURE;
63 return StatusCode::FAILURE;
68 return StatusCode::FAILURE;
73 return StatusCode::FAILURE;
78 return StatusCode::FAILURE;
83 return StatusCode::FAILURE;
88 return StatusCode::FAILURE;
94 return StatusCode::FAILURE;
98 ATH_MSG_ERROR (
"cannot use both eta and rapidity cuts at the same time");
99 return StatusCode::FAILURE;
103 ATH_MSG_DEBUG(
"Performing pt and eta cuts on the dressed properties" );
117 ATH_MSG_DEBUG(
"Performing eta cut on the e/gamma cluster" );
122 ATH_MSG_DEBUG(
"Performing eta/rapidity cut on the jet constituent momentum" );
149 return StatusCode::SUCCESS;
◆ inputHandles()
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() [1/2]
◆ msg() [2/2]
◆ 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.
◆ msgLvl()
◆ outputHandles()
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 |
Print the state of the tool.
Implements asg::IAsgTool.
Reimplemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, LundVariablesTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_accept
◆ m_detStore
◆ m_dressedEtaAccessor
std::unique_ptr<SG::ConstAccessor<float> > CP::AsgPtEtaSelectionTool::m_dressedEtaAccessor {} |
|
private |
◆ m_dressedPropertiesIndex
int CP::AsgPtEtaSelectionTool::m_dressedPropertiesIndex { -1 } |
|
private |
◆ m_dressedPtAccessor
std::unique_ptr<SG::ConstAccessor<float> > CP::AsgPtEtaSelectionTool::m_dressedPtAccessor {} |
|
private |
◆ m_egammaCastCutIndex
int CP::AsgPtEtaSelectionTool::m_egammaCastCutIndex { -1 } |
|
private |
◆ m_egammaClusterCutIndex
int CP::AsgPtEtaSelectionTool::m_egammaClusterCutIndex { -1 } |
|
private |
◆ m_etaGapCutIndex
int CP::AsgPtEtaSelectionTool::m_etaGapCutIndex { -1 } |
|
private |
◆ 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 |
◆ m_etaGapLow
Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_etaGapLow {this, "etaGapLow", 0, "low end of the eta gap"} |
|
private |
◆ m_evtStore
◆ m_jetCastCutIndex
int CP::AsgPtEtaSelectionTool::m_jetCastCutIndex { -1 } |
|
private |
◆ m_maxEta
Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_maxEta {this, "maxEta", 0, "maximum abs(eta) to allow (or 0 for no eta cut)"} |
|
private |
◆ m_maxEtaCutIndex
int CP::AsgPtEtaSelectionTool::m_maxEtaCutIndex { -1 } |
|
private |
◆ m_maxPt
Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_maxPt {this, "maxPt", 0, "maximum pt to require (or 0 for no pt cut)"} |
|
private |
◆ m_maxPtCutIndex
int CP::AsgPtEtaSelectionTool::m_maxPtCutIndex { -1 } |
|
private |
◆ m_maxRapidity
Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_maxRapidity {this, "maxRapidity", 0, "maximum abs(rapidity) to allow (or 0 for no eta cut)"} |
|
private |
◆ m_maxRapidityCutIndex
int CP::AsgPtEtaSelectionTool::m_maxRapidityCutIndex { -1 } |
|
private |
◆ m_minEta
Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_minEta {this, "minEta", 0, "minimum abs(eta) to allow (or 0 for no eta cut)"} |
|
private |
◆ m_minEtaCutIndex
int CP::AsgPtEtaSelectionTool::m_minEtaCutIndex { -1 } |
|
private |
◆ m_minPt
Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_minPt {this, "minPt", 0, "minimum pt to require (or 0 for no pt cut)"} |
|
private |
◆ m_minPtCutIndex
int CP::AsgPtEtaSelectionTool::m_minPtCutIndex { -1 } |
|
private |
◆ m_minRapidity
Gaudi::Property<float> CP::AsgPtEtaSelectionTool::m_minRapidity {this, "minRapidity", 0, "minimum abs(rapidity) to allow (or 0 for no eta cut)"} |
|
private |
◆ m_minRapidityCutIndex
int CP::AsgPtEtaSelectionTool::m_minRapidityCutIndex { -1 } |
|
private |
◆ m_printCastWarning
Gaudi::Property<bool> CP::AsgPtEtaSelectionTool::m_printCastWarning {this, "printCastWarning", true, "whether to print a warning/error when the cast fails"} |
|
private |
◆ m_printClusterWarning
Gaudi::Property<bool> CP::AsgPtEtaSelectionTool::m_printClusterWarning {this, "printClusterWarning", true, "whether to print a warning/error when the cluster is missing"} |
|
private |
◆ 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.
◆ 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.
◆ m_useClusterEta
Gaudi::Property<bool> CP::AsgPtEtaSelectionTool::m_useClusterEta {this, "useClusterEta", false, "whether to use the cluster eta (for electrons only)"} |
|
private |
◆ 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 |
◆ m_useDressedProperties
Gaudi::Property<bool> CP::AsgPtEtaSelectionTool::m_useDressedProperties {this, "useDressedProperties", false, "whether to use the dressed kinematic properties (for truth particles only)"} |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
virtual void setOwner(IDataHandleHolder *o)=0
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Description of a calorimeter cluster.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
void setCutResult(const std::string &cutName, bool cutResult)
Set the result of a cut, based on the cut name (safer)
bool absEta(const xAOD::TauJet &tau, double &out)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
int addCut(const std::string &cutName, const std::string &cutDescription)
Add a cut; returning the cut position.