LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ISCalculation.cxx
Go to the documentation of this file.
1 
12 
13 #include "Geant4/G4Step.hh"
14 
15 namespace larg4 {
16 
17  //......................................................................
18  double ISCalculation::EFieldAtStep(double efield, const G4Step* step) const
19  {
20  auto const* SCE = lar::providerFrom<spacecharge::SpaceChargeService>();
21  if (!SCE->EnableSimEfieldSCE()) return efield;
22  geo::Point_t midPoint{
23  (step->GetPreStepPoint()->GetPosition() + step->GetPostStepPoint()->GetPosition()) * 0.5 /
24  CLHEP::cm};
25  auto const eFieldOffsets = SCE->GetEfieldOffsets(midPoint);
26  return efield * std::hypot(1 + eFieldOffsets.X(), eFieldOffsets.Y(), eFieldOffsets.Z());
27  }
28 
29 }
Store parameters for running LArG4.
Utilities related to art service access.
double EFieldAtStep(double fEfield, const G4Step *step) const
Geant4 interface.
Interface to algorithm class for a specific detector channel mapping.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180