diff --git a/Reconstruction/MET/METReconstruction/METReconstruction/METAssociator.h b/Reconstruction/MET/METReconstruction/METReconstruction/METAssociator.h index b2cb63946697b822d394b779153dc6028247250b..9619c27fde221005683bd374e7f884698d369e53 100644 --- a/Reconstruction/MET/METReconstruction/METReconstruction/METAssociator.h +++ b/Reconstruction/MET/METReconstruction/METReconstruction/METAssociator.h @@ -1,7 +1,7 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // METAssociator.h @@ -90,12 +90,11 @@ namespace met { std::string m_pvcoll; std::string m_trkcoll; std::string m_clcoll; - std::string m_pfcoll; SG::ReadHandleKey<xAOD::VertexContainer> m_pvcollKey; SG::ReadHandleKey<xAOD::IParticleContainer> m_clcollKey; SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trkcollKey; - SG::ReadHandleKey<xAOD::PFOContainer> m_pfcollKey; + SG::ReadHandleKey<xAOD::PFOContainer> m_pfcollKey{this,"PFlowColl","CHSParticleFlowObjects","PFO Collection"}; SG::ReadHandleKey<xAOD::IParticleContainer> m_forcollKey; SG::ReadHandleKey<xAOD::IParticleContainer> m_hybridContKey; diff --git a/Reconstruction/MET/METReconstruction/Root/METAssociator.cxx b/Reconstruction/MET/METReconstruction/Root/METAssociator.cxx index 268096e589115107de45c9e994449abb449cfe55..20b1a7a925a7243bdcd78f74a52d3887a9a84856 100644 --- a/Reconstruction/MET/METReconstruction/Root/METAssociator.cxx +++ b/Reconstruction/MET/METReconstruction/Root/METAssociator.cxx @@ -1,7 +1,7 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // METAssociator.cxx @@ -54,15 +54,13 @@ namespace met { m_caloIsolationTool(this,""), m_pvcollKey(""), m_clcollKey(""), - m_trkcollKey(""), - m_pfcollKey("") + m_trkcollKey("") { ATH_MSG_INFO("METAssoc constructor"); declareProperty( "InputCollection", m_input_data_key ); declareProperty( "PrimVxColl", m_pvcoll = "PrimaryVertices" ); declareProperty( "TrkColl", m_trkcoll = "InDetTrackParticles" ); declareProperty( "ClusColl", m_clcoll = "CaloCalTopoClusters" ); - declareProperty( "PFlowColl", m_pfcoll = "CHSParticleFlowObjects" ); declareProperty( "UseModifiedClus", m_useModifiedClus = false ); declareProperty( "UseTracks", m_useTracks = true ); declareProperty( "PFlow", m_pflow = false ); @@ -109,13 +107,6 @@ namespace met { } } - if(m_pfcoll == "JetETMissParticleFlowObjects") { - ATH_MSG_ERROR("Configured to use standard pflow collection \"" << m_pfcoll << "\"."); - ATH_MSG_ERROR("This is no longer supported -- please use the CHSParticleFlowObjects collection, which has the four-vector corrections built in."); - return StatusCode::FAILURE; - } else { - ATH_MSG_INFO("Configured to use PFlow collection \"" << m_pfcoll << "\"."); - } //initialise read handle keys if(m_useTracks){ ATH_CHECK( m_pvcollKey.assign(m_pvcoll)); @@ -124,8 +115,14 @@ namespace met { ATH_CHECK( m_trkcollKey.initialize()); } if(m_pflow){ - ATH_CHECK( m_pfcollKey.assign(m_pfcoll)); ATH_CHECK( m_pfcollKey.initialize()); + if(m_pfcollKey.key() == "JetETMissParticleFlowObjects") { + ATH_MSG_ERROR("Configured to use standard pflow collection \"" << m_pfcollKey.key() << "\"."); + ATH_MSG_ERROR("This is no longer supported -- please use the CHSParticleFlowObjects collection, which has the four-vector corrections built in."); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("Configured to use PFlow collection \"" << m_pfcollKey.key() << "\"."); + } } if(!m_skipconst || m_forcoll.empty()){ ATH_CHECK( m_clcollKey.assign(m_clcoll)); @@ -263,7 +260,7 @@ namespace met { constits.trkCont=trCont.cptr(); if(m_pflow) { - ATH_MSG_DEBUG("Retrieving PFlow collection " << m_pfcoll); + ATH_MSG_DEBUG("Retrieving PFlow collection " << m_pfcollKey.key()); constits.pfoCont = 0; SG::ReadHandle<PFOContainer> pfCont(m_pfcollKey); if (!pfCont.isValid()) { diff --git a/Reconstruction/MET/METReconstruction/Root/METTruthAssociator.cxx b/Reconstruction/MET/METReconstruction/Root/METTruthAssociator.cxx index 58af810cba3d597efc5a3ab0fe0de2feea2f931d..3f43e510b311f38f0795ada3f6218387cd504b14 100644 --- a/Reconstruction/MET/METReconstruction/Root/METTruthAssociator.cxx +++ b/Reconstruction/MET/METReconstruction/Root/METTruthAssociator.cxx @@ -40,7 +40,7 @@ namespace met { using namespace xAOD; - static SG::AuxElement::ConstAccessor<std::vector<ElementLink<IParticleContainer> > > cacc_ghosttruth("GhostTruth"); + static const SG::AuxElement::ConstAccessor<std::vector<ElementLink<IParticleContainer> > > cacc_ghosttruth("GhostTruth"); // Constructors //////////////// diff --git a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_met_fromESD.py b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_met_fromESD.py index ac65568b6b332055a0a720663723a82fc185552a..8c30a3c0d03f3590dd656a62f3b62a01f23eb002 100644 --- a/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_met_fromESD.py +++ b/Reconstruction/RecExample/RecExRecoTest/share/RecExRecoTest_ART_met_fromESD.py @@ -27,7 +27,15 @@ jobproperties.InDetJobProperties.doxAOD.set_Value_and_Lock(False) rec.doFileMetaData.set_Value_and_Lock(False) athenaCommonFlags.EvtMax=10 + UserAlgs=["RecExRecoTest/RecExRecoTests_setupReadID.py"] UserAlgs+=["RecExRecoTest/RecExRecoTest_setupJetEtMissPFlow.py"] UserAlgs+=["METReconstruction/METReconstruction_jobOptions.py"] include ("RecExCommon/RecExCommon_topOptions.py") + +import AthenaCommon.PropertiesManip as manip + +manip.appendItemsToList(StreamAOD,'ItemList','xAOD::PFOContainer_v1#CHSParticleFlowObjects') +manip.appendItemsToList(StreamAOD,'ItemList','xAOD::PFOAuxContainer_v1#CHSParticleFlowObjectsAux.') + +