diff --git a/Reconstruction/eflowRec/eflowRec/IPFClusterSelectorTool.h b/Reconstruction/eflowRec/eflowRec/IPFClusterSelectorTool.h index 47a1415a4e23d500d670a3030efeb322463ffc4c..e60e73cbafe261548918524ad3d8edf3bbe0c062 100644 --- a/Reconstruction/eflowRec/eflowRec/IPFClusterSelectorTool.h +++ b/Reconstruction/eflowRec/eflowRec/IPFClusterSelectorTool.h @@ -2,7 +2,7 @@ Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#ifndef IPFCLUSTERSELECTIONTOOL_H +#ifndef IPFCLUSTERSELECTORTOOL_H #define IPFCLUSTERSELECTORTOOL_H #include "GaudiKernel/IAlgTool.h" diff --git a/Reconstruction/eflowRec/eflowRec/PFAlgorithm.h b/Reconstruction/eflowRec/eflowRec/PFAlgorithm.h index 24c0f86b4e8d5ba89e1ab63029815e57175206c5..98e99c2f617f37c3722e8a9084ad9faf329d19e7 100644 --- a/Reconstruction/eflowRec/eflowRec/PFAlgorithm.h +++ b/Reconstruction/eflowRec/eflowRec/PFAlgorithm.h @@ -10,6 +10,7 @@ #include "eflowRec/eflowRecTrack.h" #include "xAODCaloEvent/CaloClusterContainer.h" +#include "eflowRec/IPFClusterSelectorTool.h" #include "eflowRec/IPFBaseTool.h" #include "eflowRec/IPFSubtractionTool.h" @@ -24,6 +25,10 @@ public: StatusCode finalize(); private: + + /** ToolHandle for the PFClusterSelectorTool which creates the set of eflowRecCluster to be used */ + ToolHandle<IPFClusterSelectorTool> m_IPFClusterSelectorTool{this,"PFClusterSelectorTool","PFClusterSelectorTool","ToolHandle for the PFClusterSelectorTool which creates the set of eflowRecCluster to be used"}; + /** List of IPFSubtractionTool, which will be executed by this algorithm */ ToolHandleArray<IPFSubtractionTool> m_IPFSubtractionTools; diff --git a/Reconstruction/eflowRec/src/PFAlgorithm.cxx b/Reconstruction/eflowRec/src/PFAlgorithm.cxx index b29952dbd4245d81af817860d6fabc1010fb5a9a..5440326420e2947ef3d08ac71b2cf5d1a1238cc5 100644 --- a/Reconstruction/eflowRec/src/PFAlgorithm.cxx +++ b/Reconstruction/eflowRec/src/PFAlgorithm.cxx @@ -8,6 +8,7 @@ PFAlgorithm::PFAlgorithm(const std::string& name, ISvcLocator* pSvcLocator) : A StatusCode PFAlgorithm::initialize(){ + ATH_CHECK(m_IPFClusterSelectorTool); ATH_CHECK(m_IPFSubtractionTools.retrieve()); ATH_CHECK( m_IPFBaseTools.retrieve()); @@ -36,12 +37,16 @@ StatusCode PFAlgorithm::execute(){ SG::ReadHandle<eflowRecTrackContainer> eflowRecTracksReadHandle(m_eflowRecTracksReadHandleKey); eflowRecTrackContainer localEFlowRecTrackContainer(*eflowRecTracksReadHandle.ptr()); + + xAOD::CaloClusterContainer& theCaloClusterContainerReference = *(caloClustersWriteHandle.ptr()); + ATH_CHECK(m_IPFClusterSelectorTool->execute(theCaloClusterContainerReference)); + SG::ReadHandle<eflowRecClusterContainer> eflowRecClustersReadHandle(m_eflowRecClustersReadHandleKey); eflowRecClusterContainer localEFlowRecClusterContainer(*eflowRecClustersReadHandle.ptr()); /* Run the SubtractionTools */ for (auto thisIPFSubtractionTool : m_IPFSubtractionTools){ - thisIPFSubtractionTool->execute(theElowCaloObjectContainer,&localEFlowRecTrackContainer,&localEFlowRecClusterContainer,*(caloClustersWriteHandle.ptr())); + thisIPFSubtractionTool->execute(theElowCaloObjectContainer,&localEFlowRecTrackContainer,&localEFlowRecClusterContainer,theCaloClusterContainerReference); } for (auto thisEFTrack : localEFlowRecTrackContainer){ @@ -52,10 +57,9 @@ StatusCode PFAlgorithm::execute(){ ATH_MSG_DEBUG("This efRecCluster has E,pt,eta and phi of " << thisEFCluster->getCluster()->e() << "," << thisEFCluster->getCluster()->pt() << ", " << thisEFCluster->getCluster()->eta() << " and " << thisEFCluster->getCluster()->phi()); } - /* Run the other AglTools */ for (auto thisIPFBaseTool : m_IPFBaseTools){ - thisIPFBaseTool->execute(*theElowCaloObjectContainer,*(caloClustersWriteHandle.ptr())); + thisIPFBaseTool->execute(*theElowCaloObjectContainer,theCaloClusterContainerReference); } return StatusCode::SUCCESS; diff --git a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx index 312ccc01ec831f3310bdd89ae64ac1809c70a3e1..666e12792c5b331ec2bebe705bc97900301acd3c 100644 --- a/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx +++ b/Reconstruction/eflowRec/src/components/eflowRec_entries.cxx @@ -8,6 +8,7 @@ #include "eflowRec/PFLeptonSelector.h" #include "eflowRec/PFTrackSelector.h" #include "eflowRec/PFClusterSelector.h" +#include "eflowRec/PFClusterSelectorTool.h" #include "eflowRec/PFAlgorithm.h" #include "eflowRec/PFCellLevelSubtractionTool.h" #include "eflowRec/PFRecoverSplitShowersTool.h" @@ -21,6 +22,7 @@ DECLARE_COMPONENT( eflowOverlapRemoval ) DECLARE_COMPONENT( PFLeptonSelector ) DECLARE_COMPONENT( PFClusterSelector ) +DECLARE_COMPONENT( PFClusterSelectorTool ) DECLARE_COMPONENT( PFTrackSelector ) DECLARE_COMPONENT( PFAlgorithm ) DECLARE_COMPONENT( PFOChargedCreatorAlgorithm )