GGS(GenericGEANT4Simulation)Software  2.6.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSHadrIntAction.h
Go to the documentation of this file.
1 /*
2  * GGSHadrIntAction.h
3  *
4  * Created on: 31 May 2011
5  * Author: Nicola Mori
6  */
7 
10 #ifndef GGSHADRINTACTION_H_
11 #define GGSHADRINTACTION_H_
12 
13 // Standard headers
14 #include <vector>
15 #include <map>
16 
17 
18 // GGS headers
21 // messenger
23 
24 // GEANT4 headers
25 #include "G4PrimaryParticle.hh"
26 #include "G4Track.hh"
27 
28 // ROOT headers
29 #include "TClonesArray.h"
30 #include "TFile.h"
31 #include "TTree.h"
32 
40 
41 public:
42 
45 
47  virtual ~GGSHadrIntAction();
48 
56  void PreUserTrackingAction(const G4Track* track);
57 
68  void PostUserTrackingAction(const G4Track* track);
69 
74  void BeginOfEventAction(const G4Event *event);
75 
80  void EndOfEventAction(const G4Event *event);
81 
86  void BeginOfRunAction(const G4Run *run);
87 
92  void EndOfRunAction(const G4Run *run);
93 
104  void SetOutputFileBase(const std::string &outFileBase) {
105  _outBase = outFileBase;
106  }
114  void SetOutputTreeName(const std::string &outTreeName) {
115  _outTreeName = outTreeName;
116  }
117 
126  void SetEnergyFraction(double fraction) {
127  _energyFraction = fraction;
128  }
129 
134  void SetOutputOfProducts(bool output) {
135  _outputProducts = output;
136  }
137 
138 private:
139 
140  float _energyFraction;
141  TClonesArray *_inelasticInteractions;
142  TClonesArray *_quasiElasticInteractions;
143  std::map<const G4Track*, int> _tracks; //first: followed track, second: originalTrackID
144  bool _outputProducts;
145 
146  std::string _outBase;
147  std::string _outTreeName;
148  TFile *_outRootFile;
149  TTree *_outTree;
150 
151  GGSHadrIntMessenger *_messenger;
152 
153 };
154 
155 #endif /* GGSHADRINTACTION_H_ */
void SetOutputFileBase(const std::string &outFileBase)
Sets the output file base name.
void BeginOfEventAction(const G4Event *event)
Clears the interaction arrays.
GGSHadrIntAction()
Constructor.
void SetOutputTreeName(const std::string &outTreeName)
Sets the output tree name.
void BeginOfRunAction(const G4Run *run)
Opens the output file for the current run and prepares the output tree.
void SetOutputOfProducts(bool output)
Toggles the output of hadronic interaction products.
void PostUserTrackingAction(const G4Track *track)
Check the track end for a hadronic interaction.
void SetEnergyFraction(double fraction)
Sets the maximum secondary energy fraction for hadronic interactions.
Action which finds the hadronic interaction points for each primary particle.
void EndOfRunAction(const G4Run *run)
Closes the output file for the current run.
A control messenger for GGSHadrIntAction.
void PreUserTrackingAction(const G4Track *track)
Initialization of primary track.
Mother class for user actions in GGS.
Definition: GGSUserAction.h:27
void EndOfEventAction(const G4Event *event)
Fills the output tree.
virtual ~GGSHadrIntAction()
Destructor.