HerdSoftware  0.1.1
TrdTravMatAction.h
Go to the documentation of this file.
1 /*
2  * TrdTravMatAction.h
3  *
4  * Created on: 13 Jul 2020
5  * Author: Nicola Mori
6  */
7 
10 #ifndef TRDTRAVMATACTION_H_
11 #define TRDTRAVMATACTION_H_
12 
13 // HerdSoftware headers
15 
16 // GGS headers
17 #include "montecarlo/services/GGSRootFileService.h"
18 #include "montecarlo/useractions/GGSUserAction.h"
19 
20 // GEANT4 headers
21 #include "G4GenericMessenger.hh"
22 #include "G4PrimaryParticle.hh"
23 #include "G4Track.hh"
24 
25 // ROOT headers
26 #include "TClonesArray.h"
27 #include "TFile.h"
28 #include "TTree.h"
29 
36 class TrdTravMatAction : public GGSUserAction {
37 
38 public:
41 
49  void PreUserTrackingAction(const G4Track *track);
50 
55  void UserSteppingAction(const G4Step *step);
56 
61  void BeginOfEventAction(const G4Event *event);
62 
67  void EndOfEventAction(const G4Event *event);
68 
73  void BeginOfRunAction(const G4Run *run);
74 
79  void EndOfRunAction(const G4Run *run);
80 
81 private:
82  std::vector<TrdTravMat> _travMat;
83 
84  std::string _outBase;
85  std::string _outTreeName;
86  TFile *_outRootFile;
87  TTree *_outTree;
88 
89  G4GenericMessenger _messenger;
90 };
91 
92 #endif /* TRDTRAVMATACTION_H_ */
void PreUserTrackingAction(const G4Track *track)
Initialization of primary track.
Definition: TrdTravMatAction.cpp:26
std::string _outBase
Definition: TrdTravMatAction.h:84
TrdTravMatAction()
Constructor.
Definition: TrdTravMatAction.cpp:15
void EndOfRunAction(const G4Run *run)
Closes the output file for the current run.
Definition: TrdTravMatAction.cpp:78
void EndOfEventAction(const G4Event *event)
Fills the output tree.
Definition: TrdTravMatAction.cpp:56
Action which finds the point of disappearance points for each primary particle.
Definition: TrdTravMatAction.h:36
std::vector< TrdTravMat > _travMat
Definition: TrdTravMatAction.h:82
std::string _outTreeName
Definition: TrdTravMatAction.h:85
TTree * _outTree
Definition: TrdTravMatAction.h:87
TFile * _outRootFile
Definition: TrdTravMatAction.h:86
void BeginOfRunAction(const G4Run *run)
Opens the output file for the current run and prepares the output tree.
Definition: TrdTravMatAction.cpp:65
void UserSteppingAction(const G4Step *step)
Accumulates the traversed material in TRD by primary particles.
Definition: TrdTravMatAction.cpp:33
void BeginOfEventAction(const G4Event *event)
Clears the vector of traversed material in TRD by primary particles.
Definition: TrdTravMatAction.cpp:54
G4GenericMessenger _messenger
Definition: TrdTravMatAction.h:89