Skip to content
Snippets Groups Projects
Commit 3c741127 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'AsgSelectionToolWrapper_moveto_ISelectionTool' into 'master'

use  ISelectionTool rather than IAsgSelectionTool

See merge request atlas/athena!16563
parents e2886ab6 e6cf6d1c
No related merge requests found
......@@ -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 )
/*
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;
......
/*
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;
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment