diff --git a/Reconstruction/Jet/JetRec/JetRec/PseudoJetContainer.h b/Reconstruction/Jet/JetRec/JetRec/PseudoJetContainer.h index 94eacde5975589ab50bb2cf4d540ff5f21c78642..b4b47d1ef4fe0ac9af206022ff93a42d455311d6 100644 --- a/Reconstruction/Jet/JetRec/JetRec/PseudoJetContainer.h +++ b/Reconstruction/Jet/JetRec/JetRec/PseudoJetContainer.h @@ -6,7 +6,7 @@ #define PseudoJetContainer_H /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ @@ -55,6 +55,8 @@ public: const std::vector<PseudoJet> & vecPJ, bool debug=false); + ~PseudoJetContainer(); + // fill xAOD jet with constit&ghosts extracted from final PSeudoJet bool extractConstituents(xAOD::Jet&, const std::vector<PseudoJet>&) const; bool extractConstituents(xAOD::Jet& jet, const PseudoJet &finalPJ) const; diff --git a/Reconstruction/Jet/JetRec/Root/PseudoJetContainer.cxx b/Reconstruction/Jet/JetRec/Root/PseudoJetContainer.cxx index 449796aacf5631518017cf5a495ab26a179645bb..104ede8af881a909bd41bf4e0db60d62b93fa1d8 100644 --- a/Reconstruction/Jet/JetRec/Root/PseudoJetContainer.cxx +++ b/Reconstruction/Jet/JetRec/Root/PseudoJetContainer.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // PseudoJetContainer.cxx @@ -44,6 +44,14 @@ PseudoJetContainer::PseudoJetContainer(const IConstituentExtractor* c, } +PseudoJetContainer::~PseudoJetContainer() +{ + for (const IConstituentExtractor* e : m_emptyExtractors) { + delete e; + } +} + + bool PseudoJetContainer::extractConstituents(xAOD::Jet& jet, const std::vector<PseudoJet>& inConstits) const @@ -137,7 +145,7 @@ void PseudoJetContainer::append(const PseudoJetContainer* other) { pj.set_user_index(pj.user_index() + offset);return pj;} ); - for(auto e : other->m_emptyExtractors){m_emptyExtractors.insert(e);} + for(auto e : other->m_emptyExtractors){m_emptyExtractors.insert(e->clone());} if (m_debug){checkInvariants("append()");} }