Skip to content

Commit

Permalink
Merge pull request #190 from mirguest/master
Browse files Browse the repository at this point in the history
Fix the problem: the mcCol is not initialized in tracking action.
  • Loading branch information
mirguest authored Oct 11, 2021
2 parents e590e5f + 1b7a8b5 commit c4926c8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Simulation/DetSimAna/src/Edm4hepWriterAnaElemTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ void
Edm4hepWriterAnaElemTool::BeginOfEventAction(const G4Event* anEvent) {
msg() << "Event " << anEvent->GetEventID() << endmsg;

// reset
m_track2primary.clear();

}

void
Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
auto mcGenCol = m_mcParCol.get();
auto mcGenCol = m_mcParGenCol.get();
mcCol = m_mcParCol.createAndPut();

// copy the MC particle first
Expand All @@ -58,6 +51,14 @@ Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
}

msg() << "mcCol size: " << mcCol->size() << endmsg;

// reset
m_track2primary.clear();

}

void
Edm4hepWriterAnaElemTool::EndOfEventAction(const G4Event* anEvent) {
// save all data

// create collections.
Expand Down

0 comments on commit c4926c8

Please sign in to comment.