EnergyDepositAction.h
Go to the documentation of this file.
1 //
2 // EnergyDepositAction.h
3 //
4 // Created by Brian Rebel on 10/12/16.
5 //
6 /// This class implements the G4Base::UserAction interface in order to
7 /// accumulate a list of hits in the gaseous argon modeled by Geant4.
8 //
9 
10 #ifndef GAR_EnergyDepositAction_h
11 #define GAR_EnergyDepositAction_h
12 
13 // NuTools includes
14 #include "nug4/G4Base/UserAction.h"
15 
16 // GArSoft includes
17 #include "Geometry/GeometryGAr.h"
19 
20 //ART includes
22 
23 #include "CLHEP/Random/RandGauss.h"
24 
25 // Forward declarations.
26 class G4Event;
27 class G4Track;
28 class G4Step;
29 class G4EnergyLossForExtrapolator;
30 
31 namespace gar {
32  namespace garg4 {
33 
34  ///list of energy deposits from Geant4
35  class EnergyDepositAction : public g4b::UserAction {
36 
37  public:
38 
39  // Standard constructors and destructors;
40  EnergyDepositAction(CLHEP::HepRandomEngine* engine,
41  fhicl::ParameterSet const& pset);
42  virtual ~EnergyDepositAction();
43 
44  void reconfigure(fhicl::ParameterSet const& pset);
45 
46  // UserActions method that we'll override, to obtain access to
47  // Geant4's particle tracks and trajectories.
48  void BeginOfEventAction(const G4Event*);
49  void EndOfEventAction (const G4Event*);
50  void PreTrackingAction (const G4Track*);
51  void PostTrackingAction(const G4Track*);
52  void SteppingAction (const G4Step* );
53 
54  std::string GetVolumeName(const G4Track *track);
55 
56  // Returns the EnergyDeposits accumulated during the current event.
57  std::vector<gar::sdp::EnergyDeposit> const& EnergyDeposits() const { return fDeposits; }
58 
59  private:
60 
61  void AddEnergyDeposition(const G4Step* step);
62 
63  double fEnergyCut; ///< The minimum energy in GeV for a deposit to
64  ///< be included in the list.
65  std::vector<std::string> fVolumeName; ///< volume we will record energy depositions in
66  std::string fMaterialMatchString; ///< Energy deposition will be recorded for materials that match this
67  //unused CLHEP::HepRandomEngine* fEngine; ///< random number engine
68  std::vector<gar::sdp::EnergyDeposit> fDeposits; ///< energy fDeposits
69  };
70 
71  } // garg4
72  } // gar
73 
74  #endif /* GAR_EnergyDepositAction_h */
void PreTrackingAction(const G4Track *)
std::string GetVolumeName(const G4Track *track)
void BeginOfEventAction(const G4Event *)
std::string string
Definition: nybbler.cc:12
EnergyDepositAction(CLHEP::HepRandomEngine *engine, fhicl::ParameterSet const &pset)
list of energy deposits from Geant4
void PostTrackingAction(const G4Track *)
double fEnergyCut
be included in the list.
std::vector< gar::sdp::EnergyDeposit > fDeposits
energy fDeposits
std::string fMaterialMatchString
Energy deposition will be recorded for materials that match this.
void reconfigure(fhicl::ParameterSet const &pset)
General GArSoft Utilities.
std::vector< gar::sdp::EnergyDeposit > const & EnergyDeposits() const
std::vector< std::string > fVolumeName
volume we will record energy depositions in
art framework interface to geometry description
void AddEnergyDeposition(const G4Step *step)