From 53522e04d7a279728b1c77a91c6006908923e046 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 15 Jun 2014 19:04:21 +0200 Subject: [PATCH 1/3] remove unneeded new to remove memory leak --- Validation/EventGenerator/plugins/TTbar_Kinematics.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/EventGenerator/plugins/TTbar_Kinematics.cc b/Validation/EventGenerator/plugins/TTbar_Kinematics.cc index 05d46c484b886..212cff4a2dab9 100644 --- a/Validation/EventGenerator/plugins/TTbar_Kinematics.cc +++ b/Validation/EventGenerator/plugins/TTbar_Kinematics.cc @@ -39,7 +39,7 @@ void TTbar_Kinematics::analyze(const edm::Event& iEvent, const edm::EventSetup& iEvent.getByToken(hepmcCollectionToken_, evt); //Get EVENT - HepMC::GenEvent *myGenEvent = new HepMC::GenEvent(*(evt->GetEvent())); + const HepMC::GenEvent *myGenEvent = evt->GetEvent(); TLorentzVector tlv_Top, tlv_TopBar, tlv_Bottom, tlv_BottomBar ,tlv_Wplus ,tlv_Wmin , tlv_TTbar; bool top(false), antitop(false), antibottom(false), bottom(false), Wplus(false), Wmin(false); From 3ee4749ce4cf2854dd71e9421f8b7e5c4adcab89 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 15 Jun 2014 19:07:47 +0200 Subject: [PATCH 2/3] clear map before each event is processed --- RecoEgamma/EgammaMCTools/interface/PhotonMCTruthFinder.h | 1 + Validation/RecoEgamma/plugins/PhotonValidator.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RecoEgamma/EgammaMCTools/interface/PhotonMCTruthFinder.h b/RecoEgamma/EgammaMCTools/interface/PhotonMCTruthFinder.h index 77eb6084be164..45ae953ec7b83 100644 --- a/RecoEgamma/EgammaMCTools/interface/PhotonMCTruthFinder.h +++ b/RecoEgamma/EgammaMCTools/interface/PhotonMCTruthFinder.h @@ -28,6 +28,7 @@ class PhotonMCTruthFinder { std::vector find( const std::vector& simTracks, const std::vector& simVertices); + void clear() {geantToIndex_.clear();} private: diff --git a/Validation/RecoEgamma/plugins/PhotonValidator.cc b/Validation/RecoEgamma/plugins/PhotonValidator.cc index 4cd8d2cb1ca41..9ad17ffe5f50e 100755 --- a/Validation/RecoEgamma/plugins/PhotonValidator.cc +++ b/Validation/RecoEgamma/plugins/PhotonValidator.cc @@ -1637,7 +1637,7 @@ void PhotonValidator::endRun (edm::Run& r, edm::EventSetup const & theEventSetu void PhotonValidator::analyze( const edm::Event& e, const edm::EventSetup& esup ) { - + thePhotonMCTruthFinder_->clear(); using namespace edm; // const float etaPhiDistance=0.01; // Fiducial region From c23d8b3a54032cf248afb39022ef087de0a30b12 Mon Sep 17 00:00:00 2001 From: David Date: Sun, 15 Jun 2014 20:42:43 +0200 Subject: [PATCH 3/3] same problem in TkConvValidator --- Validation/RecoEgamma/plugins/TkConvValidator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Validation/RecoEgamma/plugins/TkConvValidator.cc b/Validation/RecoEgamma/plugins/TkConvValidator.cc index 6a92694de1ecb..45726d1c60edd 100644 --- a/Validation/RecoEgamma/plugins/TkConvValidator.cc +++ b/Validation/RecoEgamma/plugins/TkConvValidator.cc @@ -809,7 +809,7 @@ void TkConvValidator::endRun (edm::Run& r, edm::EventSetup const & theEventSetu void TkConvValidator::analyze( const edm::Event& e, const edm::EventSetup& esup ) { - + thePhotonMCTruthFinder_->clear(); using namespace edm; // const float etaPhiDistance=0.01; // Fiducial region