GGS(GenericGEANT4Simulation)Software  2.6.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 <vector>
15 #include <map>
16 
17 
18 // GGS headers
21 #include "montecarlo/dataobjs/GGSTMCTruthInfo.h"
22 // messenger
24 
25 // ROOT headers
26 #include "TFile.h"
27 #include "TTree.h"
28 
35 
36 public:
37 
40 
43 
48  void EndOfEventAction(const G4Event *event);
49 
54  void BeginOfRunAction(const G4Run *run);
55 
60  void EndOfRunAction(const G4Run *run);
61 
73  void SetOutputFileBase(const std::string &outFileBase) {
74  _outBase = outFileBase;
75  }
83  void SetOutputTreeName(const std::string &outTreeName) {
84  _outTreeName = outTreeName;
85  }
86 
87 private:
88 
89  void _Convert(const G4Event *event, GGSTMCTruthInfo *&mcTruth);
90 
91  GGSTMCTruthInfo *_mcTruthInfo;
92  GGSTParticle *_primaryParticle;
93 
94  std::string _outBase;
95  std::string _outTreeName;
96  TFile *_outRootFile;
97  TTree *_outTree;
98 
99  GGSMCTruthMessenger *_messenger;
100 
101 };
102 
103 #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.