协同办公软件使用体验
CMakeLists.txt编写基础知识
Focus on how to use cmake to compile scripts and library and hide source files.
Show RunTime and Solve Problem that Data ReadOut Are Disordered in Geant4 Multi-thread Mode
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); |
Emacs yasnippets and markdown configure
Focus on how to use emacs to edit markdown scripts.
G4 Detector CopyNo and MotherCopyNo access
This page introduce the mehtods to construct detector arrays and how to discriminate the different components with copyNo and motherCopyNo.