Skip to content

Commit

Permalink
Geant4Output2LCIO: Switch run header writing at beginning of run inst…
Browse files Browse the repository at this point in the history
…ead of end of run
  • Loading branch information
rete authored and gaede committed Jan 31, 2018
1 parent 412f1c4 commit bf4f54f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions DDG4/lcio/Geant4Output2LCIO.cpp
Expand Up @@ -152,17 +152,19 @@ Geant4Output2LCIO::~Geant4Output2LCIO() {
}

// Callback to store the Geant4 run information
void Geant4Output2LCIO::beginRun(const G4Run* ) {
void Geant4Output2LCIO::beginRun(const G4Run* run) {
if ( 0 == m_file && !m_output.empty() ) {
G4AutoLock protection_lock(&action_mutex);
m_file = lcio::LCFactory::getInstance()->createLCWriter();
m_file->open(m_output,lcio::LCIO::WRITE_NEW);
}

saveRun(run);
}

/// Callback to store the Geant4 run information
void Geant4Output2LCIO::endRun(const G4Run* run) {
saveRun(run);
// saveRun(run);
}

/// Commit data at end of filling procedure
Expand Down

0 comments on commit bf4f54f

Please sign in to comment.