CMS 3D CMS Logo

FieldStepper.cc
Go to the documentation of this file.
3 
4 #include "G4Mag_UsualEqRhs.hh"
5 #include "G4ClassicalRK4.hh"
6 #include "G4SimpleRunge.hh"
7 #include "G4SimpleHeum.hh"
8 #include "G4CashKarpRKF45.hh"
9 #include "G4DormandPrince745.hh"
10 #include "G4BogackiShampine45.hh"
11 #include "G4TsitourasRK45.hh"
12 #include "G4ImplicitEuler.hh"
13 #include "G4HelixExplicitEuler.hh"
14 #include "G4HelixImplicitEuler.hh"
15 #include "G4HelixSimpleRunge.hh"
16 #include "G4HelixHeum.hh"
17 #include "G4NystromRK4.hh"
18 
19 FieldStepper::FieldStepper(G4Mag_UsualEqRhs * eq, double del, const std::string& nam)
20  : G4MagIntegratorStepper(eq, 6), theEquation(eq), theDelta(del)
21 {
22  selectStepper(nam);
23 }
24 
26 {}
27 
28 void FieldStepper::Stepper(const G4double y[], const G4double dydx[], G4double h,
29  G4double yout[], G4double yerr[])
30 {
31  theStepper->Stepper(y,dydx,h,yout,yerr);
32 }
33 
34 G4double FieldStepper::DistChord() const
35 {
36  return theStepper->DistChord();
37 }
38 
40 {
41  return theStepper->IntegratorOrder();
42 }
43 
45 {
46  if (ss == "G4ClassicalRK4") theStepper = new G4ClassicalRK4(theEquation);
47  else if (ss == "G4NystromRK4") theStepper = new G4NystromRK4(theEquation, theDelta);
48  else if (ss == "G4SimpleRunge") theStepper = new G4SimpleRunge(theEquation);
49  else if (ss == "G4SimpleHeum") theStepper = new G4SimpleHeum(theEquation);
50  else if (ss == "G4CashKarpRKF45") theStepper = new G4CashKarpRKF45(theEquation);
51  else if (ss == "G4DormandPrince745") theStepper = new G4DormandPrince745(theEquation);
52  else if (ss == "G4BogackiShampine45") theStepper = new G4BogackiShampine45(theEquation);
53  else if (ss == "G4TsitourasRK45") theStepper = new G4TsitourasRK45(theEquation);
54  else if (ss == "G4ImplicitEuler") theStepper = new G4ImplicitEuler(theEquation);
55  else if (ss == "G4HelixExplicitEuler") theStepper = new G4HelixExplicitEuler(theEquation);
56  else if (ss == "G4HelixImplicitEuler") theStepper = new G4HelixImplicitEuler(theEquation);
57  else if (ss == "G4HelixSimpleRunge") theStepper = new G4HelixSimpleRunge(theEquation);
58  else if (ss == "G4HelixHeum") theStepper = new G4HelixHeum(theEquation);
59  else
60  {
61  edm::LogWarning("SimG4CoreMagneticField")
62  << " FieldStepper <" << ss << "> is not known, defaulting to G4ClassicalRK4 ";
63  theStepper = new G4ClassicalRK4(theEquation);
64  }
65  edm::LogVerbatim("SimG4CoreMagneticField")
66  << "### FieldStepper: <" << ss << ">";
67 }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
G4int IntegratorOrder() const override
Definition: FieldStepper.cc:39
~FieldStepper() override
Definition: FieldStepper.cc:25
FieldStepper(G4Mag_UsualEqRhs *eq, double del, const std::string &name)
Definition: FieldStepper.cc:19
G4MagIntegratorStepper * theStepper
Definition: FieldStepper.h:23
double theDelta
Definition: FieldStepper.h:25
void selectStepper(const std::string &)
Definition: FieldStepper.cc:44
G4Mag_UsualEqRhs * theEquation
Definition: FieldStepper.h:24
void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[]) override
Definition: FieldStepper.cc:28
G4double DistChord() const override
Definition: FieldStepper.cc:34