Skip to content

Commit

Permalink
Merge pull request #24671 from gartung/Validation-Mixing-strictcxx17
Browse files Browse the repository at this point in the history
Validation/Mixing: replace templates deprecated by std=c++17
  • Loading branch information
cmsbuild committed Sep 28, 2018
2 parents 5085974 + c0c3d11 commit 31d6122
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Validation/Mixing/src/GlobalTest.cc
Expand Up @@ -153,15 +153,15 @@ GlobalTest::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
}

// part id for each track
std::auto_ptr<MixCollection<SimTrack> > coltr(new MixCollection<SimTrack>(cf_track.product()));
std::unique_ptr<MixCollection<SimTrack> > coltr(new MixCollection<SimTrack>(cf_track.product()));
MixCollection<SimTrack>::iterator cfitr;
for (cfitr=coltr->begin(); cfitr!=coltr->end();cfitr++) {
trackPartIdH_[cfitr.bunch()-minbunch_]->Fill(cfitr->type());
}

// energy sum
double sumE[10]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
std::auto_ptr<MixCollection<PCaloHit> > colecalb(new MixCollection<PCaloHit>(cf_calohitB.product()));
std::unique_ptr<MixCollection<PCaloHit> > colecalb(new MixCollection<PCaloHit>(cf_calohitB.product()));
MixCollection<PCaloHit>::iterator cfiecalb;
for (cfiecalb=colecalb->begin(); cfiecalb!=colecalb->end();cfiecalb++) {
sumE[cfiecalb.bunch()-minbunch_]+=cfiecalb->energy();
Expand All @@ -172,7 +172,7 @@ GlobalTest::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
caloEnergyEBH_[i-minbunch_]->Fill(sumE[i-minbunch_]);
}
double sumEE[10]={0.,0.,0.,0.,0.,0.,0.,0.,0.,0.};
std::auto_ptr<MixCollection<PCaloHit> > colecale(new MixCollection<PCaloHit>(cf_calohitE.product()));
std::unique_ptr<MixCollection<PCaloHit> > colecale(new MixCollection<PCaloHit>(cf_calohitE.product()));
MixCollection<PCaloHit>::iterator cfiecale;
for (cfiecale=colecale->begin(); cfiecale!=colecale->end();cfiecale++) {
sumEE[cfiecale.bunch()-minbunch_]+=cfiecale->energy();
Expand Down
10 changes: 5 additions & 5 deletions Validation/Mixing/src/MixCollectionValidation.cc
Expand Up @@ -135,7 +135,7 @@ void MixCollectionValidation::analyze(const edm::Event& iEvent, const edm::Event
gotHepMCProduct = iEvent.getByToken(crossingFrame_Hep_Token_, crossingFrame);

if (gotHepMCProduct){
std::auto_ptr<MixCollection<HepMCProduct> >
std::unique_ptr<MixCollection<HepMCProduct> >
hepMCProduct (new MixCollection<HepMCProduct>(crossingFrame.product ()));
MixCollection<HepMCProduct>::MixItr hitItr;

Expand All @@ -149,7 +149,7 @@ void MixCollectionValidation::analyze(const edm::Event& iEvent, const edm::Event
gotSimTrack = iEvent.getByToken(crossingFrame_SimTr_Token_,crossingFrame);

if (gotSimTrack){
std::auto_ptr<MixCollection<SimTrack> >
std::unique_ptr<MixCollection<SimTrack> >
simTracks (new MixCollection<SimTrack>(crossingFrame.product ()));
MixCollection<SimTrack>::MixItr hitItr;

Expand All @@ -164,7 +164,7 @@ void MixCollectionValidation::analyze(const edm::Event& iEvent, const edm::Event
gotSimVertex = iEvent.getByToken(crossingFrame_SimVtx_Token_, crossingFrame);

if (gotSimVertex){
std::auto_ptr<MixCollection<SimVertex> >
std::unique_ptr<MixCollection<SimVertex> >
simVerteces (new MixCollection<SimVertex>(crossingFrame.product ()));
MixCollection<SimVertex>::MixItr hitItr;

Expand All @@ -181,7 +181,7 @@ void MixCollectionValidation::analyze(const edm::Event& iEvent, const edm::Event
gotPSimHit = iEvent.getByToken(crossingFrame_PSimHit_Tokens_[i], crossingFrame);

if (gotPSimHit){
std::auto_ptr<MixCollection<PSimHit> >
std::unique_ptr<MixCollection<PSimHit> >
simHits (new MixCollection<PSimHit>(crossingFrame.product ()));

MixCollection<PSimHit>::MixItr hitItr;
Expand All @@ -203,7 +203,7 @@ void MixCollectionValidation::analyze(const edm::Event& iEvent, const edm::Event
gotPCaloHit = iEvent.getByToken(crossingFrame_PCaloHit_Tokens_[i], crossingFrame);

if (gotPCaloHit){
std::auto_ptr<MixCollection<PCaloHit> >
std::unique_ptr<MixCollection<PCaloHit> >
caloHits (new MixCollection<PCaloHit>(crossingFrame.product ()));

MixCollection<PCaloHit>::MixItr hitItr;
Expand Down
10 changes: 5 additions & 5 deletions Validation/Mixing/src/TestSuite.cc
Expand Up @@ -100,7 +100,7 @@ TestSuite::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
MonitorElement * trhistsig = dbe_->book1D(sighistotracks,"Bunchcrossings",maxbunch_-minbunch_+1,minbunch_,maxbunch_+1);
MonitorElement * trindhist = dbe_->book1D(histotracksind,"Track to Vertex indices",100,0,500);
MonitorElement * trindhistsig = dbe_->book1D(histotracksindsig,"Signal Track to Vertex indices",100,0,500);
std::auto_ptr<MixCollection<SimTrack> > col1(new MixCollection<SimTrack>(cf_track.product()));
std::unique_ptr<MixCollection<SimTrack> > col1(new MixCollection<SimTrack>(cf_track.product()));
MixCollection<SimTrack>::iterator cfi1;
for (cfi1=col1->begin(); cfi1!=col1->end();cfi1++) {
if (cfi1.getTrigger()==0) {
Expand All @@ -123,7 +123,7 @@ TestSuite::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
MonitorElement * vtxhistsig = dbe_->book1D(sighistovertices,"Bunchcrossings",maxbunch_-minbunch_+1,minbunch_,maxbunch_+1);
MonitorElement * vtxindhist = dbe_->book1D(histovertexindices,"Vertex to Track Indices",100,0,300);
MonitorElement * vtxindhistsig = dbe_->book1D(histovertexindicessig,"Signal Vertex to Track Indices",100,0,300);
std::auto_ptr<MixCollection<SimVertex> > col2(new MixCollection<SimVertex>(cf_vertex.product()));
std::unique_ptr<MixCollection<SimVertex> > col2(new MixCollection<SimVertex>(cf_vertex.product()));
MixCollection<SimVertex>::iterator cfi2;
for (cfi2=col2->begin(); cfi2!=col2->end();cfi2++) {
if (cfi2.getTrigger()==0) {
Expand All @@ -143,7 +143,7 @@ TestSuite::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
MonitorElement * tofhist = dbe_->book1D(tof,"TrackerHit_ToF",100,float(bsp*minbunch_),float(bsp*maxbunch_)+50.);
sprintf(tof,"SignalTrackerHit_Tof_bcr_%d",bunchcr_);
MonitorElement * tofhist_sig = dbe_->book1D(tof,"TrackerHit_ToF",100,float(bsp*minbunch_),float(bsp*maxbunch_)+50.);
std::auto_ptr<MixCollection<PSimHit> > colsh(new MixCollection<PSimHit>(cf_simhit.product()));
std::unique_ptr<MixCollection<PSimHit> > colsh(new MixCollection<PSimHit>(cf_simhit.product()));
MixCollection<PSimHit>::iterator cfish;
for (cfish=colsh->begin(); cfish!=colsh->end();cfish++) {
if (cfish.getTrigger()) {
Expand All @@ -160,7 +160,7 @@ TestSuite::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
sprintf(tof,"SignalEcalEBHit_Tof_bcr_%d",bunchcr_);
MonitorElement * tofecalhist_sig = dbe_->book1D(tof,"EcalEBHit_ToF",100,float(bsp*minbunch_),float(bsp*maxbunch_)+50.);
// std::string ecalsubdet("EcalHitsEB");
std::auto_ptr<MixCollection<PCaloHit> > colecal(new MixCollection<PCaloHit>(cf_calohitEcal.product()));
std::unique_ptr<MixCollection<PCaloHit> > colecal(new MixCollection<PCaloHit>(cf_calohitEcal.product()));
MixCollection<PCaloHit>::iterator cfiecal;
for (cfiecal=colecal->begin(); cfiecal!=colecal->end();cfiecal++) {
if (cfiecal.getTrigger()) tofecalhist_sig->Fill(cfiecal->time());
Expand All @@ -173,7 +173,7 @@ TestSuite::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
sprintf(tof,"SignalHcalHit_Tof_bcr_%d",bunchcr_);
MonitorElement * tofhcalhist_sig = dbe_->book1D(tof,"HcalHit_ToF",100,float(bsp*minbunch_),float(bsp*maxbunch_)+50.);
// std::string hcalsubdet("HcalHits");
std::auto_ptr<MixCollection<PCaloHit> > colhcal(new MixCollection<PCaloHit>(cf_calohitHcal.product()));
std::unique_ptr<MixCollection<PCaloHit> > colhcal(new MixCollection<PCaloHit>(cf_calohitHcal.product()));
MixCollection<PCaloHit>::iterator cfihcal;

for (cfihcal=colhcal->begin(); cfihcal!=colhcal->end();cfihcal++) {
Expand Down

0 comments on commit 31d6122

Please sign in to comment.