How to show runtime
Using G4Timer in RunAction
time count start at the begin of run and stop at the end of run.
Detail Consturciton
declare a pionter to G4Timer in construct function.
1 | fTimer = new G4Timer; |
free memory of G4Timer in distruct function
1 | delete fTimer; |
time count start in BeginOfRunAction()
1 | fTimer ->Start() |
time count stop in EndOfRunAction()
1 | fTimer ->Stop(); |
Result Shows
Time used will be showed in the end of run.
1 | number of event = ... User=...s Real=...s Sys=...s |
Solve Problem that Data ReadOut Are Disordered in Geant4 Multi-thread Mode
problem discription
I encountered a problem in Geant4 multi-thread run mode. The data readout from two different sensitive detector with hits are corrected in single thread mode but disordered in multi-thread run mode. I don't know how this problem should happen. I think there must be something wrong in the Merge() function. Memory storage may be disordered in the multi-thread mode.
problem solving
Do not use Geant4 Data Merge() in root mode
1 | //analysisManager->SetNtupleMerging(true); |