00001 #ifndef ASSOCIATIONUTILS_TOOLBOX_H
00002 #define ASSOCIATIONUTILS_TOOLBOX_H
00003
00004
00005 #include "AsgTools/AsgMessaging.h"
00006 #include "AsgTools/AnaToolHandle.h"
00007
00008
00009 #include "AssociationUtils/IOverlapTool.h"
00010 #include "AssociationUtils/IOverlapRemovalTool.h"
00011
00012
00013 #include <string>
00014
00015
00016 class INamedInterface;
00017 namespace asg {
00018 class AsgTool;
00019 }
00020
00021 namespace ORUtils
00022 {
00023
00034 class ToolBox : public asg::AsgMessaging
00035 {
00036
00037 public:
00038
00040 #ifdef ROOTCORE
00041 using parentType_t = asg::AsgTool;
00042 #else
00043 using parentType_t = INamedInterface;
00044 #endif
00045 using MasterHandle_t = asg::AnaToolHandle<IOverlapRemovalTool>;
00046 using OverlapHandle_t = asg::AnaToolHandle<IOverlapTool>;
00047
00048
00050 ToolBox(const std::string& name = "ORToolBox",
00051 parentType_t* theParent = nullptr);
00052
00054 StatusCode initialize();
00055
00057 std::vector<OverlapHandle_t*> getOverlapTools();
00058
00060 template<class T> StatusCode
00061 setGlobalProperty(const std::string& property, const T& value);
00062
00064 MasterHandle_t masterTool;
00065
00068 OverlapHandle_t eleEleORT;
00069 OverlapHandle_t eleMuORT;
00070 OverlapHandle_t eleJetORT;
00071 OverlapHandle_t muJetORT;
00072 OverlapHandle_t tauEleORT;
00073 OverlapHandle_t tauMuORT;
00074 OverlapHandle_t tauJetORT;
00075 OverlapHandle_t phoEleORT;
00076 OverlapHandle_t phoMuORT;
00077 OverlapHandle_t phoJetORT;
00078 OverlapHandle_t eleFatJetORT;
00079 OverlapHandle_t jetFatJetORT;
00081
00083 parentType_t* parent() { return m_parent; }
00084
00085 private:
00086
00088 StatusCode initTool(OverlapHandle_t& handle, const std::string& key);
00089
00091 StatusCode initMaster();
00092
00094 parentType_t* m_parent;
00095
00096 };
00097
00098
00099
00100
00101
00102 template<class T> StatusCode
00103 ToolBox::setGlobalProperty(const std::string& property, const T& value)
00104 {
00105
00106 for(auto handlePtr : getOverlapTools()) {
00107 ATH_CHECK( handlePtr->setProperty(property, value) );
00108 }
00109
00110 if(!masterTool.empty()) ATH_CHECK( masterTool.setProperty(property, value) );
00111 return StatusCode::SUCCESS;
00112 }
00113
00114 }
00115
00116 #endif