GGS(GenericGEANT4Simulation)Software  2.7.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 <map>
15 #include <vector>
16 
17 // GGS headers
18 #include "montecarlo/dataobjs/GGSTLostEnergyInfo.h"
21 // messenger
23 
24 // GEANT4 headers
25 #include "G4PrimaryParticle.hh"
26 #include "G4Track.hh"
27 
28 // ROOT headers
29 #include "TFile.h"
30 #include "TTree.h"
31 
46 
47 public:
50 
52  virtual ~GGSLostEnergyAction();
53 
62  void PostUserTrackingAction(const G4Track *track);
63 
68  void BeginOfEventAction(const G4Event *event);
69 
74  void EndOfEventAction(const G4Event *event);
75 
80  void BeginOfRunAction(const G4Run *run);
81 
86  void EndOfRunAction(const G4Run *run);
87 
99  void SetOutputFileBase(const std::string &outFileBase) { _outBase = outFileBase; }
107  void SetOutputTreeName(const std::string &outTreeName) { _outTreeName = outTreeName; }
108 
116  void SetKineticAsLostEnergy() { _kinetic = true; }
117 
127  void SetTotalAsLostEnergy() { _kinetic = false; }
128 
129 private:
130  GGSTLostEnergyInfo *_lostEnergyInfo;
131 
132  std::string _outBase;
133  std::string _outTreeName;
134  TFile *_outRootFile;
135  TTree *_outTree;
136 
137  bool _kinetic;
138 
139  float _worldXMin, _worldXMax, _worldYMin, _worldYMax, _worldZMin, _worldZMax;
140  float _tolerance;
141 
142  GGSLostEnergyMessenger *_messenger;
143 };
144 
145 #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.