Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ExactHelixStepper.hh
Go to the documentation of this file.
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// G4ExactHelixStepper
27//
28// Class description:
29//
30// Concrete class for particle motion in constant magnetic field.
31// Helix a-la-Explicity Euler: x_1 = x_0 + helix(h)
32// with helix(h) being a helix piece of length h.
33// simplest approach for solving linear differential equations.
34// Take the current derivative and add it to the current position.
35//
36// As the field is assumed constant, an error is not calculated.
37
38// Author: John Apostolakis (CERN), 28.01.2005.
39// Implementation adapted from ExplicitEuler by W.Wander
40// --------------------------------------------------------------------
41#ifndef G4EXACTHELIXSTEPPER_HH
42#define G4EXACTHELIXSTEPPER_HH
43
44#include "G4Types.hh"
45#include "G4ThreeVector.hh"
46
49#include "G4Mag_EqRhs.hh"
50
51/**
52 * @brief G4ExactHelixStepper is a concrete class for particle motion in
53 * constant magnetic field. Helix a-la-Explicity Euler: x_1 = x_0 + helix(h)
54 * with helix(h) being a helix piece of length h.
55 * As the field is assumed constant, an error is not calculated.
56 */
57
59{
60 public:
61
62 /**
63 * Constructor for G4ExactHelixStepper.
64 * @param[in] EqRhs Pointer to the standard equation of motion.
65 */
67
68 /**
69 * Default Destructor.
70 */
71 ~G4ExactHelixStepper() override = default;
72
73 /**
74 * Copy constructor and assignment operator not allowed.
75 */
78
79 /**
80 * The stepper for the Runge Kutta integration.
81 * The stepsize is fixed, with the step size given by 'h'.
82 * Provides helix starting values y[0 to 6].
83 * Outputs yout[] and ZERO estimated error yerr[]=0.
84 * @param[in] yInput Starting values array of integration variables.
85 * @param[in] dydx Derivatives array.
86 * @param[in] h The given step size.
87 * @param[out] yout Integration output.
88 * @param[out] yerr The estimated error.
89 */
90 void Stepper( const G4double y[],
91 const G4double dydx[],
92 G4double h,
93 G4double yout[],
94 G4double yerr[] ) override;
95
96 /**
97 * Same as Stepper() function above, but should perform a 'dump' step
98 * without error calculation. Assuming a constant field, the solution is
99 * a helix. Should NOT be called; issues a fatal exception as the Stepper
100 * must do all the work.
101 */
102 void DumbStepper( const G4double y[],
103 G4ThreeVector Bfld,
104 G4double h,
105 G4double yout[] ) override;
106
107 /**
108 * Estimates the maximum distance of curved solution and chord.
109 */
110 G4double DistChord() const override;
111
112 /**
113 * Returns the order, 1, of integration.
114 */
115 inline G4int IntegratorOrder() const override { return 1; }
116
117 /**
118 * Returns the stepper type-ID, "kExactHelixStepper".
119 */
120 inline G4StepperType StepperType() const override { return kExactHelixStepper; }
121
122 private:
123
124 /** Initial value of field at last step. */
125 G4ThreeVector fBfieldValue;
126};
127
128#endif
G4StepperType
G4StepperType defines the available integrator of particle's equation of motion in Geant4.
@ kExactHelixStepper
G4ExactHelixStepper.
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
G4ExactHelixStepper(G4Mag_EqRhs *EqRhs)
G4double DistChord() const override
G4StepperType StepperType() const override
void DumbStepper(const G4double y[], G4ThreeVector Bfld, G4double h, G4double yout[]) override
~G4ExactHelixStepper() override=default
void Stepper(const G4double y[], const G4double dydx[], G4double h, G4double yout[], G4double yerr[]) override
G4ExactHelixStepper(const G4ExactHelixStepper &)=delete
G4int IntegratorOrder() const override
G4ExactHelixStepper & operator=(const G4ExactHelixStepper &)=delete
G4MagHelicalStepper(G4Mag_EqRhs *EqRhs)
G4Mag_EqRhs is the "standard" equation of motion of a particle in a pure magnetic field.