ATLAS Offline Software
Loading...
Searching...
No Matches
BaseOverlapTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// Local includes
7
8namespace ORUtils
9{
10
11 //---------------------------------------------------------------------------
12 // Constructor
13 //---------------------------------------------------------------------------
14 BaseOverlapTool::BaseOverlapTool(const std::string& name)
15 : asg::AsgTool(name)
16 {
17 declareProperty("InputLabel", m_inputLabel = "selected",
18 "Decoration which specifies input objects");
19 declareProperty("OutputLabel", m_outputLabel = "overlaps",
20 "Decoration given to objects that fail OR");
21 declareProperty("OutputPassValue", m_outputPassValue = false,
22 "Set the result assigned to objects that pass");
23 declareProperty("LinkOverlapObjects", m_linkOverlapObjects = false,
24 "Turn on overlap object link decorations");
25 declareProperty("EnableUserPriority", m_enableUserPrio = false,
26 "Turn on user priority score");
27 }
28
29 //---------------------------------------------------------------------------
30 // Initialize
31 //---------------------------------------------------------------------------
33 {
34 ATH_MSG_DEBUG("Initializing " << name());
35 ATH_MSG_DEBUG("Base config options: InputLabel " << m_inputLabel <<
36 " OutputLabel " << m_outputLabel <<
37 " OutputPassValue " << m_outputPassValue <<
38 " UserPrio " << m_enableUserPrio);
39
40 // Initialize the decoration helper
41 m_decHelper1 = std::make_unique<OverlapDecorationHelper<columnar::ContainerId::particle1>>
43 addSubtool(*m_decHelper1);
44 m_decHelper2 = std::make_unique<OverlapDecorationHelper<columnar::ContainerId::particle2>>
46 addSubtool(*m_decHelper2);
47
48 // Initialize the obj-link helper
50 {
51 m_objLinkHelper1 = std::make_unique<OverlapLinkHelper<columnar::ContainerId::particle1>>("overlapObject");
52 addSubtool(*m_objLinkHelper1);
53 m_objLinkHelper2 = std::make_unique<OverlapLinkHelper<columnar::ContainerId::particle2>>("overlapObject");
54 addSubtool(*m_objLinkHelper2);
55 }
56
57 // Initialize the derived tool
59
60 ATH_CHECK ( initializeColumns() );
61
62 return StatusCode::SUCCESS;
63 }
64
66 {
67 auto& baseAcc = *m_baseAccessors;
68 for (auto event : events)
69 {
70 ANA_CHECK_THROW (findOverlaps (baseAcc.m_particles1Acc (event), baseAcc.m_particles2Acc (event), event));
71 }
72 }
73} // namespace ORUtils
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
#define ANA_CHECK_THROW(EXP)
check whether the given expression was successful, throwing an exception on failure
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::unique_ptr< OverlapDecorationHelper< columnar::ContainerId::particle1 > > m_decHelper1
Helper for handling input/output decorations.
std::string m_inputLabel
Input object decoration which specifies which objects to look at.
BaseOverlapTool(const std::string &name)
Create proper constructor for Athena.
virtual StatusCode initializeDerived()
Initialization for derived tools.
StatusCode initialize() override final
Initialize base class functionality.
bool m_outputPassValue
Toggle the output flag logic.
bool m_enableUserPrio
Enable user-priority scoring.
virtual void callEvents(columnar::EventContextRange events) const override
The callEvents() for columnar tools.
std::unique_ptr< OverlapDecorationHelper< columnar::ContainerId::particle2 > > m_decHelper2
std::unique_ptr< OverlapLinkHelper< columnar::ContainerId::particle2 > > m_objLinkHelper2
std::string m_outputLabel
Output object decoration which specifies overlapping objects.
std::unique_ptr< OverlapLinkHelper< columnar::ContainerId::particle1 > > m_objLinkHelper1
Helper for linking overlap objects.
bool m_linkOverlapObjects
Flag to toggle overlap object links.
std::unique_ptr< BaseAccessors > m_baseAccessors
virtual StatusCode findOverlaps(columnar::Particle1Range cont1, columnar::Particle2Range cont2, columnar::EventContextId eventContext) const =0
Declare the interface.
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
ObjectRange< ContainerId::eventContext > EventContextRange