|
ATLAS Offline Software
|
#include <IParticleRetrievalTool.h>
|
| IParticleRetrievalTool (const std::string &name) |
| Standard constructor. More...
|
|
| ~IParticleRetrievalTool () override |
| Default destructor. More...
|
|
StatusCode | initialize () override |
| Initialise the tool. More...
|
|
StatusCode | retrieveParticles (std::vector< std::vector< const xAOD::IParticle * >> &combinations, const std::string &chain, bool rerun=false) const override |
| Retrieve the particles that caused this trigger to fire. More...
|
|
StatusCode | retrieveParticles (std::vector< const xAOD::IParticle * > &combination, const HLT::TriggerElement *te, bool &navFailure) const |
| Retrieve particles that caused this trigger element to pass. More...
|
|
xAOD::Type::ObjectType | getEGammaTEType (const HLT::TriggerElement *te) const |
| Get the type of particle that should be retrieved from this TE. More...
|
|
StatusCode | retrieveFeatureParticle (const xAOD::IParticle *&particle, const HLT::TriggerElement::FeatureAccessHelper &feature, const HLT::TriggerElement *te, bool &navFailure) const |
| Retrieve an IParticle from a feature. More...
|
|
virtual void | print () const =0 |
| Print the state of the tool. 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 > &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 |
|
Definition at line 16 of file IParticleRetrievalTool.h.
◆ StoreGateSvc_t
◆ IParticleRetrievalTool()
Trig::IParticleRetrievalTool::IParticleRetrievalTool |
( |
const std::string & |
name | ) |
|
Standard constructor.
Definition at line 54 of file IParticleRetrievalTool.cxx.
58 "The trigger decision tool to use.");
60 "Only spit a warning on a navigation error, don't cause a job failure.");
◆ ~IParticleRetrievalTool()
Trig::IParticleRetrievalTool::~IParticleRetrievalTool |
( |
| ) |
|
|
override |
◆ 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
◆ getEGammaTEType()
Get the type of particle that should be retrieved from this TE.
- Parameters
-
- Returns
- The type of object that caused this TE to fire.
This function should only be called on a TE from a single leg of an EGamma trigger.
Definition at line 226 of file IParticleRetrievalTool.cxx.
231 if (
teName.find(
"etcut") != std::string::npos &&
232 teName.find(
"trkcut") == std::string::npos)
234 else if (
teName.starts_with(
"EF_e"))
236 else if (
teName.starts_with(
"EF_g"))
239 return xAOD::Type::Other;
◆ 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 Trig::IParticleRetrievalTool::initialize |
( |
| ) |
|
|
overridevirtual |
◆ 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() [1/2]
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, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
Definition at line 131 of file AsgTool.cxx.
◆ print() [2/2]
virtual void asg::IAsgTool::print |
( |
| ) |
const |
|
pure virtualinherited |
Print the state of the tool.
Implemented in JetRecTool, JetFinder, JetModifiedMassDrop, JetFromPseudojet, JetReclusterer, JetReclusteringTool, JetTruthLabelingTool, JetPileupLabelingTool, HI::HIPileupTool, asg::AsgTool, JetDumper, JetBottomUpSoftDrop, JetRecursiveSoftDrop, JetSoftDrop, JetConstituentsRetriever, JetSubStructureMomentToolsBase, JetSplitter, JetToolRunner, JetPruner, JetPseudojetRetriever, JetTrimmer, AsgHelloTool, and KtDeltaRTool.
◆ renounce()
◆ renounceArray()
◆ retrieveFeatureParticle()
Retrieve an IParticle from a feature.
- Parameters
-
[out] | particle | The retrieved particle |
| feature | The feature containing the particle |
| te | The trigger element containing this feature |
[out] | navFailure | Use to communicate a failure in the navigation without an error. |
Expand the typedGet function here
Definition at line 242 of file IParticleRetrievalTool.cxx.
249 std::string containerType;
250 if (!CLIDToContainerType(containerType, feature.
getCLID() ) ) {
254 return StatusCode::FAILURE;
259 m_tdt->ExperimentalAndExpertMethods().getNavigation();
263 auto typelessHolder = navigation->
getHolder(feature);
265 if (!typelessHolder) {
266 std::string
message =
"Typeless holder for feature not present!";
270 return StatusCode::SUCCESS;
274 return StatusCode::FAILURE;
280 "HLT", containerType, typelessHolder->label() );
282 if (!
evtStore()->contains<xAOD::IParticleContainer>(
key) ) {
283 std::string
message =
"Store does not contain " +
key +
"!";
287 return StatusCode::SUCCESS;
291 return StatusCode::FAILURE;
296 if (cont->size() <
idx.objectsEnd() ) {
297 std::ostringstream
os;
298 os <<
"Featured object end " <<
idx.objectsEnd()
299 <<
" is *after* the end of container " <<
key;
303 return StatusCode::SUCCESS;
307 return StatusCode::FAILURE;
310 std::vector<const xAOD::IParticle*> particleFeatures;
311 particleFeatures.reserve(
idx.objectsEnd() -
idx.objectsBegin() );
312 auto begin = cont->begin();
313 auto end = cont->begin();
314 std::advance(
begin,
idx.objectsBegin() );
315 std::advance(
end,
idx.objectsEnd() );
316 particleFeatures.insert(particleFeatures.end(),
begin,
end);
319 std::ostringstream
os;
320 switch (particleFeatures.size() ) {
322 os <<
"No particles retrieved from feature "
328 return StatusCode::SUCCESS;
332 return StatusCode::FAILURE;
345 particleFeatures.begin(), particleFeatures.end(),
347 { return lhs->pt() < rhs->pt(); }) );
349 return StatusCode::SUCCESS;
◆ retrieveParticles() [1/2]
Retrieve particles that caused this trigger element to pass.
- Parameters
-
[out] | combination | All particles that caused this TE to fire. |
| te | The trigger element to be interrogated. |
[out] | navFailure | Use to communicate a failure in the navigation without an error. |
Definition at line 124 of file IParticleRetrievalTool.cxx.
134 if (!CLIDToObjectType(
type, feature.getCLID() ) )
141 if (egType == xAOD::Type::Other) {
147 return StatusCode::SUCCESS;
151 return StatusCode::FAILURE;
156 ObjectTypeToCLID(clid, egType);
161 m_tdt->ExperimentalAndExpertMethods().getNavigation();
165 std::ostringstream
os;
166 os <<
"Unable to retrieve feature of type " << egType
171 return StatusCode::SUCCESS;
175 return StatusCode::FAILURE;
180 return StatusCode::SUCCESS;
185 else if (egType !=
type) {
195 "'final' particles attached to it! This breaks this tool's asumptions!";
199 return StatusCode::SUCCESS;
203 return StatusCode::FAILURE;
208 return StatusCode::SUCCESS;
214 combination.push_back(
part);
215 return StatusCode::SUCCESS;
223 return StatusCode::SUCCESS;
◆ retrieveParticles() [2/2]
StatusCode Trig::IParticleRetrievalTool::retrieveParticles |
( |
std::vector< std::vector< const xAOD::IParticle * >> & |
combinations, |
|
|
const std::string & |
chain, |
|
|
bool |
rerun = false |
|
) |
| const |
|
overridevirtual |
Retrieve the particles that caused this trigger to fire.
- Parameters
-
[out] | combinations | All combinations of particles that could have caused the trigger to fire. |
| chain | The name of the chain. |
| rerun | Whether to look at the chain in 'rerun' mode. The provided vector will be cleared before use! Note that this also only returns electrons, photons, muons, taus or (for egamma etcut triggers) calo clusters. This tool will not return (b-)jets. For combined (b-)jet+X triggers (where X is one of the above) only the X will be returned. This tool may not work if too much trigger information has been removed. |
Implements Trig::IIParticleRetrievalTool.
Definition at line 73 of file IParticleRetrievalTool.cxx.
81 const ChainGroup* cg =
m_tdt->getChainGroup(
chain);
84 if (cg->getListOfTriggers().size() == 0) {
86 <<
" is empty! This means that no matching chains were found!");
87 return StatusCode::FAILURE;
89 unsigned int condition = TrigDefs::Physics;
91 condition |= TrigDefs::allowResurrectedDecision;
94 return StatusCode::SUCCESS;
97 FeatureContainer features = cg->features(
condition);
98 for (
const Combination& combo : features.getCombinations() ) {
103 std::vector<const xAOD::IParticle*> currentCombination;
104 bool navFailure =
false;
109 return StatusCode::FAILURE;
117 <<
" due to navigation failure");
121 return StatusCode::SUCCESS;
◆ 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_detStore
◆ m_evtStore
◆ m_tdt
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_warnOnNavigationFailure
bool Trig::IParticleRetrievalTool::m_warnOnNavigationFailure |
|
private |
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
xAOD::Type::ObjectType getEGammaTEType(const HLT::TriggerElement *te) const
Get the type of particle that should be retrieved from this TE.
Helper class for conversion from/to int stored in TE and pair of ints used in Navigation Object point...
std::string getTEName(const HLT::TriggerElement &te)
converts TEid to TE name (this may not always work, it depends on the availability of config)
ToolHandle< Trig::TrigDecisionTool > m_tdt
The TrigDecisionTool that will be used to get the navigation.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Electron_v1 Electron
Definition of the current "egamma version".
bool m_warnOnNavigationFailure
Be forgiving about the navigation not matching our expectations.
std::string label(class_id_type clid, const index_or_label_type &sti_or_label) const
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
class_id_type getCLID() const
Class ID of object.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
std::string formatSGkey(const std::string &prefix, const std::string &containername, const std::string &label)
declaration of formatting function.
Class providing the definition of the 4-vector interface.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
sub_index_type subTypeIndex() const
to get collection index
static const std::vector< TriggerElement * > & getDirectPredecessors(const TriggerElement *te)
returns list of direct predecessors (nodes seeding me)
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
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)
StatusCode retrieveFeatureParticle(const xAOD::IParticle *&particle, const HLT::TriggerElement::FeatureAccessHelper &feature, const HLT::TriggerElement *te, bool &navFailure) const
Retrieve an IParticle from a feature.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
TriggerElement::FeatureAccessHelper getFeatureRecursively(const TriggerElement *startTE, class_id_type clid, const index_or_label_type &index_or_label, const TriggerElement *&sourceTE) const
recursive search for features the function is similar to the above butif th features is not found at ...
Photon_v1 Photon
Definition of the current "egamma version".
def combinations(items, n)
const ObjectIndex & getIndex() const
index in the external ojects array
the FeatureAccessHelper is a class used to keep track of features attached to this TE.
#define ATH_MSG_WARNING(x)
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
const std::vector< FeatureAccessHelper > & getFeatureAccessHelpers() const
returns all features which ara attached to this TE
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
StatusCode retrieveParticles(std::vector< std::vector< const xAOD::IParticle * >> &combinations, const std::string &chain, bool rerun=false) const override
Retrieve the particles that caused this trigger to fire.
const BaseHolder * getHolder(const TriggerElement::FeatureAccessHelper &fea) const