Skip to content
Snippets Groups Projects
Commit f6877285 authored by Chad Lantz's avatar Chad Lantz
Browse files

Cleared output vectores at the end of events to avoid re-writing data and...

Cleared output vectores at the end of events to avoid re-writing data and exponentially growing output files
parent 80bc43ba
No related branches found
No related tags found
No related merge requests found
......@@ -55,6 +55,7 @@ class RunAction : public G4UserRunAction
virtual void EndOfRunAction(const G4Run* aRun);
std::vector< std::vector<double>* > GetVectors(){ return fPtrVec; }
inline void ClearVectors(){ for(auto vec : fPtrVec) vec->clear(); }
private:
G4Timer* fTimer;
......
......@@ -30,12 +30,14 @@
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4SDManager.hh"
#include "G4RunManager.hh"
#include "G4Event.hh"
#include "G4Track.hh"
#include "G4ios.hh"
#include "PMTHit.hh"
#include "lgAnalysis.hh"
#include "RunAction.hh"
/*
*
......@@ -69,4 +71,6 @@ void EventAction::EndOfEventAction(const G4Event* event){
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
analysisManager->FillNtupleIColumn( 0, event->GetEventID());
analysisManager->AddNtupleRow();
((RunAction*)G4RunManager::GetRunManager()->GetUserRunAction())->ClearVectors();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment