GGS(GenericGEANT4Simulation)Software  2.6.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSRandomStatusAction.cpp
Go to the documentation of this file.
1 /*
2  * GGSRandomStatusAction.cpp
3  *
4  * Created on: 01 Jan 2015
5  * Author: Nicola Mori
6  */
7 
10 // GGS headers
15 
16 // ROOT headers
17 #include "TFile.h"
18 #include "TTree.h"
19 
20 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
21 
23 
24 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
25 
27  _outRootFile(NULL), _outTree(NULL), _randInfo(new GGSTRandomStatusInfo) {
28 
29 }
30 
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
32 
34  delete _randInfo;
35 }
36 
37 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
38 
40 
43 }
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
46 
48  _outRootFile = GGSRootFileService::GetInstance().GetFileForThisRun("", run);
49  _outTree = GGSRootFileService::GetInstance().GetDefaultTree(_outRootFile);
50  _outTree->SetTitle(TString(_outTree->GetTitle()) + "RandStatus ");
51  _outTree->Branch("randomStatus", "GGSTRandomStatusInfo", &_randInfo);
52 }
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
55 
58  _outRootFile = NULL;
59  _outTree = NULL;
60 }
GGSRandomStatusAction()
Constructor.
TFile * GetFileForThisRun(const path &baseName, const G4Run *run)
Opens a file for a given run and returns a pointer to it.
void CloseFileForThisRun(const path &baseName)
Closes the ROOT output file.
const long int * GetRandomSeedsAtBeginOfEvent()
Getter methos for random seeds at the beginning of the current event.
void BeginOfEventAction(const G4Event *)
Records the status of the random engine at the beginning of the event.
Long_t seeds[2]
Seeds defining the status of the engine.
void EndOfRunAction(const G4Run *)
Closes the output file for the current run.
void BeginOfRunAction(const G4Run *run)
Opens the output file for the current run and prepares the output tree.
static GGSRunManager * GetRunManager()
Static getter function the run manager.
TTree * GetDefaultTree(TFile *file)
Gets the default tree for this file.
static GGSRootFileService & GetInstance()
Get reference to GGSRootFileService unique instance.
Data object to store the status of the random engine.
#define RegisterUA(uaClassName)
Macro for registration of user actions classes.
Stores the status of the random engine at the beginning of each event.