Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed save digi behavior to check for end of list #12038

Merged
merged 2 commits into from
Oct 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions HLTrigger/special/src/HLTRechitsToDigis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,32 +140,39 @@ HLTRechitsToDigis::produce(edm::Event& iEvent, edm::EventSetup const& setup) {
// loop over the collection of rechits and match to digis
EcalRecHitCollection::const_iterator ituneEB;
for (ituneEB = recHitsHandle->begin(); ituneEB != recHitsHandle->end(); ituneEB++) {
EcalRecHit hit = (*ituneEB);
outputEBDigiCollection->push_back( (*digisEB->find(hit.id())).id(), (*digisEB->find(hit.id())).begin() );
EcalRecHit const & hit = (*ituneEB);
EcalDigiCollection::const_iterator digiLookUp = digisEB->find(hit.id());
// protect against a digi not existing
if( digiLookUp == digisEB->end()) continue;
outputEBDigiCollection->push_back( digiLookUp->id(), digiLookUp->begin() );
}


// add the built collection to the event
iEvent.put( outputEBDigiCollection, digisOut_);
break;
}

}
case endcap: {
iEvent.getByToken(digisEEInToken_, digisEEHandle);
const EEDigiCollection* digisEE = digisEEHandle.product();

// loop over the collection of rechits and match to digis
EcalRecHitCollection::const_iterator ituneEE;
for (ituneEE = recHitsHandle->begin(); ituneEE != recHitsHandle->end(); ituneEE++) {
EcalRecHit hit = (*ituneEE);
outputEEDigiCollection->push_back( (*digisEE->find(hit.id())).id(), (*digisEE->find(hit.id())).begin() );
}

EcalRecHit const & hit = (*ituneEE);
EcalDigiCollection::const_iterator digiLookUp = digisEE->find(hit.id());
// protect against a digi not existing for the saved rechit
if(digiLookUp == digisEE->end()) continue;
outputEEDigiCollection->push_back( digiLookUp->id(), digiLookUp->begin() );
} // end loop over endcap rechits

// add the built collection to the event
iEvent.put(outputEEDigiCollection, digisOut_);
break;
}
case invalidRegion: {
break;
}
}
} // end switch statement for the region (barrel, endcap, invalid)
}

// ------------ method called when starting to processes a run ------------
Expand Down