From 24c77f7b29b11e85078653f9523ebf443160d348 Mon Sep 17 00:00:00 2001 From: wmtan Date: Fri, 3 Jun 2016 00:27:36 +0200 Subject: [PATCH] Use unique_ptr, not auto_ptr --- .../SiStripProcessedRawDigiProducer.cc | 4 +- .../plugins/SiStripProcessedRawDigiProducer.h | 4 +- .../src/TrackInfoProducer.cc | 16 +- .../plugins/APVCyclePhaseProducerFromL1ABC.cc | 4 +- .../plugins/APVCyclePhaseProducerFromL1TS.cc | 4 +- .../plugins/ByMultiplicityEventFilter.cc | 2 +- .../ConfigurableAPVCyclePhaseProducer.cc | 4 +- .../plugins/EventWithHistoryProducer.cc | 4 +- .../EventWithHistoryProducerFromL1ABC.cc | 8 +- .../FromClusterSummaryMultiplicityProducer.cc | 4 +- .../plugins/MultiplicityProducer.cc | 4 +- .../plugins/CalibratedElectronProducer.cc | 12 +- .../plugins/CalibratedPatElectronProducer.cc | 4 +- .../plugins/CalibratedPhotonProducersRun2.cc | 4 +- .../plugins/ElectronIdMVAProducer.cc | 4 +- .../ElectronIsolatorFromEffectiveArea.cc | 4 +- .../plugins/ElectronPATIdMVAProducer.cc | 4 +- .../ElectronRegressionEnergyProducer.cc | 8 +- .../PatElectronEAIsoCorrectionProducer.cc | 4 +- .../plugins/PhotonIsoProducer.cc | 12 +- .../RegressionEnergyPatElectronProducer.cc | 12 +- .../src/PiZeroDiscriminatorProducer.cc | 4 +- .../Skimming/plugins/ZMuMuMuonUserData.cc | 4 +- .../Skimming/plugins/ZMuMuOneTrackUserData.cc | 4 +- .../Skimming/plugins/ZMuMuTrackUserData.cc | 4 +- .../Skimming/plugins/ZMuMuUserData.cc | 4 +- .../Utilities/src/DistortedMETProducer.cc | 4 +- .../Utilities/src/DistortedMuonProducer.cc | 4 +- .../src/DistortedMuonProducerFromDB.cc | 10 +- .../Utilities/src/DistortedPFCandProducer.cc | 4 +- .../Utilities/src/FSRWeightProducer.cc | 4 +- .../Utilities/src/ISRGammaWeightProducer.cc | 4 +- .../Utilities/src/ISRWeightProducer.cc | 4 +- .../Utilities/src/MuonWithPFIsoProducer.cc | 8 +- .../Utilities/src/PdfWeightProducer.cc | 4 +- .../src/WeakEffectsWeightProducer.cc | 4 +- .../WMuNu/src/WMuNuProducer.cc | 4 +- .../ZEE/src/ZeeCandidateFilter.cc | 4 +- .../ZEE/src/aod2patFilterZee.cc | 8 +- .../ZMuMu/plugins/DimuonMCMatcher.cc | 4 +- .../ZMuMu/plugins/EventVtxInfoNtupleDumper.cc | 30 +- .../ZMuMu/plugins/ZToLLEdmNtupleDumper.cc | 260 +++++++++--------- .../Onia2MuMu/interface/OniaVtxReProducer.h | 2 +- .../Onia2MuMu/src/Onia2MuMuPAT.cc | 4 +- .../Onia2MuMu/src/OniaAddV0TracksProducer.cc | 10 +- .../src/OniaPhotonConversionProducer.cc | 6 +- .../Skimming/plugins/Tau3MuSkim.cc | 8 +- .../src/JetVertexAssociation.cc | 8 +- .../Modules/interface/CorrectedJetProducer.h | 4 +- .../Modules/interface/JetCorrectionProducer.h | 4 +- .../plugins/ChainedJetCorrectorProducer.cc | 4 +- .../Modules/plugins/JetCorrectorProducer.h | 4 +- .../interface/CaloJetMETcorrInputProducerT.h | 12 +- .../interface/CorrectedMETProducerT.h | 4 +- .../interface/JetCleanerForType1METT.h | 4 +- .../interface/PFJetMETcorrInputProducerT.h | 8 +- .../plugins/CorrectedCaloMETProducer.cc | 4 +- .../plugins/CorrectedPFMETProducer.cc | 4 +- .../plugins/MultShiftMETcorrInputProducer.cc | 4 +- .../plugins/MuonMETcorrInputProducer.cc | 4 +- .../plugins/PFCandMETcorrInputProducer.cc | 2 +- .../plugins/PFchsMETcorrInputProducer.cc | 4 +- .../Type1MET/plugins/ScaleCorrMETData.cc | 4 +- .../plugins/SysShiftMETcorrInputProducer.cc | 4 +- .../plugins/Type0PFMETcorrInputProducer.cc | 4 +- .../plugins/Type2CorrectionProducer.cc | 4 +- .../plugins/MuScleFitMuonProducer.cc | 12 +- .../plugins/HLTL1MuonMatcher.cc | 16 +- .../MuonAssociators/plugins/L1MuonMatcher.cc | 20 +- .../MuonAssociators/plugins/MatcherByPulls.cc | 8 +- .../plugins/MatcherUsingTracks.cc | 4 +- .../plugins/MuonCleanerBySegments.cc | 4 +- .../plugins/MuonMCClassifier.cc | 16 +- .../plugins/TriggerMatcherToHLTDebug.cc | 4 +- .../TriggerObjectFilterByCollection.cc | 4 +- .../HSCP/plugins/HSCPDeDxInfoProducer.cc | 4 +- .../HSCP/plugins/HSCParticleProducer.cc | 10 +- .../HSCP/plugins/HSCParticleSelector.cc | 4 +- .../HSCP/plugins/MuonSegmentProducer.cc | 4 +- SUSYBSMAnalysis/HSCP/plugins/SimHitShifter.cc | 12 +- .../Skim_HighPtTrackEcalDetIdProducer.cc | 4 +- .../HSCP/plugins/Skim_ProduceIsolationMap.cc | 4 +- ...Skim_ReduceHcalRecHitCollectionProducer.cc | 6 +- .../plugins/Skim_UpdatedMuonInnerTrackRef.cc | 4 +- .../interface/TtEvtBuilder.h | 4 +- .../src/PseudoTopProducer.cc | 16 +- .../src/StEvtSolutionMaker.cc | 8 +- .../TopEventProducers/src/StGenEventReco.cc | 4 +- .../TopEventProducers/src/TopDecaySubset.cc | 32 +-- .../TopEventProducers/src/TopInitSubset.cc | 6 +- .../src/TtDilepEvtSolutionMaker.cc | 8 +- .../TopEventProducers/src/TtGenEventReco.cc | 4 +- .../src/TtHadEvtSolutionMaker.cc | 8 +- .../src/TtSemiEvtSolutionMaker.cc | 8 +- .../plugins/TtFullHadSignalSelMVAComputer.cc | 4 +- .../plugins/TtSemiLepSignalSelMVAComputer.cc | 4 +- .../TopHitFit/interface/Constraint.h | 4 +- .../TopHitFit/interface/Constraint_Intermed.h | 8 +- .../plugins/TtSemiLepHitFitProducer.h | 80 +++--- TopQuarkAnalysis/TopHitFit/src/Constraint.cc | 18 +- .../TopHitFit/src/Constraint_Intermed.cc | 20 +- .../plugins/TtSemiLepJetCombGeom.cc | 12 +- .../plugins/TtSemiLepJetCombMVAComputer.cc | 22 +- .../plugins/TtSemiLepJetCombMaxSumPtWMass.cc | 12 +- .../TtSemiLepJetCombWMassDeltaTopMass.cc | 12 +- .../plugins/TtSemiLepJetCombWMassMaxSumPt.cc | 12 +- .../src/TtFullHadHypothesis.cc | 10 +- .../src/TtFullLepHypothesis.cc | 10 +- .../src/TtSemiLepHypothesis.cc | 18 +- .../plugins/TtFullHadKinFitProducer.cc | 40 +-- .../plugins/TtFullLepKinSolutionProducer.h | 20 +- .../plugins/TtSemiLepKinFitProducer.h | 66 ++--- .../TopPairBSM/src/BoostedTopProducer.cc | 4 +- .../TopTools/plugins/GenTtbarCategorizer.cc | 4 +- .../TopTools/plugins/MuonSelectorVertex.cc | 4 +- .../TopTools/plugins/TtJetPartonMatch.h | 16 +- 116 files changed, 632 insertions(+), 632 deletions(-) diff --git a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.cc b/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.cc index 4c48b2e8a2b8d..dbfd0d12bd243 100644 --- a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.cc +++ b/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.cc @@ -30,7 +30,7 @@ SiStripProcessedRawDigiProducer::SiStripProcessedRawDigiProducer(edm::ParameterS void SiStripProcessedRawDigiProducer:: produce(edm::Event& e, const edm::EventSetup& es) { - std::auto_ptr< edm::DetSetVector > output(new edm::DetSetVector()); + std::unique_ptr< edm::DetSetVector > output(new edm::DetSetVector()); edm::Handle< edm::DetSetVector > inputDigis; edm::Handle< edm::DetSetVector > inputRawdigis; @@ -45,7 +45,7 @@ produce(edm::Event& e, const edm::EventSetup& es) { else edm::LogError("Input Not Found"); - e.put(output); + e.put(std::move(output)); } template diff --git a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h b/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h index d3e1e743c9cd7..92a84a475d293 100644 --- a/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h +++ b/AnalysisAlgos/SiStripClusterInfoProducer/plugins/SiStripProcessedRawDigiProducer.h @@ -41,8 +41,8 @@ class SiStripProcessedRawDigiProducer : public edm::EDProducer { std::vector > > inputTokensRawDigi; edm::ESHandle gainHandle; - std::auto_ptr subtractorPed; - std::auto_ptr subtractorCMN; + std::unique_ptr subtractorPed; + std::unique_ptr subtractorCMN; }; #endif diff --git a/AnalysisAlgos/TrackInfoProducer/src/TrackInfoProducer.cc b/AnalysisAlgos/TrackInfoProducer/src/TrackInfoProducer.cc index 455bbc9e5f489..8980a75d7bc0f 100644 --- a/AnalysisAlgos/TrackInfoProducer/src/TrackInfoProducer.cc +++ b/AnalysisAlgos/TrackInfoProducer/src/TrackInfoProducer.cc @@ -27,7 +27,7 @@ void TrackInfoProducer::produce(edm::Event& theEvent, const edm::EventSetup& set // create empty output collections // - std::auto_ptr outputColl (new reco::TrackInfoCollection); + std::unique_ptr outputColl (new reco::TrackInfoCollection); edm::Handle > TrajectoryCollection; edm::Handle trackCollection; @@ -65,19 +65,19 @@ void TrackInfoProducer::produce(edm::Event& theEvent, const edm::EventSetup& set //put everything in the event edm::OrphanHandle rTrackInfo; -// if(forwardPredictedStateTag_!="") rTrackInfof = theEvent.put(outputFwdColl,forwardPredictedStateTag_ ); -// if(backwardPredictedStateTag_!="") rTrackInfob = theEvent.put(outputBwdColl,backwardPredictedStateTag_); -// if(updatedStateTag_!="") rTrackInfou = theEvent.put(outputUpdatedColl,updatedStateTag_ ); -// if(combinedStateTag_!="") rTrackInfoc = theEvent.put(outputCombinedColl,combinedStateTag_ ); - rTrackInfo=theEvent.put(outputColl); - std::auto_ptr TIassociationColl (new reco::TrackInfoTrackAssociationCollection(assoMap->refProd().val, rTrackInfo)); +// if(forwardPredictedStateTag_!="") rTrackInfof = theEvent.put(std::move(outputFwdColl),forwardPredictedStateTag_ ); +// if(backwardPredictedStateTag_!="") rTrackInfob = theEvent.put(std::move(outputBwdColl),backwardPredictedStateTag_); +// if(updatedStateTag_!="") rTrackInfou = theEvent.put(std::move(outputUpdatedColl),updatedStateTag_ ); +// if(combinedStateTag_!="") rTrackInfoc = theEvent.put(std::move(outputCombinedColl),combinedStateTag_ ); + rTrackInfo=theEvent.put(std::move(outputColl)); + std::unique_ptr TIassociationColl (new reco::TrackInfoTrackAssociationCollection(assoMap->refProd().val, rTrackInfo)); for(std::map::iterator ref_iter=trackid.begin();ref_iter!=trackid.end();++ref_iter){ TIassociationColl->insert( ref_iter->first,edm::Ref(rTrackInfo,ref_iter->second )); } - theEvent.put(TIassociationColl); + theEvent.put(std::move(TIassociationColl)); } diff --git a/DPGAnalysis/SiStripTools/plugins/APVCyclePhaseProducerFromL1ABC.cc b/DPGAnalysis/SiStripTools/plugins/APVCyclePhaseProducerFromL1ABC.cc index 36b0f022e6210..93ab84d46cf0e 100644 --- a/DPGAnalysis/SiStripTools/plugins/APVCyclePhaseProducerFromL1ABC.cc +++ b/DPGAnalysis/SiStripTools/plugins/APVCyclePhaseProducerFromL1ABC.cc @@ -188,7 +188,7 @@ APVCyclePhaseProducerFromL1ABC::produce(edm::Event& iEvent, const edm::EventSetu using namespace edm; - std::auto_ptr apvphases(new APVCyclePhaseCollection() ); + std::unique_ptr apvphases(new APVCyclePhaseCollection() ); const std::vector& phases = _defphases; @@ -278,7 +278,7 @@ APVCyclePhaseProducerFromL1ABC::produce(edm::Event& iEvent, const edm::EventSetu } - iEvent.put(apvphases); + iEvent.put(std::move(apvphases)); } diff --git a/DPGAnalysis/SiStripTools/plugins/APVCyclePhaseProducerFromL1TS.cc b/DPGAnalysis/SiStripTools/plugins/APVCyclePhaseProducerFromL1TS.cc index aa5ae497ad34c..a90201233224f 100644 --- a/DPGAnalysis/SiStripTools/plugins/APVCyclePhaseProducerFromL1TS.cc +++ b/DPGAnalysis/SiStripTools/plugins/APVCyclePhaseProducerFromL1TS.cc @@ -188,7 +188,7 @@ APVCyclePhaseProducerFromL1TS::produce(edm::Event& iEvent, const edm::EventSetup using namespace edm; - std::auto_ptr apvphases(new APVCyclePhaseCollection() ); + std::unique_ptr apvphases(new APVCyclePhaseCollection() ); std::vector phases(_defphases.size(),APVCyclePhaseCollection::invalid); @@ -263,7 +263,7 @@ APVCyclePhaseProducerFromL1TS::produce(edm::Event& iEvent, const edm::EventSetup } - iEvent.put(apvphases); + iEvent.put(std::move(apvphases)); } diff --git a/DPGAnalysis/SiStripTools/plugins/ByMultiplicityEventFilter.cc b/DPGAnalysis/SiStripTools/plugins/ByMultiplicityEventFilter.cc index 9e857f7960b21..deb3ab6f51030 100644 --- a/DPGAnalysis/SiStripTools/plugins/ByMultiplicityEventFilter.cc +++ b/DPGAnalysis/SiStripTools/plugins/ByMultiplicityEventFilter.cc @@ -115,7 +115,7 @@ ByMultiplicityEventFilter::filter(edm::Event& iEvent, const edm::EventSetup& m_multiplicities.getEvent(iEvent,iSetup); bool value = m_selector(m_multiplicities); - iEvent.put( std::auto_ptr(new bool(value)) ); + iEvent.put(std::unique_ptr(new bool(value))); if(m_taggedMode) return m_forcedValue; return value; diff --git a/DPGAnalysis/SiStripTools/plugins/ConfigurableAPVCyclePhaseProducer.cc b/DPGAnalysis/SiStripTools/plugins/ConfigurableAPVCyclePhaseProducer.cc index 340890bfb6a9d..f408e1cecd3c3 100644 --- a/DPGAnalysis/SiStripTools/plugins/ConfigurableAPVCyclePhaseProducer.cc +++ b/DPGAnalysis/SiStripTools/plugins/ConfigurableAPVCyclePhaseProducer.cc @@ -180,9 +180,9 @@ ConfigurableAPVCyclePhaseProducer::produce(edm::Event& iEvent, const edm::EventS using namespace edm; - std::auto_ptr apvphases(new APVCyclePhaseCollection(_currapvphases) ); + std::unique_ptr apvphases(new APVCyclePhaseCollection(_currapvphases) ); - iEvent.put(apvphases); + iEvent.put(std::move(apvphases)); } diff --git a/DPGAnalysis/SiStripTools/plugins/EventWithHistoryProducer.cc b/DPGAnalysis/SiStripTools/plugins/EventWithHistoryProducer.cc index 019fcf9c0247a..7d57ed90464d1 100755 --- a/DPGAnalysis/SiStripTools/plugins/EventWithHistoryProducer.cc +++ b/DPGAnalysis/SiStripTools/plugins/EventWithHistoryProducer.cc @@ -98,13 +98,13 @@ EventWithHistoryProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe using namespace edm; - std::auto_ptr heOut(new EventWithHistory(iEvent.id().event(),iEvent.orbitNumber(),iEvent.bunchCrossing())); + std::unique_ptr heOut(new EventWithHistory(iEvent.id().event(),iEvent.orbitNumber(),iEvent.bunchCrossing())); heOut->add(_prevHE,_depth); if(*heOut < _prevHE) edm::LogInfo("EventsNotInOrder") << " Events not in order " << _prevHE._event; _prevHE = *heOut; - iEvent.put(heOut); + iEvent.put(std::move(heOut)); } diff --git a/DPGAnalysis/SiStripTools/plugins/EventWithHistoryProducerFromL1ABC.cc b/DPGAnalysis/SiStripTools/plugins/EventWithHistoryProducerFromL1ABC.cc index fd4e4102570e2..f1dac2374f4fe 100644 --- a/DPGAnalysis/SiStripTools/plugins/EventWithHistoryProducerFromL1ABC.cc +++ b/DPGAnalysis/SiStripTools/plugins/EventWithHistoryProducerFromL1ABC.cc @@ -107,8 +107,8 @@ EventWithHistoryProducerFromL1ABC::produce(edm::Event& iEvent, const edm::EventS if(iEvent.run() < 110878 ) { - std::auto_ptr pOut(new EventWithHistory(iEvent)); - iEvent.put(pOut); + std::unique_ptr pOut(new EventWithHistory(iEvent)); + iEvent.put(std::move(pOut)); } else { @@ -130,8 +130,8 @@ EventWithHistoryProducerFromL1ABC::produce(edm::Event& iEvent, const edm::EventS } - std::auto_ptr pOut(new EventWithHistory(iEvent,*pIn,orbitoffset,bxoffset)); - iEvent.put(pOut); + std::unique_ptr pOut(new EventWithHistory(iEvent,*pIn,orbitoffset,bxoffset)); + iEvent.put(std::move(pOut)); // monitor offset diff --git a/DPGAnalysis/SiStripTools/plugins/FromClusterSummaryMultiplicityProducer.cc b/DPGAnalysis/SiStripTools/plugins/FromClusterSummaryMultiplicityProducer.cc index 2fbc8837eda94..1f7f0de992731 100644 --- a/DPGAnalysis/SiStripTools/plugins/FromClusterSummaryMultiplicityProducer.cc +++ b/DPGAnalysis/SiStripTools/plugins/FromClusterSummaryMultiplicityProducer.cc @@ -111,7 +111,7 @@ FromClusterSummaryMultiplicityProducer::produce(edm::Event& iEvent, const edm::E using namespace edm; - std::auto_ptr > mults(new std::map ); + std::unique_ptr > mults(new std::map ); Handle clustsumm; @@ -142,7 +142,7 @@ FromClusterSummaryMultiplicityProducer::produce(edm::Event& iEvent, const edm::E LogDebug("Multiplicity") << " Found " << it->second << " digis/clusters in " << it->first; } - iEvent.put(mults); + iEvent.put(std::move(mults)); } diff --git a/DPGAnalysis/SiStripTools/plugins/MultiplicityProducer.cc b/DPGAnalysis/SiStripTools/plugins/MultiplicityProducer.cc index b17dd6d86bbcb..e0346fca7ec7a 100644 --- a/DPGAnalysis/SiStripTools/plugins/MultiplicityProducer.cc +++ b/DPGAnalysis/SiStripTools/plugins/MultiplicityProducer.cc @@ -124,7 +124,7 @@ MultiplicityProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet using namespace edm; - std::auto_ptr > mults(new std::map ); + std::unique_ptr > mults(new std::map ); Handle digis; @@ -158,7 +158,7 @@ MultiplicityProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet LogDebug("Multiplicity") << " Found " << it->second << " digis/clusters in " << it->first << " " << m_subdets[it->first]; } - iEvent.put(mults); + iEvent.put(std::move(mults)); } diff --git a/EgammaAnalysis/ElectronTools/plugins/CalibratedElectronProducer.cc b/EgammaAnalysis/ElectronTools/plugins/CalibratedElectronProducer.cc index dd2db56dac3eb..2f29128cf5c88 100644 --- a/EgammaAnalysis/ElectronTools/plugins/CalibratedElectronProducer.cc +++ b/EgammaAnalysis/ElectronTools/plugins/CalibratedElectronProducer.cc @@ -185,12 +185,12 @@ void CalibratedElectronProducer::produce( edm::Event & event, const edm::EventSe event.getByToken(energyErrorRegToken_,valMapEnergyErrorH); // Prepare output collections - std::auto_ptr electrons( new reco::GsfElectronCollection ) ; + std::unique_ptr electrons( new reco::GsfElectronCollection ) ; // Fillers for ValueMaps: - std::auto_ptr > regrNewEnergyMap(new edm::ValueMap() ); + std::unique_ptr > regrNewEnergyMap(new edm::ValueMap() ); edm::ValueMap::Filler energyFiller(*regrNewEnergyMap); - std::auto_ptr > regrNewEnergyErrorMap(new edm::ValueMap() ); + std::unique_ptr > regrNewEnergyErrorMap(new edm::ValueMap() ); edm::ValueMap::Filler energyErrorFiller(*regrNewEnergyErrorMap); // first clone the initial collection @@ -362,14 +362,14 @@ void CalibratedElectronProducer::produce( edm::Event & event, const edm::EventSe } // Save the electrons - const edm::OrphanHandle gsfNewElectronHandle = event.put(electrons, newElectronName_) ; + const edm::OrphanHandle gsfNewElectronHandle = event.put(std::move(electrons), newElectronName_) ; energyFiller.insert(gsfNewElectronHandle,regressionValues.begin(),regressionValues.end()); energyFiller.fill(); energyErrorFiller.insert(gsfNewElectronHandle,regressionErrorValues.begin(),regressionErrorValues.end()); energyErrorFiller.fill(); - event.put(regrNewEnergyMap,nameNewEnergyReg_); - event.put(regrNewEnergyErrorMap,nameNewEnergyErrorReg_); + event.put(std::move(regrNewEnergyMap),nameNewEnergyReg_); + event.put(std::move(regrNewEnergyErrorMap),nameNewEnergyErrorReg_); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/EgammaAnalysis/ElectronTools/plugins/CalibratedPatElectronProducer.cc b/EgammaAnalysis/ElectronTools/plugins/CalibratedPatElectronProducer.cc index 9004b9192be93..3bf7b3a51df04 100644 --- a/EgammaAnalysis/ElectronTools/plugins/CalibratedPatElectronProducer.cc +++ b/EgammaAnalysis/ElectronTools/plugins/CalibratedPatElectronProducer.cc @@ -154,7 +154,7 @@ void CalibratedPatElectronProducer::produce( edm::Event & event, const edm::Even edm::Handle > oldElectrons ; event.getByToken(inputPatElectronsToken,oldElectrons) ; - std::auto_ptr electrons( new pat::ElectronCollection ) ; + std::unique_ptr electrons( new pat::ElectronCollection ) ; pat::ElectronCollection::const_iterator electron ; pat::ElectronCollection::iterator ele ; // first clone the initial collection @@ -318,7 +318,7 @@ void CalibratedPatElectronProducer::produce( edm::Event & event, const edm::Even } } // Save the electrons - event.put(electrons) ; + event.put(std::move(electrons)); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/EgammaAnalysis/ElectronTools/plugins/CalibratedPhotonProducersRun2.cc b/EgammaAnalysis/ElectronTools/plugins/CalibratedPhotonProducersRun2.cc index 663bde14fefbd..3a20aa38ad05a 100644 --- a/EgammaAnalysis/ElectronTools/plugins/CalibratedPhotonProducersRun2.cc +++ b/EgammaAnalysis/ElectronTools/plugins/CalibratedPhotonProducersRun2.cc @@ -45,7 +45,7 @@ CalibratedPhotonProducerRun2T::produce( edm::Event & iEvent, const edm::Event edm::Handle > in; iEvent.getByToken(thePhotonToken, in); - std::auto_ptr > out(new std::vector()); + std::unique_ptr > out(new std::vector()); out->reserve(in->size()); for (const T &ele : *in) { @@ -53,7 +53,7 @@ CalibratedPhotonProducerRun2T::produce( edm::Event & iEvent, const edm::Event theEnCorrectorRun2.calibrate(out->back(), iEvent.id().run(), iEvent.streamID()); } - iEvent.put(out); + iEvent.put(std::move(out)); } typedef CalibratedPhotonProducerRun2T CalibratedPhotonProducerRun2; diff --git a/EgammaAnalysis/ElectronTools/plugins/ElectronIdMVAProducer.cc b/EgammaAnalysis/ElectronTools/plugins/ElectronIdMVAProducer.cc index da432abc53948..eee553d5986ff 100644 --- a/EgammaAnalysis/ElectronTools/plugins/ElectronIdMVAProducer.cc +++ b/EgammaAnalysis/ElectronTools/plugins/ElectronIdMVAProducer.cc @@ -109,7 +109,7 @@ ElectronIdMVAProducer::~ElectronIdMVAProducer() // ------------ method called on each new Event ------------ bool ElectronIdMVAProducer::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { - std::auto_ptr > out(new edm::ValueMap() ); + std::unique_ptr > out(new edm::ValueMap() ); edm::Handle vertexCollection; iEvent.getByToken(vertexToken_, vertexCollection); @@ -162,7 +162,7 @@ bool ElectronIdMVAProducer::filter(edm::Event& iEvent, const edm::EventSetup& iS filler.insert(egCollection, values.begin(), values.end() ); filler.fill(); - iEvent.put(out); + iEvent.put(std::move(out)); return true; } diff --git a/EgammaAnalysis/ElectronTools/plugins/ElectronIsolatorFromEffectiveArea.cc b/EgammaAnalysis/ElectronTools/plugins/ElectronIsolatorFromEffectiveArea.cc index 6f1e6bfe23a8a..c1dd42b53b0d9 100644 --- a/EgammaAnalysis/ElectronTools/plugins/ElectronIsolatorFromEffectiveArea.cc +++ b/EgammaAnalysis/ElectronTools/plugins/ElectronIsolatorFromEffectiveArea.cc @@ -58,7 +58,7 @@ ElectronIsolatorFromEffectiveArea(const edm::ParameterSet& config) bool ElectronIsolatorFromEffectiveArea:: filter(edm::Event& event, const edm::EventSetup& ) { - std::auto_ptr product(new CandDoubleMap()); + std::unique_ptr product(new CandDoubleMap()); CandDoubleMap::Filler filler(*product); edm::Handle rho; event.getByToken(rhoIsoToken, rho); @@ -94,7 +94,7 @@ filter(edm::Event& event, const edm::EventSetup& ) } filler.fill(); - event.put(product); + event.put(std::move(product)); return true; } diff --git a/EgammaAnalysis/ElectronTools/plugins/ElectronPATIdMVAProducer.cc b/EgammaAnalysis/ElectronTools/plugins/ElectronPATIdMVAProducer.cc index 68ee1e9ef7ff4..cb3b4ad95de86 100644 --- a/EgammaAnalysis/ElectronTools/plugins/ElectronPATIdMVAProducer.cc +++ b/EgammaAnalysis/ElectronTools/plugins/ElectronPATIdMVAProducer.cc @@ -100,7 +100,7 @@ ElectronPATIdMVAProducer::~ElectronPATIdMVAProducer() // ------------ method called on each new Event ------------ void ElectronPATIdMVAProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - std::auto_ptr > out(new edm::ValueMap() ); + std::unique_ptr > out(new edm::ValueMap() ); @@ -138,7 +138,7 @@ void ElectronPATIdMVAProducer::produce(edm::Event& iEvent, const edm::EventSetup filler.insert(egCollection, values.begin(), values.end() ); filler.fill(); - iEvent.put(out); + iEvent.put(std::move(out)); } diff --git a/EgammaAnalysis/ElectronTools/plugins/ElectronRegressionEnergyProducer.cc b/EgammaAnalysis/ElectronTools/plugins/ElectronRegressionEnergyProducer.cc index 1b3fc6461ccaf..f10a673795dc7 100644 --- a/EgammaAnalysis/ElectronTools/plugins/ElectronRegressionEnergyProducer.cc +++ b/EgammaAnalysis/ElectronTools/plugins/ElectronRegressionEnergyProducer.cc @@ -117,10 +117,10 @@ bool ElectronRegressionEnergyProducer::filter(edm::Event& iEvent, const edm::Eve geomInitialized_ = true; } - std::auto_ptr > regrEnergyMap(new edm::ValueMap() ); + std::unique_ptr > regrEnergyMap(new edm::ValueMap() ); edm::ValueMap::Filler energyFiller(*regrEnergyMap); - std::auto_ptr > regrEnergyErrorMap(new edm::ValueMap() ); + std::unique_ptr > regrEnergyErrorMap(new edm::ValueMap() ); edm::ValueMap::Filler energyErrorFiller(*regrEnergyErrorMap); edm::Handle egCollection; @@ -202,8 +202,8 @@ bool ElectronRegressionEnergyProducer::filter(edm::Event& iEvent, const edm::Eve energyErrorFiller.insert( egCollection, energyErrorValues.begin(), energyErrorValues.end() ); energyErrorFiller.fill(); - iEvent.put(regrEnergyMap,nameEnergyReg_); - iEvent.put(regrEnergyErrorMap,nameEnergyErrorReg_); + iEvent.put(std::move(regrEnergyMap),nameEnergyReg_); + iEvent.put(std::move(regrEnergyErrorMap),nameEnergyErrorReg_); return true; diff --git a/EgammaAnalysis/ElectronTools/plugins/PatElectronEAIsoCorrectionProducer.cc b/EgammaAnalysis/ElectronTools/plugins/PatElectronEAIsoCorrectionProducer.cc index 3a4a488430dcf..f75e6a78b722a 100644 --- a/EgammaAnalysis/ElectronTools/plugins/PatElectronEAIsoCorrectionProducer.cc +++ b/EgammaAnalysis/ElectronTools/plugins/PatElectronEAIsoCorrectionProducer.cc @@ -33,7 +33,7 @@ void PatElectronEAIsoCorrectionProducer::produce( edm::Event& iEvent, const edm: edm::Handle< edm::ValueMap< double > > eaIsolator; iEvent.getByToken( eaIsolatorToken_, eaIsolator ); - std::auto_ptr< pat::ElectronCollection > updatedPatElectrons( new pat::ElectronCollection ); + std::unique_ptr< pat::ElectronCollection > updatedPatElectrons( new pat::ElectronCollection ); for ( size_t iElectron = 0; iElectron < patElectrons->size(); ++iElectron ) { pat::Electron* updatedPatElectron = patElectrons->at( iElectron ).clone(); @@ -42,7 +42,7 @@ void PatElectronEAIsoCorrectionProducer::produce( edm::Event& iEvent, const edm: updatedPatElectrons->push_back( *updatedPatElectron ); } - iEvent.put( updatedPatElectrons ); + iEvent.put(std::move(updatedPatElectrons)); } diff --git a/EgammaAnalysis/ElectronTools/plugins/PhotonIsoProducer.cc b/EgammaAnalysis/ElectronTools/plugins/PhotonIsoProducer.cc index 00c4631c731cf..a8a17d1c3f7a8 100644 --- a/EgammaAnalysis/ElectronTools/plugins/PhotonIsoProducer.cc +++ b/EgammaAnalysis/ElectronTools/plugins/PhotonIsoProducer.cc @@ -89,13 +89,13 @@ PhotonIsoProducer::~PhotonIsoProducer() // ------------ method called on each new Event ------------ bool PhotonIsoProducer::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { - std::auto_ptr > chIsoMap(new edm::ValueMap() ); + std::unique_ptr > chIsoMap(new edm::ValueMap() ); edm::ValueMap::Filler chFiller(*chIsoMap); - std::auto_ptr > phIsoMap(new edm::ValueMap() ); + std::unique_ptr > phIsoMap(new edm::ValueMap() ); edm::ValueMap::Filler phFiller(*phIsoMap); - std::auto_ptr > nhIsoMap(new edm::ValueMap() ); + std::unique_ptr > nhIsoMap(new edm::ValueMap() ); edm::ValueMap::Filler nhFiller(*nhIsoMap); edm::Handle vertexCollection; @@ -154,9 +154,9 @@ bool PhotonIsoProducer::filter(edm::Event& iEvent, const edm::EventSetup& iSetup nhFiller.fill(); - iEvent.put(chIsoMap,nameIsoCh_); - iEvent.put(phIsoMap,nameIsoPh_); - iEvent.put(nhIsoMap,nameIsoNh_); + iEvent.put(std::move(chIsoMap),nameIsoCh_); + iEvent.put(std::move(phIsoMap),nameIsoPh_); + iEvent.put(std::move(nhIsoMap),nameIsoNh_); return true; diff --git a/EgammaAnalysis/ElectronTools/plugins/RegressionEnergyPatElectronProducer.cc b/EgammaAnalysis/ElectronTools/plugins/RegressionEnergyPatElectronProducer.cc index abbdcd51c2247..9129be81d93a3 100644 --- a/EgammaAnalysis/ElectronTools/plugins/RegressionEnergyPatElectronProducer.cc +++ b/EgammaAnalysis/ElectronTools/plugins/RegressionEnergyPatElectronProducer.cc @@ -150,13 +150,13 @@ void RegressionEnergyPatElectronProducer::produce( edm::Event & event, const edm } // prepare the two even if only one is used - std::auto_ptr patElectrons( new pat::ElectronCollection ) ; + std::unique_ptr patElectrons( new pat::ElectronCollection ) ; // Fillers for ValueMaps: - std::auto_ptr > regrEnergyMap(new edm::ValueMap() ); + std::unique_ptr > regrEnergyMap(new edm::ValueMap() ); edm::ValueMap::Filler energyFiller(*regrEnergyMap); - std::auto_ptr > regrEnergyErrorMap(new edm::ValueMap() ); + std::unique_ptr > regrEnergyErrorMap(new edm::ValueMap() ); edm::ValueMap::Filler energyErrorFiller(*regrEnergyErrorMap); @@ -542,7 +542,7 @@ void RegressionEnergyPatElectronProducer::produce( edm::Event & event, const edm // Write the new collection in the event (AOD case) if(inputCollectionType_ == 1) { - event.put(patElectrons) ; + event.put(std::move(patElectrons)); } // now AOD case: write ValueMaps @@ -558,8 +558,8 @@ void RegressionEnergyPatElectronProducer::produce( edm::Event & event, const edm energyFiller.fill(); energyErrorFiller.fill(); - event.put(regrEnergyMap,nameEnergyReg_); - event.put(regrEnergyErrorMap,nameEnergyErrorReg_); + event.put(std::move(regrEnergyMap),nameEnergyReg_); + event.put(std::move(regrEnergyErrorMap),nameEnergyErrorReg_); } } diff --git a/EgammaAnalysis/PhotonIDProducers/src/PiZeroDiscriminatorProducer.cc b/EgammaAnalysis/PhotonIDProducers/src/PiZeroDiscriminatorProducer.cc index ca43813a1c41b..38863e3733c0f 100644 --- a/EgammaAnalysis/PhotonIDProducers/src/PiZeroDiscriminatorProducer.cc +++ b/EgammaAnalysis/PhotonIDProducers/src/PiZeroDiscriminatorProducer.cc @@ -131,7 +131,7 @@ void PiZeroDiscriminatorProducer::produce(Event& evt, const EventSetup& es) { cout << " PiZeroDiscriminatorProducer: Photon Collection size : " << corrPhoCollection.size() << endl; } - auto_ptr Pi0Assocs_p(new PhotonPi0DiscriminatorAssociationMap(correctedPhotonHandle)); + unique_ptr Pi0Assocs_p(new PhotonPi0DiscriminatorAssociationMap(correctedPhotonHandle)); for( PhotonCollection::const_iterator iPho = corrPhoCollection.begin(); iPho != corrPhoCollection.end(); iPho++) { @@ -379,7 +379,7 @@ void PiZeroDiscriminatorProducer::produce(Event& evt, const EventSetup& es) { } else { Pi0Assocs_p->insert(Ref(correctedPhotonHandle,iPho - corrPhoCollection.begin()), -1.);} } // end of cycle over Photons - evt.put(Pi0Assocs_p,PhotonPi0DiscriminatorAssociationMap_); + evt.put(std::move(Pi0Assocs_p),PhotonPi0DiscriminatorAssociationMap_); if ( debugL_pi0 <= pDEBUG ) cout << "PiZeroDiscriminatorProducer: PhotonPi0DiscriminatorAssociationMap added to the event" << endl; nEvt_++; diff --git a/ElectroWeakAnalysis/Skimming/plugins/ZMuMuMuonUserData.cc b/ElectroWeakAnalysis/Skimming/plugins/ZMuMuMuonUserData.cc index 1a99cc20aea7e..82f910f3d11c7 100755 --- a/ElectroWeakAnalysis/Skimming/plugins/ZMuMuMuonUserData.cc +++ b/ElectroWeakAnalysis/Skimming/plugins/ZMuMuMuonUserData.cc @@ -115,7 +115,7 @@ void ZMuMuMuonUserData::produce( Event & evt, const EventSetup & ) { Handle primaryVertices; // Collection of primary Vertices evt.getByToken(primaryVerticesToken_, primaryVertices); - auto_ptr > muonColl( new vector (*muons) ); + unique_ptr > muonColl( new vector (*muons) ); for (unsigned int i = 0; i< muonColl->size();++i){ pat::Muon & m = (*muonColl)[i]; //pat::Muon *mu = new pat::Muon(m); @@ -219,7 +219,7 @@ void ZMuMuMuonUserData::produce( Event & evt, const EventSetup & ) { m.addUserFloat("zDau_MuEnergyHad", zDauMuEnergyHad ); } - evt.put( muonColl); + evt.put(std::move(muonColl)); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/ElectroWeakAnalysis/Skimming/plugins/ZMuMuOneTrackUserData.cc b/ElectroWeakAnalysis/Skimming/plugins/ZMuMuOneTrackUserData.cc index 45e16a0c6edc4..25ab86c28c997 100755 --- a/ElectroWeakAnalysis/Skimming/plugins/ZMuMuOneTrackUserData.cc +++ b/ElectroWeakAnalysis/Skimming/plugins/ZMuMuOneTrackUserData.cc @@ -79,7 +79,7 @@ void ZMuMuUserDataOneTrack::produce( Event & evt, const EventSetup & ) { } //cout<<"isMCMatchTrue"< > dimuonColl( new vector () ); + unique_ptr > dimuonColl( new vector () ); for (unsigned int i = 0; i< dimuons->size();++i){ @@ -119,7 +119,7 @@ void ZMuMuUserDataOneTrack::produce( Event & evt, const EventSetup & ) { } - evt.put( dimuonColl); + evt.put(std::move(dimuonColl)); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/ElectroWeakAnalysis/Skimming/plugins/ZMuMuTrackUserData.cc b/ElectroWeakAnalysis/Skimming/plugins/ZMuMuTrackUserData.cc index 7a54c220cd2ea..0c3e2edc5419b 100755 --- a/ElectroWeakAnalysis/Skimming/plugins/ZMuMuTrackUserData.cc +++ b/ElectroWeakAnalysis/Skimming/plugins/ZMuMuTrackUserData.cc @@ -106,7 +106,7 @@ void ZMuMuTrackUserData::produce( Event & evt, const EventSetup & ) { Handle primaryVertices; // Collection of primary Vertices evt.getByToken(primaryVerticesToken_, primaryVertices); - auto_ptr > tkColl( new vector (*tracks) ); + unique_ptr > tkColl( new vector (*tracks) ); for (unsigned int i = 0; i< tkColl->size();++i){ pat::GenericParticle & tk = (*tkColl)[i]; vector iso = isolation(tk,ptThreshold_, etEcalThreshold_, etHcalThreshold_ ,dRVetoTrk_, dRTrk_, dREcal_ , dRHcal_, alpha_, beta_); @@ -167,7 +167,7 @@ void ZMuMuTrackUserData::produce( Event & evt, const EventSetup & ) { } - evt.put( tkColl); + evt.put(std::move(tkColl)); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/ElectroWeakAnalysis/Skimming/plugins/ZMuMuUserData.cc b/ElectroWeakAnalysis/Skimming/plugins/ZMuMuUserData.cc index 292c35f2e14e4..706b61c8454ca 100755 --- a/ElectroWeakAnalysis/Skimming/plugins/ZMuMuUserData.cc +++ b/ElectroWeakAnalysis/Skimming/plugins/ZMuMuUserData.cc @@ -76,7 +76,7 @@ void ZMuMuUserData::produce( Event & evt, const EventSetup & ) { } //cout<<"isMCMatchTrue"< > dimuonColl( new vector () ); + unique_ptr > dimuonColl( new vector () ); for (unsigned int i = 0; i< dimuons->size();++i){ @@ -169,7 +169,7 @@ void ZMuMuUserData::produce( Event & evt, const EventSetup & ) { } - evt.put( dimuonColl); + evt.put(std::move(dimuonColl)); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/ElectroWeakAnalysis/Utilities/src/DistortedMETProducer.cc b/ElectroWeakAnalysis/Utilities/src/DistortedMETProducer.cc index a2d3eeac68eae..b058f5817f37f 100644 --- a/ElectroWeakAnalysis/Utilities/src/DistortedMETProducer.cc +++ b/ElectroWeakAnalysis/Utilities/src/DistortedMETProducer.cc @@ -65,7 +65,7 @@ void DistortedMETProducer::produce(edm::Event& ev, const edm::EventSetup&) { } edm::RefToBase met = metCollection->refAt(0); - std::auto_ptr newmetCollection (new reco::METCollection); + std::unique_ptr newmetCollection (new reco::METCollection); double met_et = met->et() * (1. + metScaleShift_); double sum_et = met->sumEt() * (1. + metScaleShift_); @@ -78,7 +78,7 @@ void DistortedMETProducer::produce(edm::Event& ev, const edm::EventSetup&) { newmetCollection->push_back(*newmet); - ev.put(newmetCollection); + ev.put(std::move(newmetCollection)); } DEFINE_FWK_MODULE(DistortedMETProducer); diff --git a/ElectroWeakAnalysis/Utilities/src/DistortedMuonProducer.cc b/ElectroWeakAnalysis/Utilities/src/DistortedMuonProducer.cc index 52f108267900a..2e826d29e60cf 100644 --- a/ElectroWeakAnalysis/Utilities/src/DistortedMuonProducer.cc +++ b/ElectroWeakAnalysis/Utilities/src/DistortedMuonProducer.cc @@ -138,7 +138,7 @@ void DistortedMuonProducer::produce(edm::Event& ev, const edm::EventSetup& iSetu unsigned int muonCollectionSize = muonCollection->size(); - std::auto_ptr newmuons (new reco::MuonCollection); + std::unique_ptr newmuons (new reco::MuonCollection); for (unsigned int i=0; i mu = muonCollection->refAt(i); @@ -216,7 +216,7 @@ void DistortedMuonProducer::produce(edm::Event& ev, const edm::EventSetup& iSetu } - ev.put(newmuons); + ev.put(std::move(newmuons)); } DEFINE_FWK_MODULE(DistortedMuonProducer); diff --git a/ElectroWeakAnalysis/Utilities/src/DistortedMuonProducerFromDB.cc b/ElectroWeakAnalysis/Utilities/src/DistortedMuonProducerFromDB.cc index e990ec027fea5..c15a1f02eb768 100644 --- a/ElectroWeakAnalysis/Utilities/src/DistortedMuonProducerFromDB.cc +++ b/ElectroWeakAnalysis/Utilities/src/DistortedMuonProducerFromDB.cc @@ -29,9 +29,9 @@ class DistortedMuonProducerFromDB : public edm::EDProducer { std::string dbDataResolutionLabel_; std::string dbMCResolutionLabel_; - std::auto_ptr momCorrector_; - std::auto_ptr momResolutionData_; - std::auto_ptr momResolutionMC_; + std::unique_ptr momCorrector_; + std::unique_ptr momResolutionData_; + std::unique_ptr momResolutionMC_; }; #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -101,7 +101,7 @@ void DistortedMuonProducerFromDB::produce(edm::Event& ev, const edm::EventSetup& } unsigned int muonCollectionSize = muonCollection->size(); - std::auto_ptr newmuons (new reco::MuonCollection); + std::unique_ptr newmuons (new reco::MuonCollection); for (unsigned int i=0; i mu = muonCollection->refAt(i); @@ -132,7 +132,7 @@ void DistortedMuonProducerFromDB::produce(edm::Event& ev, const edm::EventSetup& } - ev.put(newmuons); + ev.put(std::move(newmuons)); } DEFINE_FWK_MODULE(DistortedMuonProducerFromDB); diff --git a/ElectroWeakAnalysis/Utilities/src/DistortedPFCandProducer.cc b/ElectroWeakAnalysis/Utilities/src/DistortedPFCandProducer.cc index 6ee8d134f1e51..3803ca0e26c9a 100644 --- a/ElectroWeakAnalysis/Utilities/src/DistortedPFCandProducer.cc +++ b/ElectroWeakAnalysis/Utilities/src/DistortedPFCandProducer.cc @@ -158,7 +158,7 @@ void DistortedPFCandProducer::produce(edm::Event& ev, const edm::EventSetup& iSe - std::auto_ptr newmuons (new reco::PFCandidateCollection); + std::unique_ptr newmuons (new reco::PFCandidateCollection); // Loop on all PF candidates @@ -286,7 +286,7 @@ void DistortedPFCandProducer::produce(edm::Event& ev, const edm::EventSetup& iSe } - ev.put(newmuons); + ev.put(std::move(newmuons)); } diff --git a/ElectroWeakAnalysis/Utilities/src/FSRWeightProducer.cc b/ElectroWeakAnalysis/Utilities/src/FSRWeightProducer.cc index 719166dec7ff3..a753e96328072 100644 --- a/ElectroWeakAnalysis/Utilities/src/FSRWeightProducer.cc +++ b/ElectroWeakAnalysis/Utilities/src/FSRWeightProducer.cc @@ -56,7 +56,7 @@ void FSRWeightProducer::produce(edm::Event& iEvent, const edm::EventSetup&) { edm::Handle genParticles; iEvent.getByToken(genToken_, genParticles); - std::auto_ptr weight (new double); + std::unique_ptr weight (new double); // Set a default weight to start with (*weight) = 1.; @@ -119,7 +119,7 @@ void FSRWeightProducer::produce(edm::Event& iEvent, const edm::EventSetup&) { } - iEvent.put(weight); + iEvent.put(std::move(weight)); } double FSRWeightProducer::alphaRatio(double pt) { diff --git a/ElectroWeakAnalysis/Utilities/src/ISRGammaWeightProducer.cc b/ElectroWeakAnalysis/Utilities/src/ISRGammaWeightProducer.cc index 7be37d9fced5c..bd500454f2f58 100644 --- a/ElectroWeakAnalysis/Utilities/src/ISRGammaWeightProducer.cc +++ b/ElectroWeakAnalysis/Utilities/src/ISRGammaWeightProducer.cc @@ -58,7 +58,7 @@ void ISRGammaWeightProducer::produce(edm::Event& iEvent, const edm::EventSetup&) iEvent.getByToken(genToken_, genParticles); unsigned int gensize = genParticles->size(); - std::auto_ptr weight (new double); + std::unique_ptr weight (new double); // Set a default weight to start with (*weight) = 1.; @@ -128,7 +128,7 @@ void ISRGammaWeightProducer::produce(edm::Event& iEvent, const edm::EventSetup&) //printf(">>>>>>>>> s %f t %f u %f, MV %f, weight = %f\n", s, t, u, MV, (*weight)); } - iEvent.put(weight); + iEvent.put(std::move(weight)); } DEFINE_FWK_MODULE(ISRGammaWeightProducer); diff --git a/ElectroWeakAnalysis/Utilities/src/ISRWeightProducer.cc b/ElectroWeakAnalysis/Utilities/src/ISRWeightProducer.cc index 4585c7d1182dd..3f7307db11523 100644 --- a/ElectroWeakAnalysis/Utilities/src/ISRWeightProducer.cc +++ b/ElectroWeakAnalysis/Utilities/src/ISRWeightProducer.cc @@ -73,7 +73,7 @@ void ISRWeightProducer::produce(edm::Event& iEvent, const edm::EventSetup&) { iEvent.getByToken(genToken_, genParticles); unsigned int gensize = genParticles->size(); - std::auto_ptr weight (new double); + std::unique_ptr weight (new double); // Set as default weight the asymptotic value at high pt (i.e. value of last bin) (*weight) = ptWeights_[ptWeights_.size()-1]; @@ -96,7 +96,7 @@ void ISRWeightProducer::produce(edm::Event& iEvent, const edm::EventSetup&) { break; } - iEvent.put(weight); + iEvent.put(std::move(weight)); } DEFINE_FWK_MODULE(ISRWeightProducer); diff --git a/ElectroWeakAnalysis/Utilities/src/MuonWithPFIsoProducer.cc b/ElectroWeakAnalysis/Utilities/src/MuonWithPFIsoProducer.cc index ba3b6c6bd9861..5d394ba831656 100644 --- a/ElectroWeakAnalysis/Utilities/src/MuonWithPFIsoProducer.cc +++ b/ElectroWeakAnalysis/Utilities/src/MuonWithPFIsoProducer.cc @@ -79,13 +79,13 @@ void MuonWithPFIsoProducer::endJob(){ void MuonWithPFIsoProducer::produce(edm::Event& ev, const edm::EventSetup& iSetup) { // Initialize pointer to new output muon collection - std::auto_ptr newmuons (new reco::MuonCollection); + std::unique_ptr newmuons (new reco::MuonCollection); // Get Muon collection edm::Handle > muonCollection; if (!ev.getByToken(muonToken_, muonCollection)) { edm::LogError("") << ">>> Muon collection does not exist !!!"; - ev.put(newmuons); + ev.put(std::move(newmuons)); return; } @@ -93,7 +93,7 @@ void MuonWithPFIsoProducer::produce(edm::Event& ev, const edm::EventSetup& iSetu edm::Handle > pfCollection; if (!ev.getByToken(pfToken_, pfCollection)) { edm::LogError("") << ">>> PFCandidate collection does not exist !!!"; - ev.put(newmuons); + ev.put(std::move(newmuons)); return; } @@ -183,7 +183,7 @@ void MuonWithPFIsoProducer::produce(edm::Event& ev, const edm::EventSetup& iSetu } // Add output collection to event - ev.put(newmuons); + ev.put(std::move(newmuons)); } DEFINE_FWK_MODULE(MuonWithPFIsoProducer); diff --git a/ElectroWeakAnalysis/Utilities/src/PdfWeightProducer.cc b/ElectroWeakAnalysis/Utilities/src/PdfWeightProducer.cc index 44dcfcb39a028..14e1a142089f0 100644 --- a/ElectroWeakAnalysis/Utilities/src/PdfWeightProducer.cc +++ b/ElectroWeakAnalysis/Utilities/src/PdfWeightProducer.cc @@ -144,7 +144,7 @@ void PdfWeightProducer::produce(edm::Event& iEvent, const edm::EventSetup&) { // Put PDF weights in the event for (unsigned int k=1; k<=pdfSetNames_.size(); ++k) { - std::auto_ptr > weights (new std::vector); + std::unique_ptr > weights (new std::vector); unsigned int nweights = 1; if (LHAPDF::numberPDF(k)>1) nweights += LHAPDF::numberPDF(k); weights->reserve(nweights); @@ -155,7 +155,7 @@ void PdfWeightProducer::produce(edm::Event& iEvent, const edm::EventSetup&) { double newpdf2 = LHAPDF::xfx(k, x2, Q, id2)/x2; weights->push_back(newpdf1/pdf1*newpdf2/pdf2); } - iEvent.put(weights,pdfShortNames_[k-1]); + iEvent.put(std::move(weights),pdfShortNames_[k-1]); } } diff --git a/ElectroWeakAnalysis/Utilities/src/WeakEffectsWeightProducer.cc b/ElectroWeakAnalysis/Utilities/src/WeakEffectsWeightProducer.cc index 75b18ae1108c5..817a81cdda02d 100644 --- a/ElectroWeakAnalysis/Utilities/src/WeakEffectsWeightProducer.cc +++ b/ElectroWeakAnalysis/Utilities/src/WeakEffectsWeightProducer.cc @@ -55,7 +55,7 @@ void WeakEffectsWeightProducer::produce(edm::Event & iEvent, const edm::EventSet iEvent.getByToken(genParticlesToken_, genParticles); unsigned int gensize = genParticles->size(); - std::auto_ptr weight (new double); + std::unique_ptr weight (new double); // Set default weight (*weight) = 1.; @@ -80,7 +80,7 @@ void WeakEffectsWeightProducer::produce(edm::Event & iEvent, const edm::EventSet } //printf(" \t >>>>> WeakEffectsWeightProducer: Final weight = %f\n", (*weight)); - iEvent.put(weight); + iEvent.put(std::move(weight)); } double WeakEffectsWeightProducer::alphaQED(double q2) { diff --git a/ElectroWeakAnalysis/WMuNu/src/WMuNuProducer.cc b/ElectroWeakAnalysis/WMuNu/src/WMuNuProducer.cc index bffff95d2bc1c..11899fd6350ba 100644 --- a/ElectroWeakAnalysis/WMuNu/src/WMuNuProducer.cc +++ b/ElectroWeakAnalysis/WMuNu/src/WMuNuProducer.cc @@ -132,7 +132,7 @@ void WMuNuProducer::produce (Event & ev, const EventSetup &) { if (muonCollectionSize<1) return; - auto_ptr< WMuNuCandidateCollection > WMuNuCandidates(new WMuNuCandidateCollection ); + unique_ptr< WMuNuCandidateCollection > WMuNuCandidates(new WMuNuCandidateCollection ); // Fill Collection with n muons --> n W Candidates ordered by pt @@ -156,7 +156,7 @@ void WMuNuProducer::produce (Event & ev, const EventSetup &) { std::sort(WMuNuCandidates->begin(),WMuNuCandidates->end(),ptComparator); - ev.put(WMuNuCandidates); + ev.put(std::move(WMuNuCandidates)); } diff --git a/ElectroWeakAnalysis/ZEE/src/ZeeCandidateFilter.cc b/ElectroWeakAnalysis/ZEE/src/ZeeCandidateFilter.cc index 6ce4c9859bd5d..a12c05a576f0b 100644 --- a/ElectroWeakAnalysis/ZEE/src/ZeeCandidateFilter.cc +++ b/ElectroWeakAnalysis/ZEE/src/ZeeCandidateFilter.cc @@ -1283,11 +1283,11 @@ Bool_t ZeeCandidateFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSe zeeCandidate.addDaughter(thePfMET, "pfmet"); zeeCandidate.addDaughter(theTcMET, "tcmet"); - auto_ptrselectedZeeCandidates(new pat::CompositeCandidateCollection); + unique_ptrselectedZeeCandidates(new pat::CompositeCandidateCollection); selectedZeeCandidates->push_back(zeeCandidate); - iEvent.put(selectedZeeCandidates, "selectedZeeCandidates"); + iEvent.put(std::move(selectedZeeCandidates), "selectedZeeCandidates"); // release your memory delete [] sorted; diff --git a/ElectroWeakAnalysis/ZEE/src/aod2patFilterZee.cc b/ElectroWeakAnalysis/ZEE/src/aod2patFilterZee.cc index a184c75cbeb3c..0e48cec976348 100644 --- a/ElectroWeakAnalysis/ZEE/src/aod2patFilterZee.cc +++ b/ElectroWeakAnalysis/ZEE/src/aod2patFilterZee.cc @@ -134,7 +134,7 @@ aod2patFilterZee::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) } const reco::GsfElectronCollection *pElecs = gsfElectrons.product(); // calculate your electrons - auto_ptr patElectrons(new pat::ElectronCollection); + unique_ptr patElectrons(new pat::ElectronCollection); for (reco::GsfElectronCollection::const_iterator elec = pElecs->begin(); elec != pElecs->end(); ++elec) { reco::GsfElectron mygsfelec = *elec; @@ -157,7 +157,7 @@ aod2patFilterZee::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) return false; } const reco::CaloMETCollection *mycalomets = calomets.product(); - auto_ptr patCaloMets(new pat::METCollection); + unique_ptr patCaloMets(new pat::METCollection); for (reco::CaloMETCollection::const_iterator met = mycalomets->begin(); met != mycalomets->end(); ++ met ) { pat::MET mymet(*met); @@ -167,8 +167,8 @@ aod2patFilterZee::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) // // put everything in the event // - iEvent.put( patElectrons, "patElectrons"); - iEvent.put( patCaloMets, "patCaloMets"); + iEvent.put(std::move(patElectrons), "patElectrons"); + iEvent.put(std::move(patCaloMets), "patCaloMets"); // return true; diff --git a/ElectroWeakAnalysis/ZMuMu/plugins/DimuonMCMatcher.cc b/ElectroWeakAnalysis/ZMuMu/plugins/DimuonMCMatcher.cc index 1e580e570e693..4d00f90cb3d8b 100644 --- a/ElectroWeakAnalysis/ZMuMu/plugins/DimuonMCMatcher.cc +++ b/ElectroWeakAnalysis/ZMuMu/plugins/DimuonMCMatcher.cc @@ -31,7 +31,7 @@ DimuonMCMatcher::DimuonMCMatcher(const edm::ParameterSet & cfg) : void DimuonMCMatcher::produce(edm::Event& evt, const edm::EventSetup&) { Handle src; evt.getByToken(srcToken_, src); - auto_ptr > matched(new vector); + unique_ptr > matched(new vector); matched->reserve(src->size()); int j=0; for(CandidateView::const_iterator i = src->begin(); i != src->end(); ++i) { @@ -85,7 +85,7 @@ void DimuonMCMatcher::produce(edm::Event& evt, const edm::EventSetup&) { matched->push_back(dimuonMatch); } - evt.put(matched); + evt.put(std::move(matched)); } diff --git a/ElectroWeakAnalysis/ZMuMu/plugins/EventVtxInfoNtupleDumper.cc b/ElectroWeakAnalysis/ZMuMu/plugins/EventVtxInfoNtupleDumper.cc index 9c58e8040e6ba..2247717d16711 100755 --- a/ElectroWeakAnalysis/ZMuMu/plugins/EventVtxInfoNtupleDumper.cc +++ b/ElectroWeakAnalysis/ZMuMu/plugins/EventVtxInfoNtupleDumper.cc @@ -42,15 +42,15 @@ void EventVtxInfoNtupleDumper::produce( Event & evt, const EventSetup & ) { Handle primaryVertices; // Collection of primary Vertices evt.getByToken(primaryVerticesToken_, primaryVertices); - auto_ptr nVtxs( new int ); - auto_ptr nTrkVtx( new int ); - auto_ptr chi2Vtx( new float ); - auto_ptr ndofVtx( new float ); - auto_ptr zVtx( new float ); - auto_ptr rhoVtx( new float ); - // auto_ptr< vector< unsigned int > > nTrkVtx( new vector< unsigned int > ); - // auto_ptr< vector< float > > chi2Vtx( new vector< float > ); - // auto_ptr< vector< float > > ndofVtx( new vector< float > ); + unique_ptr nVtxs( new int ); + unique_ptr nTrkVtx( new int ); + unique_ptr chi2Vtx( new float ); + unique_ptr ndofVtx( new float ); + unique_ptr zVtx( new float ); + unique_ptr rhoVtx( new float ); + // unique_ptr< vector< unsigned int > > nTrkVtx( new vector< unsigned int > ); + // unique_ptr< vector< float > > chi2Vtx( new vector< float > ); + // unique_ptr< vector< float > > ndofVtx( new vector< float > ); const reco::Vertex &pv = (*primaryVertices)[0]; @@ -71,12 +71,12 @@ void EventVtxInfoNtupleDumper::produce( Event & evt, const EventSetup & ) { // nTrkVtx->push_back(pv.tracksSize()); // chi2Vtx->push_back(pv.chi2()); // ndofVtx->push_back(pv.ndof()); - evt.put( nVtxs, "numPV" ); - evt.put( nTrkVtx, "nTrkPV" ); - evt.put( chi2Vtx, "chi2PV" ); - evt.put( ndofVtx, "ndofPV" ); - evt.put( zVtx, "zPV" ); - evt.put( rhoVtx, "rhoPV" ); + evt.put(std::move(nVtxs), "numPV" ); + evt.put(std::move(nTrkVtx), "nTrkPV" ); + evt.put(std::move(chi2Vtx), "chi2PV" ); + evt.put(std::move(ndofVtx), "ndofPV" ); + evt.put(std::move(zVtx), "zPV" ); + evt.put(std::move(rhoVtx), "rhoPV" ); } diff --git a/ElectroWeakAnalysis/ZMuMu/plugins/ZToLLEdmNtupleDumper.cc b/ElectroWeakAnalysis/ZMuMu/plugins/ZToLLEdmNtupleDumper.cc index 0a7fcc20e24c4..f2ef58521dd88 100755 --- a/ElectroWeakAnalysis/ZMuMu/plugins/ZToLLEdmNtupleDumper.cc +++ b/ElectroWeakAnalysis/ZMuMu/plugins/ZToLLEdmNtupleDumper.cc @@ -231,71 +231,71 @@ void ZToLLEdmNtupleDumper::produce( Event & evt, const EventSetup & ) { isMCMatchTrue=true; } unsigned int zSize = zColl->size(); - auto_ptr > event( new vector ); - auto_ptr > run( new vector ); - auto_ptr > lumi( new vector ); - auto_ptr > zMass( new vector ); - auto_ptr > zMassSa( new vector ); - auto_ptr > zPt( new vector ); - auto_ptr > zEta( new vector ); - auto_ptr > zPhi( new vector ); - auto_ptr > zY( new vector ); - auto_ptr > zDau1Pt( new vector ); - auto_ptr > zDau2Pt( new vector ); - auto_ptr > zDau1SaPt( new vector ); - auto_ptr > zDau2SaPt( new vector ); - auto_ptr > zDau1HLTBit( new vector ); - auto_ptr > zDau2HLTBit( new vector ); - auto_ptr > zDau1Q( new vector ); - auto_ptr > zDau2Q( new vector ); - auto_ptr > zDau1Eta( new vector ); - auto_ptr > zDau2Eta( new vector ); - auto_ptr > zDau1SaEta( new vector ); - auto_ptr > zDau2SaEta( new vector ); - auto_ptr > zDau1Phi( new vector ); - auto_ptr > zDau2Phi( new vector ); - auto_ptr > zDau1SaPhi( new vector ); - auto_ptr > zDau2SaPhi( new vector ); - auto_ptr > zDau1Iso( new vector ); - auto_ptr > zDau2Iso( new vector ); - auto_ptr > zDau1TrkIso( new vector ); - auto_ptr > zDau2TrkIso( new vector ); - auto_ptr > zDau1EcalIso( new vector ); - auto_ptr > zDau2EcalIso( new vector ); - auto_ptr > zDau1HcalIso( new vector ); - auto_ptr > zDau2HcalIso( new vector ); - auto_ptr > zDau1MuEnergyEm( new vector ); - auto_ptr > zDau2MuEnergyEm( new vector ); - auto_ptr > zDau1MuEnergyHad( new vector ); - auto_ptr > zDau2MuEnergyHad( new vector ); - auto_ptr > vtxNormChi2( new vector ); - auto_ptr > zDau1NofHit( new vector ); - auto_ptr > zDau2NofHit( new vector ); - auto_ptr > zDau1NofHitTk( new vector ); - auto_ptr > zDau2NofHitTk( new vector ); - auto_ptr > zDau1NofHitSta( new vector ); - auto_ptr > zDau2NofHitSta( new vector ); - auto_ptr > zDau1NofMuChambers( new vector ); - auto_ptr > zDau2NofMuChambers( new vector ); - auto_ptr > zDau1NofMuMatches( new vector ); - auto_ptr > zDau2NofMuMatches( new vector ); - auto_ptr > zDau1Chi2( new vector ); - auto_ptr > zDau2Chi2( new vector ); - auto_ptr > zDau1TrkChi2( new vector ); - auto_ptr > zDau2TrkChi2( new vector ); - auto_ptr > zDau1dxyFromBS( new vector ); - auto_ptr > zDau2dxyFromBS( new vector ); - auto_ptr > zDau1dzFromBS( new vector ); - auto_ptr > zDau2dzFromBS( new vector ); - auto_ptr > zDau1dxyFromPV( new vector ); - auto_ptr > zDau2dxyFromPV( new vector ); - auto_ptr > zDau1dzFromPV( new vector ); - auto_ptr > zDau2dzFromPV( new vector ); - auto_ptr > trueZMass( new vector ); - auto_ptr > trueZPt( new vector ); - auto_ptr > trueZEta( new vector ); - auto_ptr > trueZPhi( new vector ); - auto_ptr > trueZY( new vector ); + unique_ptr > event( new vector ); + unique_ptr > run( new vector ); + unique_ptr > lumi( new vector ); + unique_ptr > zMass( new vector ); + unique_ptr > zMassSa( new vector ); + unique_ptr > zPt( new vector ); + unique_ptr > zEta( new vector ); + unique_ptr > zPhi( new vector ); + unique_ptr > zY( new vector ); + unique_ptr > zDau1Pt( new vector ); + unique_ptr > zDau2Pt( new vector ); + unique_ptr > zDau1SaPt( new vector ); + unique_ptr > zDau2SaPt( new vector ); + unique_ptr > zDau1HLTBit( new vector ); + unique_ptr > zDau2HLTBit( new vector ); + unique_ptr > zDau1Q( new vector ); + unique_ptr > zDau2Q( new vector ); + unique_ptr > zDau1Eta( new vector ); + unique_ptr > zDau2Eta( new vector ); + unique_ptr > zDau1SaEta( new vector ); + unique_ptr > zDau2SaEta( new vector ); + unique_ptr > zDau1Phi( new vector ); + unique_ptr > zDau2Phi( new vector ); + unique_ptr > zDau1SaPhi( new vector ); + unique_ptr > zDau2SaPhi( new vector ); + unique_ptr > zDau1Iso( new vector ); + unique_ptr > zDau2Iso( new vector ); + unique_ptr > zDau1TrkIso( new vector ); + unique_ptr > zDau2TrkIso( new vector ); + unique_ptr > zDau1EcalIso( new vector ); + unique_ptr > zDau2EcalIso( new vector ); + unique_ptr > zDau1HcalIso( new vector ); + unique_ptr > zDau2HcalIso( new vector ); + unique_ptr > zDau1MuEnergyEm( new vector ); + unique_ptr > zDau2MuEnergyEm( new vector ); + unique_ptr > zDau1MuEnergyHad( new vector ); + unique_ptr > zDau2MuEnergyHad( new vector ); + unique_ptr > vtxNormChi2( new vector ); + unique_ptr > zDau1NofHit( new vector ); + unique_ptr > zDau2NofHit( new vector ); + unique_ptr > zDau1NofHitTk( new vector ); + unique_ptr > zDau2NofHitTk( new vector ); + unique_ptr > zDau1NofHitSta( new vector ); + unique_ptr > zDau2NofHitSta( new vector ); + unique_ptr > zDau1NofMuChambers( new vector ); + unique_ptr > zDau2NofMuChambers( new vector ); + unique_ptr > zDau1NofMuMatches( new vector ); + unique_ptr > zDau2NofMuMatches( new vector ); + unique_ptr > zDau1Chi2( new vector ); + unique_ptr > zDau2Chi2( new vector ); + unique_ptr > zDau1TrkChi2( new vector ); + unique_ptr > zDau2TrkChi2( new vector ); + unique_ptr > zDau1dxyFromBS( new vector ); + unique_ptr > zDau2dxyFromBS( new vector ); + unique_ptr > zDau1dzFromBS( new vector ); + unique_ptr > zDau2dzFromBS( new vector ); + unique_ptr > zDau1dxyFromPV( new vector ); + unique_ptr > zDau2dxyFromPV( new vector ); + unique_ptr > zDau1dzFromPV( new vector ); + unique_ptr > zDau2dzFromPV( new vector ); + unique_ptr > trueZMass( new vector ); + unique_ptr > trueZPt( new vector ); + unique_ptr > trueZEta( new vector ); + unique_ptr > trueZPhi( new vector ); + unique_ptr > trueZY( new vector ); event -> push_back(evt.id().event()); run -> push_back(evt.id().run()); lumi -> push_back(evt.luminosityBlock()); @@ -536,71 +536,71 @@ void ZToLLEdmNtupleDumper::produce( Event & evt, const EventSetup & ) { } } const string & zName = zName_[c]; - evt.put( event,zName + "EventNumber" ); - evt.put( run, zName + "RunNumber" ); - evt.put( lumi,zName + "LumiBlock" ); - evt.put( zMass, zName + "Mass" ); - evt.put( zMassSa, zName + "MassSa" ); - evt.put( zPt, zName + "Pt" ); - evt.put( zEta, zName + "Eta" ); - evt.put( zPhi, zName + "Phi" ); - evt.put( zY, zName + "Y" ); - evt.put( zDau1Pt, zName + "Dau1Pt" ); - evt.put( zDau2Pt, zName + "Dau2Pt" ); - evt.put( zDau1SaPt, zName + "Dau1SaPt" ); - evt.put( zDau2SaPt, zName + "Dau2SaPt" ); - evt.put( zDau1HLTBit, zName + "Dau1HLTBit" ); - evt.put( zDau2HLTBit, zName + "Dau2HLTBit" ); - evt.put( zDau1Q, zName + "Dau1Q" ); - evt.put( zDau2Q, zName + "Dau2Q" ); - evt.put( zDau1Eta, zName + "Dau1Eta" ); - evt.put( zDau2Eta, zName + "Dau2Eta" ); - evt.put( zDau1SaEta, zName + "Dau1SaEta" ); - evt.put( zDau2SaEta, zName + "Dau2SaEta" ); - evt.put( zDau1Phi, zName + "Dau1Phi" ); - evt.put( zDau2Phi, zName + "Dau2Phi" ); - evt.put( zDau1SaPhi, zName + "Dau1SaPhi" ); - evt.put( zDau2SaPhi, zName + "Dau2SaPhi" ); - evt.put( zDau1Iso, zName + "Dau1Iso" ); - evt.put( zDau2Iso, zName + "Dau2Iso" ); - evt.put( zDau1TrkIso, zName + "Dau1TrkIso" ); - evt.put( zDau2TrkIso, zName + "Dau2TrkIso" ); - evt.put( zDau1EcalIso, zName + "Dau1EcalIso" ); - evt.put( zDau2EcalIso, zName + "Dau2EcalIso" ); - evt.put( zDau1HcalIso, zName + "Dau1HcalIso" ); - evt.put( zDau2HcalIso, zName + "Dau2HcalIso" ); - evt.put( zDau1MuEnergyEm, zName + "Dau1MuEnergyEm" ); - evt.put( zDau2MuEnergyEm, zName + "Dau2MuEnergyEm" ); - evt.put( zDau1MuEnergyHad, zName + "Dau1MuEnergyHad" ); - evt.put( zDau2MuEnergyHad, zName + "Dau2MuEnergyHad" ); - evt.put( vtxNormChi2, zName + "VtxNormChi2" ); - evt.put( zDau1NofHit, zName + "Dau1NofHit" ); - evt.put( zDau2NofHit, zName + "Dau2NofHit" ); - evt.put( zDau1NofHitTk, zName + "Dau1NofHitTk" ); - evt.put( zDau2NofHitTk, zName + "Dau2NofHitTk" ); - evt.put( zDau1NofHitSta, zName + "Dau1NofHitSta" ); - evt.put( zDau2NofHitSta, zName + "Dau2NofHitSta" ); - evt.put( zDau1NofMuChambers, zName + "Dau1NofMuChambers" ); - evt.put( zDau1NofMuMatches, zName + "Dau1NofMuMatches" ); - evt.put( zDau2NofMuChambers, zName + "Dau2NofMuChambers" ); - evt.put( zDau2NofMuMatches, zName + "Dau2NofMuMatches" ); - evt.put( zDau1Chi2, zName + "Dau1Chi2" ); - evt.put( zDau2Chi2, zName + "Dau2Chi2" ); - evt.put( zDau1TrkChi2, zName + "Dau1TrkChi2" ); - evt.put( zDau2TrkChi2, zName + "Dau2TrkChi2" ); - evt.put( zDau1dxyFromBS, zName + "Dau1dxyFromBS" ); - evt.put( zDau2dxyFromBS, zName + "Dau2dxyFromBS" ); - evt.put( zDau1dxyFromPV, zName + "Dau1dxyFromPV" ); - evt.put( zDau2dxyFromPV, zName + "Dau2dxyFromPV" ); - evt.put( zDau1dzFromBS, zName + "Dau1dzFromBS" ); - evt.put( zDau2dzFromBS, zName + "Dau2dzFromBS" ); - evt.put( zDau1dzFromPV, zName + "Dau1dzFromPV" ); - evt.put( zDau2dzFromPV, zName + "Dau2dzFromPV" ); - evt.put( trueZMass, zName + "TrueMass" ); - evt.put( trueZPt, zName + "TruePt" ); - evt.put( trueZEta, zName + "TrueEta" ); - evt.put( trueZPhi, zName + "TruePhi" ); - evt.put( trueZY, zName + "TrueY" ); + evt.put(std::move(event),zName + "EventNumber" ); + evt.put(std::move(run), zName + "RunNumber" ); + evt.put(std::move(lumi),zName + "LumiBlock" ); + evt.put(std::move(zMass), zName + "Mass" ); + evt.put(std::move(zMassSa), zName + "MassSa" ); + evt.put(std::move(zPt), zName + "Pt" ); + evt.put(std::move(zEta), zName + "Eta" ); + evt.put(std::move(zPhi), zName + "Phi" ); + evt.put(std::move(zY), zName + "Y" ); + evt.put(std::move(zDau1Pt), zName + "Dau1Pt" ); + evt.put(std::move(zDau2Pt), zName + "Dau2Pt" ); + evt.put(std::move(zDau1SaPt), zName + "Dau1SaPt" ); + evt.put(std::move(zDau2SaPt), zName + "Dau2SaPt" ); + evt.put(std::move(zDau1HLTBit), zName + "Dau1HLTBit" ); + evt.put(std::move(zDau2HLTBit), zName + "Dau2HLTBit" ); + evt.put(std::move(zDau1Q), zName + "Dau1Q" ); + evt.put(std::move(zDau2Q), zName + "Dau2Q" ); + evt.put(std::move(zDau1Eta), zName + "Dau1Eta" ); + evt.put(std::move(zDau2Eta), zName + "Dau2Eta" ); + evt.put(std::move(zDau1SaEta), zName + "Dau1SaEta" ); + evt.put(std::move(zDau2SaEta), zName + "Dau2SaEta" ); + evt.put(std::move(zDau1Phi), zName + "Dau1Phi" ); + evt.put(std::move(zDau2Phi), zName + "Dau2Phi" ); + evt.put(std::move(zDau1SaPhi), zName + "Dau1SaPhi" ); + evt.put(std::move(zDau2SaPhi), zName + "Dau2SaPhi" ); + evt.put(std::move(zDau1Iso), zName + "Dau1Iso" ); + evt.put(std::move(zDau2Iso), zName + "Dau2Iso" ); + evt.put(std::move(zDau1TrkIso), zName + "Dau1TrkIso" ); + evt.put(std::move(zDau2TrkIso), zName + "Dau2TrkIso" ); + evt.put(std::move(zDau1EcalIso), zName + "Dau1EcalIso" ); + evt.put(std::move(zDau2EcalIso), zName + "Dau2EcalIso" ); + evt.put(std::move(zDau1HcalIso), zName + "Dau1HcalIso" ); + evt.put(std::move(zDau2HcalIso), zName + "Dau2HcalIso" ); + evt.put(std::move(zDau1MuEnergyEm), zName + "Dau1MuEnergyEm" ); + evt.put(std::move(zDau2MuEnergyEm), zName + "Dau2MuEnergyEm" ); + evt.put(std::move(zDau1MuEnergyHad), zName + "Dau1MuEnergyHad" ); + evt.put(std::move(zDau2MuEnergyHad), zName + "Dau2MuEnergyHad" ); + evt.put(std::move(vtxNormChi2), zName + "VtxNormChi2" ); + evt.put(std::move(zDau1NofHit), zName + "Dau1NofHit" ); + evt.put(std::move(zDau2NofHit), zName + "Dau2NofHit" ); + evt.put(std::move(zDau1NofHitTk), zName + "Dau1NofHitTk" ); + evt.put(std::move(zDau2NofHitTk), zName + "Dau2NofHitTk" ); + evt.put(std::move(zDau1NofHitSta), zName + "Dau1NofHitSta" ); + evt.put(std::move(zDau2NofHitSta), zName + "Dau2NofHitSta" ); + evt.put(std::move(zDau1NofMuChambers), zName + "Dau1NofMuChambers" ); + evt.put(std::move(zDau1NofMuMatches), zName + "Dau1NofMuMatches" ); + evt.put(std::move(zDau2NofMuChambers), zName + "Dau2NofMuChambers" ); + evt.put(std::move(zDau2NofMuMatches), zName + "Dau2NofMuMatches" ); + evt.put(std::move(zDau1Chi2), zName + "Dau1Chi2" ); + evt.put(std::move(zDau2Chi2), zName + "Dau2Chi2" ); + evt.put(std::move(zDau1TrkChi2), zName + "Dau1TrkChi2" ); + evt.put(std::move(zDau2TrkChi2), zName + "Dau2TrkChi2" ); + evt.put(std::move(zDau1dxyFromBS), zName + "Dau1dxyFromBS" ); + evt.put(std::move(zDau2dxyFromBS), zName + "Dau2dxyFromBS" ); + evt.put(std::move(zDau1dxyFromPV), zName + "Dau1dxyFromPV" ); + evt.put(std::move(zDau2dxyFromPV), zName + "Dau2dxyFromPV" ); + evt.put(std::move(zDau1dzFromBS), zName + "Dau1dzFromBS" ); + evt.put(std::move(zDau2dzFromBS), zName + "Dau2dzFromBS" ); + evt.put(std::move(zDau1dzFromPV), zName + "Dau1dzFromPV" ); + evt.put(std::move(zDau2dzFromPV), zName + "Dau2dzFromPV" ); + evt.put(std::move(trueZMass), zName + "TrueMass" ); + evt.put(std::move(trueZPt), zName + "TruePt" ); + evt.put(std::move(trueZEta), zName + "TrueEta" ); + evt.put(std::move(trueZPhi), zName + "TruePhi" ); + evt.put(std::move(trueZY), zName + "TrueY" ); } } diff --git a/HeavyFlavorAnalysis/Onia2MuMu/interface/OniaVtxReProducer.h b/HeavyFlavorAnalysis/Onia2MuMu/interface/OniaVtxReProducer.h index 05fe42348cdcf..88e94e5e234fe 100644 --- a/HeavyFlavorAnalysis/Onia2MuMu/interface/OniaVtxReProducer.h +++ b/HeavyFlavorAnalysis/Onia2MuMu/interface/OniaVtxReProducer.h @@ -36,7 +36,7 @@ class OniaVtxReProducer { edm::ParameterSet config_; edm::InputTag tracksTag_; edm::InputTag beamSpotTag_; - std::auto_ptr algo_; + std::unique_ptr algo_; }; #endif diff --git a/HeavyFlavorAnalysis/Onia2MuMu/src/Onia2MuMuPAT.cc b/HeavyFlavorAnalysis/Onia2MuMu/src/Onia2MuMuPAT.cc index bf571fbc16ca6..821a367b133d8 100644 --- a/HeavyFlavorAnalysis/Onia2MuMu/src/Onia2MuMuPAT.cc +++ b/HeavyFlavorAnalysis/Onia2MuMu/src/Onia2MuMuPAT.cc @@ -69,7 +69,7 @@ Onia2MuMuPAT::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) muMasses.push_back( 0.1056583715 ); muMasses.push_back( 0.1056583715 ); - std::auto_ptr oniaOutput(new pat::CompositeCandidateCollection); + std::unique_ptr oniaOutput(new pat::CompositeCandidateCollection); Vertex thePrimaryV; Vertex theBeamSpotV; @@ -392,7 +392,7 @@ Onia2MuMuPAT::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) std::sort(oniaOutput->begin(),oniaOutput->end(),vPComparator_); - iEvent.put(oniaOutput); + iEvent.put(std::move(oniaOutput)); } diff --git a/HeavyFlavorAnalysis/Onia2MuMu/src/OniaAddV0TracksProducer.cc b/HeavyFlavorAnalysis/Onia2MuMu/src/OniaAddV0TracksProducer.cc index 12a6e4be16783..194633c042bdd 100644 --- a/HeavyFlavorAnalysis/Onia2MuMu/src/OniaAddV0TracksProducer.cc +++ b/HeavyFlavorAnalysis/Onia2MuMu/src/OniaAddV0TracksProducer.cc @@ -21,9 +21,9 @@ OniaAddV0TracksProducer:: OniaAddV0TracksProducer(const edm::ParameterSet& ps) { void OniaAddV0TracksProducer::produce(edm::Event& event, const edm::EventSetup& esetup){ - // Create auto_ptr for each collection to be stored in the Event - std::auto_ptr Enhanced_kShortCandidates(new pat::CompositeCandidateCollection); - std::auto_ptr Enhanced_lambdaCandidates(new pat::CompositeCandidateCollection); + // Create unique_ptr for each collection to be stored in the Event + std::unique_ptr Enhanced_kShortCandidates(new pat::CompositeCandidateCollection); + std::unique_ptr Enhanced_lambdaCandidates(new pat::CompositeCandidateCollection); edm::Handle lcandidates; event.getByToken(LambdaCollectionToken_,lcandidates); @@ -61,8 +61,8 @@ void OniaAddV0TracksProducer::produce(edm::Event& event, const edm::EventSetup& total_lambda += exits_l; if (exits_k || exits_l) events_v0++; - event.put( Enhanced_kShortCandidates,"Kshort"); - event.put( Enhanced_lambdaCandidates,"Lambda"); + event.put(std::move(Enhanced_kShortCandidates),"Kshort"); + event.put(std::move(Enhanced_lambdaCandidates),"Lambda"); } void OniaAddV0TracksProducer::endJob(){ diff --git a/HeavyFlavorAnalysis/Onia2MuMu/src/OniaPhotonConversionProducer.cc b/HeavyFlavorAnalysis/Onia2MuMu/src/OniaPhotonConversionProducer.cc index 26c41e4ba6e45..b29d667dd852f 100644 --- a/HeavyFlavorAnalysis/Onia2MuMu/src/OniaPhotonConversionProducer.cc +++ b/HeavyFlavorAnalysis/Onia2MuMu/src/OniaPhotonConversionProducer.cc @@ -99,8 +99,8 @@ OniaPhotonConversionProducer:: OniaPhotonConversionProducer(const edm::Parameter void OniaPhotonConversionProducer::produce(edm::Event& event, const edm::EventSetup& esetup){ - std::auto_ptr outCollection(new reco::ConversionCollection); - std::auto_ptr patoutCollection(new pat::CompositeCandidateCollection); + std::unique_ptr outCollection(new reco::ConversionCollection); + std::unique_ptr patoutCollection(new pat::CompositeCandidateCollection); edm::Handle priVtxs; event.getByToken(thePVsToken_, priVtxs); @@ -198,7 +198,7 @@ void OniaPhotonConversionProducer::produce(edm::Event& event, const edm::EventSe } } store_conversion += patoutCollection->size(); - event.put(patoutCollection,"conversions"); + event.put(std::move(patoutCollection),"conversions"); delete convSelection_; } diff --git a/HeavyFlavorAnalysis/Skimming/plugins/Tau3MuSkim.cc b/HeavyFlavorAnalysis/Skimming/plugins/Tau3MuSkim.cc index 12c039b7ffbca..ee72ae2e1e438 100644 --- a/HeavyFlavorAnalysis/Skimming/plugins/Tau3MuSkim.cc +++ b/HeavyFlavorAnalysis/Skimming/plugins/Tau3MuSkim.cc @@ -47,13 +47,13 @@ Tau3MuSkim::~Tau3MuSkim() bool Tau3MuSkim::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { - std::auto_ptr tau3MuCandidateMuons(new reco::MuonCollection); - std::auto_ptr tau3MuCandidateTracks(new reco::TrackCollection); + std::unique_ptr tau3MuCandidateMuons(new reco::MuonCollection); + std::unique_ptr tau3MuCandidateTracks(new reco::TrackCollection); bool accept = m_Tau3MuReco->doTau3MuReco(iEvent, iSetup, tau3MuCandidateMuons.get(), tau3MuCandidateTracks.get()); - iEvent.put(tau3MuCandidateMuons, "tau3MuCandidateMuons"); - iEvent.put(tau3MuCandidateTracks, "tau3MuCandidateTracks"); + iEvent.put(std::move(tau3MuCandidateMuons), "tau3MuCandidateMuons"); + iEvent.put(std::move(tau3MuCandidateTracks), "tau3MuCandidateTracks"); return accept; } diff --git a/JetMETCorrections/JetVertexAssociation/src/JetVertexAssociation.cc b/JetMETCorrections/JetVertexAssociation/src/JetVertexAssociation.cc index 9a17398e47344..e9f89582e532d 100644 --- a/JetMETCorrections/JetVertexAssociation/src/JetVertexAssociation.cc +++ b/JetMETCorrections/JetVertexAssociation/src/JetVertexAssociation.cc @@ -103,8 +103,8 @@ namespace cms{ } pair result; - std::auto_ptr result1 (new ResultCollection1) ; - std::auto_ptr result2 (new ResultCollection2) ; + std::unique_ptr result1 (new ResultCollection1) ; + std::unique_ptr result2 (new ResultCollection2) ; CaloJetCollection::const_iterator jet = jets->begin (); @@ -117,8 +117,8 @@ namespace cms{ } } - iEvent.put(result1, "Var"); - iEvent.put(result2, "JetType"); + iEvent.put(std::move(result1), "Var"); + iEvent.put(std::move(result2), "JetType"); } } diff --git a/JetMETCorrections/Modules/interface/CorrectedJetProducer.h b/JetMETCorrections/Modules/interface/CorrectedJetProducer.h index 6be95e6dc1fd4..2dc8eae0ab68c 100644 --- a/JetMETCorrections/Modules/interface/CorrectedJetProducer.h +++ b/JetMETCorrections/Modules/interface/CorrectedJetProducer.h @@ -71,7 +71,7 @@ namespace reco { } edm::Handle jets; //Define Inputs fEvent.getByToken (mInput, jets); //Get Inputs - std::auto_ptr result (new JetCollection); //Corrected jets + std::unique_ptr result (new JetCollection); //Corrected jets typename JetCollection::const_iterator jet; for (jet = jets->begin(); jet != jets->end(); jet++) { @@ -116,7 +116,7 @@ namespace reco { // reorder corrected jets std::sort (result->begin (), result->end (), compJets); // put corrected jet collection into event - fEvent.put(result); + fEvent.put(std::move(result)); } } diff --git a/JetMETCorrections/Modules/interface/JetCorrectionProducer.h b/JetMETCorrections/Modules/interface/JetCorrectionProducer.h index a4cfa7489a17e..06746ff1966e7 100644 --- a/JetMETCorrections/Modules/interface/JetCorrectionProducer.h +++ b/JetMETCorrections/Modules/interface/JetCorrectionProducer.h @@ -82,7 +82,7 @@ namespace cms { } edm::Handle jets; //Define Inputs fEvent.getByToken (mInput, jets); //Get Inputs - std::auto_ptr result (new JetCollection); //Corrected jets + std::unique_ptr result (new JetCollection); //Corrected jets typename JetCollection::const_iterator jet; for (jet = jets->begin(); jet != jets->end(); jet++) { @@ -128,7 +128,7 @@ namespace cms { // reorder corrected jets std::sort (result->begin (), result->end (), compJets); // put corrected jet collection into event - fEvent.put(result); + fEvent.put(std::move(result)); } } diff --git a/JetMETCorrections/Modules/plugins/ChainedJetCorrectorProducer.cc b/JetMETCorrections/Modules/plugins/ChainedJetCorrectorProducer.cc index 062385af044a9..9ec68ce282663 100644 --- a/JetMETCorrections/Modules/plugins/ChainedJetCorrectorProducer.cc +++ b/JetMETCorrections/Modules/plugins/ChainedJetCorrectorProducer.cc @@ -175,8 +175,8 @@ ChainedJetCorrectorProducer::produce(edm::Event& iEvent, const edm::EventSetup& correctors.emplace_back(&(*hCorrector)); } - std::auto_ptr pCorr( new reco::JetCorrector( std::unique_ptr(new ChainedJetCorrectorImpl(std::move(correctors)) ))); - iEvent.put(pCorr); + std::unique_ptr pCorr( new reco::JetCorrector( std::unique_ptr(new ChainedJetCorrectorImpl(std::move(correctors)) ))); + iEvent.put(std::move(pCorr)); } // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ diff --git a/JetMETCorrections/Modules/plugins/JetCorrectorProducer.h b/JetMETCorrections/Modules/plugins/JetCorrectorProducer.h index 0f0e0555d2327..beb274dd8e43b 100644 --- a/JetMETCorrections/Modules/plugins/JetCorrectorProducer.h +++ b/JetMETCorrections/Modules/plugins/JetCorrectorProducer.h @@ -43,8 +43,8 @@ class JetCorrectorProducer : public edm::stream::EDProducer<> // ---------- member functions --------------------------- void produce(edm::Event& iEvent, edm::EventSetup const& iSetup) override { auto impl =maker_.make(iEvent,iSetup); - std::auto_ptr corrector{ new reco::JetCorrector{std::move(impl) } }; - iEvent.put(corrector); + std::unique_ptr corrector{ new reco::JetCorrector{std::move(impl) } }; + iEvent.put(std::move(corrector)); } static void fillDescriptions(edm::ConfigurationDescriptions& iDescriptions) { diff --git a/JetMETCorrections/Type1MET/interface/CaloJetMETcorrInputProducerT.h b/JetMETCorrections/Type1MET/interface/CaloJetMETcorrInputProducerT.h index a8dfe565fab5d..33cea66ce07f2 100644 --- a/JetMETCorrections/Type1MET/interface/CaloJetMETcorrInputProducerT.h +++ b/JetMETCorrections/Type1MET/interface/CaloJetMETcorrInputProducerT.h @@ -103,9 +103,9 @@ class CaloJetMETcorrInputProducerT final : public edm::global::EDProducer<> void produce(edm::StreamID, edm::Event& evt, const edm::EventSetup& es) const override { - std::auto_ptr type1Correction(new CorrMETData()); - std::auto_ptr unclEnergySum(new CorrMETData()); - std::auto_ptr offsetEnergySum(new CorrMETData()); + std::unique_ptr type1Correction(new CorrMETData()); + std::unique_ptr unclEnergySum(new CorrMETData()); + std::unique_ptr offsetEnergySum(new CorrMETData()); edm::Handle jetCorr; evt.getByToken(jetCorrToken_, jetCorr); @@ -186,9 +186,9 @@ class CaloJetMETcorrInputProducerT final : public edm::global::EDProducer<> // o momentum sum of "unclustered energy" (jets of (corrected) Pt < 20 GeV) // o momentum sum of "offset energy" (sum of energy attributed to pile-up/underlying event) // to the event - evt.put(type1Correction, "type1"); - evt.put(unclEnergySum, "type2"); - evt.put(offsetEnergySum, "offset"); + evt.put(std::move(type1Correction), "type1"); + evt.put(std::move(unclEnergySum), "type2"); + evt.put(std::move(offsetEnergySum), "offset"); } std::string moduleLabel_; diff --git a/JetMETCorrections/Type1MET/interface/CorrectedMETProducerT.h b/JetMETCorrections/Type1MET/interface/CorrectedMETProducerT.h index 91cc86c419182..6d7c315bbc335 100644 --- a/JetMETCorrections/Type1MET/interface/CorrectedMETProducerT.h +++ b/JetMETCorrections/Type1MET/interface/CorrectedMETProducerT.h @@ -96,7 +96,7 @@ class CorrectedMETProducerT : public edm::stream::EDProducer<> void produce(edm::Event& evt, const edm::EventSetup& es) { - std::auto_ptr correctedMEtCollection(new METCollection); + std::unique_ptr correctedMEtCollection(new METCollection); edm::Handle rawMEtCollection; evt.getByToken(token_, rawMEtCollection); @@ -112,7 +112,7 @@ class CorrectedMETProducerT : public edm::stream::EDProducer<> } //--- add collection of MET objects with Type 1 / Type 1 + 2 corrections applied to the event - evt.put(correctedMEtCollection); + evt.put(std::move(correctedMEtCollection)); } std::string moduleLabel_; diff --git a/JetMETCorrections/Type1MET/interface/JetCleanerForType1METT.h b/JetMETCorrections/Type1MET/interface/JetCleanerForType1METT.h index de4e79d82fe3a..d5ffcbdf084ab 100644 --- a/JetMETCorrections/Type1MET/interface/JetCleanerForType1METT.h +++ b/JetMETCorrections/Type1MET/interface/JetCleanerForType1METT.h @@ -142,7 +142,7 @@ class JetCleanerForType1METT : public edm::stream::EDProducer<> evt.getByToken(token_, jets); //new collection - std::auto_ptr< std::vector > cleanedJets( new std::vector() ); + std::unique_ptr< std::vector > cleanedJets( new std::vector() ); int numJets = jets->size(); for(int jetIndex=0;jetIndex cleanedJets->push_back(jet); } - evt.put(cleanedJets); + evt.put(std::move(cleanedJets)); } diff --git a/JetMETCorrections/Type1MET/interface/PFJetMETcorrInputProducerT.h b/JetMETCorrections/Type1MET/interface/PFJetMETcorrInputProducerT.h index 7fb84da5be9b8..91b17545a508e 100644 --- a/JetMETCorrections/Type1MET/interface/PFJetMETcorrInputProducerT.h +++ b/JetMETCorrections/Type1MET/interface/PFJetMETcorrInputProducerT.h @@ -158,7 +158,7 @@ class PFJetMETcorrInputProducerT : public edm::stream::EDProducer<> void produce(edm::Event& evt, const edm::EventSetup& es) { - std::auto_ptr type1Correction(new CorrMETData()); + std::unique_ptr type1Correction(new CorrMETData()); for ( typename std::vector::iterator type2BinningEntry = type2Binning_.begin(); type2BinningEntry != type2Binning_.end(); ++type2BinningEntry ) { (*type2BinningEntry)->binUnclEnergySum_ = CorrMETData(); @@ -253,11 +253,11 @@ class PFJetMETcorrInputProducerT : public edm::stream::EDProducer<> // o momentum sum of "unclustered energy" (jets of (corrected) Pt < 10 GeV) // o momentum sum of "offset energy" (sum of energy attributed to pile-up/underlying event) // to the event - evt.put(type1Correction, "type1"); + evt.put(std::move(type1Correction), "type1"); for ( typename std::vector::const_iterator type2BinningEntry = type2Binning_.begin(); type2BinningEntry != type2Binning_.end(); ++type2BinningEntry ) { - evt.put(std::auto_ptr(new CorrMETData((*type2BinningEntry)->binUnclEnergySum_)), (*type2BinningEntry)->getInstanceLabel_full("type2")); - evt.put(std::auto_ptr(new CorrMETData((*type2BinningEntry)->binOffsetEnergySum_)), (*type2BinningEntry)->getInstanceLabel_full("offset")); + evt.put(std::unique_ptr(new CorrMETData((*type2BinningEntry)->binUnclEnergySum_)), (*type2BinningEntry)->getInstanceLabel_full("type2")); + evt.put(std::unique_ptr(new CorrMETData((*type2BinningEntry)->binOffsetEnergySum_)), (*type2BinningEntry)->getInstanceLabel_full("offset")); } } diff --git a/JetMETCorrections/Type1MET/plugins/CorrectedCaloMETProducer.cc b/JetMETCorrections/Type1MET/plugins/CorrectedCaloMETProducer.cc index b12c8565e8d6d..0d0d8a2bf0c80 100644 --- a/JetMETCorrections/Type1MET/plugins/CorrectedCaloMETProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/CorrectedCaloMETProducer.cc @@ -58,9 +58,9 @@ class CorrectedCaloMETProducer : public edm::stream::EDProducer<> reco::CaloMET outMET = corrector.getCorrectedCaloMET(srcMET, evt, es); - std::auto_ptr product(new METCollection); + std::unique_ptr product(new METCollection); product->push_back(outMET); - evt.put(product); + evt.put(std::move(product)); } }; diff --git a/JetMETCorrections/Type1MET/plugins/CorrectedPFMETProducer.cc b/JetMETCorrections/Type1MET/plugins/CorrectedPFMETProducer.cc index 1ef8401ef1aa7..b367ae103477e 100644 --- a/JetMETCorrections/Type1MET/plugins/CorrectedPFMETProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/CorrectedPFMETProducer.cc @@ -58,9 +58,9 @@ class CorrectedPFMETProducer : public edm::stream::EDProducer<> reco::PFMET outMET= corrector.getCorrectedPFMET(srcMET, evt, es); - std::auto_ptr product(new METCollection); + std::unique_ptr product(new METCollection); product->push_back(outMET); - evt.put(product); + evt.put(std::move(product)); } }; diff --git a/JetMETCorrections/Type1MET/plugins/MultShiftMETcorrInputProducer.cc b/JetMETCorrections/Type1MET/plugins/MultShiftMETcorrInputProducer.cc index 1d4c12499ac0d..1b5ff0b83da2b 100644 --- a/JetMETCorrections/Type1MET/plugins/MultShiftMETcorrInputProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/MultShiftMETcorrInputProducer.cc @@ -101,7 +101,7 @@ void MultShiftMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSet } //MM: loop over all constituent types and sum each correction - std::auto_ptr metCorr(new CorrMETData()); + std::unique_ptr metCorr(new CorrMETData()); double corx=0.; double cory=0.; @@ -127,7 +127,7 @@ void MultShiftMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSet metCorr->mex = corx; metCorr->mey = cory; - evt.put(metCorr, ""); + evt.put(std::move(metCorr), ""); } diff --git a/JetMETCorrections/Type1MET/plugins/MuonMETcorrInputProducer.cc b/JetMETCorrections/Type1MET/plugins/MuonMETcorrInputProducer.cc index d501c18c29a8b..2e2886d89b98d 100644 --- a/JetMETCorrections/Type1MET/plugins/MuonMETcorrInputProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/MuonMETcorrInputProducer.cc @@ -20,7 +20,7 @@ MuonMETcorrInputProducer::~MuonMETcorrInputProducer() void MuonMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSetup& es) { - std::auto_ptr unclEnergySum(new CorrMETData()); + std::unique_ptr unclEnergySum(new CorrMETData()); edm::Handle muons; evt.getByToken(token_, muons); @@ -50,7 +50,7 @@ void MuonMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSetup& e } //--- add sum of muon corrections to the event - evt.put(unclEnergySum); + evt.put(std::move(unclEnergySum)); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/JetMETCorrections/Type1MET/plugins/PFCandMETcorrInputProducer.cc b/JetMETCorrections/Type1MET/plugins/PFCandMETcorrInputProducer.cc index 88aa2b7e0d7c1..286f62c18987d 100644 --- a/JetMETCorrections/Type1MET/plugins/PFCandMETcorrInputProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/PFCandMETcorrInputProducer.cc @@ -54,7 +54,7 @@ void PFCandMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSetup& //--- add momentum sum of PFCandidates not within jets ("unclustered energy") to the event for ( auto binningEntry = binning_.cbegin(); binningEntry != binning_.cend(); ++binningEntry ) { - evt.put(std::auto_ptr(new CorrMETData((*binningEntry)->binUnclEnergySum_)), (*binningEntry)->binLabel_); + evt.put(std::unique_ptr(new CorrMETData((*binningEntry)->binUnclEnergySum_)), (*binningEntry)->binLabel_); } } diff --git a/JetMETCorrections/Type1MET/plugins/PFchsMETcorrInputProducer.cc b/JetMETCorrections/Type1MET/plugins/PFchsMETcorrInputProducer.cc index 0256930977282..a58f02a7a9139 100644 --- a/JetMETCorrections/Type1MET/plugins/PFchsMETcorrInputProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/PFchsMETcorrInputProducer.cc @@ -22,7 +22,7 @@ void PFchsMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSetup& edm::Handle recVtxs; evt.getByToken(token_, recVtxs); - std::auto_ptr chsSum(new CorrMETData()); + std::unique_ptr chsSum(new CorrMETData()); for (unsigned i = 1; i < recVtxs->size(); ++i) { @@ -42,7 +42,7 @@ void PFchsMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSetup& } } - evt.put(chsSum, "type0"); + evt.put(std::move(chsSum), "type0"); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/JetMETCorrections/Type1MET/plugins/ScaleCorrMETData.cc b/JetMETCorrections/Type1MET/plugins/ScaleCorrMETData.cc index a0040d5ce5514..06f4eb08a0da9 100644 --- a/JetMETCorrections/Type1MET/plugins/ScaleCorrMETData.cc +++ b/JetMETCorrections/Type1MET/plugins/ScaleCorrMETData.cc @@ -46,8 +46,8 @@ void ScaleCorrMETData::produce(edm::Event& evt, const edm::EventSetup& es) evt.getByToken(token_, input); product += scaleFactor_*(*input); - std::auto_ptr pprod(new CorrMETData(product)); - evt.put(pprod, ""); + std::unique_ptr pprod(new CorrMETData(product)); + evt.put(std::move(pprod), ""); } //____________________________________________________________________________|| diff --git a/JetMETCorrections/Type1MET/plugins/SysShiftMETcorrInputProducer.cc b/JetMETCorrections/Type1MET/plugins/SysShiftMETcorrInputProducer.cc index 745a52b93f655..dc83482cc5b0b 100644 --- a/JetMETCorrections/Type1MET/plugins/SysShiftMETcorrInputProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/SysShiftMETcorrInputProducer.cc @@ -66,12 +66,12 @@ void SysShiftMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSetu } //std::cout << " Nvtx = " << Nvtx << std::endl; - std::auto_ptr metCorr(new CorrMETData()); + std::unique_ptr metCorr(new CorrMETData()); metCorr->mex = -corrPx_->Eval(sumEt, Nvtx); metCorr->mey = -corrPy_->Eval(sumEt, Nvtx); //std::cout << "--> metCorr: Px = " << metCorr->mex << ", Py = " << metCorr->mey << std::endl; - evt.put(metCorr); + evt.put(std::move(metCorr)); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/JetMETCorrections/Type1MET/plugins/Type0PFMETcorrInputProducer.cc b/JetMETCorrections/Type1MET/plugins/Type0PFMETcorrInputProducer.cc index a9781c97ba394..60081476f4d93 100644 --- a/JetMETCorrections/Type1MET/plugins/Type0PFMETcorrInputProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/Type0PFMETcorrInputProducer.cc @@ -46,7 +46,7 @@ void Type0PFMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSetup edm::Handle pfCandidateToVertexAssociations; evt.getByToken(pfCandidateToVertexAssociationsToken_, pfCandidateToVertexAssociations); - std::auto_ptr pfMEtCorrection(new CorrMETData()); + std::unique_ptr pfMEtCorrection(new CorrMETData()); for ( PFCandToVertexAssMap::const_iterator pfCandidateToVertexAssociation = pfCandidateToVertexAssociations->begin(); pfCandidateToVertexAssociation != pfCandidateToVertexAssociations->end(); ++pfCandidateToVertexAssociation ) { @@ -85,7 +85,7 @@ void Type0PFMETcorrInputProducer::produce(edm::Event& evt, const edm::EventSetup } } - evt.put(pfMEtCorrection); + evt.put(std::move(pfMEtCorrection)); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/JetMETCorrections/Type1MET/plugins/Type2CorrectionProducer.cc b/JetMETCorrections/Type1MET/plugins/Type2CorrectionProducer.cc index 1ecb7385e713c..d1f560b0141de 100644 --- a/JetMETCorrections/Type1MET/plugins/Type2CorrectionProducer.cc +++ b/JetMETCorrections/Type1MET/plugins/Type2CorrectionProducer.cc @@ -159,8 +159,8 @@ void Type2CorrectionProducer::produce(edm::Event& evt, const edm::EventSetup& es product += (unclEnergyScaleFactor - 1.)*unclEnergySum; } - std::auto_ptr pprod(new CorrMETData(product)); - evt.put(pprod, ""); + std::unique_ptr pprod(new CorrMETData(product)); + evt.put(std::move(pprod), ""); } //____________________________________________________________________________|| diff --git a/MuonAnalysis/MomentumScaleCalibration/plugins/MuScleFitMuonProducer.cc b/MuonAnalysis/MomentumScaleCalibration/plugins/MuScleFitMuonProducer.cc index 70296f268d08c..28952e13d2ec8 100644 --- a/MuonAnalysis/MomentumScaleCalibration/plugins/MuScleFitMuonProducer.cc +++ b/MuonAnalysis/MomentumScaleCalibration/plugins/MuScleFitMuonProducer.cc @@ -53,7 +53,7 @@ class MuScleFitMuonProducer : public edm::EDProducer { virtual void beginJob() override ; virtual void produce(edm::Event&, const edm::EventSetup&) override; virtual void endJob() override ; - template std::auto_ptr applyCorrection(const edm::Handle & allMuons); + template std::unique_ptr applyCorrection(const edm::Handle & allMuons); edm::InputTag theMuonLabel_; edm::EDGetTokenT thePatMuonToken_; @@ -87,9 +87,9 @@ MuScleFitMuonProducer::~MuScleFitMuonProducer() template -std::auto_ptr MuScleFitMuonProducer::applyCorrection(const edm::Handle & allMuons) +std::unique_ptr MuScleFitMuonProducer::applyCorrection(const edm::Handle & allMuons) { - std::auto_ptr pOut(new T); + std::unique_ptr pOut(new T); // Apply the correction and produce the new muons for( typename T::const_iterator muon = allMuons->begin(); muon != allMuons->end(); ++muon ) { @@ -138,10 +138,10 @@ void MuScleFitMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& i } // put into the Event - // iEvent.put(pOut); - // iEvent.put(applyCorrection(allMuons)); + // iEvent.put(std::move(pOut)); + // iEvent.put(applyCorrection(allMuons); -/* std::auto_ptr pOut(new reco::MuonCollection); +/* std::unique_ptr pOut(new reco::MuonCollection); // Apply the correction and produce the new muons for( std::vector::const_iterator muon = allMuons->begin(); muon != allMuons->end(); ++muon ) { diff --git a/MuonAnalysis/MuonAssociators/plugins/HLTL1MuonMatcher.cc b/MuonAnalysis/MuonAssociators/plugins/HLTL1MuonMatcher.cc index 5c24ef8e79911..dafe1631ae704 100644 --- a/MuonAnalysis/MuonAssociators/plugins/HLTL1MuonMatcher.cc +++ b/MuonAnalysis/MuonAssociators/plugins/HLTL1MuonMatcher.cc @@ -110,7 +110,7 @@ pat::HLTL1MuonMatcher::produce(edm::Event & iEvent, const edm::EventSetup & iSet iEvent.getByToken(recoToken_, reco); iEvent.getByToken(l1Token_, l1s); - auto_ptr propOut(new PATPrimitiveCollection()); + unique_ptr propOut(new PATPrimitiveCollection()); vector propMatches(reco->size(), -1); vector fullMatches(reco->size(), -1); vector deltaRs(reco->size(), 999), deltaPhis(reco->size(), 999); @@ -133,19 +133,19 @@ pat::HLTL1MuonMatcher::produce(edm::Event & iEvent, const edm::EventSetup & iSet } lockedItems_.clear(); - OrphanHandle propDone = iEvent.put(propOut, "propagatedReco"); + OrphanHandle propDone = iEvent.put(std::move(propOut), "propagatedReco"); - auto_ptr propAss(new PATTriggerAssociation(propDone)); + unique_ptr propAss(new PATTriggerAssociation(propDone)); PATTriggerAssociation::Filler propFiller(*propAss); propFiller.insert(reco, propMatches.begin(), propMatches.end()); propFiller.fill(); - iEvent.put(propAss, "propagatedReco"); + iEvent.put(std::move(propAss), "propagatedReco"); - auto_ptr fullAss(new PATTriggerAssociation(l1s)); + unique_ptr fullAss(new PATTriggerAssociation(l1s)); PATTriggerAssociation::Filler fullFiller(*fullAss); fullFiller.insert(reco, fullMatches.begin(), fullMatches.end()); fullFiller.fill(); - iEvent.put(fullAss); + iEvent.put(std::move(fullAss)); if (writeExtraInfo_) { storeExtraInfo(iEvent, reco, deltaRs, "deltaR"); @@ -160,11 +160,11 @@ pat::HLTL1MuonMatcher::storeExtraInfo(edm::Event &iEvent, const std::vector & values, const std::string & label) const { using namespace edm; using namespace std; - auto_ptr > valMap(new ValueMap()); + unique_ptr > valMap(new ValueMap()); typename edm::ValueMap::Filler filler(*valMap); filler.insert(handle, values.begin(), values.end()); filler.fill(); - iEvent.put(valMap, label); + iEvent.put(std::move(valMap), label); } diff --git a/MuonAnalysis/MuonAssociators/plugins/L1MuonMatcher.cc b/MuonAnalysis/MuonAssociators/plugins/L1MuonMatcher.cc index 40cd7f881f085..286173a718802 100644 --- a/MuonAnalysis/MuonAssociators/plugins/L1MuonMatcher.cc +++ b/MuonAnalysis/MuonAssociators/plugins/L1MuonMatcher.cc @@ -99,8 +99,8 @@ pat::L1MuonMatcher::produce(edm::Event & iEvent, const edm::EventSetup & iSetup) iEvent.getByToken(recoToken_, reco); iEvent.getByToken(l1Token_, l1s); - auto_ptr propOut(new PATPrimitiveCollection()); - auto_ptr l1Out(new PATPrimitiveCollection()); + unique_ptr propOut(new PATPrimitiveCollection()); + unique_ptr l1Out(new PATPrimitiveCollection()); std::vector > l1rawMatches(reco->size()); vector isSelected(l1s->size(), -1); std::vector > whichRecoMatch(l1s->size()); @@ -137,20 +137,20 @@ pat::L1MuonMatcher::produce(edm::Event & iEvent, const edm::EventSetup & iSetup) } } - OrphanHandle l1Done = iEvent.put(l1Out, "l1muons"); - OrphanHandle propDone = iEvent.put(propOut, "propagatedReco"); + OrphanHandle l1Done = iEvent.put(std::move(l1Out), "l1muons"); + OrphanHandle propDone = iEvent.put(std::move(propOut), "propagatedReco"); - auto_ptr propAss(new PATTriggerAssociation(propDone)); + unique_ptr propAss(new PATTriggerAssociation(propDone)); PATTriggerAssociation::Filler propFiller(*propAss); propFiller.insert(reco, propMatches.begin(), propMatches.end()); propFiller.fill(); - iEvent.put(propAss, "propagatedReco"); + iEvent.put(std::move(propAss), "propagatedReco"); - auto_ptr fullAss(new PATTriggerAssociation( l1Done)); + unique_ptr fullAss(new PATTriggerAssociation( l1Done)); PATTriggerAssociation::Filler fullFiller(*fullAss); fullFiller.insert(reco, fullMatches.begin(), fullMatches.end()); fullFiller.fill(); - iEvent.put(fullAss); + iEvent.put(std::move(fullAss)); if (writeExtraInfo_) { storeExtraInfo(iEvent, reco, deltaRs, "deltaR"); @@ -170,11 +170,11 @@ pat::L1MuonMatcher::storeExtraInfo(edm::Event &iEvent, const std::vector & values, const std::string & label) const { using namespace edm; using namespace std; - auto_ptr > valMap(new ValueMap()); + unique_ptr > valMap(new ValueMap()); typename edm::ValueMap::Filler filler(*valMap); filler.insert(handle, values.begin(), values.end()); filler.fill(); - iEvent.put(valMap, label); + iEvent.put(std::move(valMap), label); } diff --git a/MuonAnalysis/MuonAssociators/plugins/MatcherByPulls.cc b/MuonAnalysis/MuonAssociators/plugins/MatcherByPulls.cc index b146f90f0fecd..eed4ef1a4eb46 100644 --- a/MuonAnalysis/MuonAssociators/plugins/MatcherByPulls.cc +++ b/MuonAnalysis/MuonAssociators/plugins/MatcherByPulls.cc @@ -120,17 +120,17 @@ pat::MatcherByPulls::produce(edm::Event& iEvent, const edm::EventSetup& iSetu } typedef edm::Association MCAsso; - std::auto_ptr matchesMap(new MCAsso(edm::RefProd(cands))); + std::unique_ptr matchesMap(new MCAsso(edm::RefProd(cands))); MCAsso::Filler matchesFiller(*matchesMap); matchesFiller.insert(src, matches.begin(), matches.end()); matchesFiller.fill(); - iEvent.put(matchesMap); + iEvent.put(std::move(matchesMap)); - std::auto_ptr > pullsMap(new edm::ValueMap()); + std::unique_ptr > pullsMap(new edm::ValueMap()); edm::ValueMap::Filler pullsFiller(*pullsMap); pullsFiller.insert(src, pulls.begin(), pulls.end()); pullsFiller.fill(); - iEvent.put(pullsMap, "pulls"); + iEvent.put(std::move(pullsMap), "pulls"); } //define this as a plug-in diff --git a/MuonAnalysis/MuonAssociators/plugins/MatcherUsingTracks.cc b/MuonAnalysis/MuonAssociators/plugins/MatcherUsingTracks.cc index 47b7e4b221334..a3a3d6d9fa1b6 100644 --- a/MuonAnalysis/MuonAssociators/plugins/MatcherUsingTracks.cc +++ b/MuonAnalysis/MuonAssociators/plugins/MatcherUsingTracks.cc @@ -170,11 +170,11 @@ pat::MatcherUsingTracks::storeValueMap(edm::Event &iEvent, const std::vector & values, const std::string & label) const { using namespace edm; using namespace std; - auto_ptr > valMap(new ValueMap()); + unique_ptr > valMap(new ValueMap()); typename edm::ValueMap::Filler filler(*valMap); filler.insert(handle, values.begin(), values.end()); filler.fill(); - iEvent.put(valMap, label); + iEvent.put(std::move(valMap), label); } diff --git a/MuonAnalysis/MuonAssociators/plugins/MuonCleanerBySegments.cc b/MuonAnalysis/MuonAssociators/plugins/MuonCleanerBySegments.cc index b1971a4c8849a..c15115f61dd95 100644 --- a/MuonAnalysis/MuonAssociators/plugins/MuonCleanerBySegments.cc +++ b/MuonAnalysis/MuonAssociators/plugins/MuonCleanerBySegments.cc @@ -95,7 +95,7 @@ modules::MuonCleanerBySegmentsT::produce(edm::Event & iEvent, const edm::Even using namespace std; Handle > src; - auto_ptr > out(new vector()); + unique_ptr > out(new vector()); iEvent.getByToken(srcToken_, src); unsigned int nsrc = src->size(); @@ -126,7 +126,7 @@ modules::MuonCleanerBySegmentsT::produce(edm::Event & iEvent, const edm::Even const T &mu1 = (*src)[i]; if (good[i] || passthrough_(mu1)) out->push_back(mu1); } - iEvent.put(out); + iEvent.put(std::move(out)); } template diff --git a/MuonAnalysis/MuonAssociators/plugins/MuonMCClassifier.cc b/MuonAnalysis/MuonAssociators/plugins/MuonMCClassifier.cc index 269a5ed4f6271..d4496e3ec68c1 100644 --- a/MuonAnalysis/MuonAssociators/plugins/MuonMCClassifier.cc +++ b/MuonAnalysis/MuonAssociators/plugins/MuonMCClassifier.cc @@ -246,7 +246,7 @@ MuonMCClassifier::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) std::vector prodRho(nmu, 0.0), prodZ(nmu, 0.0), momRho(nmu, 0.0), momZ(nmu, 0.0); std::vector tpAssoQuality(nmu, -1); - std::auto_ptr secondaries; // output collection of secondary muons + std::unique_ptr secondaries; // output collection of secondary muons std::map tpToSecondaries; // map from tp to (index+1) in output collection std::vector muToPrimary(nmu, -1), muToSecondary(nmu, -1); // map from input into (index) in output, -1 for null if (linkToGenParticles_) secondaries.reset(new reco::GenParticleCollection()); @@ -433,17 +433,17 @@ MuonMCClassifier::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) writeValueMap(iEvent, muons, tpAssoQuality, "tpAssoQuality"); if (linkToGenParticles_) { - edm::OrphanHandle secHandle = iEvent.put(secondaries, "secondaries"); + edm::OrphanHandle secHandle = iEvent.put(std::move(secondaries), "secondaries"); edm::RefProd priRP(genParticles); edm::RefProd secRP(secHandle); - std::auto_ptr > outPri(new edm::Association(priRP)); - std::auto_ptr > outSec(new edm::Association(secRP)); + std::unique_ptr > outPri(new edm::Association(priRP)); + std::unique_ptr > outSec(new edm::Association(secRP)); edm::Association::Filler fillPri(*outPri), fillSec(*outSec); fillPri.insert(muons, muToPrimary.begin(), muToPrimary.end()); fillSec.insert(muons, muToSecondary.begin(), muToSecondary.end()); fillPri.fill(); fillSec.fill(); - iEvent.put(outPri, "toPrimaries"); - iEvent.put(outSec, "toSecondaries"); + iEvent.put(std::move(outPri), "toPrimaries"); + iEvent.put(std::move(outSec), "toSecondaries"); } } @@ -456,11 +456,11 @@ MuonMCClassifier::writeValueMap(edm::Event &iEvent, { using namespace edm; using namespace std; - auto_ptr > valMap(new ValueMap()); + unique_ptr > valMap(new ValueMap()); typename edm::ValueMap::Filler filler(*valMap); filler.insert(handle, values.begin(), values.end()); filler.fill(); - iEvent.put(valMap, label); + iEvent.put(std::move(valMap), label); } int diff --git a/MuonAnalysis/MuonAssociators/plugins/TriggerMatcherToHLTDebug.cc b/MuonAnalysis/MuonAssociators/plugins/TriggerMatcherToHLTDebug.cc index ef9cbafb67488..0925590c37b7f 100644 --- a/MuonAnalysis/MuonAssociators/plugins/TriggerMatcherToHLTDebug.cc +++ b/MuonAnalysis/MuonAssociators/plugins/TriggerMatcherToHLTDebug.cc @@ -413,11 +413,11 @@ TriggerMatcherToHLTDebug::storeValueMap(edm::Event &iEvent, const std::vector & values, const std::string & label) const { using namespace edm; using namespace std; - auto_ptr > valMap(new ValueMap()); + unique_ptr > valMap(new ValueMap()); typename edm::ValueMap::Filler filler(*valMap); filler.insert(handle, values.begin(), values.end()); filler.fill(); - iEvent.put(valMap, label); + iEvent.put(std::move(valMap), label); } diff --git a/MuonAnalysis/MuonAssociators/plugins/TriggerObjectFilterByCollection.cc b/MuonAnalysis/MuonAssociators/plugins/TriggerObjectFilterByCollection.cc index 42fc51f0a3cb5..144709c5f00cb 100644 --- a/MuonAnalysis/MuonAssociators/plugins/TriggerObjectFilterByCollection.cc +++ b/MuonAnalysis/MuonAssociators/plugins/TriggerObjectFilterByCollection.cc @@ -60,7 +60,7 @@ TriggerObjectFilterByCollection::produce(edm::Event & iEvent, const edm::EventSe Handle > src; iEvent.getByToken(src_, src); - std::auto_ptr > out(new std::vector()); + std::unique_ptr > out(new std::vector()); out->reserve(src->size()); for (std::vector::const_iterator it = src->begin(), ed = src->end(); it != ed; ++it) { const std::string &coll = it->collection(); @@ -71,7 +71,7 @@ TriggerObjectFilterByCollection::produce(edm::Event & iEvent, const edm::EventSe if (found) out->push_back(*it); } - iEvent.put(out); + iEvent.put(std::move(out)); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/SUSYBSMAnalysis/HSCP/plugins/HSCPDeDxInfoProducer.cc b/SUSYBSMAnalysis/HSCP/plugins/HSCPDeDxInfoProducer.cc index 45ff644d64a78..8528efd422e9b 100644 --- a/SUSYBSMAnalysis/HSCP/plugins/HSCPDeDxInfoProducer.cc +++ b/SUSYBSMAnalysis/HSCP/plugins/HSCPDeDxInfoProducer.cc @@ -82,7 +82,7 @@ void HSCPDeDxInfoProducer::beginRun(edm::Run const& run, const edm::EventSetup& void HSCPDeDxInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - auto_ptr > trackDeDxAssociation(new ValueMap ); + unique_ptr > trackDeDxAssociation(new ValueMap ); ValueMap::Filler filler(*trackDeDxAssociation); edm::Handle trackCollectionHandle; @@ -134,7 +134,7 @@ void HSCPDeDxInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iS filler.insert(trackCollectionHandle, dEdxInfos.begin(), dEdxInfos.end()); filler.fill(); - iEvent.put(trackDeDxAssociation); + iEvent.put(std::move(trackDeDxAssociation)); } void HSCPDeDxInfoProducer::processHit(const TrackingRecHit* recHit, float trackMomentum, float& cosine, susybsm::HSCPDeDxInfo& hscpDeDxInfo, LocalPoint HitLocalPos){ diff --git a/SUSYBSMAnalysis/HSCP/plugins/HSCParticleProducer.cc b/SUSYBSMAnalysis/HSCP/plugins/HSCParticleProducer.cc index fca7120d255e4..c66a4980647af 100644 --- a/SUSYBSMAnalysis/HSCP/plugins/HSCParticleProducer.cc +++ b/SUSYBSMAnalysis/HSCP/plugins/HSCParticleProducer.cc @@ -105,10 +105,10 @@ HSCParticleProducer::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { // creates the output collection susybsm::HSCParticleCollection* hscp = new susybsm::HSCParticleCollection; - std::auto_ptr result(hscp); + std::unique_ptr result(hscp); susybsm::HSCPCaloInfoCollection* caloInfoColl = new susybsm::HSCPCaloInfoCollection; - std::auto_ptr caloInfoCollaptr(caloInfoColl); + std::unique_ptr caloInfoCollaptr(caloInfoColl); // Fill the output collection with HSCP Candidate (the candiate only contains ref to muon AND/OR track object) @@ -173,7 +173,7 @@ HSCParticleProducer::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { // output result if(useBetaFromEcal){ - edm::OrphanHandle caloInfoHandle= iEvent.put(caloInfoCollaptr); + edm::OrphanHandle caloInfoHandle= iEvent.put(std::move(caloInfoCollaptr)); // adding the reftoCaloInfoObject to the HSCP Object for(int i=0;i<(int)hscp->size();i++) { susybsm::HSCParticleCollection::iterator hscpcandidate = hscp->begin() + i; @@ -185,12 +185,12 @@ HSCParticleProducer::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) { // output result - edm::OrphanHandle putHandle = iEvent.put(result); + edm::OrphanHandle putHandle = iEvent.put(std::move(result)); // if(useBetaFromEcal){ // edm::RefProd hscpCollectionHandle = iEvent.getRefBeforePut(); // filler.insert(putHandle, CaloInfoColl.begin(), CaloInfoColl.end()); // filler.fill(); -// iEvent.put(CaloInfoMap); +// iEvent.put(std::move(CaloInfoMap)); // } return filterResult; diff --git a/SUSYBSMAnalysis/HSCP/plugins/HSCParticleSelector.cc b/SUSYBSMAnalysis/HSCP/plugins/HSCParticleSelector.cc index 0918112d53f2f..c0b553b8b0261 100644 --- a/SUSYBSMAnalysis/HSCP/plugins/HSCParticleSelector.cc +++ b/SUSYBSMAnalysis/HSCP/plugins/HSCParticleSelector.cc @@ -73,7 +73,7 @@ bool HSCParticleSelector::filter(edm::Event& iEvent, const edm::EventSetup& iSet // Output Collection susybsm::HSCParticleCollection* output = new susybsm::HSCParticleCollection; - std::auto_ptr result(output); + std::unique_ptr result(output); // cleanup the collection based on the input selection for(susybsm::HSCParticleCollection::iterator hscpcandidate = Source.begin(); hscpcandidate < Source.end(); ++hscpcandidate){ @@ -87,7 +87,7 @@ bool HSCParticleSelector::filter(edm::Event& iEvent, const edm::EventSetup& iSet bool filterResult = !Filter_ || (Filter_ && output->size()>=1); - iEvent.put(result); + iEvent.put(std::move(result)); return filterResult; } diff --git a/SUSYBSMAnalysis/HSCP/plugins/MuonSegmentProducer.cc b/SUSYBSMAnalysis/HSCP/plugins/MuonSegmentProducer.cc index 35ee5f9c59fd6..f5ee020273750 100644 --- a/SUSYBSMAnalysis/HSCP/plugins/MuonSegmentProducer.cc +++ b/SUSYBSMAnalysis/HSCP/plugins/MuonSegmentProducer.cc @@ -90,7 +90,7 @@ MuonSegmentProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) using namespace susybsm; susybsm::MuonSegmentCollection* segments = new susybsm::MuonSegmentCollection; - std::auto_ptr resultSeg(segments); + std::unique_ptr resultSeg(segments); edm::ESHandle dtGeom; iSetup.get().get(dtGeom); @@ -126,7 +126,7 @@ MuonSegmentProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) segments->push_back(muonSegment); } - edm::OrphanHandle putHandleSeg = iEvent.put(resultSeg); + edm::OrphanHandle putHandleSeg = iEvent.put(std::move(resultSeg)); } // ------------ method called once each job just before starting event loop ------------ diff --git a/SUSYBSMAnalysis/HSCP/plugins/SimHitShifter.cc b/SUSYBSMAnalysis/HSCP/plugins/SimHitShifter.cc index 579e5fc080fc3..916697f852cfa 100644 --- a/SUSYBSMAnalysis/HSCP/plugins/SimHitShifter.cc +++ b/SUSYBSMAnalysis/HSCP/plugins/SimHitShifter.cc @@ -164,9 +164,9 @@ void SimHitShifter::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){ iEvent.getManyByType(theSimHitContainers); //std::cout << " The Number of sim Hits is " << theSimHitContainers.size() < pcsc(new edm::PSimHitContainer); - std::auto_ptr pdt(new edm::PSimHitContainer); - std::auto_ptr prpc(new edm::PSimHitContainer); + std::unique_ptr pcsc(new edm::PSimHitContainer); + std::unique_ptr pdt(new edm::PSimHitContainer); + std::unique_ptr prpc(new edm::PSimHitContainer); std::vector theSimHits; @@ -263,9 +263,9 @@ void SimHitShifter::produce(edm::Event& iEvent, const edm::EventSetup& iSetup){ std::cout<<"Putting collections in the event"< tkTracks; iEvent.getByToken(inputCollectionToken_,tkTracks); - std::auto_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ; + std::unique_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ; for(TrackCollection::const_iterator itTrack = tkTracks->begin(); itTrack != tkTracks->end(); ++itTrack) { @@ -148,7 +148,7 @@ HighPtTrackEcalDetIdProducer::produce(edm::Event& iEvent, const edm::EventSetup& } } - iEvent.put(interestingDetIdCollection); + iEvent.put(std::move(interestingDetIdCollection)); } //define this as a plug-in diff --git a/SUSYBSMAnalysis/HSCP/plugins/Skim_ProduceIsolationMap.cc b/SUSYBSMAnalysis/HSCP/plugins/Skim_ProduceIsolationMap.cc index cee31d540b615..0902253f56bf4 100644 --- a/SUSYBSMAnalysis/HSCP/plugins/Skim_ProduceIsolationMap.cc +++ b/SUSYBSMAnalysis/HSCP/plugins/Skim_ProduceIsolationMap.cc @@ -131,7 +131,7 @@ ProduceIsolationMap::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) if(!TKHandle.isValid() ){ edm::LogError("ProduceIsolationMap") << "TK Tracks collection not found"; return; } //Create empty output collections - auto_ptr > trackHSCPIsolMap(new ValueMap ); + unique_ptr > trackHSCPIsolMap(new ValueMap ); ValueMap::Filler filler(*trackHSCPIsolMap); //loop through tracks. @@ -168,7 +168,7 @@ ProduceIsolationMap::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) filler.insert(tkTracks, IsolationInfoColl.begin(), IsolationInfoColl.end()); filler.fill(); - iEvent.put(trackHSCPIsolMap); + iEvent.put(std::move(trackHSCPIsolMap)); } //define this as a plug-in DEFINE_FWK_MODULE(ProduceIsolationMap); diff --git a/SUSYBSMAnalysis/HSCP/plugins/Skim_ReduceHcalRecHitCollectionProducer.cc b/SUSYBSMAnalysis/HSCP/plugins/Skim_ReduceHcalRecHitCollectionProducer.cc index cd1e0cba12752..7d3b0c589269c 100644 --- a/SUSYBSMAnalysis/HSCP/plugins/Skim_ReduceHcalRecHitCollectionProducer.cc +++ b/SUSYBSMAnalysis/HSCP/plugins/Skim_ReduceHcalRecHitCollectionProducer.cc @@ -143,12 +143,12 @@ ReduceHcalRecHitCollectionProducer::produce(edm::Event& iEvent, const edm::Event } //Create empty output collections - std::auto_ptr< HBHERecHitCollection > miniRecHitCollection (new HBHERecHitCollection) ; + std::unique_ptr< HBHERecHitCollection > miniRecHitCollection (new HBHERecHitCollection) ; //loop through tracks. Handle tkTracks; iEvent.getByToken(inputCollectionToken_,tkTracks); - std::auto_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ; + std::unique_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ; for(TrackCollection::const_iterator itTrack = tkTracks->begin(); itTrack != tkTracks->end(); ++itTrack) { @@ -172,7 +172,7 @@ ReduceHcalRecHitCollectionProducer::produce(edm::Event& iEvent, const edm::Event } } - iEvent.put( miniRecHitCollection,reducedHitsCollection_ ); + iEvent.put(std::move(miniRecHitCollection),reducedHitsCollection_ ); diff --git a/SUSYBSMAnalysis/HSCP/plugins/Skim_UpdatedMuonInnerTrackRef.cc b/SUSYBSMAnalysis/HSCP/plugins/Skim_UpdatedMuonInnerTrackRef.cc index a0cc9610994b7..fd9578a473074 100644 --- a/SUSYBSMAnalysis/HSCP/plugins/Skim_UpdatedMuonInnerTrackRef.cc +++ b/SUSYBSMAnalysis/HSCP/plugins/Skim_UpdatedMuonInnerTrackRef.cc @@ -89,7 +89,7 @@ void UpdatedMuonInnerTrackRef::produce(edm::Event& ev, const edm::EventSetup& iS } unsigned int muonCollectionSize = muonCollectionHandle->size(); - std::auto_ptr newmuons (new reco::MuonCollection); + std::unique_ptr newmuons (new reco::MuonCollection); for (unsigned int i=0; ipush_back(*newmu); } - ev.put(newmuons); + ev.put(std::move(newmuons)); } reco::TrackRef UpdatedMuonInnerTrackRef::findNewRef(reco::TrackRef oldTrackRef, edm::Handle& newTrackCollection){ diff --git a/TopQuarkAnalysis/TopEventProducers/interface/TtEvtBuilder.h b/TopQuarkAnalysis/TopEventProducers/interface/TtEvtBuilder.h index 81aa21145f88b..fb40cbeb47c72 100644 --- a/TopQuarkAnalysis/TopEventProducers/interface/TtEvtBuilder.h +++ b/TopQuarkAnalysis/TopEventProducers/interface/TtEvtBuilder.h @@ -235,9 +235,9 @@ TtEvtBuilder::produce(edm::Event& evt, const edm::EventSetup& setup) ttEvent.print(verbosity_); // write object into the edm::Event - std::auto_ptr pOut(new C); + std::unique_ptr pOut(new C); *pOut=ttEvent; - evt.put(pOut); + evt.put(std::move(pOut)); } template <> diff --git a/TopQuarkAnalysis/TopEventProducers/src/PseudoTopProducer.cc b/TopQuarkAnalysis/TopEventProducers/src/PseudoTopProducer.cc index d4f9d71d08e43..ad14c69970e73 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/PseudoTopProducer.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/PseudoTopProducer.cc @@ -52,14 +52,14 @@ void PseudoTopProducer::produce(edm::Event& event, const edm::EventSetup& eventS edm::Handle > genParticleHandle; event.getByToken(genParticleToken_, genParticleHandle); - std::auto_ptr neutrinos(new reco::GenParticleCollection); - std::auto_ptr leptons(new reco::GenJetCollection); - std::auto_ptr jets(new reco::GenJetCollection); + std::unique_ptr neutrinos(new reco::GenParticleCollection); + std::unique_ptr leptons(new reco::GenJetCollection); + std::unique_ptr jets(new reco::GenJetCollection); auto neutrinosRefHandle = event.getRefBeforePut("neutrinos"); auto leptonsRefHandle = event.getRefBeforePut("leptons"); auto jetsRefHandle = event.getRefBeforePut("jets"); - std::auto_ptr pseudoTop(new reco::GenParticleCollection); + std::unique_ptr pseudoTop(new reco::GenParticleCollection); auto pseudoTopRefHandle = event.getRefBeforePut(); // Collect unstable B-hadrons @@ -434,11 +434,11 @@ void PseudoTopProducer::produce(edm::Event& event, const edm::EventSetup& eventS pseudoTop->at(9).addMother(reco::GenParticleRef(pseudoTopRefHandle, 6)); } - event.put(neutrinos, "neutrinos"); - event.put(leptons, "leptons"); - event.put(jets, "jets"); + event.put(std::move(neutrinos), "neutrinos"); + event.put(std::move(leptons), "leptons"); + event.put(std::move(jets), "jets"); - event.put(pseudoTop); + event.put(std::move(pseudoTop)); } const reco::Candidate* PseudoTopProducer::getLast(const reco::Candidate* p) diff --git a/TopQuarkAnalysis/TopEventProducers/src/StEvtSolutionMaker.cc b/TopQuarkAnalysis/TopEventProducers/src/StEvtSolutionMaker.cc index c10baa198e2b1..c2e061afdbfae 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/StEvtSolutionMaker.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/StEvtSolutionMaker.cc @@ -122,8 +122,8 @@ void StEvtSolutionMaker::produce(edm::Event& iEvent, const edm::EventSetup& iSet } //store the vector of solutions to the event - std::auto_ptr > pOut(evtsols); - iEvent.put(pOut); + std::unique_ptr > pOut(evtsols); + iEvent.put(std::move(pOut)); } else { @@ -136,7 +136,7 @@ void StEvtSolutionMaker::produce(edm::Event& iEvent, const edm::EventSetup& iSet StEvtSolution asol; evtsols->push_back(asol); - std::auto_ptr > pOut(evtsols); - iEvent.put(pOut); + std::unique_ptr > pOut(evtsols); + iEvent.put(std::move(pOut)); } } diff --git a/TopQuarkAnalysis/TopEventProducers/src/StGenEventReco.cc b/TopQuarkAnalysis/TopEventProducers/src/StGenEventReco.cc index bf947c2c5a74b..03dc0ac6f2fa0 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/StGenEventReco.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/StGenEventReco.cc @@ -28,6 +28,6 @@ StGenEventReco::produce(edm::Event& evt, const edm::EventSetup& setup) //add genEvt to the output stream StGenEvent* genEvt = new StGenEvent( cands, initParts ); - std::auto_ptr gen( genEvt ); - evt.put( gen ); + std::unique_ptr gen( genEvt ); + evt.put(std::move(gen)); } diff --git a/TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc b/TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc index 7e7da1730ba4f..ea472984ad9b3 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/TopDecaySubset.cc @@ -48,7 +48,7 @@ void TopDecaySubset::produce(edm::Event& event, const edm::EventSetup& setup) { // create target vector - std::auto_ptr target( new reco::GenParticleCollection ); + std::unique_ptr target( new reco::GenParticleCollection ); // get source collection edm::Handle src; @@ -98,7 +98,7 @@ TopDecaySubset::produce(edm::Event& event, const edm::EventSetup& setup) } // write vectors to the event - event.put(target); + event.put(std::move(target)); } /// find top quarks in list of input particles @@ -339,7 +339,7 @@ TopDecaySubset::fillListing(const std::vector& tops, r for(std::vector::const_iterator it=tops.begin(); it!=tops.end(); ++it){ const reco::GenParticle* t = *it; // if particle is top or anti-top - std::auto_ptr topPtr( new reco::GenParticle( t->threeCharge(), p4(it, statusFlag), t->vertex(), t->pdgId(), statusFlag, false ) ); + std::unique_ptr topPtr( new reco::GenParticle( t->threeCharge(), p4(it, statusFlag), t->vertex(), t->pdgId(), statusFlag, false ) ); target.push_back( *topPtr ); ++motherPartIdx_; // keep the top index for the map to manage the daughter refs @@ -357,7 +357,7 @@ TopDecaySubset::fillListing(const std::vector& tops, r for(reco::GenParticle::const_iterator td=((showerModel_==kPythia)?t->begin():t->begin()->begin()); td!=((showerModel_==kPythia)?t->end():t->begin()->end()); ++td){ if( td->status()==TopDecayID::unfrag && std::abs( td->pdgId() )<=TopDecayID::bID ){ // if particle is beauty or other quark - std::auto_ptr bPtr( new reco::GenParticle( td->threeCharge(), p4( td, statusFlag ), td->vertex(), td->pdgId(), statusFlag, false ) ); + std::unique_ptr bPtr( new reco::GenParticle( td->threeCharge(), p4( td, statusFlag ), td->vertex(), td->pdgId(), statusFlag, false ) ); target.push_back( *bPtr ); // increment & push index of the top daughter topDaughters.push_back( ++motherPartIdx_ ); @@ -372,7 +372,7 @@ TopDecaySubset::fillListing(const std::vector& tops, r reco::GenParticle::const_iterator buffer = (showerModel_==kPythia)?td:td->begin(); if( buffer->status()==TopDecayID::unfrag && std::abs( buffer->pdgId() )==TopDecayID::WID ){ // if particle is a W boson - std::auto_ptr wPtr( new reco::GenParticle( buffer->threeCharge(), p4( buffer, statusFlag), buffer->vertex(), buffer->pdgId(), statusFlag, true ) ); + std::unique_ptr wPtr( new reco::GenParticle( buffer->threeCharge(), p4( buffer, statusFlag), buffer->vertex(), buffer->pdgId(), statusFlag, true ) ); target.push_back( *wPtr ); // increment & push index of the top daughter topDaughters.push_back( ++motherPartIdx_ ); @@ -388,7 +388,7 @@ TopDecaySubset::fillListing(const std::vector& tops, r for(reco::GenParticle::const_iterator wd=((showerModel_==kPythia)?buffer->begin():buffer->begin()->begin()); wd!=((showerModel_==kPythia)?buffer->end():buffer->begin()->end()); ++wd){ // make sure the W daughter is of status unfrag and not the W itself if( wd->status()==TopDecayID::unfrag && !(std::abs(wd->pdgId())==TopDecayID::WID) ) { - std::auto_ptr qPtr( new reco::GenParticle( wd->threeCharge(), p4( wd, statusFlag ), wd->vertex(), wd->pdgId(), statusFlag, false) ); + std::unique_ptr qPtr( new reco::GenParticle( wd->threeCharge(), p4( wd, statusFlag ), wd->vertex(), wd->pdgId(), statusFlag, false) ); target.push_back( *qPtr ); // increment & push index of the top daughter wDaughters.push_back( ++motherPartIdx_ ); @@ -406,7 +406,7 @@ TopDecaySubset::fillListing(const std::vector& tops, r } if(addRadiation_ && buffer->status()==TopDecayID::stable && ( buffer->pdgId()==TopDecayID::glueID || std::abs(buffer->pdgId()) radPtr( new reco::GenParticle( buffer->threeCharge(), buffer->p4(), buffer->vertex(), buffer->pdgId(), statusFlag, false ) ); + std::unique_ptr radPtr( new reco::GenParticle( buffer->threeCharge(), buffer->p4(), buffer->vertex(), buffer->pdgId(), statusFlag, false ) ); target.push_back( *radPtr ); // increment & push index of the top daughter topDaughters.push_back( ++motherPartIdx_ ); @@ -422,7 +422,7 @@ TopDecaySubset::fillListing(const std::vector& tops, r // add all further particles but the two top quarks and potential // cases where the mother of the top has itself as daughter reco::GenParticle* cand = new reco::GenParticle( ts->threeCharge(), ts->p4(), ts->vertex(), ts->pdgId(), ts->status(), false ); - std::auto_ptr sPtr( cand ); + std::unique_ptr sPtr( cand ); target.push_back( *sPtr ); if(ts->begin()!=ts->end()){ // in case the sister has daughters increment @@ -456,7 +456,7 @@ void TopDecaySubset::fillListing( top_start; it != top_end; ++it) { const reco::GenParticle* t = *it; // summation might happen here - std::auto_ptr < reco::GenParticle + std::unique_ptr < reco::GenParticle > topPtr( new reco::GenParticle(t->threeCharge(), t->p4(), t->vertex(), t->pdgId(), t->status(), false)); @@ -477,7 +477,7 @@ void TopDecaySubset::fillListing( td != final_top->end(); ++td) { if (std::abs(td->pdgId()) <= TopDecayID::bID) { // if particle is beauty or other quark - std::auto_ptr < reco::GenParticle + std::unique_ptr < reco::GenParticle > qPtr( new reco::GenParticle(td->threeCharge(), td->p4(), td->vertex(), td->pdgId(), @@ -494,7 +494,7 @@ void TopDecaySubset::fillListing( } } else if (std::abs(td->pdgId()) == TopDecayID::WID) { // ladies and gentleman, we have a W boson - std::auto_ptr < reco::GenParticle + std::unique_ptr < reco::GenParticle > WPtr( new reco::GenParticle(td->threeCharge(), td->p4(), td->vertex(), td->pdgId(), @@ -512,7 +512,7 @@ void TopDecaySubset::fillListing( for (reco::GenParticle::const_iterator wd = decaying_W->begin(); wd != decaying_W->end(); ++wd) { if (!(std::abs(wd->pdgId()) == TopDecayID::WID)) { - std::auto_ptr < reco::GenParticle + std::unique_ptr < reco::GenParticle > qPtr( new reco::GenParticle(wd->threeCharge(), wd->p4(), wd->vertex(), @@ -537,7 +537,7 @@ void TopDecaySubset::fillListing( if(addRadiation_ && ( td->pdgId()==TopDecayID::glueID || std::abs(td->pdgId()) radPtr( + std::unique_ptr radPtr( new reco::GenParticle( td->threeCharge(), td->p4(), td->vertex(), td->pdgId(), td->status(), false ) ); target.push_back( *radPtr ); @@ -641,7 +641,7 @@ TopDecaySubset::addRadiation(int& idx, const reco::GenParticle::const_iterator p // skip comment lines and make sure that // the particle is not double counted as // daughter of itself - std::auto_ptr ptr( new reco::GenParticle( daughter->threeCharge(), daughter->p4(), daughter->vertex(), daughter->pdgId(), daughter->status(), false) ); + std::unique_ptr ptr( new reco::GenParticle( daughter->threeCharge(), daughter->p4(), daughter->vertex(), daughter->pdgId(), daughter->status(), false) ); target.push_back( *ptr ); daughters.push_back( ++idx ); //push index of daughter } @@ -660,7 +660,7 @@ void TopDecaySubset::addRadiation(int& idx, const reco::GenParticle* part, // either pick daughters as long as they are different // to the initial particle if (daughter->pdgId() != part->pdgId()) { - std::auto_ptr < reco::GenParticle + std::unique_ptr < reco::GenParticle > ptr( new reco::GenParticle(daughter->threeCharge(), daughter->p4(), daughter->vertex(), @@ -682,7 +682,7 @@ TopDecaySubset::addDaughters(int& idx, const reco::GenParticle::const_iterator p std::vector daughters; int idxBuffer = idx; for(reco::GenParticle::const_iterator daughter=part->begin(); daughter!=part->end(); ++daughter){ - std::auto_ptr ptr( new reco::GenParticle( daughter->threeCharge(), daughter->p4(), daughter->vertex(), daughter->pdgId(), daughter->status(), false) ); + std::unique_ptr ptr( new reco::GenParticle( daughter->threeCharge(), daughter->p4(), daughter->vertex(), daughter->pdgId(), daughter->status(), false) ); target.push_back( *ptr ); // increment & push index of daughter daughters.push_back( ++idx ); diff --git a/TopQuarkAnalysis/TopEventProducers/src/TopInitSubset.cc b/TopQuarkAnalysis/TopEventProducers/src/TopInitSubset.cc index 794dfa1a2c587..b08820bbc3fa0 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/TopInitSubset.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/TopInitSubset.cc @@ -17,12 +17,12 @@ TopInitSubset::produce(edm::Event& evt, const edm::EventSetup& setup) evt.getByToken(srcToken_, src); const reco::GenParticleRefProd ref = evt.getRefBeforePut(); - std::auto_ptr sel( new reco::GenParticleCollection ); + std::unique_ptr sel( new reco::GenParticleCollection ); //fill output collection fillOutput( *src, *sel ); - evt.put( sel ); + evt.put(std::move(sel)); } void TopInitSubset::fillOutput(const reco::GenParticleCollection& src, reco::GenParticleCollection& sel) @@ -39,7 +39,7 @@ void TopInitSubset::fillOutput(const reco::GenParticleCollection& src, reco::Gen reco::GenParticle* cand = new reco::GenParticle( t->mother(idx)->threeCharge(), t->mother(idx)->p4(), t->mother(idx)->vertex(), t->mother(idx)->pdgId(), t->mother(idx)->status(), false ); - std::auto_ptr ptr( cand ); + std::unique_ptr ptr( cand ); sel.push_back( *ptr ); } break; diff --git a/TopQuarkAnalysis/TopEventProducers/src/TtDilepEvtSolutionMaker.cc b/TopQuarkAnalysis/TopEventProducers/src/TtDilepEvtSolutionMaker.cc index 391d561bdaca5..e3a976fd93363 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/TtDilepEvtSolutionMaker.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/TtDilepEvtSolutionMaker.cc @@ -385,14 +385,14 @@ void TtDilepEvtSolutionMaker::produce(edm::Event & iEvent, const edm::EventSetup if(bestSol!=-1) (*evtsols)[bestSol].setBestSol(true); } // put the result in the event - std::auto_ptr > pOut(evtsols); - iEvent.put(pOut); + std::unique_ptr > pOut(evtsols); + iEvent.put(std::move(pOut)); } else { // no solution: put a dummy solution in the event TtDilepEvtSolution asol; evtsols->push_back(asol); - std::auto_ptr > pOut(evtsols); - iEvent.put(pOut); + std::unique_ptr > pOut(evtsols); + iEvent.put(std::move(pOut)); } } diff --git a/TopQuarkAnalysis/TopEventProducers/src/TtGenEventReco.cc b/TopQuarkAnalysis/TopEventProducers/src/TtGenEventReco.cc index da7003b971ff2..be4fcef1737b1 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/TtGenEventReco.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/TtGenEventReco.cc @@ -30,6 +30,6 @@ TtGenEventReco::produce(edm::Event& evt, const edm::EventSetup& setup) //add genEvt to the output stream TtGenEvent* genEvt = new TtGenEvent( cands, initParts ); - std::auto_ptr gen( genEvt ); - evt.put( gen ); + std::unique_ptr gen( genEvt ); + evt.put(std::move(gen)); } diff --git a/TopQuarkAnalysis/TopEventProducers/src/TtHadEvtSolutionMaker.cc b/TopQuarkAnalysis/TopEventProducers/src/TtHadEvtSolutionMaker.cc index a4427d0caee83..a09258aae00ca 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/TtHadEvtSolutionMaker.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/TtHadEvtSolutionMaker.cc @@ -278,13 +278,13 @@ void TtHadEvtSolutionMaker::produce(edm::Event & iEvent, const edm::EventSetup & } //store the vector of solutions to the event - std::auto_ptr > pOut(evtsols); - iEvent.put(pOut); + std::unique_ptr > pOut(evtsols); + iEvent.put(std::move(pOut)); }else { //end loop jet/MET found std::cout<<"No calibrated solutions built, because only "<size()<<" were present"; - std::auto_ptr > pOut(evtsols); - iEvent.put(pOut); + std::unique_ptr > pOut(evtsols); + iEvent.put(std::move(pOut)); } } diff --git a/TopQuarkAnalysis/TopEventProducers/src/TtSemiEvtSolutionMaker.cc b/TopQuarkAnalysis/TopEventProducers/src/TtSemiEvtSolutionMaker.cc index 376c87230064c..54d3d85ddbe5d 100644 --- a/TopQuarkAnalysis/TopEventProducers/src/TtSemiEvtSolutionMaker.cc +++ b/TopQuarkAnalysis/TopEventProducers/src/TtSemiEvtSolutionMaker.cc @@ -252,8 +252,8 @@ void TtSemiEvtSolutionMaker::produce(edm::Event & iEvent, const edm::EventSetup } //store the vector of solutions to the event - std::auto_ptr > pOut(evtsols); - iEvent.put(pOut); + std::unique_ptr > pOut(evtsols); + iEvent.put(std::move(pOut)); } else { @@ -266,8 +266,8 @@ void TtSemiEvtSolutionMaker::produce(edm::Event & iEvent, const edm::EventSetup */ // TtSemiEvtSolution asol; // evtsols->push_back(asol); - std::auto_ptr > pOut(evtsols); - iEvent.put(pOut); + std::unique_ptr > pOut(evtsols); + iEvent.put(std::move(pOut)); } } diff --git a/TopQuarkAnalysis/TopEventSelection/plugins/TtFullHadSignalSelMVAComputer.cc b/TopQuarkAnalysis/TopEventSelection/plugins/TtFullHadSignalSelMVAComputer.cc index 5d2cd77469fb0..7f9287fce19e6 100644 --- a/TopQuarkAnalysis/TopEventSelection/plugins/TtFullHadSignalSelMVAComputer.cc +++ b/TopQuarkAnalysis/TopEventSelection/plugins/TtFullHadSignalSelMVAComputer.cc @@ -26,7 +26,7 @@ TtFullHadSignalSelMVAComputer::~TtFullHadSignalSelMVAComputer() void TtFullHadSignalSelMVAComputer::produce(edm::Event& evt, const edm::EventSetup& setup) { - std::auto_ptr< double > pOutDisc (new double); + std::unique_ptr< double > pOutDisc (new double); mvaComputer.update(setup, "ttFullHadSignalSelMVA"); @@ -51,7 +51,7 @@ TtFullHadSignalSelMVAComputer::produce(edm::Event& evt, const edm::EventSetup& s *pOutDisc = discrim; - evt.put(pOutDisc, "DiscSel"); + evt.put(std::move(pOutDisc), "DiscSel"); DiscSel = discrim; } diff --git a/TopQuarkAnalysis/TopEventSelection/plugins/TtSemiLepSignalSelMVAComputer.cc b/TopQuarkAnalysis/TopEventSelection/plugins/TtSemiLepSignalSelMVAComputer.cc index c1662d1fc6d9b..b4233b0e880e2 100644 --- a/TopQuarkAnalysis/TopEventSelection/plugins/TtSemiLepSignalSelMVAComputer.cc +++ b/TopQuarkAnalysis/TopEventSelection/plugins/TtSemiLepSignalSelMVAComputer.cc @@ -29,7 +29,7 @@ TtSemiLepSignalSelMVAComputer::~TtSemiLepSignalSelMVAComputer() void TtSemiLepSignalSelMVAComputer::produce(edm::Event& evt, const edm::EventSetup& setup) { - std::auto_ptr< double > pOutDisc (new double); + std::unique_ptr< double > pOutDisc (new double); mvaComputer.update(setup, "ttSemiLepSignalSelMVA"); @@ -116,7 +116,7 @@ TtSemiLepSignalSelMVAComputer::produce(edm::Event& evt, const edm::EventSetup& s *pOutDisc = discrim; - evt.put(pOutDisc, "DiscSel"); + evt.put(std::move(pOutDisc), "DiscSel"); DiscSel = discrim; diff --git a/TopQuarkAnalysis/TopHitFit/interface/Constraint.h b/TopQuarkAnalysis/TopHitFit/interface/Constraint.h index 506038e046147..ad0960792d03e 100644 --- a/TopQuarkAnalysis/TopHitFit/interface/Constraint.h +++ b/TopQuarkAnalysis/TopHitFit/interface/Constraint.h @@ -152,12 +152,12 @@ class Constraint /** Left hand side of the constraint. */ - std::auto_ptr _lhs; + std::unique_ptr _lhs; /** Right hand side of the constraint. */ - std::auto_ptr _rhs; + std::unique_ptr _rhs; }; diff --git a/TopQuarkAnalysis/TopHitFit/interface/Constraint_Intermed.h b/TopQuarkAnalysis/TopHitFit/interface/Constraint_Intermed.h index addbb1e0d538e..eedf31c662e8a 100644 --- a/TopQuarkAnalysis/TopHitFit/interface/Constraint_Intermed.h +++ b/TopQuarkAnalysis/TopHitFit/interface/Constraint_Intermed.h @@ -151,7 +151,7 @@ class Constraint_Intermed /** Clone function to copy the instance. */ - virtual std::auto_ptr clone () const = 0; + virtual std::unique_ptr clone () const = 0; }; @@ -231,7 +231,7 @@ class Constraint_Intermed_Constant /** Clone function to copy the instance. */ - virtual std::auto_ptr clone () const; + virtual std::unique_ptr clone () const; private: // Store c^2 / 2. @@ -315,7 +315,7 @@ class Constraint_Intermed_Labels /** Clone function to copy the instance. */ - virtual std::auto_ptr clone () const; + virtual std::unique_ptr clone () const; private: // Test to see if LABEL is used by this constraint half. @@ -378,7 +378,7 @@ std::ostream& operator<< (std::ostream& s, const Constraint_Intermed& ci); NULL pointer if the input string cannot be interpreted as a mass constraint. */ -std::auto_ptr make_constraint_intermed (std::string s); +std::unique_ptr make_constraint_intermed (std::string s); } // namespace hitfit diff --git a/TopQuarkAnalysis/TopHitFit/plugins/TtSemiLepHitFitProducer.h b/TopQuarkAnalysis/TopHitFit/plugins/TtSemiLepHitFitProducer.h index f1c7267bd5469..df1c2c79b7771 100644 --- a/TopQuarkAnalysis/TopHitFit/plugins/TtSemiLepHitFitProducer.h +++ b/TopQuarkAnalysis/TopHitFit/plugins/TtSemiLepHitFitProducer.h @@ -189,20 +189,20 @@ TtSemiLepHitFitProducer::~TtSemiLepHitFitProducer() template void TtSemiLepHitFitProducer::produce(edm::Event& evt, const edm::EventSetup& setup) { - std::auto_ptr< std::vector > pPartonsHadP( new std::vector ); - std::auto_ptr< std::vector > pPartonsHadQ( new std::vector ); - std::auto_ptr< std::vector > pPartonsHadB( new std::vector ); - std::auto_ptr< std::vector > pPartonsLepB( new std::vector ); - std::auto_ptr< std::vector > pLeptons ( new std::vector ); - std::auto_ptr< std::vector > pNeutrinos ( new std::vector ); - - std::auto_ptr< std::vector > > pCombi ( new std::vector > ); - std::auto_ptr< std::vector > pChi2 ( new std::vector ); - std::auto_ptr< std::vector > pProb ( new std::vector ); - std::auto_ptr< std::vector > pMT ( new std::vector ); - std::auto_ptr< std::vector > pSigMT ( new std::vector ); - std::auto_ptr< std::vector > pStatus( new std::vector ); - std::auto_ptr< int > pJetsConsidered( new int ); + std::unique_ptr< std::vector > pPartonsHadP( new std::vector ); + std::unique_ptr< std::vector > pPartonsHadQ( new std::vector ); + std::unique_ptr< std::vector > pPartonsHadB( new std::vector ); + std::unique_ptr< std::vector > pPartonsLepB( new std::vector ); + std::unique_ptr< std::vector > pLeptons ( new std::vector ); + std::unique_ptr< std::vector > pNeutrinos ( new std::vector ); + + std::unique_ptr< std::vector > > pCombi ( new std::vector > ); + std::unique_ptr< std::vector > pChi2 ( new std::vector ); + std::unique_ptr< std::vector > pProb ( new std::vector ); + std::unique_ptr< std::vector > pMT ( new std::vector ); + std::unique_ptr< std::vector > pSigMT ( new std::vector ); + std::unique_ptr< std::vector > pStatus( new std::vector ); + std::unique_ptr< int > pJetsConsidered( new int ); edm::Handle > jets; evt.getByToken(jetsToken_, jets); @@ -278,19 +278,19 @@ void TtSemiLepHitFitProducer::produce(edm::Event& evt, const e // status of the fitter pStatus->push_back( -1 ); // feed out all products - evt.put(pCombi); - evt.put(pPartonsHadP, "PartonsHadP"); - evt.put(pPartonsHadQ, "PartonsHadQ"); - evt.put(pPartonsHadB, "PartonsHadB"); - evt.put(pPartonsLepB, "PartonsLepB"); - evt.put(pLeptons , "Leptons" ); - evt.put(pNeutrinos , "Neutrinos" ); - evt.put(pChi2 , "Chi2" ); - evt.put(pProb , "Prob" ); - evt.put(pMT , "MT" ); - evt.put(pSigMT , "SigMT" ); - evt.put(pStatus , "Status" ); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pCombi)); + evt.put(std::move(pPartonsHadP), "PartonsHadP"); + evt.put(std::move(pPartonsHadQ), "PartonsHadQ"); + evt.put(std::move(pPartonsHadB), "PartonsHadB"); + evt.put(std::move(pPartonsLepB), "PartonsLepB"); + evt.put(std::move(pLeptons ), "Leptons" ); + evt.put(std::move(pNeutrinos ), "Neutrinos" ); + evt.put(std::move(pChi2 ), "Chi2" ); + evt.put(std::move(pProb ), "Prob" ); + evt.put(std::move(pMT ), "MT" ); + evt.put(std::move(pSigMT ), "SigMT" ); + evt.put(std::move(pStatus ), "Status" ); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); return; } @@ -475,19 +475,19 @@ void TtSemiLepHitFitProducer::produce(edm::Event& evt, const e pStatus->push_back( result->Status ); } } - evt.put(pCombi); - evt.put(pPartonsHadP, "PartonsHadP"); - evt.put(pPartonsHadQ, "PartonsHadQ"); - evt.put(pPartonsHadB, "PartonsHadB"); - evt.put(pPartonsLepB, "PartonsLepB"); - evt.put(pLeptons , "Leptons" ); - evt.put(pNeutrinos , "Neutrinos" ); - evt.put(pChi2 , "Chi2" ); - evt.put(pProb , "Prob" ); - evt.put(pMT , "MT" ); - evt.put(pSigMT , "SigMT" ); - evt.put(pStatus , "Status" ); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pCombi)); + evt.put(std::move(pPartonsHadP), "PartonsHadP"); + evt.put(std::move(pPartonsHadQ), "PartonsHadQ"); + evt.put(std::move(pPartonsHadB), "PartonsHadB"); + evt.put(std::move(pPartonsLepB), "PartonsLepB"); + evt.put(std::move(pLeptons ), "Leptons" ); + evt.put(std::move(pNeutrinos ), "Neutrinos" ); + evt.put(std::move(pChi2 ), "Chi2" ); + evt.put(std::move(pProb ), "Prob" ); + evt.put(std::move(pMT ), "MT" ); + evt.put(std::move(pSigMT ), "SigMT" ); + evt.put(std::move(pStatus ), "Status" ); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); } #endif diff --git a/TopQuarkAnalysis/TopHitFit/src/Constraint.cc b/TopQuarkAnalysis/TopHitFit/src/Constraint.cc index 81ff0b525e997..b5b86842ce92d 100644 --- a/TopQuarkAnalysis/TopHitFit/src/Constraint.cc +++ b/TopQuarkAnalysis/TopHitFit/src/Constraint.cc @@ -38,7 +38,7 @@ #include -using std::auto_ptr; +using std::unique_ptr; using std::ostream; using std::string; @@ -70,12 +70,12 @@ Constraint& Constraint::operator= (const Constraint& c) // { { - auto_ptr ci = c._lhs->clone (); - _lhs = ci; + unique_ptr ci = c._lhs->clone (); + _lhs = std::move(ci); } { - auto_ptr ci = c._rhs->clone (); - _rhs = ci; + unique_ptr ci = c._rhs->clone (); + _rhs = std::move(ci); } return *this; @@ -97,14 +97,14 @@ Constraint::Constraint (std::string s) // And then build the two halves. { - auto_ptr ci = + unique_ptr ci = make_constraint_intermed (s.substr (0, i)); - _lhs = ci; + _lhs = std::move(ci); } { - auto_ptr ci = + unique_ptr ci = make_constraint_intermed (s.substr (i+1)); - _rhs = ci; + _rhs = std::move(ci); } } diff --git a/TopQuarkAnalysis/TopHitFit/src/Constraint_Intermed.cc b/TopQuarkAnalysis/TopHitFit/src/Constraint_Intermed.cc index fb6f5cd970ffa..deb0444dc2cf6 100644 --- a/TopQuarkAnalysis/TopHitFit/src/Constraint_Intermed.cc +++ b/TopQuarkAnalysis/TopHitFit/src/Constraint_Intermed.cc @@ -42,7 +42,7 @@ #include -using std::auto_ptr; +using std::unique_ptr; using std::ostream; using std::sqrt; using std::stable_sort; @@ -134,7 +134,7 @@ void Constraint_Intermed_Constant::print (std::ostream& s) const } -auto_ptr Constraint_Intermed_Constant::clone () const +unique_ptr Constraint_Intermed_Constant::clone () const // // Purpose: Copy this object. // @@ -142,7 +142,7 @@ auto_ptr Constraint_Intermed_Constant::clone () const // A new copy of this object. // { - return auto_ptr + return unique_ptr (new Constraint_Intermed_Constant (*this)); } @@ -273,7 +273,7 @@ bool Constraint_Intermed_Labels::has_label (int label) const } -auto_ptr Constraint_Intermed_Labels::clone () const +unique_ptr Constraint_Intermed_Labels::clone () const // // Purpose: Copy this object. // @@ -281,7 +281,7 @@ auto_ptr Constraint_Intermed_Labels::clone () const // A new copy of this object. // { - return auto_ptr + return unique_ptr (new Constraint_Intermed_Labels (*this)); } @@ -317,7 +317,7 @@ std::ostream& operator<< (std::ostream& s, const hitfit::Constraint_Intermed& ci } -auto_ptr make_constraint_intermed (string s) +unique_ptr make_constraint_intermed (string s) // // Purpose: Parse the string S and return an appropriate // Constraint_Intermed instance. @@ -353,7 +353,7 @@ auto_ptr make_constraint_intermed (string s) if (i < s.size() && s[i] == '<') { i = s.find ('>', i); if (i == string::npos) - return auto_ptr (); + return unique_ptr (); ++i; } while (i < s.size() && s[i] == ' ') @@ -361,7 +361,7 @@ auto_ptr make_constraint_intermed (string s) // Fail if there's nothing left. if (i == s.size()) - return auto_ptr (); + return unique_ptr (); if (s[i] == '(') { // List of labels. @@ -378,12 +378,12 @@ auto_ptr make_constraint_intermed (string s) while (i < s.size() && s[i] != ' ' && s[i] != ')') ++i; } - return auto_ptr + return unique_ptr (new Constraint_Intermed_Labels (labels)); } else { // Make a Constraint_Intermed_Constant instance. - return auto_ptr + return unique_ptr (new Constraint_Intermed_Constant (atof (s.c_str() + i))); } } diff --git a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombGeom.cc b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombGeom.cc index d52544fc5e751..4c59dc0f0fb87 100644 --- a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombGeom.cc +++ b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombGeom.cc @@ -32,8 +32,8 @@ TtSemiLepJetCombGeom::~TtSemiLepJetCombGeom() void TtSemiLepJetCombGeom::produce(edm::Event& evt, const edm::EventSetup& setup) { - std::auto_ptr > > pOut(new std::vector >); - std::auto_ptr pJetsConsidered(new int); + std::unique_ptr > > pOut(new std::vector >); + std::unique_ptr pJetsConsidered(new int); std::vector match; for(unsigned int i = 0; i < 4; ++i) @@ -50,16 +50,16 @@ TtSemiLepJetCombGeom::produce(edm::Event& evt, const edm::EventSetup& setup) // skip events without lepton candidate or less than 4 jets if(leps->empty() || jets->size() < 4){ pOut->push_back( match ); - evt.put(pOut); + evt.put(std::move(pOut)); *pJetsConsidered = jets->size(); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); return; } unsigned maxNJets = maxNJets_; if(maxNJets_ == -1 || (int)jets->size() < maxNJets_) maxNJets = jets->size(); *pJetsConsidered = maxNJets; - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); std::vector isBJet; std::vector isLJet; @@ -140,7 +140,7 @@ TtSemiLepJetCombGeom::produce(edm::Event& evt, const edm::EventSetup& setup) match[TtSemiLepEvtPartons::LepB ] = lepB; pOut->push_back( match ); - evt.put(pOut); + evt.put(std::move(pOut)); } double diff --git a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMVAComputer.cc b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMVAComputer.cc index 71423e3cf5725..5e068538b2fe0 100644 --- a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMVAComputer.cc +++ b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMVAComputer.cc @@ -22,10 +22,10 @@ TtSemiLepJetCombMVAComputer::~TtSemiLepJetCombMVAComputer() void TtSemiLepJetCombMVAComputer::produce(edm::Event& evt, const edm::EventSetup& setup) { - std::auto_ptr > > pOut (new std::vector >); - std::auto_ptr > pOutDisc(new std::vector); - std::auto_ptr pOutMeth(new std::string); - std::auto_ptr pJetsConsidered(new int); + std::unique_ptr > > pOut (new std::vector >); + std::unique_ptr > pOutDisc(new std::vector); + std::unique_ptr pOutMeth(new std::string); + std::unique_ptr pJetsConsidered(new int); mvaComputer.update(setup, "ttSemiLepJetCombMVA"); @@ -36,7 +36,7 @@ TtSemiLepJetCombMVAComputer::produce(edm::Event& evt, const edm::EventSetup& set std::vector processors = (calibContainer->find("ttSemiLepJetCombMVA")).getProcessors(); *pOutMeth = ( processors[ processors.size()-3 ] )->getInstanceName(); - evt.put(pOutMeth, "Method"); + evt.put(std::move(pOutMeth), "Method"); // get lepton, jets and mets edm::Handle< edm::View > leptons; @@ -57,11 +57,11 @@ TtSemiLepJetCombMVAComputer::produce(edm::Event& evt, const edm::EventSetup& set for(unsigned int i = 0; i < nPartons; ++i) invalidCombi.push_back( -1 ); pOut->push_back( invalidCombi ); - evt.put(pOut); + evt.put(std::move(pOut)); pOutDisc->push_back( 0. ); - evt.put(pOutDisc, "Discriminators"); + evt.put(std::move(pOutDisc), "Discriminators"); *pJetsConsidered = jets->size(); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); return; } @@ -122,9 +122,9 @@ TtSemiLepJetCombMVAComputer::produce(edm::Event& evt, const edm::EventSetup& set pOutDisc->push_back( discCombPair->first ); iDiscComb++; } - evt.put(pOut); - evt.put(pOutDisc, "Discriminators"); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pOut)); + evt.put(std::move(pOutDisc), "Discriminators"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); } void diff --git a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMaxSumPtWMass.cc b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMaxSumPtWMass.cc index e4e6fff0c4ad5..4d135bc5d8163 100644 --- a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMaxSumPtWMass.cc +++ b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombMaxSumPtWMass.cc @@ -30,8 +30,8 @@ TtSemiLepJetCombMaxSumPtWMass::~TtSemiLepJetCombMaxSumPtWMass() void TtSemiLepJetCombMaxSumPtWMass::produce(edm::Event& evt, const edm::EventSetup& setup) { - std::auto_ptr > > pOut(new std::vector >); - std::auto_ptr pJetsConsidered(new int); + std::unique_ptr > > pOut(new std::vector >); + std::unique_ptr pJetsConsidered(new int); std::vector match; for(unsigned int i = 0; i < 4; ++i) @@ -49,16 +49,16 @@ TtSemiLepJetCombMaxSumPtWMass::produce(edm::Event& evt, const edm::EventSetup& s // skip events without lepton candidate or less than 4 jets or no MET if(leps->empty() || jets->size() < 4){ pOut->push_back( match ); - evt.put(pOut); + evt.put(std::move(pOut)); *pJetsConsidered = jets->size(); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); return; } unsigned maxNJets = maxNJets_; if(maxNJets_ == -1 || (int)jets->size() < maxNJets_) maxNJets = jets->size(); *pJetsConsidered = maxNJets; - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); std::vector isBJet; std::vector isLJet; @@ -160,5 +160,5 @@ TtSemiLepJetCombMaxSumPtWMass::produce(edm::Event& evt, const edm::EventSetup& s match[TtSemiLepEvtPartons::LepB ] = lepB; pOut->push_back( match ); - evt.put(pOut); + evt.put(std::move(pOut)); } diff --git a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombWMassDeltaTopMass.cc b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombWMassDeltaTopMass.cc index 36fe560c1ab61..0c3aac630bdb3 100644 --- a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombWMassDeltaTopMass.cc +++ b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombWMassDeltaTopMass.cc @@ -32,8 +32,8 @@ TtSemiLepJetCombWMassDeltaTopMass::~TtSemiLepJetCombWMassDeltaTopMass() void TtSemiLepJetCombWMassDeltaTopMass::produce(edm::Event& evt, const edm::EventSetup& setup) { - std::auto_ptr > > pOut(new std::vector >); - std::auto_ptr pJetsConsidered(new int); + std::unique_ptr > > pOut(new std::vector >); + std::unique_ptr pJetsConsidered(new int); std::vector match; for(unsigned int i = 0; i < 4; ++i) @@ -54,16 +54,16 @@ TtSemiLepJetCombWMassDeltaTopMass::produce(edm::Event& evt, const edm::EventSetu // skip events without lepton candidate or less than 4 jets or no MET if(leps->empty() || jets->size() < 4 || mets->empty()){ pOut->push_back( match ); - evt.put(pOut); + evt.put(std::move(pOut)); *pJetsConsidered = jets->size(); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); return; } unsigned maxNJets = maxNJets_; if(maxNJets_ == -1 || (int)jets->size() < maxNJets_) maxNJets = jets->size(); *pJetsConsidered = maxNJets; - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); std::vector isBJet; std::vector isLJet; @@ -161,5 +161,5 @@ TtSemiLepJetCombWMassDeltaTopMass::produce(edm::Event& evt, const edm::EventSetu match[TtSemiLepEvtPartons::LepB ] = lepB; pOut->push_back( match ); - evt.put(pOut); + evt.put(std::move(pOut)); } diff --git a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombWMassMaxSumPt.cc b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombWMassMaxSumPt.cc index 2a147732b076a..3f5e5ef75fd73 100644 --- a/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombWMassMaxSumPt.cc +++ b/TopQuarkAnalysis/TopJetCombination/plugins/TtSemiLepJetCombWMassMaxSumPt.cc @@ -28,8 +28,8 @@ TtSemiLepJetCombWMassMaxSumPt::~TtSemiLepJetCombWMassMaxSumPt() void TtSemiLepJetCombWMassMaxSumPt::produce(edm::Event& evt, const edm::EventSetup& setup) { - std::auto_ptr > > pOut(new std::vector >); - std::auto_ptr pJetsConsidered(new int); + std::unique_ptr > > pOut(new std::vector >); + std::unique_ptr pJetsConsidered(new int); std::vector match; for(unsigned int i = 0; i < 4; ++i) @@ -47,16 +47,16 @@ TtSemiLepJetCombWMassMaxSumPt::produce(edm::Event& evt, const edm::EventSetup& s // skip events without lepton candidate or less than 4 jets or no MET if(leps->empty() || jets->size() < 4){ pOut->push_back( match ); - evt.put(pOut); + evt.put(std::move(pOut)); *pJetsConsidered = jets->size(); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); return; } unsigned maxNJets = maxNJets_; if(maxNJets_ == -1 || (int)jets->size() < maxNJets_) maxNJets = jets->size(); *pJetsConsidered = maxNJets; - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); std::vector isBJet; std::vector isLJet; @@ -142,5 +142,5 @@ TtSemiLepJetCombWMassMaxSumPt::produce(edm::Event& evt, const edm::EventSetup& s match[TtSemiLepEvtPartons::LepB ] = lepB; pOut->push_back( match ); - evt.put(pOut); + evt.put(std::move(pOut)); } diff --git a/TopQuarkAnalysis/TopJetCombination/src/TtFullHadHypothesis.cc b/TopQuarkAnalysis/TopJetCombination/src/TtFullHadHypothesis.cc index 291542eb0a1b4..ca3c6c59a599d 100644 --- a/TopQuarkAnalysis/TopJetCombination/src/TtFullHadHypothesis.cc +++ b/TopQuarkAnalysis/TopJetCombination/src/TtFullHadHypothesis.cc @@ -49,10 +49,10 @@ TtFullHadHypothesis::produce(edm::Event& evt, const edm::EventSetup& setup) matchVec.push_back( dummyMatch ); } - // declare auto_ptr for products - std::auto_ptr > > > + // declare unique_ptr for products + std::unique_ptr > > > pOut( new std::vector > > ); - std::auto_ptr pKey(new int); + std::unique_ptr pKey(new int); // go through given vector of jet combinations unsigned int idMatch = 0; @@ -65,12 +65,12 @@ TtFullHadHypothesis::produce(edm::Event& evt, const edm::EventSetup& setup) pOut->push_back( std::make_pair(hypo(), *match) ); } // feed out hyps and matches - evt.put(pOut); + evt.put(std::move(pOut)); // build and feed out key buildKey(); *pKey=key(); - evt.put(pKey, "Key"); + evt.put(std::move(pKey), "Key"); } /// reset candidate pointers before hypo build process diff --git a/TopQuarkAnalysis/TopJetCombination/src/TtFullLepHypothesis.cc b/TopQuarkAnalysis/TopJetCombination/src/TtFullLepHypothesis.cc index 93731ba715243..ecc9126b74f40 100644 --- a/TopQuarkAnalysis/TopJetCombination/src/TtFullLepHypothesis.cc +++ b/TopQuarkAnalysis/TopJetCombination/src/TtFullLepHypothesis.cc @@ -69,15 +69,15 @@ TtFullLepHypothesis::produce(edm::Event& evt, const edm::EventSetup& setup) matchVec.push_back( dummyMatch ); } - // declare auto_ptr for products - std::auto_ptr > > > + // declare unique_ptr for products + std::unique_ptr > > > pOut( new std::vector > > ); - std::auto_ptr pKey(new int); + std::unique_ptr pKey(new int); // build and feed out key buildKey(); *pKey=key(); - evt.put(pKey, "Key"); + evt.put(std::move(pKey), "Key"); // go through given vector of jet combinations unsigned int idMatch = 0; @@ -90,7 +90,7 @@ TtFullLepHypothesis::produce(edm::Event& evt, const edm::EventSetup& setup) pOut->push_back( std::make_pair(hypo(), *match) ); } // feed out hyps and matches - evt.put(pOut); + evt.put(std::move(pOut)); } /// reset candidate pointers before hypo build process diff --git a/TopQuarkAnalysis/TopJetCombination/src/TtSemiLepHypothesis.cc b/TopQuarkAnalysis/TopJetCombination/src/TtSemiLepHypothesis.cc index a35355505c3a1..e22fb25d91d74 100644 --- a/TopQuarkAnalysis/TopJetCombination/src/TtSemiLepHypothesis.cc +++ b/TopQuarkAnalysis/TopJetCombination/src/TtSemiLepHypothesis.cc @@ -74,12 +74,12 @@ TtSemiLepHypothesis::produce(edm::Event& evt, const edm::EventSetup& setup) matchVec.push_back( dummyMatch ); } - // declare auto_ptr for products - std::auto_ptr > > > + // declare unique_ptr for products + std::unique_ptr > > > pOut( new std::vector > > ); - std::auto_ptr pKey(new int); - std::auto_ptr pNeutrinoSolutions(new int); - std::auto_ptr pJetsConsidered(new int); + std::unique_ptr pKey(new int); + std::unique_ptr pNeutrinoSolutions(new int); + std::unique_ptr pJetsConsidered(new int); // go through given vector of jet combinations unsigned int idMatch = 0; @@ -92,20 +92,20 @@ TtSemiLepHypothesis::produce(edm::Event& evt, const edm::EventSetup& setup) pOut->push_back( std::make_pair(hypo(), *match) ); } // feed out hyps and matches - evt.put(pOut); + evt.put(std::move(pOut)); // build and feed out key buildKey(); *pKey=key(); - evt.put(pKey, "Key"); + evt.put(std::move(pKey), "Key"); // feed out number of real neutrino solutions *pNeutrinoSolutions=numberOfRealNeutrinoSolutions_; - evt.put(pNeutrinoSolutions, "NumberOfRealNeutrinoSolutions"); + evt.put(std::move(pNeutrinoSolutions), "NumberOfRealNeutrinoSolutions"); // feed out number of considered jets *pJetsConsidered=*nJetsConsidered; - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); } /// reset candidate pointers before hypo build process diff --git a/TopQuarkAnalysis/TopKinFitter/plugins/TtFullHadKinFitProducer.cc b/TopQuarkAnalysis/TopKinFitter/plugins/TtFullHadKinFitProducer.cc index 184aa54e6b895..6917b6554f5fa 100644 --- a/TopQuarkAnalysis/TopKinFitter/plugins/TtFullHadKinFitProducer.cc +++ b/TopQuarkAnalysis/TopKinFitter/plugins/TtFullHadKinFitProducer.cc @@ -99,17 +99,17 @@ TtFullHadKinFitProducer::produce(edm::Event& event, const edm::EventSetup& setup std::list fitResults = kinFitter->fit(*jets); // pointer for output collections - std::auto_ptr< std::vector > pPartonsB( new std::vector ); - std::auto_ptr< std::vector > pPartonsBBar( new std::vector ); - std::auto_ptr< std::vector > pPartonsLightQ ( new std::vector ); - std::auto_ptr< std::vector > pPartonsLightQBar( new std::vector ); - std::auto_ptr< std::vector > pPartonsLightP ( new std::vector ); - std::auto_ptr< std::vector > pPartonsLightPBar( new std::vector ); + std::unique_ptr< std::vector > pPartonsB( new std::vector ); + std::unique_ptr< std::vector > pPartonsBBar( new std::vector ); + std::unique_ptr< std::vector > pPartonsLightQ ( new std::vector ); + std::unique_ptr< std::vector > pPartonsLightQBar( new std::vector ); + std::unique_ptr< std::vector > pPartonsLightP ( new std::vector ); + std::unique_ptr< std::vector > pPartonsLightPBar( new std::vector ); // pointer for meta information - std::auto_ptr< std::vector > > pCombi ( new std::vector > ); - std::auto_ptr< std::vector > pChi2 ( new std::vector ); - std::auto_ptr< std::vector > pProb ( new std::vector ); - std::auto_ptr< std::vector > pStatus( new std::vector ); + std::unique_ptr< std::vector > > pCombi ( new std::vector > ); + std::unique_ptr< std::vector > pChi2 ( new std::vector ); + std::unique_ptr< std::vector > pProb ( new std::vector ); + std::unique_ptr< std::vector > pStatus( new std::vector ); unsigned int iComb = 0; for(std::list::const_iterator res = fitResults.begin(); res != fitResults.end(); ++res){ @@ -132,16 +132,16 @@ TtFullHadKinFitProducer::produce(edm::Event& event, const edm::EventSetup& setup } - event.put(pCombi); - event.put(pPartonsB , "PartonsB" ); - event.put(pPartonsBBar , "PartonsBBar" ); - event.put(pPartonsLightQ , "PartonsLightQ" ); - event.put(pPartonsLightQBar, "PartonsLightQBar"); - event.put(pPartonsLightP , "PartonsLightP" ); - event.put(pPartonsLightPBar, "PartonsLightPBar"); - event.put(pChi2 , "Chi2" ); - event.put(pProb , "Prob" ); - event.put(pStatus , "Status" ); + event.put(std::move(pCombi)); + event.put(std::move(pPartonsB ), "PartonsB" ); + event.put(std::move(pPartonsBBar ), "PartonsBBar" ); + event.put(std::move(pPartonsLightQ ), "PartonsLightQ" ); + event.put(std::move(pPartonsLightQBar), "PartonsLightQBar"); + event.put(std::move(pPartonsLightP ), "PartonsLightP" ); + event.put(std::move(pPartonsLightPBar), "PartonsLightPBar"); + event.put(std::move(pChi2 ), "Chi2" ); + event.put(std::move(pProb ), "Prob" ); + event.put(std::move(pStatus ), "Status" ); } #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/TopQuarkAnalysis/TopKinFitter/plugins/TtFullLepKinSolutionProducer.h b/TopQuarkAnalysis/TopKinFitter/plugins/TtFullLepKinSolutionProducer.h index 7bab7074f781d..24e856b96983a 100644 --- a/TopQuarkAnalysis/TopKinFitter/plugins/TtFullLepKinSolutionProducer.h +++ b/TopQuarkAnalysis/TopKinFitter/plugins/TtFullLepKinSolutionProducer.h @@ -120,11 +120,11 @@ void TtFullLepKinSolutionProducer::produce(edm::Event & evt, const edm::EventSet std::vector > weightsV; //create pointer for products - std::auto_ptr > > pIdcs(new std::vector >); - std::auto_ptr > pNus(new std::vector); - std::auto_ptr > pNuBars(new std::vector); - std::auto_ptr > pWeight(new std::vector); - std::auto_ptr pWrongCharge(new bool); + std::unique_ptr > > pIdcs(new std::vector >); + std::unique_ptr > pNus(new std::vector); + std::unique_ptr > pNuBars(new std::vector); + std::unique_ptr > pWeight(new std::vector); + std::unique_ptr pWrongCharge(new bool); edm::Handle > jets; evt.getByToken(jetsToken_, jets); @@ -459,11 +459,11 @@ void TtFullLepKinSolutionProducer::produce(edm::Event & evt, const edm::EventSet } // put the results in the event - evt.put(pIdcs); - evt.put(pNus, "fullLepNeutrinos"); - evt.put(pNuBars, "fullLepNeutrinoBars"); - evt.put(pWeight, "solWeight"); - evt.put(pWrongCharge, "isWrongCharge"); + evt.put(std::move(pIdcs)); + evt.put(std::move(pNus), "fullLepNeutrinos"); + evt.put(std::move(pNuBars), "fullLepNeutrinoBars"); + evt.put(std::move(pWeight), "solWeight"); + evt.put(std::move(pWrongCharge), "isWrongCharge"); } #endif diff --git a/TopQuarkAnalysis/TopKinFitter/plugins/TtSemiLepKinFitProducer.h b/TopQuarkAnalysis/TopKinFitter/plugins/TtSemiLepKinFitProducer.h index 7a23aa5dec064..004707743b545 100644 --- a/TopQuarkAnalysis/TopKinFitter/plugins/TtSemiLepKinFitProducer.h +++ b/TopQuarkAnalysis/TopKinFitter/plugins/TtSemiLepKinFitProducer.h @@ -173,19 +173,19 @@ bool TtSemiLepKinFitProducer::doBTagging(bool& useBTag_, edm:: template void TtSemiLepKinFitProducer::produce(edm::Event& evt, const edm::EventSetup& setup) { - std::auto_ptr< std::vector > pPartonsHadP( new std::vector ); - std::auto_ptr< std::vector > pPartonsHadQ( new std::vector ); - std::auto_ptr< std::vector > pPartonsHadB( new std::vector ); - std::auto_ptr< std::vector > pPartonsLepB( new std::vector ); - std::auto_ptr< std::vector > pLeptons ( new std::vector ); - std::auto_ptr< std::vector > pNeutrinos ( new std::vector ); + std::unique_ptr< std::vector > pPartonsHadP( new std::vector ); + std::unique_ptr< std::vector > pPartonsHadQ( new std::vector ); + std::unique_ptr< std::vector > pPartonsHadB( new std::vector ); + std::unique_ptr< std::vector > pPartonsLepB( new std::vector ); + std::unique_ptr< std::vector > pLeptons ( new std::vector ); + std::unique_ptr< std::vector > pNeutrinos ( new std::vector ); - std::auto_ptr< std::vector > > pCombi ( new std::vector > ); - std::auto_ptr< std::vector > pChi2 ( new std::vector ); - std::auto_ptr< std::vector > pProb ( new std::vector ); - std::auto_ptr< std::vector > pStatus( new std::vector ); + std::unique_ptr< std::vector > > pCombi ( new std::vector > ); + std::unique_ptr< std::vector > pChi2 ( new std::vector ); + std::unique_ptr< std::vector > pProb ( new std::vector ); + std::unique_ptr< std::vector > pStatus( new std::vector ); - std::auto_ptr pJetsConsidered(new int); + std::unique_ptr pJetsConsidered(new int); edm::Handle > jets; evt.getByToken(jetsToken_, jets); @@ -244,17 +244,17 @@ void TtSemiLepKinFitProducer::produce(edm::Event& evt, const e // number of jets *pJetsConsidered = jets->size(); // feed out all products - evt.put(pCombi); - evt.put(pPartonsHadP, "PartonsHadP"); - evt.put(pPartonsHadQ, "PartonsHadQ"); - evt.put(pPartonsHadB, "PartonsHadB"); - evt.put(pPartonsLepB, "PartonsLepB"); - evt.put(pLeptons , "Leptons" ); - evt.put(pNeutrinos , "Neutrinos" ); - evt.put(pChi2 , "Chi2" ); - evt.put(pProb , "Prob" ); - evt.put(pStatus , "Status" ); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pCombi)); + evt.put(std::move(pPartonsHadP), "PartonsHadP"); + evt.put(std::move(pPartonsHadQ), "PartonsHadQ"); + evt.put(std::move(pPartonsHadB), "PartonsHadB"); + evt.put(std::move(pPartonsLepB), "PartonsLepB"); + evt.put(std::move(pLeptons ), "Leptons" ); + evt.put(std::move(pNeutrinos ), "Neutrinos" ); + evt.put(std::move(pChi2 ), "Chi2" ); + evt.put(std::move(pProb ), "Prob" ); + evt.put(std::move(pStatus ), "Status" ); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); return; } @@ -374,17 +374,17 @@ void TtSemiLepKinFitProducer::produce(edm::Event& evt, const e pStatus->push_back( result->Status ); } } - evt.put(pCombi); - evt.put(pPartonsHadP, "PartonsHadP"); - evt.put(pPartonsHadQ, "PartonsHadQ"); - evt.put(pPartonsHadB, "PartonsHadB"); - evt.put(pPartonsLepB, "PartonsLepB"); - evt.put(pLeptons , "Leptons" ); - evt.put(pNeutrinos , "Neutrinos" ); - evt.put(pChi2 , "Chi2" ); - evt.put(pProb , "Prob" ); - evt.put(pStatus , "Status" ); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(pCombi)); + evt.put(std::move(pPartonsHadP), "PartonsHadP"); + evt.put(std::move(pPartonsHadQ), "PartonsHadQ"); + evt.put(std::move(pPartonsHadB), "PartonsHadB"); + evt.put(std::move(pPartonsLepB), "PartonsLepB"); + evt.put(std::move(pLeptons ), "Leptons" ); + evt.put(std::move(pNeutrinos ), "Neutrinos" ); + evt.put(std::move(pChi2 ), "Chi2" ); + evt.put(std::move(pProb ), "Prob" ); + evt.put(std::move(pStatus ), "Status" ); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); } template diff --git a/TopQuarkAnalysis/TopPairBSM/src/BoostedTopProducer.cc b/TopQuarkAnalysis/TopPairBSM/src/BoostedTopProducer.cc index 2abe1a846be48..4097293faa1e4 100644 --- a/TopQuarkAnalysis/TopPairBSM/src/BoostedTopProducer.cc +++ b/TopQuarkAnalysis/TopPairBSM/src/BoostedTopProducer.cc @@ -364,8 +364,8 @@ BoostedTopProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) if ( debug ) cout << "Writing out" << endl; ttbarList.push_back( ttbar ); } - std::auto_ptr > pTtbar ( new std::vector(ttbarList) ); - iEvent.put( pTtbar ); + std::unique_ptr > pTtbar ( new std::vector(ttbarList) ); + iEvent.put(std::move(pTtbar)); } diff --git a/TopQuarkAnalysis/TopTools/plugins/GenTtbarCategorizer.cc b/TopQuarkAnalysis/TopTools/plugins/GenTtbarCategorizer.cc index ef7a56f83fafc..d0b78cb7f9ab2 100644 --- a/TopQuarkAnalysis/TopTools/plugins/GenTtbarCategorizer.cc +++ b/TopQuarkAnalysis/TopTools/plugins/GenTtbarCategorizer.cc @@ -353,9 +353,9 @@ GenTtbarCategorizer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) } } - std::auto_ptr ttbarId(new int); + std::unique_ptr ttbarId(new int); *ttbarId = additionalJetEventId; - iEvent.put(ttbarId, "genTtbarId"); + iEvent.put(std::move(ttbarId), "genTtbarId"); } // ------------ method called once each job just before starting event loop ------------ diff --git a/TopQuarkAnalysis/TopTools/plugins/MuonSelectorVertex.cc b/TopQuarkAnalysis/TopTools/plugins/MuonSelectorVertex.cc index e926f59655d68..af3c706fd1e8e 100644 --- a/TopQuarkAnalysis/TopTools/plugins/MuonSelectorVertex.cc +++ b/TopQuarkAnalysis/TopTools/plugins/MuonSelectorVertex.cc @@ -63,8 +63,8 @@ void MuonSelectorVertex::produce( edm::Event & iEvent, const edm::EventSetup & i } } - std::auto_ptr< std::vector< pat::Muon > > selectedMuonsPtr( selectedMuons ); - iEvent.put( selectedMuonsPtr ); + std::unique_ptr< std::vector< pat::Muon > > selectedMuonsPtr( selectedMuons ); + iEvent.put(std::move(selectedMuonsPtr)); } diff --git a/TopQuarkAnalysis/TopTools/plugins/TtJetPartonMatch.h b/TopQuarkAnalysis/TopTools/plugins/TtJetPartonMatch.h index 96e9fad2f5002..9089a12416b53 100644 --- a/TopQuarkAnalysis/TopTools/plugins/TtJetPartonMatch.h +++ b/TopQuarkAnalysis/TopTools/plugins/TtJetPartonMatch.h @@ -121,10 +121,10 @@ TtJetPartonMatch::produce(edm::Event& evt, const edm::EventSetup& setup) // * sumPt // * sumDR // to the event - std::auto_ptr > > match(new std::vector >); - std::auto_ptr > sumPt(new std::vector); - std::auto_ptr > sumDR(new std::vector); - std::auto_ptr pJetsConsidered(new int); + std::unique_ptr > > match(new std::vector >); + std::unique_ptr > sumPt(new std::vector); + std::unique_ptr > sumDR(new std::vector); + std::unique_ptr pJetsConsidered(new int); // get TtGenEvent and jet collection from the event edm::Handle genEvt; @@ -174,10 +174,10 @@ TtJetPartonMatch::produce(edm::Event& evt, const edm::EventSetup& setup) sumPt->push_back( jetPartonMatch.getSumDeltaPt(ic) ); sumDR->push_back( jetPartonMatch.getSumDeltaR (ic) ); } - evt.put(match); - evt.put(sumPt, "SumPt"); - evt.put(sumDR, "SumDR"); - evt.put(pJetsConsidered, "NumberOfConsideredJets"); + evt.put(std::move(match)); + evt.put(std::move(sumPt), "SumPt"); + evt.put(std::move(sumDR), "SumDR"); + evt.put(std::move(pJetsConsidered), "NumberOfConsideredJets"); } template