CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FieldStepper.cc
Go to the documentation of this file.
2 
3 #include "G4Mag_UsualEqRhs.hh"
4 #include "G4ClassicalRK4.hh"
5 #include "G4SimpleRunge.hh"
6 #include "G4SimpleHeum.hh"
7 #include "G4CashKarpRKF45.hh"
8 #include "G4RKG3_Stepper.hh"
9 #include "G4ExplicitEuler.hh"
10 #include "G4ImplicitEuler.hh"
11 #include "G4HelixExplicitEuler.hh"
12 #include "G4HelixImplicitEuler.hh"
13 #include "G4HelixSimpleRunge.hh"
14 #include "G4HelixHeum.hh"
15 
16 using namespace sim;
17 
18 FieldStepper::FieldStepper(G4Mag_UsualEqRhs * eq) :
19  G4MagIntegratorStepper(eq, 6), theEquation(eq) {}
20 
22 
23 void FieldStepper::Stepper(const double y[],const double dydx[],double h,
24  double yout[],double yerr[])
25 { theStepper->Stepper(y,dydx,h,yout,yerr); }
26 
27 double FieldStepper::DistChord() const { return theStepper->DistChord(); }
28 
30 { return theStepper->IntegratorOrder(); }
31 
32 G4MagIntegratorStepper * FieldStepper::select(const std::string & s)
33 {
34  if (s == "G4ClassicalRK4") theStepper = new G4ClassicalRK4(theEquation);
35  else if (s == "G4SimpleRunge") theStepper = new G4SimpleRunge(theEquation);
36  else if (s == "G4SimpleHeum") theStepper = new G4SimpleHeum(theEquation);
37  else if (s == "G4CashKarpRKF45") theStepper = new G4CashKarpRKF45(theEquation);
38  else if (s == "G4RKG3_Stepper") theStepper = new G4RKG3_Stepper(theEquation);
39  else if (s == "G4ExplicitEuler") theStepper = new G4ExplicitEuler(theEquation);
40  else if (s == "G4ImplicitEuler") theStepper = new G4ImplicitEuler(theEquation);
41  else if (s == "G4HelixExplicitEuler") theStepper = new G4HelixExplicitEuler(theEquation);
42  else if (s == "G4HelixImplicitEuler") theStepper = new G4HelixImplicitEuler(theEquation);
43  else if (s == "G4HelixSimpleRunge") theStepper = new G4HelixSimpleRunge(theEquation);
44  else if (s == "G4HelixHeum") theStepper = new G4HelixHeum(theEquation);
45  else
46  {
47  std::cout << " FieldStepper invalid choice, defaulting to G4ClassicalRK4 " << std::endl;
48  theStepper = new G4ClassicalRK4(theEquation);
49  }
50  return theStepper;
51 }
virtual double DistChord() const
Definition: FieldStepper.cc:27
virtual void Stepper(const double y[], const double dydx[], double h, double yout[], double yerr[])
Definition: FieldStepper.cc:23
Definition: sim.h:19
G4MagIntegratorStepper * theStepper
Definition: FieldStepper.h:20
virtual int IntegratorOrder() const
Definition: FieldStepper.cc:29
G4MagIntegratorStepper * select(const std::string &s)
Definition: FieldStepper.cc:32
FieldStepper(G4Mag_UsualEqRhs *eq)
Definition: FieldStepper.cc:18
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
G4Mag_UsualEqRhs * theEquation
Definition: FieldStepper.h:21
tuple cout
Definition: gather_cfg.py:121