ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
AssociationUtils
AssociationUtils
ToolBox.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ASSOCIATIONUTILS_TOOLBOX_H
6
#define ASSOCIATIONUTILS_TOOLBOX_H
7
8
// Framework includes
9
#include "
AsgMessaging/AsgMessaging.h
"
10
#include "
AsgTools/AnaToolHandle.h
"
11
12
// Local includes
13
#include "
AssociationUtils/IOverlapTool.h
"
14
#include "
AssociationUtils/IOverlapRemovalTool.h
"
15
16
// STL includes
17
#include <string>
18
19
// Forward declarations
20
class
INamedInterface;
21
namespace
asg
{
22
class
AsgTool
;
23
}
24
25
namespace
ORUtils
26
{
27
38
class
ToolBox
:
public
asg::AsgMessaging
39
{
40
41
public
:
42
44
using
parentType_t
= INamedInterface;
45
using
MasterHandle_t
=
asg::AnaToolHandle<IOverlapRemovalTool>
;
46
using
OverlapHandle_t
=
asg::AnaToolHandle<IOverlapTool>
;
47
48
50
ToolBox
(
const
std::string& name =
"ORToolBox"
,
51
parentType_t
* theParent =
nullptr
);
52
54
StatusCode
initialize
();
55
57
std::vector<OverlapHandle_t*>
getOverlapTools
();
58
60
template
<
class
T> StatusCode
61
setGlobalProperty
(
const
std::string& property,
const
T& value);
62
64
MasterHandle_t
masterTool
;
65
68
OverlapHandle_t
muPFJetORT
;
69
OverlapHandle_t
eleEleORT
;
70
OverlapHandle_t
eleMuORT
;
71
OverlapHandle_t
eleJetORT
;
72
OverlapHandle_t
muJetORT
;
73
OverlapHandle_t
tauEleORT
;
74
OverlapHandle_t
tauMuORT
;
75
OverlapHandle_t
tauJetORT
;
76
OverlapHandle_t
phoEleORT
;
77
OverlapHandle_t
phoMuORT
;
78
OverlapHandle_t
phoJetORT
;
79
OverlapHandle_t
eleFatJetORT
;
80
OverlapHandle_t
jetFatJetORT
;
82
84
parentType_t
*
parent
() {
return
m_parent
; }
85
86
private
:
87
89
StatusCode
initTool
(
OverlapHandle_t
& handle,
const
std::string& key);
90
92
StatusCode
initMaster
();
93
95
parentType_t
*
m_parent
;
96
97
};
98
99
100
//---------------------------------------------------------------------------
101
// Implementation method to set a property on all tools.
102
//---------------------------------------------------------------------------
103
template
<
class
T> StatusCode
104
ToolBox::setGlobalProperty
(
const
std::string& property,
const
T& value)
105
{
106
// Handle the overlap tools
107
for
(
auto
handlePtr :
getOverlapTools
()) {
108
ATH_CHECK
( handlePtr->setProperty(property, value) );
109
}
110
// Handle the master tool
111
if
(!
masterTool
.empty())
ATH_CHECK
(
masterTool
.setProperty(property, value) );
112
return
StatusCode::SUCCESS;
113
}
114
115
}
// namespace ORUtils
116
117
#endif
AnaToolHandle.h
AsgMessaging.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
IOverlapRemovalTool.h
IOverlapTool.h
ORUtils::ToolBox::getOverlapTools
std::vector< OverlapHandle_t * > getOverlapTools()
Get a list of all handles to loop over.
Definition
ToolBox.cxx:71
ORUtils::ToolBox::phoEleORT
OverlapHandle_t phoEleORT
Definition
ToolBox.h:76
ORUtils::ToolBox::setGlobalProperty
StatusCode setGlobalProperty(const std::string &property, const T &value)
Apply a global property to all tools.
Definition
ToolBox.h:104
ORUtils::ToolBox::eleJetORT
OverlapHandle_t eleJetORT
Definition
ToolBox.h:71
ORUtils::ToolBox::eleFatJetORT
OverlapHandle_t eleFatJetORT
Definition
ToolBox.h:79
ORUtils::ToolBox::initMaster
StatusCode initMaster()
Initialize master tool.
Definition
ToolBox.cxx:120
ORUtils::ToolBox::muPFJetORT
OverlapHandle_t muPFJetORT
Definition
ToolBox.h:68
ORUtils::ToolBox::phoJetORT
OverlapHandle_t phoJetORT
Definition
ToolBox.h:78
ORUtils::ToolBox::jetFatJetORT
OverlapHandle_t jetFatJetORT
Definition
ToolBox.h:80
ORUtils::ToolBox::masterTool
MasterHandle_t masterTool
Master overlap removal tool handle.
Definition
ToolBox.h:64
ORUtils::ToolBox::initTool
StatusCode initTool(OverlapHandle_t &handle, const std::string &key)
Initialize and attach one overlap tool.
Definition
ToolBox.cxx:94
ORUtils::ToolBox::parent
parentType_t * parent()
Pointer to the parent component for the tool handles.
Definition
ToolBox.h:84
ORUtils::ToolBox::eleEleORT
OverlapHandle_t eleEleORT
Definition
ToolBox.h:69
ORUtils::ToolBox::ToolBox
ToolBox(const std::string &name="ORToolBox", parentType_t *theParent=nullptr)
Basic constructor with name and parent.
Definition
ToolBox.cxx:14
ORUtils::ToolBox::muJetORT
OverlapHandle_t muJetORT
Definition
ToolBox.h:72
ORUtils::ToolBox::eleMuORT
OverlapHandle_t eleMuORT
Definition
ToolBox.h:70
ORUtils::ToolBox::parentType_t
INamedInterface parentType_t
Aliases.
Definition
ToolBox.h:44
ORUtils::ToolBox::OverlapHandle_t
asg::AnaToolHandle< IOverlapTool > OverlapHandle_t
Definition
ToolBox.h:46
ORUtils::ToolBox::phoMuORT
OverlapHandle_t phoMuORT
Definition
ToolBox.h:77
ORUtils::ToolBox::tauMuORT
OverlapHandle_t tauMuORT
Definition
ToolBox.h:74
ORUtils::ToolBox::MasterHandle_t
asg::AnaToolHandle< IOverlapRemovalTool > MasterHandle_t
Definition
ToolBox.h:45
ORUtils::ToolBox::tauJetORT
OverlapHandle_t tauJetORT
Definition
ToolBox.h:75
ORUtils::ToolBox::tauEleORT
OverlapHandle_t tauEleORT
Definition
ToolBox.h:73
ORUtils::ToolBox::initialize
StatusCode initialize()
Attach and initialize all tools.
Definition
ToolBox.cxx:35
ORUtils::ToolBox::m_parent
parentType_t * m_parent
Pointer to the parent component for the tool handles.
Definition
ToolBox.h:95
asg::AnaToolHandle
a modified tool handle that allows its owner to configure new tools from the C++ side
Definition
AnaToolHandle.h:167
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition
AsgMessaging.h:40
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
ORUtils
Definition
AltMuJetOverlapTool.h:30
asg
Definition
DataHandleTestTool.h:28
Generated on
for ATLAS Offline Software by
1.17.0