CMS 3D CMS Logo

FieldStepper.cc
Go to the documentation of this file.
4 
5 #include "G4BogackiShampine45.hh"
6 #include "G4CashKarpRKF45.hh"
7 #include "G4TCashKarpRKF45.hh"
8 #include "G4ClassicalRK4.hh"
9 #include "G4TClassicalRK4.hh"
10 #include "G4DormandPrince745.hh"
11 #include "G4TDormandPrince45.hh"
12 #include "CMSTDormandPrince45.h"
13 #include "G4HelixExplicitEuler.hh"
14 #include "G4HelixHeum.hh"
15 #include "G4HelixImplicitEuler.hh"
16 #include "G4HelixSimpleRunge.hh"
17 #include "G4ImplicitEuler.hh"
18 #include "G4Mag_UsualEqRhs.hh"
19 #include "G4TMagFieldEquation.hh"
20 #include "CMSTMagFieldEquation.h"
21 #include "G4NystromRK4.hh"
22 #include "G4SimpleHeum.hh"
23 #include "G4SimpleRunge.hh"
24 #include "G4TsitourasRK45.hh"
25 
26 FieldStepper::FieldStepper(G4Mag_UsualEqRhs *eq, double del, const std::string &nam)
27  : G4MagIntegratorStepper(eq, 6), theEquation(eq), theDelta(del) {
28  selectStepper(nam);
29 }
30 
32 
33 void FieldStepper::Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[]) {
34  theStepper->Stepper(y, dydx, h, yout, yerr);
35 }
36 
37 G4double FieldStepper::DistChord() const { return theStepper->DistChord(); }
38 
39 G4int FieldStepper::IntegratorOrder() const { return theStepper->IntegratorOrder(); }
40 
42  if (ss == "G4ClassicalRK4")
43  theStepper = new G4ClassicalRK4(theEquation);
44  else if (ss == "G4TClassicalRK4")
45  theStepper = new G4TClassicalRK4<G4Mag_UsualEqRhs, 8>(theEquation);
46  else if (ss == "G4NystromRK4")
47  theStepper = new G4NystromRK4(theEquation, theDelta);
48  else if (ss == "G4SimpleRunge")
49  theStepper = new G4SimpleRunge(theEquation);
50  else if (ss == "G4SimpleHeum")
51  theStepper = new G4SimpleHeum(theEquation);
52  else if (ss == "G4CashKarpRKF45")
53  theStepper = new G4CashKarpRKF45(theEquation);
54  else if (ss == "G4TCashKarpRKF45")
55  theStepper = new G4TCashKarpRKF45<G4Mag_UsualEqRhs>(theEquation);
56  else if (ss == "G4DormandPrince745")
57  theStepper = new G4DormandPrince745(theEquation);
58  else if (ss == "G4TDormandPrince45")
59  theStepper = new G4TDormandPrince45<G4TMagFieldEquation<sim::Field>>(
60  dynamic_cast<G4TMagFieldEquation<sim::Field> *>(theEquation));
61  else if (ss == "CMSTDormandPrince45")
64  else if (ss == "G4BogackiShampine45")
65  theStepper = new G4BogackiShampine45(theEquation);
66  else if (ss == "G4TsitourasRK45")
67  theStepper = new G4TsitourasRK45(theEquation);
68  else if (ss == "G4ImplicitEuler")
69  theStepper = new G4ImplicitEuler(theEquation);
70  else if (ss == "G4HelixExplicitEuler")
71  theStepper = new G4HelixExplicitEuler(theEquation);
72  else if (ss == "G4HelixImplicitEuler")
73  theStepper = new G4HelixImplicitEuler(theEquation);
74  else if (ss == "G4HelixSimpleRunge")
75  theStepper = new G4HelixSimpleRunge(theEquation);
76  else if (ss == "G4HelixHeum")
77  theStepper = new G4HelixHeum(theEquation);
78  else {
79  edm::LogWarning("SimG4CoreMagneticField")
80  << " FieldStepper <" << ss << "> is not known, defaulting to G4ClassicalRK4 ";
81  theStepper = new G4ClassicalRK4(theEquation);
82  }
83  edm::LogVerbatim("SimG4CoreMagneticField") << "### FieldStepper: <" << ss << ">";
84 }
Log< level::Info, true > LogVerbatim
G4int IntegratorOrder() const override
Definition: FieldStepper.cc:39
G4double DistChord() const override
Definition: FieldStepper.cc:37
~FieldStepper() override
Definition: FieldStepper.cc:31
FieldStepper(G4Mag_UsualEqRhs *eq, double del, const std::string &name)
Definition: FieldStepper.cc:26
G4MagIntegratorStepper * theStepper
Definition: FieldStepper.h:21
double theDelta
Definition: FieldStepper.h:23
void selectStepper(const std::string &)
Definition: FieldStepper.cc:41
G4Mag_UsualEqRhs * theEquation
Definition: FieldStepper.h:22
Log< level::Warning, false > LogWarning
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[]) override
Definition: FieldStepper.cc:33