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 using namespace sim;
20 
21 FieldStepper::FieldStepper(G4Mag_UsualEqRhs * eq, double del) :
22  G4MagIntegratorStepper(eq, 6), theEquation(eq), delta(del) {}
23 
25 
26 void FieldStepper::Stepper(const double y[],const double dydx[],double h,
27  double yout[],double yerr[])
28 { theStepper->Stepper(y,dydx,h,yout,yerr); }
29 
30 double FieldStepper::DistChord() const { return theStepper->DistChord(); }
31 
33 { return theStepper->IntegratorOrder(); }
34 
35 G4MagIntegratorStepper * FieldStepper::select(const std::string & ss)
36 {
37  if (ss == "G4ClassicalRK4") theStepper = new G4ClassicalRK4(theEquation);
38  else if (ss == "G4NystromRK4") theStepper = new G4NystromRK4(theEquation, delta);
39  else if (ss == "G4SimpleRunge") theStepper = new G4SimpleRunge(theEquation);
40  else if (ss == "G4SimpleHeum") theStepper = new G4SimpleHeum(theEquation);
41  else if (ss == "G4CashKarpRKF45") theStepper = new G4CashKarpRKF45(theEquation);
42  else if (ss == "G4DormandPrince745") theStepper = new G4DormandPrince745(theEquation);
43  else if (ss == "G4BogackiShampine45") theStepper = new G4BogackiShampine45(theEquation);
44  else if (ss == "G4TsitourasRK45") theStepper = new G4TsitourasRK45(theEquation);
45  else if (ss == "G4ImplicitEuler") theStepper = new G4ImplicitEuler(theEquation);
46  else if (ss == "G4HelixExplicitEuler") theStepper = new G4HelixExplicitEuler(theEquation);
47  else if (ss == "G4HelixImplicitEuler") theStepper = new G4HelixImplicitEuler(theEquation);
48  else if (ss == "G4HelixSimpleRunge") theStepper = new G4HelixSimpleRunge(theEquation);
49  else if (ss == "G4HelixHeum") theStepper = new G4HelixHeum(theEquation);
50  else
51  {
52  edm::LogWarning("SimG4CoreMagneticField")
53  << " FieldStepper <" << ss << "> is not known, defaulting to G4ClassicalRK4 ";
54  theStepper = new G4ClassicalRK4(theEquation);
55  }
56  edm::LogInfo("SimG4CoreMagneticField")
57  << "### FieldStepper: <" << ss << ">";
58  return theStepper;
59 }
dbl * delta
Definition: mlp_gen.cc:36
void Stepper(const double y[], const double dydx[], double h, double yout[], double yerr[]) override
Definition: FieldStepper.cc:26
double DistChord() const override
Definition: FieldStepper.cc:30
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
~FieldStepper() override
Definition: FieldStepper.cc:24
G4MagIntegratorStepper * theStepper
Definition: FieldStepper.h:20
FieldStepper(G4Mag_UsualEqRhs *eq, double del=0.0)
Definition: FieldStepper.cc:21
Definition: RunManager.h:28
int IntegratorOrder() const override
Definition: FieldStepper.cc:32
G4MagIntegratorStepper * select(const std::string &s)
Definition: FieldStepper.cc:35
G4Mag_UsualEqRhs * theEquation
Definition: FieldStepper.h:21