From e93f28853cb034b77db09bd43e7e6d2c811cc755 Mon Sep 17 00:00:00 2001 From: christos <christos@cern.ch> Date: Fri, 7 Dec 2018 15:00:17 +0000 Subject: [PATCH] use ISelectionTool rather than IAsgSelectionTool Former-commit-id: e6cf6d1c67242bc3934b21960f80e7f5aed2228e --- .../DerivationFrameworkTools/CMakeLists.txt | 8 ++++--- .../AsgSelectionToolWrapper.h | 6 ++--- .../src/AsgSelectionToolWrapper.cxx | 22 +++++++++---------- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/CMakeLists.txt b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/CMakeLists.txt index c7e5fd91050..d4cf699d1b5 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/CMakeLists.txt +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/CMakeLists.txt @@ -11,7 +11,8 @@ atlas_depends_on_subdirs( PUBLIC Event/xAOD/xAODBase GaudiKernel PhysicsAnalysis/AnalysisCommon/PATCore - PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces + PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces + PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces Trigger/TrigAnalysis/TrigDecisionTool PRIVATE Control/AthenaKernel @@ -25,11 +26,12 @@ atlas_add_library( DerivationFrameworkToolsLib src/*.cxx PUBLIC_HEADERS DerivationFrameworkTools PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES AthenaBaseComps xAODBase GaudiKernel PATCoreLib TrigDecisionToolLib ExpressionEvaluationLib + LINK_LIBRARIES AthenaBaseComps xAODBase GaudiKernel PATCoreLib AsgAnalysisInterfaces TrigDecisionToolLib ExpressionEvaluationLib PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel ) atlas_add_component( DerivationFrameworkTools src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps xAODBase GaudiKernel PATCoreLib TrigDecisionToolLib AthenaKernel ExpressionEvaluationLib DerivationFrameworkToolsLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps xAODBase GaudiKernel AsgAnalysisInterfaces PATCoreLib TrigDecisionToolLib AthenaKernel + ExpressionEvaluationLib DerivationFrameworkToolsLib ) diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/AsgSelectionToolWrapper.h b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/AsgSelectionToolWrapper.h index b02c3360cae..cdf765f1cea 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/AsgSelectionToolWrapper.h +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/DerivationFrameworkTools/AsgSelectionToolWrapper.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -13,7 +13,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "DerivationFrameworkInterfaces/IAugmentationTool.h" -#include "PATCore/IAsgSelectionTool.h" +#include "AsgAnalysisInterfaces/ISelectionTool.h" #include "GaudiKernel/ToolHandle.h" namespace DerivationFramework { @@ -27,7 +27,7 @@ namespace DerivationFramework { virtual StatusCode addBranches() const; private: - ToolHandle<IAsgSelectionTool> m_tool; + ToolHandle<CP::ISelectionTool> m_tool; std::string m_cut; std::string m_sgName; std::string m_containerName; diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/AsgSelectionToolWrapper.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/AsgSelectionToolWrapper.cxx index 16644e5e113..a358cceba1d 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/AsgSelectionToolWrapper.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTools/src/AsgSelectionToolWrapper.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -10,7 +10,7 @@ #include "DerivationFrameworkTools/AsgSelectionToolWrapper.h" #include "xAODBase/IParticleContainer.h" -#include "PATCore/TAccept.h" +#include "PATCore/AcceptData.h" #include <vector> #include <string> @@ -59,18 +59,18 @@ namespace DerivationFramework { // Write mask for each element and record to SG for subsequent selection for (xAOD::IParticleContainer::const_iterator pItr = particles->begin(); pItr!=particles->end(); ++pItr) { - Root::TAccept theAccept(m_tool->accept(*pItr)); + asg::AcceptData theAccept=m_tool->accept(*pItr); if(m_cut==""){ - bool pass_selection = (bool) theAccept; - if(pass_selection) decorator(**pItr) = 1; - else decorator(**pItr) = 0; + bool pass_selection = static_cast<bool>(theAccept); + if(pass_selection) decorator(**pItr) = 1; + else decorator(**pItr) = 0; } else{ - if (theAccept.getCutResult(m_cut)) { - decorator(**pItr) = 1; - } else { - decorator(**pItr) = 0; - } + if (theAccept.getCutResult(m_cut)) { + decorator(**pItr) = 1; + } else { + decorator(**pItr) = 0; + } } } -- GitLab