GGS(GenericGEANT4Simulation)Software  2.7.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 <map>
15 #include <vector>
16 
17 // GGS headers
20 // messenger
22 
23 // GEANT4 headers
24 #include "G4PrimaryParticle.hh"
25 #include "G4Track.hh"
26 
27 // ROOT headers
28 #include "TClonesArray.h"
29 #include "TFile.h"
30 #include "TTree.h"
31 
39 
40 public:
43 
45  virtual ~GGSHadrIntAction();
46 
54  void PreUserTrackingAction(const G4Track *track);
55 
66  void PostUserTrackingAction(const G4Track *track);
67 
72  void BeginOfEventAction(const G4Event *event);
73 
78  void EndOfEventAction(const G4Event *event);
79 
84  void BeginOfRunAction(const G4Run *run);
85 
90  void EndOfRunAction(const G4Run *run);
91 
102  void SetOutputFileBase(const std::string &outFileBase) { _outBase = outFileBase; }
110  void SetOutputTreeName(const std::string &outTreeName) { _outTreeName = outTreeName; }
111 
120  void SetEnergyFraction(double fraction) { _energyFraction = fraction; }
121 
126  void SetOutputOfProducts(bool output) { _outputProducts = output; }
127 
128 private:
129  float _energyFraction;
130  TClonesArray *_inelasticInteractions;
131  TClonesArray *_quasiElasticInteractions;
132  std::map<const G4Track *, int> _tracks; // first: followed track, second: originalTrackID
133  bool _outputProducts;
134 
135  std::string _outBase;
136  std::string _outTreeName;
137  TFile *_outRootFile;
138  TTree *_outTree;
139 
140  GGSHadrIntMessenger *_messenger;
141 };
142 
143 #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.