GGS(GenericGEANT4Simulation)Software  2.6.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSLostEnergyAction.h
Go to the documentation of this file.
1 /*
2  * GGSLostEnergyAction.h
3  *
4  * Created on: 16 Jun 2011
5  * Author: Nicola Mori
6  */
7 
10 #ifndef GGSLOSTENERGYACTION_H_
11 #define GGSLOSTENERGYACTION_H_
12 
13 // Standard headers
14 #include <vector>
15 #include <map>
16 
17 
18 // GGS headers
21 #include "montecarlo/dataobjs/GGSTLostEnergyInfo.h"
22 // messenger
24 
25 // GEANT4 headers
26 #include "G4PrimaryParticle.hh"
27 #include "G4Track.hh"
28 
29 // ROOT headers
30 #include "TFile.h"
31 #include "TTree.h"
32 
47 
48 public:
49 
52 
54  virtual ~GGSLostEnergyAction();
55 
56 
65  void PostUserTrackingAction(const G4Track* track);
66 
71  void BeginOfEventAction(const G4Event *event);
72 
77  void EndOfEventAction(const G4Event *event);
78 
83  void BeginOfRunAction(const G4Run *run);
84 
89  void EndOfRunAction(const G4Run *run);
90 
102  void SetOutputFileBase(const std::string &outFileBase) {
103  _outBase = outFileBase;
104  }
112  void SetOutputTreeName(const std::string &outTreeName) {
113  _outTreeName = outTreeName;
114  }
115 
124  _kinetic = true;
125  }
126 
137  _kinetic = false;
138  }
139 
140 private:
141 
142  GGSTLostEnergyInfo *_lostEnergyInfo;
143 
144  std::string _outBase;
145  std::string _outTreeName;
146  TFile *_outRootFile;
147  TTree *_outTree;
148 
149  bool _kinetic;
150 
151  float _worldXMin, _worldXMax, _worldYMin, _worldYMax, _worldZMin, _worldZMax;
152  float _tolerance;
153 
154  GGSLostEnergyMessenger *_messenger;
155 
156 };
157 
158 #endif /* GGSLOSTENERGYACTION_H_ */
void SetKineticAsLostEnergy()
Sets the kinetic energy as lost energy.
A simple class to carry informations about lost energy.
void SetOutputFileBase(const std::string &outFileBase)
Sets the output file base name.
void PostUserTrackingAction(const G4Track *track)
Check the track end.
void EndOfRunAction(const G4Run *run)
Closes the output file for the current run.
void EndOfEventAction(const G4Event *event)
Converts energies to GeV and fills the tree.
void SetOutputTreeName(const std::string &outTreeName)
Sets the output tree name.
void BeginOfEventAction(const G4Event *event)
Resets the GGSTLostEnergyInfo buffer.
virtual ~GGSLostEnergyAction()
Destructor.
void BeginOfRunAction(const G4Run *run)
Opens the output file for the current run and prepares the output tree.
Mother class for user actions in GGS.
Definition: GGSUserAction.h:27
A control messenger for GGSLostEnergyAction.
GGSLostEnergyAction()
Constructor.
void SetTotalAsLostEnergy()
Sets the total energy as lost energy.
Computes the lost energy due to particles escaping the world volume.