ATLAS Offline Software
Loading...
Searching...
No Matches
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
11
12// Local includes
15
16// STL includes
17#include <string>
18
19// Forward declarations
20class INamedInterface;
21namespace asg {
22 class AsgTool;
23}
24
25namespace ORUtils
26{
27
39 {
40
41 public:
42
44 using parentType_t = INamedInterface;
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
65
82
85
86 private:
87
89 StatusCode initTool(OverlapHandle_t& handle, const std::string& key);
90
92 StatusCode initMaster();
93
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
#define ATH_CHECK
Evaluate an expression and check for errors.
std::vector< OverlapHandle_t * > getOverlapTools()
Get a list of all handles to loop over.
Definition ToolBox.cxx:71
OverlapHandle_t phoEleORT
Definition ToolBox.h:76
StatusCode setGlobalProperty(const std::string &property, const T &value)
Apply a global property to all tools.
Definition ToolBox.h:104
OverlapHandle_t eleJetORT
Definition ToolBox.h:71
OverlapHandle_t eleFatJetORT
Definition ToolBox.h:79
StatusCode initMaster()
Initialize master tool.
Definition ToolBox.cxx:120
OverlapHandle_t muPFJetORT
Definition ToolBox.h:68
OverlapHandle_t phoJetORT
Definition ToolBox.h:78
OverlapHandle_t jetFatJetORT
Definition ToolBox.h:80
MasterHandle_t masterTool
Master overlap removal tool handle.
Definition ToolBox.h:64
StatusCode initTool(OverlapHandle_t &handle, const std::string &key)
Initialize and attach one overlap tool.
Definition ToolBox.cxx:94
parentType_t * parent()
Pointer to the parent component for the tool handles.
Definition ToolBox.h:84
OverlapHandle_t eleEleORT
Definition ToolBox.h:69
ToolBox(const std::string &name="ORToolBox", parentType_t *theParent=nullptr)
Basic constructor with name and parent.
Definition ToolBox.cxx:14
OverlapHandle_t muJetORT
Definition ToolBox.h:72
OverlapHandle_t eleMuORT
Definition ToolBox.h:70
INamedInterface parentType_t
Aliases.
Definition ToolBox.h:44
asg::AnaToolHandle< IOverlapTool > OverlapHandle_t
Definition ToolBox.h:46
OverlapHandle_t phoMuORT
Definition ToolBox.h:77
OverlapHandle_t tauMuORT
Definition ToolBox.h:74
asg::AnaToolHandle< IOverlapRemovalTool > MasterHandle_t
Definition ToolBox.h:45
OverlapHandle_t tauJetORT
Definition ToolBox.h:75
OverlapHandle_t tauEleORT
Definition ToolBox.h:73
StatusCode initialize()
Attach and initialize all tools.
Definition ToolBox.cxx:35
parentType_t * m_parent
Pointer to the parent component for the tool handles.
Definition ToolBox.h:95
a modified tool handle that allows its owner to configure new tools from the C++ side
Class mimicking the AthMessaging class from the offline software.
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47