diff --git a/RecoEcal/EgammaClusterAlgos/interface/PFECALSuperClusterAlgo.h b/RecoEcal/EgammaClusterAlgos/interface/PFECALSuperClusterAlgo.h index 2235d7a7554e4..c37ce6a4be1fe 100644 --- a/RecoEcal/EgammaClusterAlgos/interface/PFECALSuperClusterAlgo.h +++ b/RecoEcal/EgammaClusterAlgos/interface/PFECALSuperClusterAlgo.h @@ -115,9 +115,9 @@ class PFECALSuperClusterAlgo { void update(const edm::EventSetup&); - std::auto_ptr& + std::unique_ptr& getEBOutputSCCollection() { return superClustersEB_; } - std::auto_ptr& + std::unique_ptr& getEEOutputSCCollection() { return superClustersEE_; } void loadAndSortPFClusters(const edm::Event &evt); @@ -135,8 +135,8 @@ class PFECALSuperClusterAlgo { CalibratedClusterPtrVector _clustersEB; CalibratedClusterPtrVector _clustersEE; - std::auto_ptr superClustersEB_; - std::auto_ptr superClustersEE_; + std::unique_ptr superClustersEB_; + std::unique_ptr superClustersEE_; const reco::PFCluster::EEtoPSAssociation* EEtoPS_; std::shared_ptr _pfEnergyCalibration; clustering_type _clustype; diff --git a/RecoEcal/EgammaClusterAlgos/src/PFECALSuperClusterAlgo.cc b/RecoEcal/EgammaClusterAlgos/src/PFECALSuperClusterAlgo.cc index ad7e4e8a83793..a16544bcb19aa 100644 --- a/RecoEcal/EgammaClusterAlgos/src/PFECALSuperClusterAlgo.cc +++ b/RecoEcal/EgammaClusterAlgos/src/PFECALSuperClusterAlgo.cc @@ -240,9 +240,9 @@ loadAndSortPFClusters(const edm::Event &iEvent) { } // reset the system for running - superClustersEB_.reset(new reco::SuperClusterCollection); + superClustersEB_ = std::make_unique(); _clustersEB.clear(); - superClustersEE_.reset(new reco::SuperClusterCollection); + superClustersEE_ = std::make_unique(); _clustersEE.clear(); EEtoPS_ = &psclusters; diff --git a/RecoEcal/EgammaClusterProducers/src/CleanAndMergeProducer.cc b/RecoEcal/EgammaClusterProducers/src/CleanAndMergeProducer.cc index 54606b2ff33e4..9e3fcf772e0d1 100644 --- a/RecoEcal/EgammaClusterProducers/src/CleanAndMergeProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/CleanAndMergeProducer.cc @@ -166,10 +166,10 @@ void CleanAndMergeProducer::produce(edm::Event& evt, // now you have the collection of basic clusters of the SC to be remain in the // in the clean collection, export them to the event // you will need to reread them later in order to make correctly the refs to the SC - std::auto_ptr< reco::BasicClusterCollection> basicClusters_p(new reco::BasicClusterCollection); + auto basicClusters_p = std::make_unique(); basicClusters_p->assign(basicClusters.begin(), basicClusters.end()); edm::OrphanHandle bccHandle = - evt.put(basicClusters_p, bcCollection_); + evt.put(std::move(basicClusters_p), bcCollection_); if (!(bccHandle.isValid())) { edm::LogWarning("MissingInput")<<"could not get a handle on the BasicClusterCollection!" << std::endl; return; @@ -201,13 +201,13 @@ void CleanAndMergeProducer::produce(edm::Event& evt, } // export the collection of references to the clean collection - std::auto_ptr< reco::SuperClusterRefVector > scRefs_p( scRefs ); - evt.put(scRefs_p, refScCollection_); + std::unique_ptr scRefs_p(scRefs); + evt.put(std::move(scRefs_p), refScCollection_); // the collection of basic clusters is already in the event // the collection of uncleaned SC - std::auto_ptr< reco::SuperClusterCollection > superClusters_p(new reco::SuperClusterCollection); + auto superClusters_p = std::make_unique(); superClusters_p->assign(superClusters.begin(), superClusters.end()); - evt.put(superClusters_p, scCollection_); + evt.put(std::move(superClusters_p), scCollection_); LogDebug("EcalCleaning")<< "Hybrid Clusters (Basic/Super) added to the Event! :-)"; } diff --git a/RecoEcal/EgammaClusterProducers/src/CosmicClusterProducer.cc b/RecoEcal/EgammaClusterProducers/src/CosmicClusterProducer.cc index 9214b74da9a4f..6030e81999fa9 100644 --- a/RecoEcal/EgammaClusterProducers/src/CosmicClusterProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/CosmicClusterProducer.cc @@ -166,33 +166,32 @@ void CosmicClusterProducer::clusterizeECALPart(edm::Event &evt, const edm::Event } //Put clustershapes in event, but retain a Handle on them. - std::auto_ptr< reco::ClusterShapeCollection> clustersshapes_p(new reco::ClusterShapeCollection); + auto clustersshapes_p = std::make_unique(); clustersshapes_p->assign(ClusVec.begin(), ClusVec.end()); edm::OrphanHandle clusHandle; if (ecalPart == CosmicClusterAlgo::barrel) - clusHandle= evt.put(clustersshapes_p, clustershapecollectionEB_); + clusHandle= evt.put(std::move(clustersshapes_p), clustershapecollectionEB_); else - clusHandle= evt.put(clustersshapes_p, clustershapecollectionEE_); + clusHandle= evt.put(std::move(clustersshapes_p), clustershapecollectionEE_); - // create an auto_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event: - std::auto_ptr< reco::BasicClusterCollection > clusters_p(new reco::BasicClusterCollection); + // create a unique_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event: + auto clusters_p = std::make_unique(); clusters_p->assign(clusters.begin(), clusters.end()); edm::OrphanHandle bccHandle; if (ecalPart == CosmicClusterAlgo::barrel) - bccHandle = evt.put(clusters_p, barrelClusterCollection_); + bccHandle = evt.put(std::move(clusters_p), barrelClusterCollection_); else - bccHandle = evt.put(clusters_p, endcapClusterCollection_); + bccHandle = evt.put(std::move(clusters_p), endcapClusterCollection_); // BasicClusterShapeAssociationMap - std::auto_ptr shapeAssocs_p( - new reco::BasicClusterShapeAssociationCollection(bccHandle, clusHandle)); + auto shapeAssocs_p = std::make_unique(bccHandle, clusHandle); for (unsigned int i = 0; i < clusHandle->size(); i++){ shapeAssocs_p->insert(edm::Ref(bccHandle,i),edm::Ref(clusHandle,i)); } - evt.put(shapeAssocs_p,clusterShapeAssociation); + evt.put(std::move(shapeAssocs_p),clusterShapeAssociation); delete topology_p; } diff --git a/RecoEcal/EgammaClusterProducers/src/EcalDigiSelector.cc b/RecoEcal/EgammaClusterProducers/src/EcalDigiSelector.cc index 0081f09f9cb0e..2727ecc1ee05f 100644 --- a/RecoEcal/EgammaClusterProducers/src/EcalDigiSelector.cc +++ b/RecoEcal/EgammaClusterProducers/src/EcalDigiSelector.cc @@ -101,8 +101,8 @@ void EcalDigiSelector::produce(edm::Event& evt, const edm::EventSetup& es) } } - std::auto_ptr SEBDigiCol(new EBDigiCollection); - std::auto_ptr SEEDigiCol(new EEDigiCollection); + auto SEBDigiCol = std::make_unique(); + auto SEEDigiCol = std::make_unique(); int TotClus = saveBarrelSuperClusters.size() + saveEndcapSuperClusters.size(); if (TotClus >= nclus_sel_ || meet_single_thresh){ @@ -235,7 +235,7 @@ void EcalDigiSelector::produce(edm::Event& evt, const edm::EventSetup& es) //Empty collection, or full, still put in event. SEBDigiCol->sort(); SEEDigiCol->sort(); - evt.put(SEBDigiCol, selectedEcalEBDigiCollection_); - evt.put(SEEDigiCol, selectedEcalEEDigiCollection_); + evt.put(std::move(SEBDigiCol), selectedEcalEBDigiCollection_); + evt.put(std::move(SEEDigiCol), selectedEcalEEDigiCollection_); } diff --git a/RecoEcal/EgammaClusterProducers/src/EgammaSCCorrectionMaker.cc b/RecoEcal/EgammaClusterProducers/src/EgammaSCCorrectionMaker.cc index 964b7c838a3d5..2b1dbd994668f 100644 --- a/RecoEcal/EgammaClusterProducers/src/EgammaSCCorrectionMaker.cc +++ b/RecoEcal/EgammaClusterProducers/src/EgammaSCCorrectionMaker.cc @@ -157,7 +157,7 @@ EgammaSCCorrectionMaker::produce(edm::Event& evt, const edm::EventSetup& es) const reco::SuperClusterCollection *rawClusters = pRawSuperClusters.product(); // Define a collection of corrected SuperClusters to put back into the event - std::auto_ptr corrClusters(new reco::SuperClusterCollection); + auto corrClusters = std::make_unique(); // Loop over raw clusters and make corrected ones reco::SuperClusterCollection::const_iterator aClus; @@ -193,7 +193,7 @@ EgammaSCCorrectionMaker::produce(edm::Event& evt, const edm::EventSetup& es) } // Put collection of corrected SuperClusters into the event - evt.put(corrClusters, outputCollection_); + evt.put(std::move(corrClusters), outputCollection_); } diff --git a/RecoEcal/EgammaClusterProducers/src/HybridClusterProducer.cc b/RecoEcal/EgammaClusterProducers/src/HybridClusterProducer.cc index b1a6cb864d79d..2a5569b1b48e6 100644 --- a/RecoEcal/EgammaClusterProducers/src/HybridClusterProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/HybridClusterProducer.cc @@ -117,13 +117,13 @@ void HybridClusterProducer::produce(edm::Event& evt, const edm::EventSetup& es) es.get().get(geoHandle); const CaloGeometry& geometry = *geoHandle; const CaloSubdetectorGeometry *geometry_p; - std::auto_ptr topology; + std::unique_ptr topology; edm::ESHandle sevLv; es.get().get(sevLv); geometry_p = geometry.getSubdetectorGeometry(DetId::Ecal, EcalBarrel); - topology.reset(new EcalBarrelTopology(geoHandle)); + topology = std::make_unique(geoHandle); // make the Basic clusters! reco::BasicClusterCollection basicClusters; @@ -132,10 +132,10 @@ void HybridClusterProducer::produce(edm::Event& evt, const edm::EventSetup& es) LogTrace("EcalClusters") << "Finished clustering - BasicClusterCollection returned to producer..." ; - // create an auto_ptr to a BasicClusterCollection, copy the clusters into it and put in the Event: - std::auto_ptr< reco::BasicClusterCollection > basicclusters_p(new reco::BasicClusterCollection); + // create a unique_ptr to a BasicClusterCollection, copy the clusters into it and put in the Event: + auto basicclusters_p = std::make_unique(); basicclusters_p->assign(basicClusters.begin(), basicClusters.end()); - edm::OrphanHandle bccHandle = evt.put(basicclusters_p,basicclusterCollection_); + edm::OrphanHandle bccHandle = evt.put(std::move(basicclusters_p),basicclusterCollection_); //Basic clusters now in the event. LogTrace("EcalClusters") << "Basic Clusters now put into event." ; @@ -161,10 +161,10 @@ void HybridClusterProducer::produce(edm::Event& evt, const edm::EventSetup& es) reco::SuperClusterCollection superClusters = hybrid_p->makeSuperClusters(clusterPtrVector); LogTrace("EcalClusters") << "Found: " << superClusters.size() << " superclusters." ; - std::auto_ptr< reco::SuperClusterCollection > superclusters_p(new reco::SuperClusterCollection); + auto superclusters_p = std::make_unique(); superclusters_p->assign(superClusters.begin(), superClusters.end()); - evt.put(superclusters_p, superclusterCollection_); + evt.put(std::move(superclusters_p), superclusterCollection_); LogTrace("EcalClusters") << "Hybrid Clusters (Basic/Super) added to the Event! :-)" ; diff --git a/RecoEcal/EgammaClusterProducers/src/InterestingDetIdCollectionProducer.cc b/RecoEcal/EgammaClusterProducers/src/InterestingDetIdCollectionProducer.cc index a1cb43ad756c9..a41d4679d5cb7 100644 --- a/RecoEcal/EgammaClusterProducers/src/InterestingDetIdCollectionProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/InterestingDetIdCollectionProducer.cc @@ -159,9 +159,7 @@ InterestingDetIdCollectionProducer::produce (edm::Event& iEvent, std::sort(indexToStore.begin(),indexToStore.end()); std::unique(indexToStore.begin(),indexToStore.end()); - std::auto_ptr< DetIdCollection > detIdCollection (new DetIdCollection(indexToStore) ) ; - - iEvent.put( detIdCollection, interestingDetIdCollection_ ); + iEvent.put(std::make_unique(indexToStore), interestingDetIdCollection_); } diff --git a/RecoEcal/EgammaClusterProducers/src/InterestingDetIdFromSuperClusterProducer.cc b/RecoEcal/EgammaClusterProducers/src/InterestingDetIdFromSuperClusterProducer.cc index 62c2d992f7fc6..a0e5c4c6d3614 100644 --- a/RecoEcal/EgammaClusterProducers/src/InterestingDetIdFromSuperClusterProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/InterestingDetIdFromSuperClusterProducer.cc @@ -161,9 +161,9 @@ InterestingDetIdFromSuperClusterProducer::produce (edm::Event& iEvent, std::sort(indexToStore.begin(),indexToStore.end()); std::unique(indexToStore.begin(),indexToStore.end()); - std::auto_ptr< DetIdCollection > detIdCollection (new DetIdCollection(indexToStore) ) ; + auto detIdCollection = std::make_unique(indexToStore); - iEvent.put( detIdCollection, interestingDetIdCollection_ ); + iEvent.put(std::move(detIdCollection), interestingDetIdCollection_ ); } diff --git a/RecoEcal/EgammaClusterProducers/src/InterestingTrackEcalDetIdProducer.cc b/RecoEcal/EgammaClusterProducers/src/InterestingTrackEcalDetIdProducer.cc index 4a930d2f7214d..e45a340939ce2 100644 --- a/RecoEcal/EgammaClusterProducers/src/InterestingTrackEcalDetIdProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/InterestingTrackEcalDetIdProducer.cc @@ -117,7 +117,7 @@ InterestingTrackEcalDetIdProducer::produce(edm::Event& iEvent, const edm::EventS { using namespace edm; - std::auto_ptr< DetIdCollection > interestingDetIdCollection( new DetIdCollection() ) ; + auto interestingDetIdCollection = std::make_unique(); // Get tracks from event edm::Handle tracks; @@ -150,7 +150,7 @@ InterestingTrackEcalDetIdProducer::produce(edm::Event& iEvent, const edm::EventS } - iEvent.put(interestingDetIdCollection); + iEvent.put(std::move(interestingDetIdCollection)); } diff --git a/RecoEcal/EgammaClusterProducers/src/IslandClusterProducer.cc b/RecoEcal/EgammaClusterProducers/src/IslandClusterProducer.cc index 1b71fca223bb3..8962fb8d055d2 100644 --- a/RecoEcal/EgammaClusterProducers/src/IslandClusterProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/IslandClusterProducer.cc @@ -150,30 +150,30 @@ void IslandClusterProducer::clusterizeECALPart(edm::Event &evt, const edm::Event } //Put clustershapes in event, but retain a Handle on them. - std::auto_ptr< reco::ClusterShapeCollection> clustersshapes_p(new reco::ClusterShapeCollection); + auto clustersshapes_p = std::make_unique(); clustersshapes_p->assign(ClusVec.begin(), ClusVec.end()); edm::OrphanHandle clusHandle; if (ecalPart == IslandClusterAlgo::barrel) - clusHandle= evt.put(clustersshapes_p, clustershapecollectionEB_); + clusHandle= evt.put(std::move(clustersshapes_p), clustershapecollectionEB_); else - clusHandle= evt.put(clustersshapes_p, clustershapecollectionEE_); + clusHandle= evt.put(std::move(clustersshapes_p), clustershapecollectionEE_); - // create an auto_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event: - std::auto_ptr< reco::BasicClusterCollection > clusters_p(new reco::BasicClusterCollection); + // create a unique_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event: + auto clusters_p = std::make_unique(); clusters_p->assign(clusters.begin(), clusters.end()); edm::OrphanHandle bccHandle; if (ecalPart == IslandClusterAlgo::barrel) - bccHandle = evt.put(clusters_p, barrelClusterCollection_); + bccHandle = evt.put(std::move(clusters_p), barrelClusterCollection_); else - bccHandle = evt.put(clusters_p, endcapClusterCollection_); + bccHandle = evt.put(std::move(clusters_p), endcapClusterCollection_); // BasicClusterShapeAssociationMap - std::auto_ptr shapeAssocs_p(new reco::BasicClusterShapeAssociationCollection(bccHandle, clusHandle)); + auto shapeAssocs_p = std::make_unique(bccHandle, clusHandle); for (unsigned int i = 0; i < clusHandle->size(); i++){ shapeAssocs_p->insert(edm::Ref(bccHandle,i),edm::Ref(clusHandle,i)); } - evt.put(shapeAssocs_p,clusterShapeAssociation); + evt.put(std::move(shapeAssocs_p),clusterShapeAssociation); delete topology_p; } diff --git a/RecoEcal/EgammaClusterProducers/src/Multi5x5ClusterProducer.cc b/RecoEcal/EgammaClusterProducers/src/Multi5x5ClusterProducer.cc index ef05ab33ad71d..0748a99f748f1 100644 --- a/RecoEcal/EgammaClusterProducers/src/Multi5x5ClusterProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/Multi5x5ClusterProducer.cc @@ -145,14 +145,14 @@ void Multi5x5ClusterProducer::clusterizeECALPart(edm::Event &evt, const edm::Eve reco::BasicClusterCollection clusters; clusters = island_p->makeClusters(hitCollection_p, geometry_p, topology_p, geometryES_p, detector); - // create an auto_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event: - std::auto_ptr< reco::BasicClusterCollection > clusters_p(new reco::BasicClusterCollection); + // create a unique_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event: + auto clusters_p = std::make_unique(); clusters_p->assign(clusters.begin(), clusters.end()); edm::OrphanHandle bccHandle; if (detector == reco::CaloID::DET_ECAL_BARREL) - bccHandle = evt.put(clusters_p, barrelClusterCollection_); + bccHandle = evt.put(std::move(clusters_p), barrelClusterCollection_); else - bccHandle = evt.put(clusters_p, endcapClusterCollection_); + bccHandle = evt.put(std::move(clusters_p), endcapClusterCollection_); delete topology_p; } diff --git a/RecoEcal/EgammaClusterProducers/src/Multi5x5SuperClusterProducer.cc b/RecoEcal/EgammaClusterProducers/src/Multi5x5SuperClusterProducer.cc index eea509d9bf6aa..4101b80bfec51 100644 --- a/RecoEcal/EgammaClusterProducers/src/Multi5x5SuperClusterProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/Multi5x5SuperClusterProducer.cc @@ -101,8 +101,7 @@ produceSuperclustersForECALPart(edm::Event& evt, getClusterPtrVector(evt, clustersToken, clusterPtrVector_p); // run the brem recovery and get the SC collection - std::auto_ptr - superclusters_ap(new reco::SuperClusterCollection(bremAlgo_p->makeSuperClusters(*clusterPtrVector_p))); + auto superclusters_ap = std::make_unique(bremAlgo_p->makeSuperClusters(*clusterPtrVector_p)); // count the total energy and the number of superclusters reco::SuperClusterCollection::iterator it; @@ -113,7 +112,7 @@ produceSuperclustersForECALPart(edm::Event& evt, } // put the SC collection in the event - evt.put(superclusters_ap, superclusterCollection); + evt.put(std::move(superclusters_ap), superclusterCollection); delete clusterPtrVector_p; } diff --git a/RecoEcal/EgammaClusterProducers/src/PFECALSuperClusterProducer.cc b/RecoEcal/EgammaClusterProducers/src/PFECALSuperClusterProducer.cc index 067b174b3c2e9..74d7860b3ddbb 100644 --- a/RecoEcal/EgammaClusterProducers/src/PFECALSuperClusterProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/PFECALSuperClusterProducer.cc @@ -184,9 +184,9 @@ void PFECALSuperClusterProducer::produce(edm::Event& iEvent, superClusterAlgo_.run(); //build collections of output CaloClusters from the used PFClusters - std::auto_ptr caloClustersEB(new reco::CaloClusterCollection); - std::auto_ptr caloClustersEE(new reco::CaloClusterCollection); - std::auto_ptr caloClustersES(new reco::CaloClusterCollection); + auto caloClustersEB = std::make_unique(); + auto caloClustersEE = std::make_unique(); + auto caloClustersES = std::make_unique(); std::map pfClusterMapEB; //maps of pfclusters to caloclusters std::map pfClusterMapEE; @@ -235,8 +235,8 @@ void PFECALSuperClusterProducer::produce(edm::Event& iEvent, } //create ValueMaps from output CaloClusters back to original PFClusters - std::auto_ptr > pfClusterAssociationEBEE(new edm::ValueMap); - std::auto_ptr > pfClusterAssociationES(new edm::ValueMap); + auto pfClusterAssociationEBEE = std::make_unique>(); + auto pfClusterAssociationES = std::make_unique>(); //vectors to fill ValueMaps std::vector clusptrsEB(caloClustersEB->size()); @@ -244,9 +244,9 @@ void PFECALSuperClusterProducer::produce(edm::Event& iEvent, std::vector clusptrsES(caloClustersES->size()); //put calocluster output collections in event and get orphan handles to create ptrs - const edm::OrphanHandle &caloClusHandleEB = iEvent.put(caloClustersEB,PFBasicClusterCollectionBarrel_); - const edm::OrphanHandle &caloClusHandleEE = iEvent.put(caloClustersEE,PFBasicClusterCollectionEndcap_); - const edm::OrphanHandle &caloClusHandleES = iEvent.put(caloClustersES,PFBasicClusterCollectionPreshower_); + const edm::OrphanHandle &caloClusHandleEB = iEvent.put(std::move(caloClustersEB),PFBasicClusterCollectionBarrel_); + const edm::OrphanHandle &caloClusHandleEE = iEvent.put(std::move(caloClustersEE),PFBasicClusterCollectionEndcap_); + const edm::OrphanHandle &caloClusHandleES = iEvent.put(std::move(caloClustersES),PFBasicClusterCollectionPreshower_); //relink superclusters to output caloclusters and fill vectors for ValueMaps for( auto& ebsc : *(superClusterAlgo_.getEBOutputSCCollection()) ) { @@ -296,11 +296,11 @@ void PFECALSuperClusterProducer::produce(edm::Event& iEvent, fillerES.fill(); //store in the event - iEvent.put(pfClusterAssociationEBEE,PFClusterAssociationEBEE_); - iEvent.put(pfClusterAssociationES,PFClusterAssociationES_); - iEvent.put(superClusterAlgo_.getEBOutputSCCollection(), + iEvent.put(std::move(pfClusterAssociationEBEE),PFClusterAssociationEBEE_); + iEvent.put(std::move(pfClusterAssociationES),PFClusterAssociationES_); + iEvent.put(std::move(superClusterAlgo_.getEBOutputSCCollection()), PFSuperClusterCollectionBarrel_); - iEvent.put(superClusterAlgo_.getEEOutputSCCollection(), + iEvent.put(std::move(superClusterAlgo_.getEEOutputSCCollection()), PFSuperClusterCollectionEndcapWithPreshower_); } diff --git a/RecoEcal/EgammaClusterProducers/src/PreshowerClusterProducer.cc b/RecoEcal/EgammaClusterProducers/src/PreshowerClusterProducer.cc index c87c0e6e87afa..4bd7712fa8e37 100644 --- a/RecoEcal/EgammaClusterProducers/src/PreshowerClusterProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/PreshowerClusterProducer.cc @@ -98,11 +98,11 @@ void PreshowerClusterProducer::produce(edm::Event& evt, const edm::EventSetup& e const CaloSubdetectorGeometry *geometry = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalPreshower); const CaloSubdetectorGeometry *& geometry_p = geometry; - // create auto_ptr to a PreshowerClusterCollection - std::auto_ptr< reco::PreshowerClusterCollection > clusters_p1(new reco::PreshowerClusterCollection); - std::auto_ptr< reco::PreshowerClusterCollection > clusters_p2(new reco::PreshowerClusterCollection); + // create unique_ptr to a PreshowerClusterCollection + auto clusters_p1 = std::make_unique(); + auto clusters_p2 = std::make_unique(); // create new collection of corrected super clusters - std::auto_ptr< reco::SuperClusterCollection > superclusters_p(new reco::SuperClusterCollection); + auto superclusters_p = std::make_unique(); CaloSubdetectorTopology * topology_p=0; if (geometry) @@ -247,13 +247,13 @@ void PreshowerClusterProducer::produce(edm::Event& evt, const edm::EventSetup& e clusters_p1->assign(clusters1.begin(), clusters1.end()); clusters_p2->assign(clusters2.begin(), clusters2.end()); // put collection of preshower clusters to the event - evt.put( clusters_p1, preshClusterCollectionX_ ); - evt.put( clusters_p2, preshClusterCollectionY_ ); + evt.put(std::move(clusters_p1), preshClusterCollectionX_); + evt.put(std::move(clusters_p2), preshClusterCollectionY_); LogTrace("EcalClusters") << "Preshower clusters added to the event" ; // put collection of corrected super clusters to the event superclusters_p->assign(new_SC.begin(), new_SC.end()); - evt.put(superclusters_p, assocSClusterCollection_); + evt.put(std::move(superclusters_p), assocSClusterCollection_); LogTrace("EcalClusters") << "Corrected SClusters added to the event" ; if (topology_p) diff --git a/RecoEcal/EgammaClusterProducers/src/PreshowerClusterShapeProducer.cc b/RecoEcal/EgammaClusterProducers/src/PreshowerClusterShapeProducer.cc index 2d4e1d6ba2740..bd8c18fa0d008 100644 --- a/RecoEcal/EgammaClusterProducers/src/PreshowerClusterShapeProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/PreshowerClusterShapeProducer.cc @@ -91,9 +91,9 @@ void PreshowerClusterShapeProducer::produce(Event& evt, const EventSetup& es) { const CaloSubdetectorGeometry *& geometry_p = geometry; - // create an auto_ptr to a PreshowerClusterShapeCollection - std::auto_ptr< reco::PreshowerClusterShapeCollection > ps_cl_for_pi0_disc_x(new reco::PreshowerClusterShapeCollection); - std::auto_ptr< reco::PreshowerClusterShapeCollection > ps_cl_for_pi0_disc_y(new reco::PreshowerClusterShapeCollection); + // create a unique_ptr to a PreshowerClusterShapeCollection + auto ps_cl_for_pi0_disc_x = std::make_unique(); + auto ps_cl_for_pi0_disc_y = std::make_unique(); CaloSubdetectorTopology* topology_p=0; @@ -186,8 +186,8 @@ void PreshowerClusterShapeProducer::produce(Event& evt, const EventSetup& es) { ps_cl_for_pi0_disc_x->assign(ps_cl_x.begin(), ps_cl_x.end()); ps_cl_for_pi0_disc_y->assign(ps_cl_y.begin(), ps_cl_y.end()); - evt.put(ps_cl_for_pi0_disc_x, PreshowerClusterShapeCollectionX_); - evt.put(ps_cl_for_pi0_disc_y, PreshowerClusterShapeCollectionY_); + evt.put(std::move(ps_cl_for_pi0_disc_x), PreshowerClusterShapeCollectionX_); + evt.put(std::move(ps_cl_for_pi0_disc_y), PreshowerClusterShapeCollectionY_); LogTrace("EcalClusters") << "PreshowerClusterShapeCollection added to the event" ; if (topology_p) diff --git a/RecoEcal/EgammaClusterProducers/src/PreshowerPhiClusterProducer.cc b/RecoEcal/EgammaClusterProducers/src/PreshowerPhiClusterProducer.cc index 89387f1c0c958..f6ec15cb9a8b0 100644 --- a/RecoEcal/EgammaClusterProducers/src/PreshowerPhiClusterProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/PreshowerPhiClusterProducer.cc @@ -90,11 +90,11 @@ void PreshowerPhiClusterProducer::produce(edm::Event& evt, const edm::EventSetup const CaloSubdetectorGeometry *geometry = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalPreshower); const CaloSubdetectorGeometry *& geometry_p = geometry; - // create auto_ptr to a PreshowerClusterCollection - std::auto_ptr< reco::PreshowerClusterCollection > clusters_p1(new reco::PreshowerClusterCollection); - std::auto_ptr< reco::PreshowerClusterCollection > clusters_p2(new reco::PreshowerClusterCollection); + // create unique_ptr to a PreshowerClusterCollection + auto clusters_p1 = std::make_unique(); + auto clusters_p2 = std::make_unique(); // create new collection of corrected super clusters - std::auto_ptr< reco::SuperClusterCollection > superclusters_p(new reco::SuperClusterCollection); + auto superclusters_p = std::make_unique(); CaloSubdetectorTopology * topology_p=0; if (geometry) @@ -265,13 +265,13 @@ void PreshowerPhiClusterProducer::produce(edm::Event& evt, const edm::EventSetup clusters_p1->assign(clusters1.begin(), clusters1.end()); clusters_p2->assign(clusters2.begin(), clusters2.end()); // put collection of preshower clusters to the event - evt.put( clusters_p1, preshClusterCollectionX_ ); - evt.put( clusters_p2, preshClusterCollectionY_ ); + evt.put(std::move(clusters_p1), preshClusterCollectionX_ ); + evt.put(std::move(clusters_p2), preshClusterCollectionY_ ); LogTrace("EcalClusters") << "Preshower clusters added to the event" ; // put collection of corrected super clusters to the event superclusters_p->assign(new_SC.begin(), new_SC.end()); - evt.put(superclusters_p, assocSClusterCollection_); + evt.put(std::move(superclusters_p), assocSClusterCollection_); LogTrace("EcalClusters") << "Corrected SClusters added to the event" ; if (topology_p) delete topology_p; diff --git a/RecoEcal/EgammaClusterProducers/src/RecHitFilter.cc b/RecoEcal/EgammaClusterProducers/src/RecHitFilter.cc index bc60ed962536b..3e9b2a4c95979 100644 --- a/RecoEcal/EgammaClusterProducers/src/RecHitFilter.cc +++ b/RecoEcal/EgammaClusterProducers/src/RecHitFilter.cc @@ -50,8 +50,8 @@ void RecHitFilter::produce(edm::StreamID, edm::Event& evt, const edm::EventSetup int nTot = hit_collection->size(); int nRed = 0; - // create an auto_ptr to a BasicClusterCollection, copy the clusters into it and put in the Event: - std::auto_ptr< EcalRecHitCollection > redCollection(new EcalRecHitCollection); + // create a unique_ptr to a BasicClusterCollection, copy the clusters into it and put in the Event: + auto redCollection = std::make_unique(); for(EcalRecHitCollection::const_iterator it = hit_collection->begin(); it != hit_collection->end(); ++it) { //std::cout << *it << std::endl; @@ -64,6 +64,6 @@ void RecHitFilter::produce(edm::StreamID, edm::Event& evt, const edm::EventSetup edm::LogInfo("")<< "total # hits: " << nTot << " #hits with E > " << noiseEnergyThreshold_ << " GeV and chi2 < " << noiseChi2Threshold_ << " : " << nRed << std::endl; - evt.put(redCollection, reducedHitCollection_); + evt.put(std::move(redCollection), reducedHitCollection_); } diff --git a/RecoEcal/EgammaClusterProducers/src/ReducedESRecHitCollectionProducer.cc b/RecoEcal/EgammaClusterProducers/src/ReducedESRecHitCollectionProducer.cc index fb1581a4dd9fe..054e26cd566f7 100644 --- a/RecoEcal/EgammaClusterProducers/src/ReducedESRecHitCollectionProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/ReducedESRecHitCollectionProducer.cc @@ -72,7 +72,7 @@ void ReducedESRecHitCollectionProducer::produce(edm::Event & e, const edm::Event edm::Handle ESRecHits_; e.getByToken(InputRecHitES_, ESRecHits_); - std::auto_ptr output(new EcalRecHitCollection); + auto output = std::make_unique(); edm::Handle pEndcapSuperClusters; e.getByToken(InputSuperClusterEE_, pEndcapSuperClusters); @@ -161,7 +161,7 @@ void ReducedESRecHitCollectionProducer::produce(edm::Event & e, const edm::Event } collectedIds_.clear(); - e.put(output, OutputLabelES_); + e.put(std::move(output), OutputLabelES_); } diff --git a/RecoEcal/EgammaClusterProducers/src/ReducedRecHitCollectionProducer.cc b/RecoEcal/EgammaClusterProducers/src/ReducedRecHitCollectionProducer.cc index 24373189a4446..8a1ebc4a1c1f0 100644 --- a/RecoEcal/EgammaClusterProducers/src/ReducedRecHitCollectionProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/ReducedRecHitCollectionProducer.cc @@ -100,7 +100,7 @@ ReducedRecHitCollectionProducer::produce (edm::Event& iEvent, } //Create empty output collections - std::auto_ptr< EcalRecHitCollection > miniRecHitCollection (new EcalRecHitCollection) ; + auto miniRecHitCollection = std::make_unique(); for (unsigned int iCry=0;iCrysize() << " original is " << recHitsHandle->size() << std::endl; - iEvent.put( miniRecHitCollection,reducedHitsCollection_ ); + iEvent.put(std::move(miniRecHitCollection),reducedHitsCollection_ ); } diff --git a/RecoEcal/EgammaClusterProducers/src/UncleanSCRecoveryProducer.cc b/RecoEcal/EgammaClusterProducers/src/UncleanSCRecoveryProducer.cc index 75deacb680e94..382345e1992a3 100644 --- a/RecoEcal/EgammaClusterProducers/src/UncleanSCRecoveryProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/UncleanSCRecoveryProducer.cc @@ -121,10 +121,10 @@ void UncleanSCRecoveryProducer::produce(edm::StreamID, edm::Event& evt, } // // now export the basic clusters into the event and get them back - std::auto_ptr< reco::BasicClusterCollection> basicClusters_p(new reco::BasicClusterCollection); + auto basicClusters_p = std::make_unique(); basicClusters_p->assign(basicClusters.begin(), basicClusters.end()); edm::OrphanHandle bccHandle = - evt.put(basicClusters_p, bcCollection_); + evt.put(std::move(basicClusters_p), bcCollection_); if (!(bccHandle.isValid())) { edm::LogWarning("MissingInput") << "could not handle the new BasicClusters!"; @@ -181,11 +181,10 @@ void UncleanSCRecoveryProducer::produce(edm::StreamID, edm::Event& evt, superClusters.push_back(newSC); } - std::auto_ptr< reco::SuperClusterCollection> - superClusters_p(new reco::SuperClusterCollection); + auto superClusters_p = std::make_unique(); superClusters_p->assign(superClusters.begin(), superClusters.end()); - evt.put(superClusters_p, scCollection_); + evt.put(std::move(superClusters_p), scCollection_); LogTrace("EcalCleaning")<<"Clusters (Basic/Super) added to the Event! :-)"; diff --git a/RecoEcal/EgammaClusterProducers/src/UnifiedSCCollectionProducer.cc b/RecoEcal/EgammaClusterProducers/src/UnifiedSCCollectionProducer.cc index 75a5a2ced991c..72acae0d408af 100644 --- a/RecoEcal/EgammaClusterProducers/src/UnifiedSCCollectionProducer.cc +++ b/RecoEcal/EgammaClusterProducers/src/UnifiedSCCollectionProducer.cc @@ -274,11 +274,10 @@ void UnifiedSCCollectionProducer::produce(edm::Event& evt, << " uncleaned SC: " << uncleanSize ; // // export the clusters to the event from the clean clusters - std::auto_ptr< reco::BasicClusterCollection> - basicClusters_p(new reco::BasicClusterCollection); + auto basicClusters_p = std::make_unique(); basicClusters_p->assign(basicClusters.begin(), basicClusters.end()); edm::OrphanHandle bccHandle = - evt.put(basicClusters_p, bcCollection_); + evt.put(std::move(basicClusters_p), bcCollection_); if (!(bccHandle.isValid())) { edm::LogWarning("MissingInput")<< "could not handle the new BasicClusters!"; @@ -289,12 +288,11 @@ void UnifiedSCCollectionProducer::produce(edm::Event& evt, LogTrace("UnifiedSC")<< "Got the BasicClusters from the event again" ; // // export the clusters to the event: from the unclean only clusters - std::auto_ptr< reco::BasicClusterCollection> - basicClustersUncleanOnly_p(new reco::BasicClusterCollection); + auto basicClustersUncleanOnly_p = std::make_unique(); basicClustersUncleanOnly_p->assign(basicClustersUncleanOnly.begin(), basicClustersUncleanOnly.end()); edm::OrphanHandle bccHandleUncleanOnly = - evt.put(basicClustersUncleanOnly_p, bcCollectionUncleanOnly_); + evt.put(std::move(basicClustersUncleanOnly_p), bcCollectionUncleanOnly_); if (!(bccHandleUncleanOnly.isValid())) { edm::LogWarning("MissingInput")<< "could not handle the new BasicClusters (Unclean Only)!" ; @@ -398,20 +396,18 @@ void UnifiedSCCollectionProducer::produce(edm::Event& evt, LogTrace("UnifiedSC")<< "New SC collection was created"; - std::auto_ptr< reco::SuperClusterCollection> - superClusters_p(new reco::SuperClusterCollection); + auto superClusters_p = std::make_unique(); superClusters_p->assign(superClusters.begin(), superClusters.end()); - evt.put(superClusters_p, scCollection_); + evt.put(std::move(superClusters_p), scCollection_); LogTrace("UnifiedSC") << "Clusters (Basic/Super) added to the Event! :-)"; - std::auto_ptr< reco::SuperClusterCollection> - superClustersUncleanOnly_p(new reco::SuperClusterCollection); + auto superClustersUncleanOnly_p = std::make_unique(); superClustersUncleanOnly_p->assign(superClustersUncleanOnly.begin(), superClustersUncleanOnly.end()); - evt.put(superClustersUncleanOnly_p, scCollectionUncleanOnly_); + evt.put(std::move(superClustersUncleanOnly_p), scCollectionUncleanOnly_); // ----- debugging ---------- // print the new collection SC quantities diff --git a/RecoEgamma/EgammaElectronAlgos/src/SeedFilter.cc b/RecoEgamma/EgammaElectronAlgos/src/SeedFilter.cc index 2613f0a84d2b1..8a6132e70abdd 100644 --- a/RecoEgamma/EgammaElectronAlgos/src/SeedFilter.cc +++ b/RecoEgamma/EgammaElectronAlgos/src/SeedFilter.cc @@ -87,7 +87,7 @@ SeedFilter::~SeedFilter() { void SeedFilter::seeds(edm::Event& e, const edm::EventSetup& setup, const reco::SuperClusterRef &scRef, TrajectorySeedCollection *output) { setup.get().get(theMagField); - std::auto_ptr seedColl(new TrajectorySeedCollection()); + auto seedColl = std::make_unique(); GlobalPoint vtxPos; double deltaZVertex; diff --git a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc index 823c47a82a1d3..dfb657cb898c4 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/ElectronSeedProducer.cc @@ -206,7 +206,7 @@ void ElectronSeedProducer::produce(edm::Event& e, const edm::EventSetup& iSetup) } // store the accumulated result - std::auto_ptr pSeeds(seeds) ; + std::unique_ptr pSeeds(seeds); ElectronSeedCollection::iterator is ; for ( is=pSeeds->begin() ; is!=pSeeds->end() ; is++ ) { edm::RefToBase caloCluster = is->caloCluster() ; @@ -218,7 +218,7 @@ void ElectronSeedProducer::produce(edm::Event& e, const edm::EventSetup& iSetup) << " and cluster energy " << superCluster->energy() << " PID "< electrons(new GsfElectronCoreCollection) ; + auto electrons = std::make_unique(); const PFCandidateCollection * pfCandidateCollection = gedEMUnbiasedH_.product(); for ( unsigned int i=0 ; isize() ; ++i ) produceElectronCore((*pfCandidateCollection)[i],electrons.get()) ; - event.put(electrons) ; + event.put(std::move(electrons)); } void GEDGsfElectronCoreProducer::produceElectronCore( const reco::PFCandidate & pfCandidate, reco::GsfElectronCoreCollection * electrons ) diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronFinalizer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronFinalizer.cc index a777b85afac02..e37fb09b272b3 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronFinalizer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronFinalizer.cc @@ -57,7 +57,7 @@ void GEDGsfElectronFinalizer::produce( edm::Event & event, const edm::EventSetup { // Output collection - std::auto_ptr outputElectrons_p(new reco::GsfElectronCollection); + auto outputElectrons_p = std::make_unique(); if( gedRegression_ ) { gedRegression_->setEvent(event); @@ -128,7 +128,7 @@ void GEDGsfElectronFinalizer::produce( edm::Event & event, const edm::EventSetup outputElectrons_p->push_back(newElectron); } - event.put(outputElectrons_p,outputCollectionLabel_); + event.put(std::move(outputElectrons_p),outputCollectionLabel_); } diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronProducer.cc index 51a93eafb3ac0..70053d56e0c0f 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GEDGsfElectronProducer.cc @@ -51,11 +51,11 @@ void GEDGsfElectronProducer::produce( edm::Event & event, const edm::EventSetup fillEvent(event) ; // ValueMap - std::auto_ptr > valMap_p(new edm::ValueMap); + auto valMap_p = std::make_unique>(); edm::ValueMap::Filler valMapFiller(*valMap_p); fillGsfElectronValueMap(event,valMapFiller); valMapFiller.fill(); - event.put(valMap_p,outputValueMapLabel_); + event.put(std::move(valMap_p),outputValueMapLabel_); // Done with the ValueMap endEvent() ; diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.cc index 610f36a1903c4..e0385424ee6e9 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.cc @@ -429,9 +429,9 @@ void GsfElectronBaseProducer::fillEvent( edm::Event & event ) algo_->displayInternalElectrons("GsfElectronAlgo Info (after amb. solving)") ; } // final filling - std::auto_ptr finalCollection( new GsfElectronCollection ) ; + auto finalCollection = std::make_unique(); algo_->copyElectrons(*finalCollection) ; - orphanHandle_ = event.put(finalCollection) ; + orphanHandle_ = event.put(std::move(finalCollection)); } void GsfElectronBaseProducer::endEvent() diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.h b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.h index f0137ed54b113..dfcc1e23ea13d 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.h +++ b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronBaseProducer.h @@ -37,7 +37,7 @@ class GsfElectronBaseProducer : public edm::stream::EDProducer< edm::GlobalCache static std::unique_ptr initializeGlobalCache( const edm::ParameterSet& conf ) { - return std::unique_ptr(new gsfAlgoHelpers::HeavyObjectCache(conf)); + return std::make_unique(conf); } static void globalEndJob(gsfAlgoHelpers::HeavyObjectCache const* ) { diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreEcalDrivenProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreEcalDrivenProducer.cc index 7380bea376637..6873c9c28e92d 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreEcalDrivenProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreEcalDrivenProducer.cc @@ -34,7 +34,7 @@ void GsfElectronCoreEcalDrivenProducer::produce( edm::Event & event, const edm:: GsfElectronCoreBaseProducer::initEvent(event,setup) ; // output - std::auto_ptr electrons(new GsfElectronCoreCollection) ; + auto electrons = std::make_unique(); // loop on ecal driven tracks if (useGsfPfRecTracks_) @@ -59,7 +59,7 @@ void GsfElectronCoreEcalDrivenProducer::produce( edm::Event & event, const edm:: } } - event.put(electrons) ; + event.put(std::move(electrons)); } void GsfElectronCoreEcalDrivenProducer::produceEcalDrivenCore( const GsfTrackRef & gsfTrackRef, GsfElectronCoreCollection * electrons ) diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreProducer.cc index 68f243019a660..b56be488b9ca4 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronCoreProducer.cc @@ -114,7 +114,7 @@ void GsfElectronCoreProducer::produce( edm::Event & event, const edm::EventSetup } // store - std::auto_ptr collection(new GsfElectronCoreCollection) ; + auto collection = std::make_unique(); for ( eleCore = electrons.begin() ; eleCore != electrons.end() ; eleCore++ ) { if ((*eleCore)->superCluster().isNull()) @@ -123,7 +123,7 @@ void GsfElectronCoreProducer::produce( edm::Event & event, const edm::EventSetup { collection->push_back(**eleCore) ; } delete (*eleCore) ; } - event.put(collection) ; + event.put(std::move(collection)); } void GsfElectronCoreProducer::produceTrackerDrivenCore( const GsfTrackRef & gsfTrackRef, std::list & electrons ) diff --git a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronFull5x5Filler.cc b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronFull5x5Filler.cc index 2e0aa44d44424..0f7f82b8abac7 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronFull5x5Filler.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/GsfElectronFull5x5Filler.cc @@ -72,7 +72,7 @@ GsfElectronFull5x5Filler::~GsfElectronFull5x5Filler() // ------------ method called to produce the data ------------ void GsfElectronFull5x5Filler::produce( edm::Event & event, const edm::EventSetup & setup ) { - std::auto_ptr out(new reco::GsfElectronCollection); + auto out = std::make_unique(); edm::Handle eles; event.getByToken(_source,eles); @@ -88,7 +88,7 @@ void GsfElectronFull5x5Filler::produce( edm::Event & event, const edm::EventSetu out->push_back(temp); } - event.put(out); + event.put(std::move(out)); } void GsfElectronFull5x5Filler::beginLuminosityBlock(edm::LuminosityBlock const& lb, diff --git a/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronAssociator.cc b/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronAssociator.cc index 5d191424f0797..2cc2d49c6ceff 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronAssociator.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronAssociator.cc @@ -82,7 +82,7 @@ SiStripElectronAssociator::produce(edm::Event& iEvent, const edm::EventSetup& iS } // Output the high-level Electrons - std::auto_ptr output(new reco::ElectronCollection); + auto output = std::make_unique(); LogDebug("SiStripElectronAssociator") << " About to loop over tracks " << std::endl ; LogDebug("SiStripElectronAssociator") << " Number of tracks in Associator " << tracks.product()->size() ; @@ -200,5 +200,5 @@ SiStripElectronAssociator::produce(edm::Event& iEvent, const edm::EventSetup& iS LogDebug("SiStripElectronAssociator") << " Number of SiStripElectrons returned with a good fit " << countSiElFit << "\n"<< std::endl ; - iEvent.put(output, electronsLabel_.label()); + iEvent.put(std::move(output), electronsLabel_.label()); } diff --git a/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronProducer.cc index 84bf2188c1010..158af6e5a7f39 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronProducer.cc @@ -137,8 +137,8 @@ SiStripElectronProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet algo_p->prepareEvent(trackerHandle, rphiHitsHandle, stereoHitsHandle, matchedHitsHandle, magneticFieldHandle); // Prepare the output electron candidates and clouds to be filled - std::auto_ptr electronOut(new reco::SiStripElectronCollection); - std::auto_ptr trackCandidateOut(new TrackCandidateCollection); + auto electronOut = std::make_unique(); + auto trackCandidateOut = std::make_unique(); //Retrieve tracker topology from geometry edm::ESHandle tTopoHand; @@ -174,8 +174,8 @@ SiStripElectronProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSet LogDebug("SiStripElectronProducer") << str.str(); // Put the electron candidates and the tracking trajectories into the event - iEvent.put(electronOut, siStripElectronsLabel_); - iEvent.put(trackCandidateOut, trackCandidatesLabel_); + iEvent.put(std::move(electronOut), siStripElectronsLabel_); + iEvent.put(std::move(trackCandidateOut), trackCandidatesLabel_); } // diff --git a/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronSeedProducer.cc b/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronSeedProducer.cc index b5b2fb5021033..23bfeb805743a 100644 --- a/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronSeedProducer.cc +++ b/RecoEgamma/EgammaElectronProducers/plugins/SiStripElectronSeedProducer.cc @@ -80,7 +80,7 @@ void SiStripElectronSeedProducer::produce(edm::Event& e, const edm::EventSetup& matcher_->setupES(iSetup); ElectronSeedCollection *seeds = new ElectronSeedCollection; - std::auto_ptr pSeeds; + std::unique_ptr pSeeds; // do both barrel and endcap instances for (unsigned int i=0; i<2; i++) { @@ -94,9 +94,9 @@ void SiStripElectronSeedProducer::produce(edm::Event& e, const edm::EventSetup& } - pSeeds = std::auto_ptr(seeds); + pSeeds = std::unique_ptr(seeds); - e.put(pSeeds); + e.put(std::move(pSeeds)); } diff --git a/RecoEgamma/EgammaHFProducers/plugins/HFEMClusterProducer.cc b/RecoEgamma/EgammaHFProducers/plugins/HFEMClusterProducer.cc index 5e1872e878dd7..3d659dc0c4fd2 100644 --- a/RecoEgamma/EgammaHFProducers/plugins/HFEMClusterProducer.cc +++ b/RecoEgamma/EgammaHFProducers/plugins/HFEMClusterProducer.cc @@ -36,8 +36,8 @@ void HFEMClusterProducer::produce(edm::Event & e, edm::EventSetup const& iSetup) iSetup.get().get(geometry); // create return data - std::auto_ptr retdata1(new HFEMClusterShapeCollection()); - std::auto_ptr retdata2(new SuperClusterCollection()); + auto retdata1 = std::make_unique(); + auto retdata2 = std::make_unique(); algo_.isMC(!e.isRealData()); @@ -47,17 +47,16 @@ void HFEMClusterProducer::produce(edm::Event & e, edm::EventSetup const& iSetup) edm::OrphanHandle ShapeHandle; // put the results - ShapeHandle=e.put(retdata1); - SupHandle=e.put(retdata2); + ShapeHandle=e.put(std::move(retdata1)); + SupHandle=e.put(std::move(retdata2)); - std::auto_ptr retdata3( - new HFEMClusterShapeAssociationCollection(SupHandle, ShapeHandle)); + auto retdata3 = std::make_unique(SupHandle, ShapeHandle); for (unsigned int i=0; i < ShapeHandle->size();i++){ retdata3->insert(edm::Ref(SupHandle,i),edm::Ref(ShapeHandle,i)); } - e.put(retdata3); + e.put(std::move(retdata3)); } diff --git a/RecoEgamma/EgammaHFProducers/plugins/HFRecoEcalCandidateProducer.cc b/RecoEgamma/EgammaHFProducers/plugins/HFRecoEcalCandidateProducer.cc index bfeabd3a160f4..a0efb937858ab 100644 --- a/RecoEgamma/EgammaHFProducers/plugins/HFRecoEcalCandidateProducer.cc +++ b/RecoEgamma/EgammaHFProducers/plugins/HFRecoEcalCandidateProducer.cc @@ -87,12 +87,12 @@ void HFRecoEcalCandidateProducer::produce(edm::Event & e, edm::EventSetup const& // create return data - std::auto_ptr retdata1(new reco::RecoEcalCandidateCollection()); + auto retdata1 = std::make_unique(); algo_.produce(super_clus,*hf_assoc,*retdata1,nvertex); - e.put(retdata1); + e.put(std::move(retdata1)); } diff --git a/RecoEgamma/EgammaHFProducers/plugins/HLTHFRecoEcalCandidateProducer.cc b/RecoEgamma/EgammaHFProducers/plugins/HLTHFRecoEcalCandidateProducer.cc index 52f814c134fcc..d7474b37b1ca9 100644 --- a/RecoEgamma/EgammaHFProducers/plugins/HLTHFRecoEcalCandidateProducer.cc +++ b/RecoEgamma/EgammaHFProducers/plugins/HLTHFRecoEcalCandidateProducer.cc @@ -61,12 +61,12 @@ void HLTHFRecoEcalCandidateProducer::produce(edm::Event & e, edm::EventSetup con int nvertex = 1; // create return data - std::auto_ptr retdata1(new reco::RecoEcalCandidateCollection()); + auto retdata1 = std::make_unique(); algo_.produce(super_clus,*hf_assoc,*retdata1,nvertex); - e.put(retdata1); + e.put(std::move(retdata1)); } diff --git a/RecoEgamma/EgammaHLTProducers/interface/HLTCaloObjInRegionsProducer.h b/RecoEgamma/EgammaHLTProducers/interface/HLTCaloObjInRegionsProducer.h index c4c28dd5e6ddb..9a6a8bdc6de5a 100644 --- a/RecoEgamma/EgammaHLTProducers/interface/HLTCaloObjInRegionsProducer.h +++ b/RecoEgamma/EgammaHLTProducers/interface/HLTCaloObjInRegionsProducer.h @@ -123,7 +123,7 @@ class HLTCaloObjInRegionsProducer : public edm::stream::EDProducer<> { private: EtaPhiRegionDataBase* createEtaPhiRegionData(const std::string&,const edm::ParameterSet&,edm::ConsumesCollector &&); //calling function owns this - static std::auto_ptr + static std::unique_ptr makeFilteredColl(const edm::Handle& inputColl, const edm::ESHandle& caloGeomHandle, const std::vector& regions); @@ -210,19 +210,19 @@ void HLTCaloObjInRegionsProducer::produce(edm::Even continue; } auto outputColl = makeFilteredColl(inputColl,caloGeomHandle,regions); - event.put(outputColl,outputProductNames_[inputCollNr]); + event.put(std::move(outputColl),outputProductNames_[inputCollNr]); } } template -std::auto_ptr +std::unique_ptr HLTCaloObjInRegionsProducer:: makeFilteredColl(const edm::Handle& inputColl, const edm::ESHandle& caloGeomHandle, const std::vector& regions) { - std::auto_ptr outputColl(new CaloObjCollType); + auto outputColl = std::make_unique(); if(!inputColl->empty()){ const CaloSubdetectorGeometry* subDetGeom=caloGeomHandle->getSubdetectorGeometry(inputColl->front().id()); if(!regions.empty()){ diff --git a/RecoEgamma/EgammaHLTProducers/interface/HLTRecHitInAllL1RegionsProducer.h b/RecoEgamma/EgammaHLTProducers/interface/HLTRecHitInAllL1RegionsProducer.h index 7d35db51b624e..b45b3c33c72c4 100644 --- a/RecoEgamma/EgammaHLTProducers/interface/HLTRecHitInAllL1RegionsProducer.h +++ b/RecoEgamma/EgammaHLTProducers/interface/HLTRecHitInAllL1RegionsProducer.h @@ -217,7 +217,7 @@ void HLTRecHitInAllL1RegionsProducer::produce(edm::Event& event, con continue; } - std::unique_ptr filteredRecHits(new RecHitCollectionType); + auto filteredRecHits = std::make_unique(); if(!recHits->empty()){ const CaloSubdetectorGeometry* subDetGeom=caloGeomHandle->getSubdetectorGeometry(recHits->front().id()); diff --git a/RecoEgamma/EgammaHLTProducers/src/ESListOfFEDSProducer.cc b/RecoEgamma/EgammaHLTProducers/src/ESListOfFEDSProducer.cc index 514b0cc0f399f..e9d977c482f43 100644 --- a/RecoEgamma/EgammaHLTProducers/src/ESListOfFEDSProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/ESListOfFEDSProducer.cc @@ -136,7 +136,7 @@ void ESListOfFEDSProducer::produce(edm::Event & e, const edm::EventSetup& iSetup first_ = false; } - std::unique_ptr productAddress(new ESListOfFEDS); + auto productAddress = std::make_unique(); std::vector feds; // the list of Ecal FEDS produced /// diff --git a/RecoEgamma/EgammaHLTProducers/src/ESRecHitsMerger.cc b/RecoEgamma/EgammaHLTProducers/src/ESRecHitsMerger.cc index daf9fe9c37ecd..38a130a77c342 100644 --- a/RecoEgamma/EgammaHLTProducers/src/ESRecHitsMerger.cc +++ b/RecoEgamma/EgammaHLTProducers/src/ESRecHitsMerger.cc @@ -72,7 +72,7 @@ void ESRecHitsMerger::produce(edm::Event & e, const edm::EventSetup& iSetup){ std::vector< edm::Handle > EcalRecHits_done; e.getManyByType(EcalRecHits_done); - std::unique_ptr ESMergedRecHits(new EcalRecHitCollection); + auto ESMergedRecHits = std::make_unique(); unsigned int nColl = EcalRecHits_done.size(); diff --git a/RecoEgamma/EgammaHLTProducers/src/EcalListOfFEDSProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EcalListOfFEDSProducer.cc index 869762e92cc1f..107c895d3d0ff 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EcalListOfFEDSProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EcalListOfFEDSProducer.cc @@ -133,7 +133,7 @@ void EcalListOfFEDSProducer::produce(edm::Event & e, const edm::EventSetup& iSet first_ = false; } - std::unique_ptr productAddress(new EcalListOfFEDS); + auto productAddress = std::make_unique(); std::vector feds; // the list of FEDS produced by this module diff --git a/RecoEgamma/EgammaHLTProducers/src/EcalRecHitsMerger.cc b/RecoEgamma/EgammaHLTProducers/src/EcalRecHitsMerger.cc index 72bdc08ca094b..766c04e011a14 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EcalRecHitsMerger.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EcalRecHitsMerger.cc @@ -86,8 +86,8 @@ void EcalRecHitsMerger::produce(edm::Event & e, const edm::EventSetup& iSetup){ std::vector< edm::Handle > EcalRecHits_done; e.getManyByType(EcalRecHits_done); - std::unique_ptr EBMergedRecHits(new EcalRecHitCollection); - std::unique_ptr EEMergedRecHits(new EcalRecHitCollection); + auto EBMergedRecHits = std::make_unique(); + auto EEMergedRecHits = std::make_unique(); unsigned int nColl = EcalRecHits_done.size(); diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTBcHcalIsolationProducersRegional.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTBcHcalIsolationProducersRegional.cc index 2e461893ca22d..e9c87f43896eb 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTBcHcalIsolationProducersRegional.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTBcHcalIsolationProducersRegional.cc @@ -161,6 +161,5 @@ void EgammaHLTBcHcalIsolationProducersRegional::produce(edm::Event& iEvent, cons isoMap.insert(recoEcalCandRef, isol); } - std::unique_ptr isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap)); - iEvent.put(std::move(isolMap)); + iEvent.put(std::make_unique(isoMap)); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTCaloTowerProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTCaloTowerProducer.cc index 6d31922ef5fca..ab9776a35e835 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTCaloTowerProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTCaloTowerProducer.cc @@ -57,7 +57,7 @@ void EgammaHLTCaloTowerProducer::produce(edm::StreamID, edm::Event & evt, edm::E evt.getByToken(l1isoseeds_, emIsolColl); edm::Handle > emNonIsolColl; evt.getByToken(l1nonisoseeds_, emNonIsolColl); - std::unique_ptr cands(new CaloTowerCollection); + auto cands = std::make_unique(); cands->reserve(caloTowers->size()); for (unsigned idx = 0; idx < caloTowers->size(); idx++) { diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTClusterShapeProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTClusterShapeProducer.cc index 963c90eba9ed8..9f37f65df408a 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTClusterShapeProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTClusterShapeProducer.cc @@ -75,10 +75,6 @@ void EgammaHLTClusterShapeProducer::produce(edm::StreamID sid, edm::Event& iEven } - - - std::unique_ptr clushMap(new reco::RecoEcalCandidateIsolationMap(clshMap)); - std::unique_ptr clush5x5Map(new reco::RecoEcalCandidateIsolationMap(clsh5x5Map)); - iEvent.put(std::move(clushMap)); - iEvent.put(std::move(clush5x5Map),"sigmaIEtaIEta5x5"); + iEvent.put(std::make_unique(clshMap)); + iEvent.put(std::make_unique(clsh5x5Map),"sigmaIEtaIEta5x5"); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTCombinedIsolationProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTCombinedIsolationProducer.cc index 6c28c8379a4b2..b94fefa1f7f88 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTCombinedIsolationProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTCombinedIsolationProducer.cc @@ -78,8 +78,7 @@ EgammaHLTCombinedIsolationProducer::produce(edm::Event& iEvent, const edm::Event } - std::unique_ptr Map(new reco::RecoEcalCandidateIsolationMap(TotalIsolMap)); - iEvent.put(std::move(Map)); + iEvent.put(std::make_unique(TotalIsolMap)); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTEcalIsolationProducersRegional.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTEcalIsolationProducersRegional.cc index de8bcc517a5f8..bdd6ee9fa8cf1 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTEcalIsolationProducersRegional.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTEcalIsolationProducersRegional.cc @@ -101,7 +101,6 @@ void EgammaHLTEcalIsolationProducersRegional::produce(edm::Event& iEvent, const } - std::unique_ptr isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap)); - iEvent.put(std::move(isolMap)); + iEvent.put(std::make_unique(isoMap)); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTEcalRecIsolationProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTEcalRecIsolationProducer.cc index b3ff551861ffa..c23b09eb41348 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTEcalRecIsolationProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTEcalRecIsolationProducer.cc @@ -176,8 +176,7 @@ void EgammaHLTEcalRecIsolationProducer::produce(edm::Event& iEvent, const edm::E isoMap.insert(recoecalcandref, isol); } - std::unique_ptr isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap)); - iEvent.put(std::move(isolMap)); + iEvent.put(std::make_unique(isoMap)); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronCombinedIsolationProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronCombinedIsolationProducer.cc index 97f1769b4fa40..42edd9c58cb40 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronCombinedIsolationProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronCombinedIsolationProducer.cc @@ -97,8 +97,7 @@ void EgammaHLTElectronCombinedIsolationProducer::produce(edm::Event& iEvent, con } - std::unique_ptr isolMap(new reco::ElectronIsolationMap(TotalIsolMap)); - iEvent.put(std::move(isolMap)); + iEvent.put(std::make_unique(TotalIsolMap)); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronDetaDphiProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronDetaDphiProducer.cc index 73259a2b0cfe9..6978b0fe67556 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronDetaDphiProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronDetaDphiProducer.cc @@ -103,18 +103,14 @@ void EgammaHLTElectronDetaDphiProducer::produce(edm::Event& iEvent, const edm::E dphiCandMap.insert(recoEcalCandRef, dEtaDPhi.second); }//end loop over reco ecal candidates - std::unique_ptr detaCandMapForEvent(new reco::RecoEcalCandidateIsolationMap(detaCandMap)); - std::unique_ptr dphiCandMapForEvent(new reco::RecoEcalCandidateIsolationMap(dphiCandMap)); - iEvent.put(std::move(detaCandMapForEvent), "Deta" ); - iEvent.put(std::move(dphiCandMapForEvent), "Dphi" ); + iEvent.put(std::make_unique(detaCandMap), "Deta" ); + iEvent.put(std::make_unique(dphiCandMap), "Dphi" ); }//end if between electrons or reco ecal candidates if(!useSCRefs_){ - std::unique_ptr detMap(new reco::ElectronIsolationMap(detaMap)); - std::unique_ptr dphMap(new reco::ElectronIsolationMap(dphiMap)); - iEvent.put(std::move(detMap), "Deta" ); - iEvent.put(std::move(dphMap), "Dphi" ); + iEvent.put(std::make_unique(detaMap), "Deta" ); + iEvent.put(std::make_unique(dphiMap), "Dphi" ); } } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronTrackIsolationProducers.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronTrackIsolationProducers.cc index c7dcc6cc1288d..580d32169f49d 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronTrackIsolationProducers.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTElectronTrackIsolationProducers.cc @@ -105,8 +105,7 @@ void EgammaHLTElectronTrackIsolationProducers::produce(edm::StreamID sid, edm::E recoEcalCandMap.insert(recoEcalCandRef,isol); }//end reco ecal candidate ref - std::unique_ptr mapForEvent(new reco::RecoEcalCandidateIsolationMap(recoEcalCandMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(recoEcalCandMap)); }else{ //we are going to loop over electron instead for(reco::ElectronCollection::const_iterator iElectron = electronHandle->begin(); iElectron != electronHandle->end(); iElectron++){ @@ -116,8 +115,7 @@ void EgammaHLTElectronTrackIsolationProducers::produce(edm::StreamID sid, edm::E eleMap.insert(eleRef, isol); } - std::unique_ptr mapForEvent(new reco::ElectronIsolationMap(eleMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(eleMap)); } } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTGsfTrackVarProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTGsfTrackVarProducer.cc index 998aad5b41e11..938ba23a07bc3 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTGsfTrackVarProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTGsfTrackVarProducer.cc @@ -188,14 +188,14 @@ void EgammaHLTGsfTrackVarProducer::produce(edm::Event& iEvent, const edm::EventS chi2Map.insert(recoEcalCandRef, chi2Value); } - std::unique_ptr dEtaMapForEvent(new reco::RecoEcalCandidateIsolationMap(dEtaMap)); - std::unique_ptr dEtaSeedMapForEvent(new reco::RecoEcalCandidateIsolationMap(dEtaSeedMap)); - std::unique_ptr dPhiMapForEvent(new reco::RecoEcalCandidateIsolationMap(dPhiMap)); - std::unique_ptr oneOverESuperMinusOneOverPMapForEvent(new reco::RecoEcalCandidateIsolationMap(oneOverESuperMinusOneOverPMap)); - std::unique_ptr oneOverESeedMinusOneOverPMapForEvent(new reco::RecoEcalCandidateIsolationMap(oneOverESeedMinusOneOverPMap)); - std::unique_ptr missingHitsForEvent(new reco::RecoEcalCandidateIsolationMap(missingHitsMap)); - std::unique_ptr validHitsForEvent(new reco::RecoEcalCandidateIsolationMap(validHitsMap)); - std::unique_ptr chi2ForEvent(new reco::RecoEcalCandidateIsolationMap(chi2Map)); + auto dEtaMapForEvent = std::make_unique(dEtaMap); + auto dEtaSeedMapForEvent = std::make_unique(dEtaSeedMap); + auto dPhiMapForEvent = std::make_unique(dPhiMap); + auto oneOverESuperMinusOneOverPMapForEvent = std::make_unique(oneOverESuperMinusOneOverPMap); + auto oneOverESeedMinusOneOverPMapForEvent = std::make_unique(oneOverESeedMinusOneOverPMap); + auto missingHitsForEvent = std::make_unique(missingHitsMap); + auto validHitsForEvent = std::make_unique(validHitsMap); + auto chi2ForEvent = std::make_unique(chi2Map); iEvent.put(std::move(dEtaMapForEvent), "Deta" ); iEvent.put(std::move(dEtaSeedMapForEvent), "DetaSeed" ); diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationDoubleConeProducers.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationDoubleConeProducers.cc index fdc8cd7c699db..bd2e9fbb29fb3 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationDoubleConeProducers.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationDoubleConeProducers.cc @@ -79,7 +79,6 @@ void EgammaHLTHcalIsolationDoubleConeProducers::produce(edm::Event& iEvent, cons isoMap.insert(recoecalcandref, isol); } - std::unique_ptr isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap)); - iEvent.put(std::move(isolMap)); + iEvent.put(std::make_unique(isoMap)); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationProducersRegional.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationProducersRegional.cc index 84c6ab31c5059..ead51278cb003 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationProducersRegional.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationProducersRegional.cc @@ -140,8 +140,7 @@ void EgammaHLTHcalIsolationProducersRegional::produce(edm::Event& iEvent, const isoMap.insert(recoEcalCandRef, isol); } - std::unique_ptr isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap)); - iEvent.put(std::move(isolMap)); + iEvent.put(std::make_unique(isoMap)); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHybridClusterProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHybridClusterProducer.cc index 0e041748d92de..5df88ba551c9e 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHybridClusterProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHybridClusterProducer.cc @@ -291,7 +291,7 @@ void EgammaHLTHybridClusterProducer::produce(edm::Event& evt, const edm::EventSe hybrid_p->makeClusters(hit_collection, geometry_p, basicClusters, sevLevel, true, regions); // create an unique_ptr to a BasicClusterCollection, copy the clusters into it and put in the Event: - std::unique_ptr< reco::BasicClusterCollection > basicclusters_p(new reco::BasicClusterCollection); + auto basicclusters_p = std::make_unique(); basicclusters_p->assign(basicClusters.begin(), basicClusters.end()); edm::OrphanHandle bccHandle = evt.put(std::move(basicclusters_p), basicclusterCollection_); @@ -307,7 +307,7 @@ void EgammaHLTHybridClusterProducer::produce(edm::Event& evt, const edm::EventSe reco::SuperClusterCollection superClusters = hybrid_p->makeSuperClusters(clusterRefVector); - std::unique_ptr< reco::SuperClusterCollection > superclusters_p(new reco::SuperClusterCollection); + auto superclusters_p = std::make_unique(); superclusters_p->assign(superClusters.begin(), superClusters.end()); evt.put(std::move(superclusters_p), superclusterCollection_); diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTIslandClusterProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTIslandClusterProducer.cc index 0edd3f6fa3247..398c1beada39f 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTIslandClusterProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTIslandClusterProducer.cc @@ -294,7 +294,7 @@ void EgammaHLTIslandClusterProducer::clusterizeECALPart(edm::Event &evt, const e clusters = island_p->makeClusters(hitCollection_p, geometry_p, topology_p, geometryES_p, ecalPart, true, regions); // create an unique_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event: - std::unique_ptr< reco::BasicClusterCollection > clusters_p(new reco::BasicClusterCollection); + auto clusters_p = std::make_unique(); clusters_p->assign(clusters.begin(), clusters.end()); edm::OrphanHandle bccHandle; if (ecalPart == IslandClusterAlgo::barrel) diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTMulti5x5ClusterProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTMulti5x5ClusterProducer.cc index 0307e9226f915..9cb3455cc2599 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTMulti5x5ClusterProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTMulti5x5ClusterProducer.cc @@ -302,7 +302,7 @@ void EgammaHLTMulti5x5ClusterProducer::clusterizeECALPart(edm::Event &evt, const clusters = Multi5x5_p->makeClusters(hitCollection_p, geometry_p, topology_p, geometryES_p, detector, true, regions); // create an unique_ptr to a BasicClusterCollection, copy the barrel clusters into it and put in the Event: - std::unique_ptr< reco::BasicClusterCollection > clusters_p(new reco::BasicClusterCollection); + auto clusters_p = std::make_unique(); clusters_p->assign(clusters.begin(), clusters.end()); edm::OrphanHandle bccHandle; if (detector == reco::CaloID::DET_ECAL_BARREL) diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTNxNClusterProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTNxNClusterProducer.cc index 5a1608aed36e9..1bfd96ae6b853 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTNxNClusterProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTNxNClusterProducer.cc @@ -249,7 +249,7 @@ void EgammaHLTNxNClusterProducer::makeNxNClusters(edm::Event &evt, const edm::Ev //Create empty output collections - std::unique_ptr< reco::BasicClusterCollection > clusters_p(new reco::BasicClusterCollection); + auto clusters_p = std::make_unique(); clusters_p->assign(clusters.begin(), clusters.end()); if (detector == reco::CaloID::DET_ECAL_BARREL){ if(debug_>=1) LogDebug("")<<"nxnclusterProducer: "<size() <<" made in barrel"< mapForEvent(new reco::RecoEcalCandidateIsolationMap(recoEcalCandMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(recoEcalCandMap)); } else { @@ -161,7 +160,6 @@ void EgammaHLTPFChargedIsolationProducer::produce(edm::Event& iEvent, const edm: eleMap.insert(eleRef, sum); } - std::unique_ptr mapForEvent(new reco::ElectronIsolationMap(eleMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(eleMap)); } } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPFNeutralIsolationProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPFNeutralIsolationProducer.cc index efb43a1857490..940c525b5f900 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPFNeutralIsolationProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPFNeutralIsolationProducer.cc @@ -161,8 +161,7 @@ void EgammaHLTPFNeutralIsolationProducer::produce(edm::Event& iEvent, const edm: recoEcalCandMap.insert(candRef, sum); } - std::unique_ptr mapForEvent(new reco::RecoEcalCandidateIsolationMap(recoEcalCandMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(recoEcalCandMap)); } else { @@ -219,7 +218,6 @@ void EgammaHLTPFNeutralIsolationProducer::produce(edm::Event& iEvent, const edm: eleMap.insert(eleRef, sum); } - std::unique_ptr mapForEvent(new reco::ElectronIsolationMap(eleMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(eleMap)); } } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPFPhotonIsolationProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPFPhotonIsolationProducer.cc index 009a55d564536..e1b715ef2fc66 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPFPhotonIsolationProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPFPhotonIsolationProducer.cc @@ -188,8 +188,7 @@ void EgammaHLTPFPhotonIsolationProducer::produce(edm::Event& iEvent, const edm:: recoEcalCandMap.insert(candRef, sum); } - std::unique_ptr mapForEvent(new reco::RecoEcalCandidateIsolationMap(recoEcalCandMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(recoEcalCandMap)); } else { @@ -270,7 +269,6 @@ void EgammaHLTPFPhotonIsolationProducer::produce(edm::Event& iEvent, const edm:: eleMap.insert(eleRef, sum); } - std::unique_ptr mapForEvent(new reco::ElectronIsolationMap(eleMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(eleMap)); } } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPhotonTrackIsolationProducersRegional.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPhotonTrackIsolationProducersRegional.cc index fe8c1b10081a1..aeb12babe817a 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPhotonTrackIsolationProducersRegional.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPhotonTrackIsolationProducersRegional.cc @@ -85,7 +85,6 @@ EgammaHLTPhotonTrackIsolationProducersRegional::produce(edm::StreamID sid, edm:: } - std::unique_ptr isolMap(new reco::RecoEcalCandidateIsolationMap(isoMap)); - iEvent.put(std::move(isolMap)); + iEvent.put(std::make_unique(isoMap)); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPixelMatchElectronProducers.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPixelMatchElectronProducers.cc index e652cbee0eaa6..bd1b4a1b477b7 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPixelMatchElectronProducers.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPixelMatchElectronProducers.cc @@ -65,7 +65,7 @@ void EgammaHLTPixelMatchElectronProducers::produce(edm::StreamID sid, edm::Event algo_->setupES(iSetup); // Create the output collections - std::unique_ptr pOutEle(new ElectronCollection); + auto pOutEle = std::make_unique(); // invoke algorithm algo_->run(e,*pOutEle); diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPixelMatchVarProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPixelMatchVarProducer.cc index b255ac274a825..2a90e39891b9a 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPixelMatchVarProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTPixelMatchVarProducer.cc @@ -126,10 +126,10 @@ void EgammaHLTPixelMatchVarProducer::produce(edm::StreamID sid, edm::Event& iEve if(!recoEcalCandHandle.isValid() || !pixelSeedsHandle.isValid()) return; - std::unique_ptr dPhi1BestS2Map(new reco::RecoEcalCandidateIsolationMap(recoEcalCandHandle)); - std::unique_ptr dPhi2BestS2Map(new reco::RecoEcalCandidateIsolationMap(recoEcalCandHandle)); - std::unique_ptr dzBestS2Map(new reco::RecoEcalCandidateIsolationMap(recoEcalCandHandle)); - std::unique_ptr s2Map(new reco::RecoEcalCandidateIsolationMap(recoEcalCandHandle)); + auto dPhi1BestS2Map = std::make_unique(recoEcalCandHandle); + auto dPhi2BestS2Map = std::make_unique(recoEcalCandHandle); + auto dzBestS2Map = std::make_unique(recoEcalCandHandle); + auto s2Map = std::make_unique(recoEcalCandHandle); for(unsigned int candNr = 0; candNrsize(); candNr++) { diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTR9IDProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTR9IDProducer.cc index 90250bba4b4d6..1d276600345ae 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTR9IDProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTR9IDProducer.cc @@ -70,11 +70,9 @@ void EgammaHLTR9IDProducer::produce(edm::StreamID sid, edm::Event& iEvent, const } - std::unique_ptr R9Map(new reco::RecoEcalCandidateIsolationMap(r9Map)); - iEvent.put(std::move(R9Map)); + iEvent.put(std::make_unique(r9Map)); - std::unique_ptr R95x5Map(new reco::RecoEcalCandidateIsolationMap(r95x5Map)); - iEvent.put(std::move(R95x5Map),"r95x5"); + iEvent.put(std::make_unique(r95x5Map),"r95x5"); } //define this as a plug-in diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTR9Producer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTR9Producer.cc index 1b95712d33ef3..9571bb8f33cbd 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTR9Producer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTR9Producer.cc @@ -70,7 +70,6 @@ void EgammaHLTR9Producer::produce(edm::StreamID sid, edm::Event& iEvent, const e } - std::unique_ptr R9Map(new reco::RecoEcalCandidateIsolationMap(r9Map)); - iEvent.put(std::move(R9Map)); + iEvent.put(std::make_unique(r9Map)); } diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRecoEcalCandidateProducers.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRecoEcalCandidateProducers.cc index 1abfc648977c8..209e87a63c4c9 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRecoEcalCandidateProducers.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRecoEcalCandidateProducers.cc @@ -47,7 +47,7 @@ void EgammaHLTRecoEcalCandidateProducers::produce(edm::StreamID sid, edm::Event& // reco::RecoEcalCandidateCollection outputRecoEcalCandidateCollection; - std::unique_ptr< reco::RecoEcalCandidateCollection > outputRecoEcalCandidateCollection_p(new reco::RecoEcalCandidateCollection); + auto outputRecoEcalCandidateCollection_p = std::make_unique(); // Get the Barrel Super Cluster collection Handle scBarrelHandle; diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRegionalPixelSeedGeneratorProducers.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRegionalPixelSeedGeneratorProducers.cc index 130f45042e3f0..c0f6d48951373 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRegionalPixelSeedGeneratorProducers.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRegionalPixelSeedGeneratorProducers.cc @@ -115,7 +115,7 @@ void EgammaHLTRegionalPixelSeedGeneratorProducers::produce(edm::Event& iEvent, c { // resulting collection - std::unique_ptr output(new TrajectorySeedCollection()); + auto output = std::make_unique< TrajectorySeedCollection>(); // Get the recoEcalCandidates edm::Handle recoecalcands; diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRemoveDuplicatedSC.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRemoveDuplicatedSC.cc index f4f832389d39c..68e4db28058f5 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRemoveDuplicatedSC.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTRemoveDuplicatedSC.cc @@ -55,7 +55,7 @@ EgammaHLTRemoveDuplicatedSC::produce(edm::Event& evt, const edm::EventSetup& es) // Define a collection of corrected SuperClusters to put back into the event - std::unique_ptr corrClusters(new reco::SuperClusterCollection); + auto corrClusters = std::make_unique(); // Loop over raw clusters and make corrected ones reco::SuperClusterCollection::const_iterator aClus; diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTTimeCleanedRechitProducer.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTTimeCleanedRechitProducer.cc index 4d519d22965f3..3726f2aee6971 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTTimeCleanedRechitProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTTimeCleanedRechitProducer.cc @@ -60,7 +60,7 @@ void EgammaHLTTimeCleanedRechitProducer::produce(edm::Event& evt, const edm::Eve for (unsigned int i=0; i hits(new EcalRecHitCollection); + auto hits = std::make_unique(); evt.getByToken(hitTokens[i], rhcH[i]); if (!(rhcH[i].isValid())) { diff --git a/RecoEgamma/EgammaHLTProducers/src/HLTEcalPFClusterIsolationProducer.cc b/RecoEgamma/EgammaHLTProducers/src/HLTEcalPFClusterIsolationProducer.cc index 0d68f21e7ce81..746571a7ed0f8 100644 --- a/RecoEgamma/EgammaHLTProducers/src/HLTEcalPFClusterIsolationProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/HLTEcalPFClusterIsolationProducer.cc @@ -137,8 +137,7 @@ void HLTEcalPFClusterIsolationProducer::produce(edm::Event& iEvent, const ed recoCandMap.insert(candRef, sum); } - std::unique_ptr mapForEvent(new T1IsolationMap(recoCandMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(recoCandMap)); } typedef HLTEcalPFClusterIsolationProducer EgammaHLTEcalPFClusterIsolationProducer; diff --git a/RecoEgamma/EgammaHLTProducers/src/HLTHcalPFClusterIsolationProducer.cc b/RecoEgamma/EgammaHLTProducers/src/HLTHcalPFClusterIsolationProducer.cc index 0d6386b20c244..38de74a9d3a3c 100644 --- a/RecoEgamma/EgammaHLTProducers/src/HLTHcalPFClusterIsolationProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/HLTHcalPFClusterIsolationProducer.cc @@ -151,8 +151,7 @@ void HLTHcalPFClusterIsolationProducer::produce(edm::StreamID sid, edm::Even recoCandMap.insert(candRef, sum); } - std::unique_ptr mapForEvent(new T1IsolationMap(recoCandMap)); - iEvent.put(std::move(mapForEvent)); + iEvent.put(std::make_unique(recoCandMap)); } typedef HLTHcalPFClusterIsolationProducer EgammaHLTHcalPFClusterIsolationProducer; diff --git a/RecoEgamma/EgammaHLTProducers/src/HLTRechitInRegionsProducer.cc b/RecoEgamma/EgammaHLTProducers/src/HLTRechitInRegionsProducer.cc index e5e18df97849b..7a7d6add59c1d 100644 --- a/RecoEgamma/EgammaHLTProducers/src/HLTRechitInRegionsProducer.cc +++ b/RecoEgamma/EgammaHLTProducers/src/HLTRechitInRegionsProducer.cc @@ -130,7 +130,7 @@ void HLTRechitInRegionsProducer::produce(edm::Event& evt, const edm::EventSe edm::Handle urhcH[3]; for (unsigned int i=0; i uhits(new EcalUncalibratedRecHitCollection); + auto uhits = std::make_unique(); evt.getByToken(uncalibHitTokens[i], urhcH[i]); if (!(urhcH[i].isValid())) { @@ -142,13 +142,13 @@ void HLTRechitInRegionsProducer::produce(edm::Event& evt, const edm::EventSe if (uncalibRecHits->size() > 0) { if ((*uncalibRecHits)[0].id().subdetId() == EcalBarrel) { geometry_p = geometry.getSubdetectorGeometry(DetId::Ecal, EcalBarrel); - topology.reset(new EcalBarrelTopology(geoHandle)); + topology = std::make_unique(geoHandle); } else if ((*uncalibRecHits)[0].id().subdetId() == EcalEndcap) { geometry_p = geometry.getSubdetectorGeometry(DetId::Ecal, EcalEndcap); - topology.reset(new EcalEndcapTopology(geoHandle)); + topology = std::make_unique(geoHandle); } else if ((*uncalibRecHits)[0].id().subdetId() == EcalPreshower) { geometry_p = geometry.getSubdetectorGeometry(DetId::Ecal, EcalPreshower); - topology.reset(new EcalPreshowerTopology (geoHandle)); + topology = std::make_unique(geoHandle); } else throw(std::runtime_error("\n\nProducer encountered invalied ecalhitcollection type.\n\n")); if(regions.size() != 0) { @@ -175,7 +175,7 @@ void HLTRechitInRegionsProducer::produce(edm::Event& evt, const edm::EventSe edm::Handle rhcH[3]; for (unsigned int i=0; i hits(new EcalRecHitCollection); + auto hits = std::make_unique(); evt.getByToken(hitTokens[i], rhcH[i]); if (!(rhcH[i].isValid())) { @@ -187,13 +187,13 @@ void HLTRechitInRegionsProducer::produce(edm::Event& evt, const edm::EventSe if (recHits->size() > 0) { if ((*recHits)[0].id().subdetId() == EcalBarrel) { geometry_p = geometry.getSubdetectorGeometry(DetId::Ecal, EcalBarrel); - topology.reset(new EcalBarrelTopology(geoHandle)); + topology = std::make_unique(geoHandle); } else if ((*recHits)[0].id().subdetId() == EcalEndcap) { geometry_p = geometry.getSubdetectorGeometry(DetId::Ecal, EcalEndcap); - topology.reset(new EcalEndcapTopology(geoHandle)); + topology = std::make_unique(geoHandle); } else if ((*recHits)[0].id().subdetId() == EcalPreshower) { geometry_p = geometry.getSubdetectorGeometry(DetId::Ecal, EcalPreshower); - topology.reset(new EcalPreshowerTopology (geoHandle)); + topology = std::make_unique(geoHandle); } else throw(std::runtime_error("\n\nProducer encountered invalied ecalhitcollection type.\n\n")); if(regions.size() != 0) { diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalPFClusterIsolationProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalPFClusterIsolationProducer.cc index e12cc6a45e1e5..6e2e0aa03bc6b 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalPFClusterIsolationProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalPFClusterIsolationProducer.cc @@ -57,7 +57,7 @@ void EgammaEcalPFClusterIsolationProducer::produce(edm::Event& iEvent, const edm::Handle emObjectHandle; iEvent.getByToken(emObjectProducer_, emObjectHandle); - std::auto_ptr > isoMap(new edm::ValueMap()); + auto isoMap = std::make_unique>(); edm::ValueMap::Filler filler(*isoMap); std::vector retV(emObjectHandle->size(),0); @@ -74,7 +74,7 @@ void EgammaEcalPFClusterIsolationProducer::produce(edm::Event& iEvent, const filler.insert(emObjectHandle,retV.begin(),retV.end()); filler.fill(); - iEvent.put(isoMap); + iEvent.put(std::move(isoMap)); } typedef EgammaEcalPFClusterIsolationProducer ElectronEcalPFClusterIsolationProducer; diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalRecHitIsolationProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalRecHitIsolationProducer.cc index 35e49ce0b5d6b..7c606de1b524c 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalRecHitIsolationProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaEcalRecHitIsolationProducer.cc @@ -97,7 +97,7 @@ EgammaEcalRecHitIsolationProducer::produce(edm::Event& iEvent, const edm::EventS const CaloGeometry* caloGeom = pG.product(); //reco::CandViewDoubleAssociations* isoMap = new reco::CandViewDoubleAssociations( reco::CandidateBaseRefProd( emObjectHandle ) ); - std::auto_ptr > isoMap(new edm::ValueMap()); + auto isoMap = std::make_unique>(); edm::ValueMap::Filler filler(*isoMap); std::vector retV(emObjectHandle->size(),0); @@ -149,8 +149,7 @@ EgammaEcalRecHitIsolationProducer::produce(edm::Event& iEvent, const edm::EventS filler.insert(emObjectHandle,retV.begin(),retV.end()); filler.fill(); - //std::auto_ptr isolMap(isoMap); - iEvent.put(isoMap); + iEvent.put(std::move(isoMap)); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaElectronTkIsolationProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaElectronTkIsolationProducer.cc index 1b3529c1dbdf2..5b7401efef5fa 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaElectronTkIsolationProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaElectronTkIsolationProducer.cc @@ -62,7 +62,7 @@ void EgammaElectronTkIsolationProducer::produce(edm::Event& iEvent, const edm::E const reco::TrackCollection* trackCollection = tracks.product(); //prepare product - std::auto_ptr > isoMap(new edm::ValueMap()); + auto isoMap = std::make_unique>(); edm::ValueMap::Filler filler(*isoMap); std::vector retV(electronHandle->size(),0); @@ -80,5 +80,5 @@ void EgammaElectronTkIsolationProducer::produce(edm::Event& iEvent, const edm::E //fill and insert valuemap filler.insert(electronHandle,retV.begin(),retV.end()); filler.fill(); - iEvent.put(isoMap); + iEvent.put(std::move(isoMap)); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaElectronTkNumIsolationProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaElectronTkNumIsolationProducer.cc index d39951de26fd1..9826297b32bc6 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaElectronTkNumIsolationProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaElectronTkNumIsolationProducer.cc @@ -62,7 +62,7 @@ void EgammaElectronTkNumIsolationProducer::produce(edm::Event& iEvent, const edm const reco::TrackCollection* trackCollection = tracks.product(); //prepare product - std::auto_ptr > isoMap(new edm::ValueMap()); + auto isoMap = std::make_unique>(); edm::ValueMap::Filler filler(*isoMap); std::vector retV(electronHandle->size(),0); @@ -81,5 +81,5 @@ void EgammaElectronTkNumIsolationProducer::produce(edm::Event& iEvent, const edm //fill and insert valuemap filler.insert(electronHandle,retV.begin(),retV.end()); filler.fill(); - iEvent.put(isoMap); + iEvent.put(std::move(isoMap)); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaHcalPFClusterIsolationProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaHcalPFClusterIsolationProducer.cc index 660508e58746d..f3717fd8e3dcb 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaHcalPFClusterIsolationProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaHcalPFClusterIsolationProducer.cc @@ -71,7 +71,7 @@ void EgammaHcalPFClusterIsolationProducer::produce(edm::Event& iEvent, const edm::Handle emObjectHandle; iEvent.getByToken(emObjectProducer_, emObjectHandle); - std::auto_ptr > isoMap(new edm::ValueMap()); + auto isoMap = std::make_unique>(); edm::ValueMap::Filler filler(*isoMap); std::vector retV(emObjectHandle->size(),0); @@ -99,7 +99,7 @@ void EgammaHcalPFClusterIsolationProducer::produce(edm::Event& iEvent, const filler.insert(emObjectHandle,retV.begin(),retV.end()); filler.fill(); - iEvent.put(isoMap); + iEvent.put(std::move(isoMap)); } typedef EgammaHcalPFClusterIsolationProducer ElectronHcalPFClusterIsolationProducer; diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoESDetIdCollectionProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoESDetIdCollectionProducer.cc index 2e740507ff9e9..8fbd188379979 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoESDetIdCollectionProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoESDetIdCollectionProducer.cc @@ -95,9 +95,9 @@ EgammaIsoESDetIdCollectionProducer::produce (edm::Event& iEvent, std::sort(indexToStore.begin(),indexToStore.end()); std::unique(indexToStore.begin(),indexToStore.end()); - std::auto_ptr< DetIdCollection > detIdCollection (new DetIdCollection(indexToStore) ) ; + auto detIdCollection = std::make_unique(indexToStore); - iEvent.put( detIdCollection, interestingDetIdCollection_ ); + iEvent.put(std::move(detIdCollection), interestingDetIdCollection_ ); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoHcalDetIdCollectionProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoHcalDetIdCollectionProducer.cc index b273a4d519851..cc4fde913a4e8 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoHcalDetIdCollectionProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaIsoHcalDetIdCollectionProducer.cc @@ -92,9 +92,9 @@ EgammaIsoHcalDetIdCollectionProducer::produce (edm::Event& iEvent, std::sort(indexToStore.begin(),indexToStore.end()); std::unique(indexToStore.begin(),indexToStore.end()); - std::auto_ptr< DetIdCollection > detIdCollection (new DetIdCollection(indexToStore) ) ; + auto detIdCollection = std::make_unique(indexToStore); - iEvent.put( detIdCollection, interestingDetIdCollection_ ); + iEvent.put(std::move(detIdCollection), interestingDetIdCollection_ ); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaPhotonTkIsolationProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaPhotonTkIsolationProducer.cc index c3744dff643dd..969549d8b8b1b 100755 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaPhotonTkIsolationProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaPhotonTkIsolationProducer.cc @@ -71,7 +71,7 @@ EgammaPhotonTkIsolationProducer::produce(edm::Event& iEvent, const edm::EventSet reco::TrackBase::Point beamspot = beamSpotH->position(); //prepare product - std::auto_ptr > isoMap(new edm::ValueMap()); + auto isoMap = std::make_unique>(); edm::ValueMap::Filler filler(*isoMap); std::vector retV(photonHandle->size(),0); @@ -85,7 +85,7 @@ EgammaPhotonTkIsolationProducer::produce(edm::Event& iEvent, const edm::EventSet //fill and insert valuemap filler.insert(photonHandle,retV.begin(),retV.end()); filler.fill(); - iEvent.put(isoMap); + iEvent.put(std::move(isoMap)); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaPhotonTkNumIsolationProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaPhotonTkNumIsolationProducer.cc index 8dd6cb3ee425a..6eb1e6b88dac5 100755 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaPhotonTkNumIsolationProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaPhotonTkNumIsolationProducer.cc @@ -69,7 +69,7 @@ EgammaPhotonTkNumIsolationProducer::produce(edm::Event& iEvent, const edm::Event reco::TrackBase::Point beamspot = beamSpotH->position(); //prepare product - std::auto_ptr > isoMap(new edm::ValueMap()); + auto isoMap = std::make_unique>(); edm::ValueMap::Filler filler(*isoMap); std::vector retV(photonHandle->size(),0); @@ -85,7 +85,7 @@ EgammaPhotonTkNumIsolationProducer::produce(edm::Event& iEvent, const edm::Event //fill and insert valuemap filler.insert(photonHandle,retV.begin(),retV.end()); filler.fill(); - iEvent.put(isoMap); + iEvent.put(std::move(isoMap)); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaTowerIsolationProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaTowerIsolationProducer.cc index 0e14fe691d3ed..05825ab592ea4 100755 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaTowerIsolationProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EgammaTowerIsolationProducer.cc @@ -60,7 +60,7 @@ EgammaTowerIsolationProducer::produce(edm::Event& iEvent, const edm::EventSetup& iEvent.getByLabel(towerProducer_, towerHandle); const CaloTowerCollection* towers = towerHandle.product(); - std::auto_ptr > isoMap(new edm::ValueMap()); + auto isoMap = std::make_unique>(); edm::ValueMap::Filler filler(*isoMap); std::vector retV(emObjectHandle->size(),0); @@ -78,7 +78,7 @@ EgammaTowerIsolationProducer::produce(edm::Event& iEvent, const edm::EventSetup& filler.insert(emObjectHandle,retV.begin(),retV.end()); filler.fill(); - iEvent.put(isoMap); + iEvent.put(std::move(isoMap)); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/EleIsoDetIdCollectionProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/EleIsoDetIdCollectionProducer.cc index 4be9c0c0606ac..e4e981eecb914 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/EleIsoDetIdCollectionProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/EleIsoDetIdCollectionProducer.cc @@ -108,7 +108,7 @@ EleIsoDetIdCollectionProducer::produce (edm::Event& iEvent, const edm::EventSetu doubleConeSel_= new CaloDualConeSelector(innerRadius_,outerRadius_, &*pG, DetId::Ecal, EcalEndcap); //Create empty output collections - std::auto_ptr< DetIdCollection > detIdCollection (new DetIdCollection() ) ; + auto detIdCollection = std::make_unique(); reco::GsfElectronCollection::const_iterator emObj; if(doubleConeSel_) { //if cone selector was created @@ -176,5 +176,5 @@ EleIsoDetIdCollectionProducer::produce (edm::Event& iEvent, const edm::EventSetu delete doubleConeSel_; } //end if cone selector was created - iEvent.put( detIdCollection, interestingDetIdCollection_ ); + iEvent.put(std::move(detIdCollection), interestingDetIdCollection_ ); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/GamIsoDetIdCollectionProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/GamIsoDetIdCollectionProducer.cc index 9a967fe867463..98377c0c20271 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/GamIsoDetIdCollectionProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/GamIsoDetIdCollectionProducer.cc @@ -107,7 +107,7 @@ GamIsoDetIdCollectionProducer::produce (edm::Event& iEvent, doubleConeSel_= new CaloDualConeSelector(innerRadius_,outerRadius_, &*pG, DetId::Ecal, EcalEndcap); //Create empty output collections - std::auto_ptr< DetIdCollection > detIdCollection (new DetIdCollection() ) ; + auto detIdCollection = std::make_unique(); reco::PhotonCollection::const_iterator emObj; if(doubleConeSel_) { //if cone selector was created @@ -175,5 +175,5 @@ GamIsoDetIdCollectionProducer::produce (edm::Event& iEvent, delete doubleConeSel_; } //end if cone selector was created - iEvent.put( detIdCollection, interestingDetIdCollection_ ); + iEvent.put(std::move(detIdCollection), interestingDetIdCollection_ ); } diff --git a/RecoEgamma/EgammaIsolationAlgos/plugins/ParticleBasedIsoProducer.cc b/RecoEgamma/EgammaIsolationAlgos/plugins/ParticleBasedIsoProducer.cc index 5fb5b75f2ac16..a0ca3beb74637 100644 --- a/RecoEgamma/EgammaIsolationAlgos/plugins/ParticleBasedIsoProducer.cc +++ b/RecoEgamma/EgammaIsolationAlgos/plugins/ParticleBasedIsoProducer.cc @@ -187,26 +187,24 @@ void ParticleBasedIsoProducer::produce(edm::Event& theEvent, const edm::EventSet - std::auto_ptr> > - phoToPFCandIsoMap_p(new edm::ValueMap>()); + auto phoToPFCandIsoMap_p = std::make_unique>>(); edm::ValueMap>::Filler fillerPhotons(*phoToPFCandIsoMap_p); //// fill the isolation value map for photons fillerPhotons.insert(photonHandle,pfCandIsoPairVecPho.begin(),pfCandIsoPairVecPho.end()); fillerPhotons.fill(); - theEvent.put(phoToPFCandIsoMap_p,valueMapPhoPFCandIso_); + theEvent.put(std::move(phoToPFCandIsoMap_p),valueMapPhoPFCandIso_); - std::auto_ptr> > - eleToPFCandIsoMap_p(new edm::ValueMap>()); + auto eleToPFCandIsoMap_p = std::make_unique>>(); edm::ValueMap>::Filler fillerElectrons(*eleToPFCandIsoMap_p); //// fill the isolation value map for electrons fillerElectrons.insert(electronHandle,pfCandIsoPairVecEle.begin(),pfCandIsoPairVecEle.end()); fillerElectrons.fill(); - theEvent.put(eleToPFCandIsoMap_p,valueMapElePFCandIso_); + theEvent.put(std::move(eleToPFCandIsoMap_p),valueMapElePFCandIso_); diff --git a/RecoEgamma/EgammaPhotonProducers/interface/ConversionTrackMerger.h b/RecoEgamma/EgammaPhotonProducers/interface/ConversionTrackMerger.h index bdd52688bbb3b..ff399b6a26cd8 100644 --- a/RecoEgamma/EgammaPhotonProducers/interface/ConversionTrackMerger.h +++ b/RecoEgamma/EgammaPhotonProducers/interface/ConversionTrackMerger.h @@ -43,7 +43,7 @@ edm::EDGetTokenT trackProducer1; edm::EDGetTokenT trackProducer2; - std::auto_ptr outputTrks; + std::unique_ptr outputTrks; }; diff --git a/RecoEgamma/EgammaPhotonProducers/interface/ConversionTrackProducer.h b/RecoEgamma/EgammaPhotonProducers/interface/ConversionTrackProducer.h index c40f8f60aa94c..e41df232c5301 100644 --- a/RecoEgamma/EgammaPhotonProducers/interface/ConversionTrackProducer.h +++ b/RecoEgamma/EgammaPhotonProducers/interface/ConversionTrackProducer.h @@ -80,6 +80,6 @@ namespace reco { IdealHelixParameters ConvTrackPreSelector; //-------------------------------------------------- - std::auto_ptr outputTrks; + std::unique_ptr outputTrks; }; #endif diff --git a/RecoEgamma/EgammaPhotonProducers/interface/TrackProducerWithSCAssociation.h b/RecoEgamma/EgammaPhotonProducers/interface/TrackProducerWithSCAssociation.h index 5075b81b5a977..e806f43dc179f 100644 --- a/RecoEgamma/EgammaPhotonProducers/interface/TrackProducerWithSCAssociation.h +++ b/RecoEgamma/EgammaPhotonProducers/interface/TrackProducerWithSCAssociation.h @@ -44,10 +44,10 @@ class TrackProducerWithSCAssociation : public TrackProducerBase, pu void putInEvt(edm::Event& evt, const Propagator* thePropagator, const MeasurementTracker* theMeasTk, - std::auto_ptr& selHits, - std::auto_ptr& selTracks, - std::auto_ptr& selTrackExtras, - std::auto_ptr >& selTrajectories, + std::unique_ptr selHits, + std::unique_ptr selTracks, + std::unique_ptr selTrackExtras, + std::unique_ptr> selTrajectories, AlgoProductCollection& algoResults, TransientTrackingRecHitBuilder const * hitBuilder, const TrackerTopology *ttopo); }; diff --git a/RecoEgamma/EgammaPhotonProducers/src/ConversionProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/ConversionProducer.cc index 78d2d2878f1e4..23edec0774977 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ConversionProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ConversionProducer.cc @@ -185,7 +185,7 @@ ConversionProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) using namespace edm; reco::ConversionCollection outputConvPhotonCollection; - std::auto_ptr outputConvPhotonCollection_p(new reco::ConversionCollection); + auto outputConvPhotonCollection_p = std::make_unique(); //std::cout << " ConversionProducer::produce " << std::endl; //Read multiple track input collections @@ -226,7 +226,7 @@ ConversionProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) the_pvtx = *(vertexCollection.begin()); if (trackCollectionHandle->size()> maxNumOfTrackInPU_){ - iEvent.put( outputConvPhotonCollection_p, ConvertedPhotonCollection_); + iEvent.put(std::move(outputConvPhotonCollection_p), ConvertedPhotonCollection_); return; } @@ -241,7 +241,7 @@ ConversionProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) buildCollection( iEvent, iSetup, convTrackMap, superClusterPtrs, basicClusterPtrs, the_pvtx, outputConvPhotonCollection);//allow empty basicClusterPtrs outputConvPhotonCollection_p->assign(outputConvPhotonCollection.begin(), outputConvPhotonCollection.end()); - iEvent.put( outputConvPhotonCollection_p, ConvertedPhotonCollection_); + iEvent.put(std::move(outputConvPhotonCollection_p), ConvertedPhotonCollection_); } diff --git a/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackCandidateProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackCandidateProducer.cc index a4bb8aa5276e7..e8e685b0c2994 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackCandidateProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackCandidateProducer.cc @@ -185,12 +185,12 @@ void ConversionTrackCandidateProducer::produce(edm::Event& theEvent, const edm:: // create empty output collections // // Out In Track Candidates - std::auto_ptr outInTrackCandidate_p(new TrackCandidateCollection); + auto outInTrackCandidate_p = std::make_unique(); // In Out Track Candidates - std::auto_ptr inOutTrackCandidate_p(new TrackCandidateCollection); + auto inOutTrackCandidate_p = std::make_unique(); // Track Candidate calo Cluster Association - std::auto_ptr outInAssoc_p(new reco::TrackCandidateCaloClusterPtrAssociation); - std::auto_ptr inOutAssoc_p(new reco::TrackCandidateCaloClusterPtrAssociation); + auto outInAssoc_p = std::make_unique(); + auto inOutAssoc_p = std::make_unique(); // Get the basic cluster collection in the Barrel bool validBarrelBCHandle=true; @@ -274,11 +274,11 @@ void ConversionTrackCandidateProducer::produce(edm::Event& theEvent, const edm:: // put all products in the event // Barrel //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*outInTrackCandidate_p).size() << " Out In track Candidates " << "\n"; - const edm::OrphanHandle refprodOutInTrackC = theEvent.put( outInTrackCandidate_p, OutInTrackCandidateCollection_ ); + const edm::OrphanHandle refprodOutInTrackC = theEvent.put(std::move(outInTrackCandidate_p), OutInTrackCandidateCollection_ ); //std::cout << "ConversionTrackCandidateProducer refprodOutInTrackC size " << (*(refprodOutInTrackC.product())).size() << "\n"; // //std::cout << "ConversionTrackCandidateProducer Putting in the event " << (*inOutTrackCandidate_p).size() << " In Out track Candidates " << "\n"; - const edm::OrphanHandle refprodInOutTrackC = theEvent.put( inOutTrackCandidate_p, InOutTrackCandidateCollection_ ); + const edm::OrphanHandle refprodInOutTrackC = theEvent.put(std::move(inOutTrackCandidate_p), InOutTrackCandidateCollection_ ); //std::cout << "ConversionTrackCandidateProducer refprodInOutTrackC size " << (*(refprodInOutTrackC.product())).size() << "\n"; @@ -292,10 +292,10 @@ void ConversionTrackCandidateProducer::produce(edm::Event& theEvent, const edm:: // std::cout << "ConversionTrackCandidateProducer Putting in the event OutIn track - SC association: size " << (*outInAssoc_p).size() << "\n"; - theEvent.put( outInAssoc_p, OutInTrackSuperClusterAssociationCollection_); + theEvent.put(std::move(outInAssoc_p), OutInTrackSuperClusterAssociationCollection_); // std::cout << "ConversionTrackCandidateProducer Putting in the event InOut track - SC association: size " << (*inOutAssoc_p).size() << "\n"; - theEvent.put( inOutAssoc_p, InOutTrackSuperClusterAssociationCollection_); + theEvent.put(std::move(inOutAssoc_p), InOutTrackSuperClusterAssociationCollection_); theOutInSeedFinder_->clear(); theInOutSeedFinder_->clear(); diff --git a/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackMerger.cc b/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackMerger.cc index dae1a48d15661..ab5f15e345b6b 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackMerger.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ConversionTrackMerger.cc @@ -102,7 +102,7 @@ reco::ConversionTrackCollection tC2 = *TC2; // Step B: create empty output collection - outputTrks = std::auto_ptr(new reco::ConversionTrackCollection); + outputTrks = std::make_unique(); int i; std::vector selected1; for (unsigned int i=0; i(new reco::ConversionTrackCollection); + outputTrks = std::make_unique(); //-------------------------------------------------- //Added by D. Giordano @@ -161,7 +161,7 @@ ConversionTrackProducer::ConversionTrackProducer(edm::ParameterSet const& conf) outputTrks->push_back(convTrack); } - e.put(outputTrks); + e.put(std::move(outputTrks)); return; }//end produce diff --git a/RecoEgamma/EgammaPhotonProducers/src/ConvertedPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/ConvertedPhotonProducer.cc index abb847a559b17..dfaafbf124010 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ConvertedPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ConvertedPhotonProducer.cc @@ -167,10 +167,10 @@ void ConvertedPhotonProducer::produce(edm::Event& theEvent, const edm::EventSetu // // Converted photon candidates reco::ConversionCollection outputConvPhotonCollection; - std::auto_ptr outputConvPhotonCollection_p(new reco::ConversionCollection); + auto outputConvPhotonCollection_p = std::make_unique(); // Converted photon candidates reco::ConversionCollection cleanedConversionCollection; - std::auto_ptr cleanedConversionCollection_p(new reco::ConversionCollection); + auto cleanedConversionCollection_p = std::make_unique(); // Get the Super Cluster collection in the Barrel @@ -298,7 +298,7 @@ void ConvertedPhotonProducer::produce(edm::Event& theEvent, const edm::EventSetu // put the product in the event outputConvPhotonCollection_p->assign(outputConvPhotonCollection.begin(),outputConvPhotonCollection.end()); //LogDebug("ConvertedPhotonProducer") << " ConvertedPhotonProducer Putting in the event converted photon candidates " << (*outputConvPhotonCollection_p).size() << "\n"; - const edm::OrphanHandle conversionHandle= theEvent.put( outputConvPhotonCollection_p, ConvertedPhotonCollection_); + const edm::OrphanHandle conversionHandle= theEvent.put(std::move(outputConvPhotonCollection_p), ConvertedPhotonCollection_); // Loop over barrel and endcap SC collections and fill the photon collection @@ -311,7 +311,7 @@ void ConvertedPhotonProducer::produce(edm::Event& theEvent, const edm::EventSetu cleanedConversionCollection_p->assign(cleanedConversionCollection.begin(),cleanedConversionCollection.end()); - theEvent.put( cleanedConversionCollection_p, CleanedConvertedPhotonCollection_); + theEvent.put(std::move(cleanedConversionCollection_p), CleanedConvertedPhotonCollection_); } diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonCoreProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonCoreProducer.cc index 73f67f88df351..766297153b1f5 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonCoreProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonCoreProducer.cc @@ -65,7 +65,7 @@ void GEDPhotonCoreProducer::produce(edm::Event &theEvent, const edm::EventSetup& // nEvt_++; reco::PhotonCoreCollection outputPhotonCoreCollection; - std::auto_ptr< reco::PhotonCoreCollection > outputPhotonCoreCollection_p(new reco::PhotonCoreCollection); + auto outputPhotonCoreCollection_p = std::make_unique(); // Get the PF refined cluster collection Handle pfCandidateHandle; @@ -142,7 +142,7 @@ void GEDPhotonCoreProducer::produce(edm::Event &theEvent, const edm::EventSetup& // put the product in the event // edm::LogInfo("GEDPhotonCoreProducer") << " Put in the event " << iSC << " Photon Candidates \n"; outputPhotonCoreCollection_p->assign(outputPhotonCoreCollection.begin(),outputPhotonCoreCollection.end()); - theEvent.put( outputPhotonCoreCollection_p, GEDPhotonCoreCollection_); + theEvent.put(std::move(outputPhotonCoreCollection_p), GEDPhotonCoreCollection_); diff --git a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc index 65b249a70f774..616cec9a79e5f 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/GEDPhotonProducer.cc @@ -235,7 +235,7 @@ void GEDPhotonProducer::produce(edm::Event& theEvent, const edm::EventSetup& the // nEvt_++; reco::PhotonCollection outputPhotonCollection; - std::auto_ptr< reco::PhotonCollection > outputPhotonCollection_p(new reco::PhotonCollection); + auto outputPhotonCollection_p = std::make_unique(); edm::ValueMap pfEGCandToPhotonMap; @@ -398,12 +398,12 @@ void GEDPhotonProducer::produce(edm::Event& theEvent, const edm::EventSetup& the // put the product in the event edm::LogInfo("GEDPhotonProducer") << " Put in the event " << iSC << " Photon Candidates \n"; outputPhotonCollection_p->assign(outputPhotonCollection.begin(),outputPhotonCollection.end()); - const edm::OrphanHandle photonOrphHandle = theEvent.put(outputPhotonCollection_p, photonCollection_); + const edm::OrphanHandle photonOrphHandle = theEvent.put(std::move(outputPhotonCollection_p), photonCollection_); if ( reconstructionStep_ != "final" ) { //// Define the value map which associate to each Egamma-unbiassaed candidate (key-ref) the corresponding PhotonRef - std::auto_ptr > pfEGCandToPhotonMap_p(new edm::ValueMap()); + auto pfEGCandToPhotonMap_p = std::make_unique>(); edm::ValueMap::Filler filler(*pfEGCandToPhotonMap_p); unsigned nObj = pfEGCandidateHandle->size(); std::vector values(nObj); @@ -423,7 +423,7 @@ void GEDPhotonProducer::produce(edm::Event& theEvent, const edm::EventSetup& the filler.insert(pfEGCandidateHandle,values.begin(),values.end()); filler.fill(); - theEvent.put(pfEGCandToPhotonMap_p,valueMapPFCandPhoton_); + theEvent.put(std::move(pfEGCandToPhotonMap_p),valueMapPFCandPhoton_); } diff --git a/RecoEgamma/EgammaPhotonProducers/src/PhotonCoreProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/PhotonCoreProducer.cc index ce9577a0163a8..1ac336427cac3 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/PhotonCoreProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/PhotonCoreProducer.cc @@ -52,7 +52,7 @@ void PhotonCoreProducer::produce(edm::Event &theEvent, const edm::EventSetup& th // nEvt_++; reco::PhotonCoreCollection outputPhotonCoreCollection; - std::auto_ptr< reco::PhotonCoreCollection > outputPhotonCoreCollection_p(new reco::PhotonCoreCollection); + auto outputPhotonCoreCollection_p = std::make_unique(); // Get the Barrel Super Cluster collection bool validBarrelSCHandle=true; @@ -120,7 +120,7 @@ void PhotonCoreProducer::produce(edm::Event &theEvent, const edm::EventSetup& th // put the product in the event edm::LogInfo("PhotonCoreProducer") << " Put in the event " << iSC << " Photon Candidates \n"; outputPhotonCoreCollection_p->assign(outputPhotonCoreCollection.begin(),outputPhotonCoreCollection.end()); - theEvent.put( outputPhotonCoreCollection_p, PhotonCoreCollection_); + theEvent.put(std::move(outputPhotonCoreCollection_p), PhotonCoreCollection_); } diff --git a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc index 96965516b02d6..ef5e05203abd4 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/PhotonProducer.cc @@ -174,7 +174,7 @@ void PhotonProducer::produce(edm::Event& theEvent, const edm::EventSetup& theEve // nEvt_++; reco::PhotonCollection outputPhotonCollection; - std::auto_ptr< reco::PhotonCollection > outputPhotonCollection_p(new reco::PhotonCollection); + auto outputPhotonCollection_p = std::make_unique(); // Get the PhotonCore collection @@ -269,7 +269,7 @@ void PhotonProducer::produce(edm::Event& theEvent, const edm::EventSetup& theEve // put the product in the event edm::LogInfo("PhotonProducer") << " Put in the event " << iSC << " Photon Candidates \n"; outputPhotonCollection_p->assign(outputPhotonCollection.begin(),outputPhotonCollection.end()); - theEvent.put( outputPhotonCollection_p, PhotonCollection_); + theEvent.put(std::move(outputPhotonCollection_p), PhotonCollection_); } diff --git a/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc b/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc index 0224ddb0604a4..4e1ec7236bc0f 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/ReducedEGProducer.cc @@ -206,37 +206,37 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the const CaloTopology *caloTopology = & (*theCaloTopology); //initialize output collections - std::auto_ptr photons(new reco::PhotonCollection); - std::auto_ptr photonCores(new reco::PhotonCoreCollection); - std::auto_ptr gsfElectrons(new reco::GsfElectronCollection); - std::auto_ptr gsfElectronCores(new reco::GsfElectronCoreCollection); - std::auto_ptr conversions(new reco::ConversionCollection); - std::auto_ptr singleConversions(new reco::ConversionCollection); - std::auto_ptr superClusters(new reco::SuperClusterCollection); - std::auto_ptr ebeeClusters(new reco::CaloClusterCollection); - std::auto_ptr esClusters(new reco::CaloClusterCollection); - std::auto_ptr ebRecHits(new EcalRecHitCollection); - std::auto_ptr eeRecHits(new EcalRecHitCollection); - std::auto_ptr esRecHits(new EcalRecHitCollection); - std::auto_ptr > > photonPfCandMap(new edm::ValueMap >); - std::auto_ptr > > gsfElectronPfCandMap(new edm::ValueMap >); - - std::vector > > photonIds; + auto photons = std::make_unique(); + auto photonCores = std::make_unique(); + auto gsfElectrons = std::make_unique(); + auto gsfElectronCores = std::make_unique(); + auto conversions = std::make_unique(); + auto singleConversions = std::make_unique(); + auto superClusters = std::make_unique(); + auto ebeeClusters = std::make_unique(); + auto esClusters = std::make_unique(); + auto ebRecHits = std::make_unique(); + auto eeRecHits = std::make_unique(); + auto esRecHits = std::make_unique(); + auto photonPfCandMap = std::make_unique>>(); + auto gsfElectronPfCandMap = std::make_unique>>(); + + std::vector > > photonIds; for (unsigned int iid=0; iid); } - std::vector > > gsfElectronIds; + std::vector > > gsfElectronIds; for (unsigned int iid=0; iid); } - std::vector > > photonPFClusterIsos; + std::vector > > photonPFClusterIsos; for (unsigned int iid=0; iid); } - std::vector > > gsfElectronPFClusterIsos; + std::vector > > gsfElectronPFClusterIsos; for (unsigned int iid=0; iid); } @@ -532,8 +532,8 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the } } - theEvent.put(ebRecHits,outEBRecHits_); - theEvent.put(eeRecHits,outEERecHits_); + theEvent.put(std::move(ebRecHits),outEBRecHits_); + theEvent.put(std::move(eeRecHits),outEERecHits_); if (doPreshowerEcalHits_) { for (const EcalRecHit &rechit : *preshowerHitHandle) { @@ -541,13 +541,13 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the esRecHits->push_back(rechit); } } - theEvent.put(esRecHits,outESRecHits_); + theEvent.put(std::move(esRecHits),outESRecHits_); } //CaloClusters //put calocluster output collections in event and get orphan handles to create ptrs - const edm::OrphanHandle &outEBEEClusterHandle = theEvent.put(ebeeClusters,outEBEEClusters_); - const edm::OrphanHandle &outESClusterHandle = theEvent.put(esClusters,outESClusters_);; + const edm::OrphanHandle &outEBEEClusterHandle = theEvent.put(std::move(ebeeClusters),outEBEEClusters_); + const edm::OrphanHandle &outESClusterHandle = theEvent.put(std::move(esClusters),outESClusters_);; //loop over output superclusters and relink to output caloclusters for (reco::SuperCluster &superCluster : *superClusters) { @@ -600,9 +600,9 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the } //put superclusters and conversions in the event - const edm::OrphanHandle &outSuperClusterHandle = theEvent.put(superClusters,outSuperClusters_); - const edm::OrphanHandle &outConversionHandle = theEvent.put(conversions,outConversions_); - const edm::OrphanHandle &outSingleConversionHandle = theEvent.put(singleConversions,outSingleConversions_); + const edm::OrphanHandle &outSuperClusterHandle = theEvent.put(std::move(superClusters),outSuperClusters_); + const edm::OrphanHandle &outConversionHandle = theEvent.put(std::move(conversions),outConversions_); + const edm::OrphanHandle &outSingleConversionHandle = theEvent.put(std::move(singleConversions),outSingleConversions_); //loop over photoncores and relink superclusters (and conversions) for (reco::PhotonCore &photonCore : *photonCores) { @@ -664,8 +664,8 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the } //put photon and gsfelectroncores into the event - const edm::OrphanHandle &outPhotonCoreHandle = theEvent.put(photonCores,outPhotonCores_); - const edm::OrphanHandle &outgsfElectronCoreHandle = theEvent.put(gsfElectronCores,outGsfElectronCores_); + const edm::OrphanHandle &outPhotonCoreHandle = theEvent.put(std::move(photonCores),outPhotonCores_); + const edm::OrphanHandle &outgsfElectronCoreHandle = theEvent.put(std::move(gsfElectronCores),outGsfElectronCores_); //loop over photons and electrons and relink the cores for (reco::Photon &photon : *photons) { @@ -687,8 +687,8 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the } //(finally) store the output photon and electron collections - const edm::OrphanHandle &outPhotonHandle = theEvent.put(photons,outPhotons_); - const edm::OrphanHandle &outGsfElectronHandle = theEvent.put(gsfElectrons,outGsfElectrons_); + const edm::OrphanHandle &outPhotonHandle = theEvent.put(std::move(photons),outPhotons_); + const edm::OrphanHandle &outGsfElectronHandle = theEvent.put(std::move(gsfElectrons),outGsfElectrons_); //still need to output relinked valuemaps @@ -702,15 +702,15 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the fillerGsfElectrons.insert(outGsfElectronHandle,pfCandIsoPairVecEle.begin(),pfCandIsoPairVecEle.end()); fillerGsfElectrons.fill(); - theEvent.put(photonPfCandMap,outPhotonPfCandMap_); - theEvent.put(gsfElectronPfCandMap,outGsfElectronPfCandMap_); + theEvent.put(std::move(photonPfCandMap),outPhotonPfCandMap_); + theEvent.put(std::move(gsfElectronPfCandMap),outGsfElectronPfCandMap_); //photon id value maps for (unsigned int iid=0; iid::Filler fillerPhotonId(*photonIds[iid]); fillerPhotonId.insert(outPhotonHandle,photonIdVals[iid].begin(),photonIdVals[iid].end()); fillerPhotonId.fill(); - theEvent.put(photonIds[iid],outPhotonIds_[iid]); + theEvent.put(std::move(photonIds[iid]),outPhotonIds_[iid]); } //electron id value maps @@ -718,7 +718,7 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the edm::ValueMap::Filler fillerGsfElectronId(*gsfElectronIds[iid]); fillerGsfElectronId.insert(outGsfElectronHandle,gsfElectronIdVals[iid].begin(),gsfElectronIdVals[iid].end()); fillerGsfElectronId.fill(); - theEvent.put(gsfElectronIds[iid],outGsfElectronIds_[iid]); + theEvent.put(std::move(gsfElectronIds[iid]),outGsfElectronIds_[iid]); } //photon iso value maps @@ -726,14 +726,14 @@ void ReducedEGProducer::produce(edm::Event& theEvent, const edm::EventSetup& the edm::ValueMap::Filler fillerPhotonPFClusterIso(*photonPFClusterIsos[iid]); fillerPhotonPFClusterIso.insert(outPhotonHandle,photonPFClusterIsoVals[iid].begin(),photonPFClusterIsoVals[iid].end()); fillerPhotonPFClusterIso.fill(); - theEvent.put(photonPFClusterIsos[iid],outPhotonPFClusterIsos_[iid]); + theEvent.put(std::move(photonPFClusterIsos[iid]),outPhotonPFClusterIsos_[iid]); } //electron iso value maps for (unsigned int iid=0; iid::Filler fillerGsfElectronPFClusterIso(*gsfElectronPFClusterIsos[iid]); fillerGsfElectronPFClusterIso.insert(outGsfElectronHandle,gsfElectronPFClusterIsoVals[iid].begin(),gsfElectronPFClusterIsoVals[iid].end()); fillerGsfElectronPFClusterIso.fill(); - theEvent.put(gsfElectronPFClusterIsos[iid],outGsfElectronPFClusterIsos_[iid]); + theEvent.put(std::move(gsfElectronPFClusterIsos[iid]),outGsfElectronPFClusterIsos_[iid]); } } diff --git a/RecoEgamma/EgammaPhotonProducers/src/TrackProducerWithSCAssociation.cc b/RecoEgamma/EgammaPhotonProducers/src/TrackProducerWithSCAssociation.cc index d361aa5d887c2..82b52f94270a6 100644 --- a/RecoEgamma/EgammaPhotonProducers/src/TrackProducerWithSCAssociation.cc +++ b/RecoEgamma/EgammaPhotonProducers/src/TrackProducerWithSCAssociation.cc @@ -70,12 +70,12 @@ void TrackProducerWithSCAssociation::produce(edm::Event& theEvent, const edm::Ev // // create empty output collections // - std::auto_ptr outputRHColl (new TrackingRecHitCollection); - std::auto_ptr outputTColl(new reco::TrackCollection); - std::auto_ptr outputTEColl(new reco::TrackExtraCollection); - std::auto_ptr > outputTrajectoryColl(new std::vector); + auto outputRHColl = std::make_unique(); + auto outputTColl = std::make_unique(); + auto outputTEColl = std::make_unique(); + auto outputTrajectoryColl = std::make_unique>(); // Reco Track - Super Cluster Association - std::auto_ptr scTrkAssoc_p(new reco::TrackCaloClusterPtrAssociation); + auto scTrkAssoc_p = std::make_unique(); // //declare and get stuff to be retrieved from ES @@ -184,7 +184,8 @@ void TrackProducerWithSCAssociation::produce(edm::Event& theEvent, const edm::Ev //put everything in the event // we copy putInEvt to get OrphanHandle filled... putInEvt(theEvent,thePropagator.product(),theMeasTk.product(), - outputRHColl, outputTColl, outputTEColl, outputTrajectoryColl, algoResults, theBuilder.product(), ttopo); + std::move(outputRHColl), std::move(outputTColl), std::move(outputTEColl), std::move(outputTrajectoryColl), + algoResults, theBuilder.product(), ttopo); // now construct associationmap and put it in the event if ( validTrackCandidateSCAssociationInput_ ) { @@ -203,7 +204,7 @@ void TrackProducerWithSCAssociation::produce(edm::Event& theEvent, const edm::Ev filler.fill(); } - theEvent.put(scTrkAssoc_p,trackSuperClusterAssociationCollection_ ); + theEvent.put(std::move(scTrkAssoc_p),trackSuperClusterAssociationCollection_ ); } @@ -264,10 +265,10 @@ std::vector TrackProducerWithSCAssociation::getTransient(e void TrackProducerWithSCAssociation::putInEvt(edm::Event& evt, const Propagator* thePropagator, const MeasurementTracker* theMeasTk, - std::auto_ptr& selHits, - std::auto_ptr& selTracks, - std::auto_ptr& selTrackExtras, - std::auto_ptr >& selTrajectories, + std::unique_ptr selHits, + std::unique_ptr selTracks, + std::unique_ptr selTrackExtras, + std::unique_ptr> selTrajectories, AlgoProductCollection& algoResults, TransientTrackingRecHitBuilder const * hitBuilder, const TrackerTopology *ttopo) { @@ -408,17 +409,17 @@ TrackingRecHitRefProd rHits = evt.getRefBeforePut(); //LogTrace("TrackingRegressionTest") << "================================================="; - rTracks_ = evt.put( selTracks ); + rTracks_ = evt.put(std::move(selTracks)); - evt.put( selTrackExtras ); - evt.put( selHits ); + evt.put(std::move(selTrackExtras)); + evt.put(std::move(selHits)); if(myTrajectoryInEvent_) { - edm::OrphanHandle > rTrajs = evt.put(selTrajectories); + edm::OrphanHandle > rTrajs = evt.put(std::move(selTrajectories)); // Now Create traj<->tracks association map - std::auto_ptr trajTrackMap( new TrajTrackAssociationCollection(rTrajs, rTracks_) ); + auto trajTrackMap = std::make_unique(rTrajs, rTracks_); for ( std::map::iterator i = tjTkMap.begin(); i != tjTkMap.end(); i++ ) { edm::Ref > trajRef( rTrajs, (*i).first ); @@ -426,6 +427,6 @@ TrackingRecHitRefProd rHits = evt.getRefBeforePut(); trajTrackMap->insert( edm::Ref >( rTrajs, (*i).first ), edm::Ref( rTracks_, (*i).second ) ); } - evt.put( trajTrackMap ); + evt.put(std::move(trajTrackMap)); } } diff --git a/RecoEgamma/EgammaTools/interface/MVAValueMapProducer.h b/RecoEgamma/EgammaTools/interface/MVAValueMapProducer.h index 2207d0938b432..c4b5137c50e35 100644 --- a/RecoEgamma/EgammaTools/interface/MVAValueMapProducer.h +++ b/RecoEgamma/EgammaTools/interface/MVAValueMapProducer.h @@ -28,7 +28,7 @@ class MVAValueMapProducer : public edm::stream::EDProducer< edm::GlobalCache initializeGlobalCache(const edm::ParameterSet& conf) { - return std::unique_ptr(new egamma::MVAObjectCache(conf)); + return std::make_unique(conf); } static void globalEndJob(const egamma::MVAObjectCache * ) { @@ -154,11 +154,11 @@ void MVAValueMapProducer::writeValueMap(edm::Event &iEvent, { using namespace edm; using namespace std; - auto_ptr > valMap(new ValueMap()); + auto valMap = std::make_unique>(); 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); } template diff --git a/RecoEgamma/ElectronIdentification/plugins/ElectronIDExternalProducer.h b/RecoEgamma/ElectronIdentification/plugins/ElectronIDExternalProducer.h index fc14fb672417c..2d5faee45cea3 100644 --- a/RecoEgamma/ElectronIdentification/plugins/ElectronIDExternalProducer.h +++ b/RecoEgamma/ElectronIdentification/plugins/ElectronIDExternalProducer.h @@ -52,12 +52,12 @@ void ElectronIDExternalProducer::produce(edm::Event & iEvent, const edm::E } // fill in the ValueMap - std::auto_ptr > out(new edm::ValueMap()); + auto out = std::make_unique>(); edm::ValueMap::Filler filler(*out); filler.insert(electrons, values.begin(), values.end()); filler.fill(); // and put it into the event - iEvent.put(out); + iEvent.put(std::move(out)); } #endif diff --git a/RecoEgamma/ElectronIdentification/plugins/ElectronIDValueMapProducer.cc b/RecoEgamma/ElectronIdentification/plugins/ElectronIDValueMapProducer.cc index 3b7cd609c1304..d79e42d8dc15b 100644 --- a/RecoEgamma/ElectronIdentification/plugins/ElectronIDValueMapProducer.cc +++ b/RecoEgamma/ElectronIdentification/plugins/ElectronIDValueMapProducer.cc @@ -177,11 +177,11 @@ void ElectronIDValueMapProducer::writeValueMap(edm::Event &iEvent, { using namespace edm; using namespace std; - auto_ptr > valMap(new ValueMap()); + auto valMap = std::make_unique>(); edm::ValueMap::Filler filler(*valMap); filler.insert(handle, values.begin(), values.end()); filler.fill(); - iEvent.put(valMap, label); + iEvent.put(std::move(valMap), label); } void ElectronIDValueMapProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { diff --git a/RecoEgamma/ElectronIdentification/plugins/ElectronIdMVABased.cc b/RecoEgamma/ElectronIdentification/plugins/ElectronIdMVABased.cc index a774f3454ca4d..036d095296346 100644 --- a/RecoEgamma/ElectronIdentification/plugins/ElectronIdMVABased.cc +++ b/RecoEgamma/ElectronIdentification/plugins/ElectronIdMVABased.cc @@ -62,7 +62,7 @@ class ElectronIdMVABased : public edm::stream::EDFilter< edm::GlobalCache initializeGlobalCache( const edm::ParameterSet& conf ) { - return std::unique_ptr(new gsfidhelper::HeavyObjectCache(conf)); + return std::make_unique(conf); } static void globalEndJob(gsfidhelper::HeavyObjectCache const* ) { @@ -124,7 +124,7 @@ bool ElectronIdMVABased::filter(edm::Event& iEvent, const edm::EventSetup& iSetu constexpr double etaEBEE = 1.485; - std::auto_ptr mvaElectrons(new reco::GsfElectronCollection); + auto mvaElectrons = std::make_unique(); Handle vertexCollection; iEvent.getByToken(vertexToken, vertexCollection); @@ -151,7 +151,7 @@ bool ElectronIdMVABased::filter(edm::Event& iEvent, const edm::EventSetup& iSetu } } - iEvent.put(mvaElectrons); + iEvent.put(std::move(mvaElectrons)); return true; } diff --git a/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Phys14NonTrig.cc b/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Phys14NonTrig.cc index e6370bda890c0..5774dabfbcc83 100644 --- a/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Phys14NonTrig.cc +++ b/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Phys14NonTrig.cc @@ -186,7 +186,7 @@ createSingleReader(const int iCategory, const edm::FileInPath &weightFile) { // std::unique_ptr temp( tmpTMVAReader.BookMVA(_MethodName , weightFile.fullPath() ) ); - return std::unique_ptr ( new GBRForest( dynamic_cast( tmpTMVAReader.FindMVA(_MethodName) ) ) ); + return std::make_unique(dynamic_cast(tmpTMVAReader.FindMVA(_MethodName) ) ); } // A function that should work on both pat and reco objects diff --git a/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Spring15NonTrig.cc b/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Spring15NonTrig.cc index 99b7dd1836ee7..926537e8d06b3 100644 --- a/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Spring15NonTrig.cc +++ b/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Spring15NonTrig.cc @@ -210,7 +210,7 @@ createSingleReader(const int iCategory, const edm::FileInPath &weightFile){ // std::unique_ptr temp( tmpTMVAReader.BookMVA(_MethodName , weightFile.fullPath() ) ); - return std::unique_ptr ( new GBRForest( dynamic_cast( tmpTMVAReader.FindMVA(_MethodName) ) ) ); + return std::make_unique(dynamic_cast( tmpTMVAReader.FindMVA(_MethodName) ) ); } // A function that should work on both pat and reco objects diff --git a/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Spring15Trig.cc b/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Spring15Trig.cc index 4957e26314dc8..0b38ddd2d3866 100644 --- a/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Spring15Trig.cc +++ b/RecoEgamma/ElectronIdentification/plugins/ElectronMVAEstimatorRun2Spring15Trig.cc @@ -189,7 +189,7 @@ createSingleReader(const int iCategory, const edm::FileInPath &weightFile){ // std::unique_ptr temp( tmpTMVAReader.BookMVA(_MethodName , weightFile.fullPath() ) ); - return std::unique_ptr ( new GBRForest( dynamic_cast( tmpTMVAReader.FindMVA(_MethodName) ) ) ); + return std::make_unique(dynamic_cast( tmpTMVAReader.FindMVA(_MethodName) ) ); } // A function that should work on both pat and reco objects diff --git a/RecoEgamma/ElectronIdentification/plugins/ElectronRegressionValueMapProducer.cc b/RecoEgamma/ElectronIdentification/plugins/ElectronRegressionValueMapProducer.cc index 4e776fb63cf94..4167ceb75f1ee 100644 --- a/RecoEgamma/ElectronIdentification/plugins/ElectronRegressionValueMapProducer.cc +++ b/RecoEgamma/ElectronIdentification/plugins/ElectronRegressionValueMapProducer.cc @@ -226,11 +226,11 @@ void ElectronRegressionValueMapProducer::writeValueMap(edm::Event &iEvent, using namespace std; typedef ValueMap TValueMap; - auto_ptr valMap(new TValueMap()); + auto valMap = std::make_unique(); typename TValueMap::Filler filler(*valMap); filler.insert(handle, values.begin(), values.end()); filler.fill(); - iEvent.put(valMap, label); + iEvent.put(std::move(valMap), label); } void ElectronRegressionValueMapProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { diff --git a/RecoEgamma/PhotonIdentification/plugins/PhotonIDProducer.cc b/RecoEgamma/PhotonIdentification/plugins/PhotonIDProducer.cc index 0c2f61db298a3..051ec5991a5d1 100644 --- a/RecoEgamma/PhotonIdentification/plugins/PhotonIDProducer.cc +++ b/RecoEgamma/PhotonIdentification/plugins/PhotonIDProducer.cc @@ -56,26 +56,26 @@ void PhotonIDProducer::produce(edm::Event& e, const edm::EventSetup& c) { } - std::auto_ptr > outlooseEM(new edm::ValueMap()); + auto outlooseEM = std::make_unique>(); edm::ValueMap::Filler fillerlooseEM(*outlooseEM); fillerlooseEM.insert(photons, LooseEM.begin(), LooseEM.end()); fillerlooseEM.fill(); // and put it into the event - e.put(outlooseEM, photonCutBasedIDLooseEMLabel_); + e.put(std::move(outlooseEM), photonCutBasedIDLooseEMLabel_); - std::auto_ptr > outloose(new edm::ValueMap()); + auto outloose = std::make_unique>(); edm::ValueMap::Filler fillerloose(*outloose); fillerloose.insert(photons, Loose.begin(), Loose.end()); fillerloose.fill(); // and put it into the event - e.put(outloose, photonCutBasedIDLooseLabel_); + e.put(std::move(outloose), photonCutBasedIDLooseLabel_); - std::auto_ptr > outtight(new edm::ValueMap()); + auto outtight = std::make_unique>(); edm::ValueMap::Filler fillertight(*outtight); fillertight.insert(photons, Tight.begin(), Tight.end()); fillertight.fill(); // and put it into the event - e.put(outtight, photonCutBasedIDTightLabel_); + e.put(std::move(outtight), photonCutBasedIDTightLabel_); } diff --git a/RecoEgamma/PhotonIdentification/plugins/PhotonIDValueMapProducer.cc b/RecoEgamma/PhotonIdentification/plugins/PhotonIDValueMapProducer.cc index f6c438ba12862..bb9756b3acdcf 100644 --- a/RecoEgamma/PhotonIdentification/plugins/PhotonIDValueMapProducer.cc +++ b/RecoEgamma/PhotonIdentification/plugins/PhotonIDValueMapProducer.cc @@ -224,24 +224,24 @@ void PhotonIDValueMapProducer::produce(edm::Event& iEvent, const edm::EventSetup // Configure Lazy Tools if (usesES_) { if( isAOD ) - lazyToolnoZS = std::unique_ptr(new noZS::EcalClusterLazyTools(iEvent, iSetup, + lazyToolnoZS = std::make_unique(iEvent, iSetup, ebReducedRecHitCollection_, eeReducedRecHitCollection_, - esReducedRecHitCollection_)); + esReducedRecHitCollection_); else - lazyToolnoZS = std::unique_ptr(new noZS::EcalClusterLazyTools(iEvent, iSetup, + lazyToolnoZS = std::make_unique(iEvent, iSetup, ebReducedRecHitCollectionMiniAOD_, eeReducedRecHitCollectionMiniAOD_, - esReducedRecHitCollectionMiniAOD_)); + esReducedRecHitCollectionMiniAOD_); } else { if( isAOD ) - lazyToolnoZS = std::unique_ptr(new noZS::EcalClusterLazyTools(iEvent, iSetup, + lazyToolnoZS = std::make_unique(iEvent, iSetup, ebReducedRecHitCollection_, - eeReducedRecHitCollection_)); + eeReducedRecHitCollection_); else - lazyToolnoZS = std::unique_ptr(new noZS::EcalClusterLazyTools(iEvent, iSetup, + lazyToolnoZS = std::make_unique(iEvent, iSetup, ebReducedRecHitCollectionMiniAOD_, - eeReducedRecHitCollectionMiniAOD_)); + eeReducedRecHitCollectionMiniAOD_); } @@ -426,11 +426,11 @@ void PhotonIDValueMapProducer::writeValueMap(edm::Event &iEvent, { using namespace edm; using namespace std; - auto_ptr > valMap(new ValueMap()); + auto valMap = std::make_unique>(); edm::ValueMap::Filler filler(*valMap); filler.insert(handle, values.begin(), values.end()); filler.fill(); - iEvent.put(valMap, label); + iEvent.put(std::move(valMap), label); } void PhotonIDValueMapProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { diff --git a/RecoEgamma/PhotonIdentification/plugins/PhotonMVAEstimatorRun2Phys14NonTrig.cc b/RecoEgamma/PhotonIdentification/plugins/PhotonMVAEstimatorRun2Phys14NonTrig.cc index 9b1259c78dbfa..b0c411408d37a 100644 --- a/RecoEgamma/PhotonIdentification/plugins/PhotonMVAEstimatorRun2Phys14NonTrig.cc +++ b/RecoEgamma/PhotonIdentification/plugins/PhotonMVAEstimatorRun2Phys14NonTrig.cc @@ -177,7 +177,7 @@ createSingleReader(const int iCategory, const edm::FileInPath &weightFile) { // std::unique_ptr temp( tmpTMVAReader.BookMVA(_MethodName , weightFile.fullPath() ) ); - return std::unique_ptr( new GBRForest( dynamic_cast( tmpTMVAReader.FindMVA(_MethodName) ) ) ); + return std::make_unique(dynamic_cast( tmpTMVAReader.FindMVA(_MethodName) ) ); } // A function that should work on both pat and reco objects diff --git a/RecoEgamma/PhotonIdentification/plugins/PhotonMVAEstimatorRun2Spring15NonTrig.cc b/RecoEgamma/PhotonIdentification/plugins/PhotonMVAEstimatorRun2Spring15NonTrig.cc index ca40900b2af22..17b672f207564 100644 --- a/RecoEgamma/PhotonIdentification/plugins/PhotonMVAEstimatorRun2Spring15NonTrig.cc +++ b/RecoEgamma/PhotonIdentification/plugins/PhotonMVAEstimatorRun2Spring15NonTrig.cc @@ -186,7 +186,7 @@ createSingleReader(const int iCategory, const edm::FileInPath &weightFile){ // std::unique_ptr temp( tmpTMVAReader.BookMVA(_MethodName , weightFile.fullPath() ) ); - return std::unique_ptr( new GBRForest( dynamic_cast( tmpTMVAReader.FindMVA(_MethodName) ) ) ); + return std::make_unique(dynamic_cast( tmpTMVAReader.FindMVA(_MethodName) ) ); } diff --git a/RecoEgamma/PhotonIdentification/plugins/PhotonRegressionValueMapProducer.cc b/RecoEgamma/PhotonIdentification/plugins/PhotonRegressionValueMapProducer.cc index 848c7f5f852db..a3cabfc00d847 100644 --- a/RecoEgamma/PhotonIdentification/plugins/PhotonRegressionValueMapProducer.cc +++ b/RecoEgamma/PhotonIdentification/plugins/PhotonRegressionValueMapProducer.cc @@ -244,11 +244,11 @@ void PhotonRegressionValueMapProducer::writeValueMap(edm::Event &iEvent, using namespace std; typedef ValueMap TValueMap; - auto_ptr valMap(new TValueMap()); + auto valMap = std::make_unique(); typename TValueMap::Filler filler(*valMap); filler.insert(handle, values.begin(), values.end()); filler.fill(); - iEvent.put(valMap, label); + iEvent.put(std::move(valMap), label); } void PhotonRegressionValueMapProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {