8 #include "cetlib_except/exception.h" 10 #include "TGeoManager.h" 11 #include "TGeoMaterial.h" 15 #include "Geant4/G4Event.hh" 16 #include "Geant4/G4Track.hh" 17 #include "Geant4/G4ThreeVector.hh" 18 #include "Geant4/G4ParticleDefinition.hh" 19 #include "Geant4/G4PrimaryParticle.hh" 20 #include "Geant4/G4DynamicParticle.hh" 21 #include "Geant4/G4VUserPrimaryParticleInformation.hh" 22 #include "Geant4/G4Step.hh" 23 #include "Geant4/G4StepPoint.hh" 24 #include "Geant4/G4VProcess.hh" 56 fVolumeName = pset.
get< std::vector<std::string> >(
"GArVolumeName");
88 <<
"EnergyDepositAction::SteppingAction";
91 TGeoManager *geomanager = geo->ROOTGeoManager();
94 G4Track *track = step->GetTrack();
96 const CLHEP::Hep3Vector &start = step->GetPreStepPoint()->GetPosition();
97 const CLHEP::Hep3Vector &stop = track->GetPosition();
100 if(start == stop)
return;
101 if(step->GetTotalEnergyDeposit() == 0)
return;
110 auto pos = 0.5 * (start + stop);
115 <<
"Node not found in " 122 std::string volmaterial = node->GetMedium()->GetMaterial()->GetName();
133 <<
" cm and deposited " 134 << step->GetTotalEnergyDeposit()
135 <<
" MeV of energy with a minimum of " 167 auto midPoint = 0.5 * (step->GetPreStepPoint()->GetPosition() +
168 step->GetPostStepPoint()->GetPosition() );
169 float time = step->GetPreStepPoint()->GetGlobalTime();
193 std::string VolName = track->GetVolume()->GetName();
194 VolName.erase(VolName.length()-3, 3);
static constexpr double cm
virtual ~EnergyDepositAction()
void PreTrackingAction(const G4Track *)
void EndOfEventAction(const G4Event *)
std::string GetVolumeName(const G4Track *track)
void BeginOfEventAction(const G4Event *)
EnergyDepositAction(CLHEP::HepRandomEngine *engine, fhicl::ParameterSet const &pset)
static constexpr double MeV
void PostTrackingAction(const G4Track *)
double fEnergyCut
be included in the list.
static constexpr double GeV
T get(std::string const &key) const
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< std::string > fVolumeName
volume we will record energy depositions in
LArSoft geometry interface.
art framework interface to geometry description
void SteppingAction(const G4Step *)
void AddEnergyDeposition(const G4Step *step)
static int GetCurrentTrackID()