LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ISCalculation.cxx
Go to the documentation of this file.
1 
11 
12 // Framework includes
13 #include "cetlib_except/exception.h"
16 
17 namespace larg4 {
18 
19  //----------------------------------------------------------------------
21  {
22  }
23 
24  //----------------------------------------------------------------------
26  {
27  }
28 
29  //......................................................................
30  double ISCalculation::EFieldAtStep(double fEfield, const G4Step* step) const
31  {
32  auto const* SCE = lar::providerFrom<spacecharge::SpaceChargeService>();
33  if (!SCE->EnableSimEfieldSCE()) return fEfield;
34 
35  geo::Point_t midPoint
36  { ( step->GetPreStepPoint()->GetPosition() + step->GetPostStepPoint()->GetPosition() ) * 0.5/CLHEP::cm };
37  auto EfieldDelta = fEfield * SCE->GetEfieldOffsets(midPoint);
38  geo::Vector_t EfieldVec
39  = { fEfield + EfieldDelta.X(), EfieldDelta.Y(), EfieldDelta.Z() };
40  return EfieldVec.R();
41  }
42 
43 }
Store parameters for running LArG4.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:167
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:187