Skip to content

Commit

Permalink
Geant4Output2EDM4hep: allow reuse of collection names... again
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc authored Aug 21, 2023
1 parent 95689ff commit 1c79b14
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions DDG4/edm4hep/Geant4Output2EDM4hep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ void Geant4Output2EDM4hep::saveCollection(OutputContext<G4Event>& /*ctxt*/, G4VH
//-------------------------------------------------------------------
if( typeid( Geant4Tracker::Hit ) == coll->type().type() ){
// Create the hit container even if there are no entries!
auto& hits = m_trackerHits[colName] = edm4hep::SimTrackerHitCollection();
auto& hits = m_trackerHits[colName];
for(unsigned i=0 ; i < nhits ; ++i){
auto sth = hits->create();
const Geant4Tracker::Hit* hit = coll->hit(i);
Expand Down Expand Up @@ -536,8 +536,7 @@ void Geant4Output2EDM4hep::saveCollection(OutputContext<G4Event>& /*ctxt*/, G4VH
Geant4Sensitive* sd = coll->sensitive();
int hit_creation_mode = sd->hitCreationMode();
// Create the hit container even if there are no entries!
auto& hits = m_calorimeterHits[colName] =
std::make_pair(edm4hep::SimCalorimeterHitCollection(), edm4hep::CaloHitContributionCollection());
auto& hits = m_calorimeterHits[colName];
for(unsigned i=0 ; i < nhits ; ++i){
auto sch = hits.first->create();
const Geant4Calorimeter::Hit* hit = coll->hit(i);
Expand Down

0 comments on commit 1c79b14

Please sign in to comment.