GGS(GenericGEANT4Simulation)Software  2.7.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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
30 
32 
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
34 
36 
39 }
40 
41 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
42 
44  _outRootFile = GGSRootFileService::GetInstance().GetFileForThisRun("", run);
45  _outTree = GGSRootFileService::GetInstance().GetDefaultTree(_outRootFile);
46  _outTree->SetTitle(TString(_outTree->GetTitle()) + "RandStatus ");
47  _outTree->Branch("randomStatus", "GGSTRandomStatusInfo", &_randInfo);
48 }
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
51 
54  _outRootFile = NULL;
55  _outTree = NULL;
56 }
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.