ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4CashKarpRKF45.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4CashKarpRKF45.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // G4CashKarpRKF45
27 //
28 // Class description:
29 //
30 // The Cash-Karp Runge-Kutta-Fehlberg 4/5 method is an embedded fourth
31 // order method (giving fifth-order accuracy) for the solution of an ODE.
32 // Two different fourth order estimates are calculated; their difference
33 // gives an error estimate. [ref. Numerical Recipes in C, 2nd Edition]
34 // It is used to integrate the equations of the motion of a particle
35 // in a magnetic field.
36 
37 // Authors: J.Apostolakis, V.Grichine - 30.01.1997
38 // -------------------------------------------------------------------
39 #ifndef G4CASHKARP_RKF45_HH
40 #define G4CASHKARP_RKF45_HH
41 
43 
45 {
46 
47  public: // with description
48 
50  G4int numberOfVariables = 6,
51  G4bool primary = true ) ;
53 
54  void Stepper( const G4double y[],
55  const G4double dydx[],
56  G4double h,
57  G4double yout[],
58  G4double yerr[] ) ;
59 
60  public: // without description
61 
62  G4double DistChord() const;
63  G4int IntegratorOrder() const { return 4; }
64 
65  private:
66 
67  void StepWithEst( const G4double yIn[],
68  const G4double dydx[],
69  G4double Step,
70  G4double yOut[],
71  G4double& alpha2,
72  G4double& beta2,
73  const G4double B1[],
74  G4double B2[] );
75  // No longer used. Obsolete.
76 
79  // Private copy constructor and assignment operator.
80 
81  private:
82 
83  G4double *ak2, *ak3, *ak4, *ak5, *ak6, *yTemp, *yIn; // *ak7
84  // scratch space
85 
89  // for DistChord calculations
90 
92 
93 };
94 
95 #endif