From f547d35ca8eae27d301b279b267813ca37d4911f Mon Sep 17 00:00:00 2001
From: Adrien Matta <matta@lpccaen.in2p3.fr>
Date: Thu, 30 Apr 2020 14:35:14 +0200
Subject: [PATCH] * Fixing issue causing simulation to be slow         - The
 state of the G4 random generator was never cleared         - bigger and
 bigger data were written to the tree

---
 NPSimulation/Core/EventAction.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/NPSimulation/Core/EventAction.cc b/NPSimulation/Core/EventAction.cc
index 5f091b942..1f35d8ed7 100644
--- a/NPSimulation/Core/EventAction.cc
+++ b/NPSimulation/Core/EventAction.cc
@@ -87,6 +87,8 @@ void EventAction::SaveRandomGeneratorInitialState(){
 
     CLHEP::HepRandom::saveFullState(m_Geant4RandomFullState);
     m_G4State=m_Geant4RandomFullState.str();
+    m_Geant4RandomFullState.str("");
+    m_Geant4RandomFullState.clear();
 }
 
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-- 
GitLab