Common base class tool for overlap tools.
More...
#include <BaseOverlapTool.h>
Inherits asg::AsgTool, columnar::ColumnarTool<>, and ORUtils::IOverlapTool.
Inherited by ORUtils::AltMuJetOverlapTool, ORUtils::DeltaROverlapTool, ORUtils::EleEleOverlapTool, ORUtils::EleJetOverlapTool, ORUtils::EleMuSharedTrkOverlapTool, ORUtils::MuJetOverlapTool, ORUtils::ObjLinkOverlapTool, ORUtils::TauAntiTauJetOverlapTool, ORUtils::TauJetOverlapTool, ORUtils::TauLooseEleOverlapTool, and ORUtils::TauLooseMuOverlapTool.
|
| virtual StatusCode | initializeDerived () |
| | Initialization for derived tools.
|
| template<columnar::RegularContainerIdConcept CI1, columnar::RegularContainerIdConcept CI2, typename CM> |
| StatusCode | handleOverlap (const columnar::ObjectId< CI1, CM > &testParticle, const columnar::ObjectId< CI2, CM > &refParticle) const |
| | Common helper method to handle an overlap result.
|
| template<typename XAODContainer, columnar::RegularContainerIdConcept CI, typename CM> |
| StatusCode | checkForXAODContainer (columnar::ObjectRange< CI, CM > cont, std::string_view message) const |
| | check whether the container is of the right type
|
| 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.
|
| void | initializeDecorations (columnar::Particle1Range container) const |
| void | initializeDecorations (columnar::Particle2Range container) const |
| char | getObjectPriority (columnar::Particle1Id obj) const |
| char | getObjectPriority (columnar::Particle2Id obj) const |
| bool | isSurvivingObject (columnar::Particle1Id obj) const |
| bool | isSurvivingObject (columnar::Particle2Id obj) const |
| bool | isRejectedObject (columnar::Particle1Id obj) const |
| bool | isRejectedObject (columnar::Particle2Id obj) const |
| void | setObjectFail (columnar::Particle1Id obj) const |
| void | setObjectFail (columnar::Particle2Id obj) const |
| template<columnar::ContainerIdConcept CI> |
| StatusCode | addObjectLink (columnar::Particle1Id p1, columnar::ObjectId< CI > p2) const |
| template<columnar::ContainerIdConcept CI> |
| StatusCode | addObjectLink (columnar::Particle2Id p1, columnar::ObjectId< CI > p2) const |
Common base class tool for overlap tools.
This class was introduced to reduce the code duplication among the overlap tools. Most implementations use some common functionality such as input/output decorations, object linking, and output value logic control. This class then holds the code to handle those things, or holds the helper objects which implement the logic. It also defines the properties associated with these shared functionalities.
- Author
- Steve Farrell Steve.nosp@m.n.Fa.nosp@m.rrell.nosp@m.@cer.nosp@m.n.ch
Definition at line 43 of file BaseOverlapTool.h.
◆ StoreGateSvc_t
◆ BaseOverlapTool()
| ORUtils::BaseOverlapTool::BaseOverlapTool |
( |
const std::string & | name | ) |
|
Create proper constructor for Athena.
Standalone constructor
Definition at line 14 of file BaseOverlapTool.cxx.
15 : asg::AsgTool(name)
16 {
18 "Decoration which specifies input objects");
20 "Decoration given to objects that fail OR");
22 "Set the result assigned to objects that pass");
24 "Turn on overlap object link decorations");
26 "Turn on user priority score");
27 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
◆ addObjectLink() [1/2]
◆ addObjectLink() [2/2]
◆ callEvents()
◆ checkForXAODContainer()
| StatusCode ORUtils::BaseOverlapTool::checkForXAODContainer |
( |
columnar::ObjectRange< CI, CM > | cont, |
|
|
std::string_view | message ) const |
|
inlineprotected |
check whether the container is of the right type
Definition at line 83 of file BaseOverlapTool.h.
84 {
85 if constexpr (CM::isXAOD) {
86 if(typeid(cont.getXAODObjectNoexcept()) != typeid(XAODContainer) &&
87 typeid(cont.getXAODObjectNoexcept()) != typeid(ConstDataVector<XAODContainer>)) {
89 return StatusCode::FAILURE;
90 }
91 }
92 return StatusCode::SUCCESS;
93 }
◆ declareGaudiProperty()
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
158 {
161 hndl.documentation());
162
163 }
◆ declareProperty()
Definition at line 145 of file AthCommonDataStore.h.
145 {
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
◆ detStore()
◆ evtStore()
◆ 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
◆ findOverlaps() [1/2]
Declare the interface.
Find overlaps between two containers. The details will depend on the tool implementation, but the convention should be that if only one container is to be marked, it should be the first argument. Otherwise, both of them can be marked. The decoration logic may depend on configuration.
Implemented in ORUtils::AltMuJetOverlapTool, ORUtils::DeltaROverlapTool, ORUtils::EleEleOverlapTool, ORUtils::EleJetOverlapTool, ORUtils::EleMuSharedTrkOverlapTool, ORUtils::MuJetOverlapTool, ORUtils::ObjLinkOverlapTool, ORUtils::TauAntiTauJetOverlapTool, ORUtils::TauJetOverlapTool, ORUtils::TauLooseEleOverlapTool, and ORUtils::TauLooseMuOverlapTool.
◆ findOverlaps() [2/2]
Definition at line 46 of file IOverlapTool.h.
48 {
52 eventContext);
53 }
ObjectRange< ContainerId::particle2 > Particle2Range
ObjectRange< ContainerId::particle1 > Particle1Range
◆ 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
-
| 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.
119 {
120
121#ifdef XAOD_STANDALONE
122
123
124 return evtStore()->event()->getKey( ptr );
125#else
127 return ( proxy ==
nullptr ? 0 :
proxy->sgkey() );
128#endif
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
-
| 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.
106 {
107
108#ifdef XAOD_STANDALONE
109
110
111 return evtStore()->event()->getName( ptr );
112#else
114 static const std::string
dummy =
"";
115 return ( proxy ==
nullptr ? dummy :
proxy->name() );
116#endif
117 }
◆ getObjectPriority() [1/2]
◆ getObjectPriority() [2/2]
◆ getProperty()
template<class T>
| const T * asg::AsgTool::getProperty |
( |
const std::string & | name | ) |
const |
|
inherited |
Get one of the tool's properties.
◆ handleOverlap()
Common helper method to handle an overlap result.
This method for now applies the user-defined object priorities set as the input decoration, so if the testParticle is higher prio than the refParticle, nothing happens. Otherwise, this method prints a debug message, decorates the testParticle as overlap, and optionally sets the object element link.
Unit conversion constant
Definition at line 177 of file BaseOverlapTool.h.
180 {
181
185 {
186 if constexpr (CM::isXAOD)
187 {
190 ATH_MSG_DEBUG(
" Found overlap " << testParticle.getXAODObject().type() <<
191 " pt " << testParticle.getXAODObject().pt()*
invGeV);
192 } else
193 {
195 }
199 }
200 }
201 return StatusCode::SUCCESS;
202 }
#define ATH_CHECK
Evaluate an expression and check for errors.
◆ initialize()
| StatusCode ORUtils::BaseOverlapTool::initialize |
( |
void | | ) |
|
|
finaloverridevirtual |
Initialize base class functionality.
Concrete tool specific initialization can be implemented by overriding the initializeDerived() method.
Reimplemented from asg::AsgTool.
Definition at line 32 of file BaseOverlapTool.cxx.
33 {
39
40
41 m_decHelper1 = std::make_unique<OverlapDecorationHelper<columnar::ContainerId::particle1>>
44 m_decHelper2 = std::make_unique<OverlapDecorationHelper<columnar::ContainerId::particle2>>
47
48
50 {
51 m_objLinkHelper1 = std::make_unique<OverlapLinkHelper<columnar::ContainerId::particle1>>(
"overlapObject");
53 m_objLinkHelper2 = std::make_unique<OverlapLinkHelper<columnar::ContainerId::particle2>>(
"overlapObject");
55 }
56
57
59
61
62 return StatusCode::SUCCESS;
63 }
◆ initializeDecorations() [1/2]
◆ initializeDecorations() [2/2]
◆ initializeDerived()
| virtual StatusCode ORUtils::BaseOverlapTool::initializeDerived |
( |
| ) |
|
|
inlineprotectedvirtual |
Initialization for derived tools.
Default implementation does nothing.
Reimplemented in ORUtils::AltMuJetOverlapTool, ORUtils::DeltaROverlapTool, ORUtils::EleEleOverlapTool, ORUtils::EleJetOverlapTool, ORUtils::EleMuSharedTrkOverlapTool, ORUtils::MuJetOverlapTool, ORUtils::ObjLinkOverlapTool, ORUtils::TauAntiTauJetOverlapTool, ORUtils::TauJetOverlapTool, ORUtils::TauLooseEleOverlapTool, and ORUtils::TauLooseMuOverlapTool.
Definition at line 66 of file BaseOverlapTool.h.
67 { 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.
◆ isRejectedObject() [1/2]
◆ isRejectedObject() [2/2]
◆ isSurvivingObject() [1/2]
◆ isSurvivingObject() [2/2]
◆ msg()
◆ 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
104 }
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
◆ msgLvl()
| bool AthCommonMsg< AlgTool >::msgLvl |
( |
const MSG::Level | lvl | ) |
const |
|
inlineinherited |
◆ 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 AsgHelloTool, HI::HIPileupTool, JetBottomUpSoftDrop, JetConstituentsRetriever, JetDumper, JetFinder, JetFromPseudojet, JetModifiedMassDrop, JetPileupLabelingTool, JetPruner, JetPseudojetRetriever, JetReclusterer, JetReclusteringTool, JetRecTool, JetRecursiveSoftDrop, JetSoftDrop, JetSplitter, JetSubStructureMomentToolsBase, JetToolRunner, JetTrimmer, JetTruthLabelingTool, KtDeltaRTool, and LundVariablesTool.
Definition at line 131 of file AsgTool.cxx.
131 {
132
134 return;
135 }
◆ renounce()
Definition at line 380 of file AthCommonDataStore.h.
381 {
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()
◆ setObjectFail() [1/2]
◆ setObjectFail() [2/2]
◆ 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()
Definition at line 308 of file AthCommonDataStore.h.
308 {
309
310
313 for (
auto k :
keys) {
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka
◆ m_baseAccessors
◆ m_decHelper1
◆ m_decHelper2
◆ m_detStore
◆ m_enableUserPrio
| bool ORUtils::BaseOverlapTool::m_enableUserPrio |
|
protected |
◆ m_evtStore
◆ m_inputLabel
| std::string ORUtils::BaseOverlapTool::m_inputLabel |
|
protected |
◆ m_linkOverlapObjects
| bool ORUtils::BaseOverlapTool::m_linkOverlapObjects |
|
protected |
◆ m_objLinkHelper1
◆ m_objLinkHelper2
◆ m_outputLabel
| std::string ORUtils::BaseOverlapTool::m_outputLabel |
|
protected |
Output object decoration which specifies overlapping objects.
Definition at line 101 of file BaseOverlapTool.h.
◆ m_outputPassValue
| bool ORUtils::BaseOverlapTool::m_outputPassValue |
|
protected |
Toggle the output flag logic.
If true, then non-overlapping objects will be assigned "true".
Definition at line 105 of file BaseOverlapTool.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files: