GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSMCTruthAction.h
Go to the documentation of this file.
1 /*
2  * GGSMCTruthAction.h
3  *
4  * Created on: 16 Aug 2011
5  * Author: Nicola Mori
6  */
7 
10 #ifndef GGSMCTRUTHACTION_H_
11 #define GGSMCTRUTHACTION_H_
12 
13 // Standard headers
14 #include <map>
15 #include <vector>
16 
17 // GGS headers
18 #include "montecarlo/dataobjs/GGSTMCTruthInfo.h"
21 // messenger
23 
24 // ROOT headers
25 #include "TFile.h"
26 #include "TTree.h"
27 
34 
35 public:
38 
41 
46  void EndOfEventAction(const G4Event *event);
47 
52  void BeginOfRunAction(const G4Run *run);
53 
58  void EndOfRunAction(const G4Run *run);
59 
71  void SetOutputFileBase(const std::string &outFileBase) { _outBase = outFileBase; }
79  void SetOutputTreeName(const std::string &outTreeName) { _outTreeName = outTreeName; }
80 
81 private:
82  void _Convert(const G4Event *event, GGSTMCTruthInfo *&mcTruth);
83 
84  GGSTMCTruthInfo *_mcTruthInfo;
85  GGSTParticle *_primaryParticle;
86 
87  std::string _outBase;
88  std::string _outTreeName;
89  TFile *_outRootFile;
90  TTree *_outTree;
91 
92  GGSMCTruthMessenger *_messenger;
93 };
94 
95 #endif /* GGSMCTRUTHACTION_H_ */
~GGSMCTruthAction()
Destructor.
void EndOfRunAction(const G4Run *run)
Closes the output file for the current run.
void SetOutputFileBase(const std::string &outFileBase)
Sets the output file base name.
void SetOutputTreeName(const std::string &outTreeName)
Sets the output tree name.
void EndOfEventAction(const G4Event *event)
Fills MC truth informations for current event.
void BeginOfRunAction(const G4Run *run)
Opens the output file for the current run and prepares the output tree.
GGSMCTruthAction()
Constructor.
Class to store G4 particles.
Definition: GGSTParticle.h:19
Mother class for user actions in GGS.
Definition: GGSUserAction.h:27
Saves MC truth for each event.
A class to store MC truth informations on ROOT files.
A control messenger for GGSMCTruthAction.