ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
AssociationUtils
Root
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
6
#include "
AssociationUtils/BaseOverlapTool.h
"
7
8
namespace
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
//---------------------------------------------------------------------------
32
StatusCode
BaseOverlapTool::initialize
()
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::Particle1Def>>
42
(
m_inputLabel
,
m_outputLabel
,
m_outputPassValue
);
43
addSubtool(*
m_decHelper1
);
44
m_decHelper2
= std::make_unique<OverlapDecorationHelper<columnar::Particle2Def>>
45
(
m_inputLabel
,
m_outputLabel
,
m_outputPassValue
);
46
addSubtool(*
m_decHelper2
);
47
48
// Initialize the obj-link helper
49
if
(
m_linkOverlapObjects
)
50
{
51
m_objLinkHelper1
= std::make_unique<OverlapLinkHelper<columnar::Particle1Def>>(
"overlapObject"
);
52
addSubtool(*
m_objLinkHelper1
);
53
m_objLinkHelper2
= std::make_unique<OverlapLinkHelper<columnar::Particle2Def>>(
"overlapObject"
);
54
addSubtool(*
m_objLinkHelper2
);
55
}
56
57
// Initialize the derived tool
58
ATH_CHECK
(
initializeDerived
() );
59
60
ATH_CHECK
( initializeColumns() );
61
62
return
StatusCode::SUCCESS;
63
}
64
65
void
BaseOverlapTool::callEvents
(
columnar::EventContextRange
events)
const
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
BaseOverlapTool.h
ANA_CHECK_THROW
#define ANA_CHECK_THROW(EXP)
check whether the given expression was successful, throwing an exception on failure
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:339
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
ORUtils::BaseOverlapTool::m_inputLabel
std::string m_inputLabel
Input object decoration which specifies which objects to look at.
Definition
BaseOverlapTool.h:99
ORUtils::BaseOverlapTool::m_objLinkHelper1
std::unique_ptr< OverlapLinkHelper< columnar::Particle1Def > > m_objLinkHelper1
Helper for linking overlap objects.
Definition
BaseOverlapTool.h:132
ORUtils::BaseOverlapTool::BaseOverlapTool
BaseOverlapTool(const std::string &name)
Create proper constructor for Athena.
Definition
BaseOverlapTool.cxx:14
ORUtils::BaseOverlapTool::initializeDerived
virtual StatusCode initializeDerived()
Initialization for derived tools.
Definition
BaseOverlapTool.h:66
ORUtils::BaseOverlapTool::initialize
StatusCode initialize() override final
Initialize base class functionality.
Definition
BaseOverlapTool.cxx:32
ORUtils::BaseOverlapTool::m_outputPassValue
bool m_outputPassValue
Toggle the output flag logic.
Definition
BaseOverlapTool.h:105
ORUtils::BaseOverlapTool::m_enableUserPrio
bool m_enableUserPrio
Enable user-priority scoring.
Definition
BaseOverlapTool.h:111
ORUtils::BaseOverlapTool::callEvents
virtual void callEvents(columnar::EventContextRange events) const override
The callEvents() for columnar tools.
Definition
BaseOverlapTool.cxx:65
ORUtils::BaseOverlapTool::m_decHelper2
std::unique_ptr< OverlapDecorationHelper< columnar::Particle2Def > > m_decHelper2
Definition
BaseOverlapTool.h:129
ORUtils::BaseOverlapTool::m_objLinkHelper2
std::unique_ptr< OverlapLinkHelper< columnar::Particle2Def > > m_objLinkHelper2
Definition
BaseOverlapTool.h:133
ORUtils::BaseOverlapTool::m_outputLabel
std::string m_outputLabel
Output object decoration which specifies overlapping objects.
Definition
BaseOverlapTool.h:101
ORUtils::BaseOverlapTool::m_linkOverlapObjects
bool m_linkOverlapObjects
Flag to toggle overlap object links.
Definition
BaseOverlapTool.h:108
ORUtils::BaseOverlapTool::m_decHelper1
std::unique_ptr< OverlapDecorationHelper< columnar::Particle1Def > > m_decHelper1
Helper for handling input/output decorations.
Definition
BaseOverlapTool.h:128
ORUtils::BaseOverlapTool::m_baseAccessors
std::unique_ptr< BaseAccessors > m_baseAccessors
Definition
BaseOverlapTool.h:125
ORUtils::IOverlapTool::findOverlaps
virtual StatusCode findOverlaps(columnar::Particle1Range cont1, columnar::Particle2Range cont2, columnar::EventContextId eventContext) const =0
Declare the interface.
asg::AsgTool::AsgTool
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition
AsgTool.cxx:58
ORUtils
Definition
AltMuJetOverlapTool.h:30
asg
Definition
DataHandleTestTool.h:28
columnar::EventContextRange
ObjectRange< EventContextDef > EventContextRange
Definition
ContainerId.h:211
Generated on
for ATLAS Offline Software by
1.17.0