BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSIntegratorDipoleRodrigues2.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSINTEGRATORDIPOLERODRIGUES2_H
19#define BDSINTEGRATORDIPOLERODRIGUES2_H
20
21#include "BDSIntegratorDrift.hh"
22#include "BDSMagnetStrength.hh"
23
24#include "globals.hh"
25#include "G4MagHelicalStepper.hh"
26#include "G4ThreeVector.hh"
27
28class G4MagIntegratorStepper;
29class G4Mag_EqRhs;
30
52class BDSIntegratorDipoleRodrigues2: public G4MagHelicalStepper, public BDSIntegratorDrift
53{
54public:
55 BDSIntegratorDipoleRodrigues2(G4Mag_EqRhs* eqOfMIn,
57
59
62 virtual void DumbStepper(const G4double yIn[6],
63 G4ThreeVector field,
64 G4double stepLength,
65 G4double yOut[6]);
66
70 void SingleStep(const G4double yIn[6],
71 const G4double& h,
72 G4double yOut[6]);
73
77 virtual void Stepper(const G4double yIn[6],
78 const G4double dydx[],
79 G4double h,
80 G4double yOut[6],
81 G4double yErr[6]);
82
83 virtual G4int IntegratorOrder() const {return 1;}
84
87 void AdvanceHelixForSpiralling(const G4double yIn[6],
88 const G4ThreeVector& field,
89 const G4double& h,
90 G4double yOut[6],
91 G4double yErr[6]);
92
94 inline G4double RadiusOfHelix() const {return GetRadHelix();}
95
96protected:
100
102 G4Mag_EqRhs* eqOfM;
103
104private:
107
111
112};
113
114#endif
Exact helix through pure dipole field.
void AdvanceHelixForSpiralling(const G4double yIn[6], const G4ThreeVector &field, const G4double &h, G4double yOut[6], G4double yErr[6])
G4Mag_EqRhs * eqOfM
Cache of equation of motion. This class does not own it.
void SingleStep(const G4double yIn[6], const G4double &h, G4double yOut[6])
virtual void DumbStepper(const G4double yIn[6], G4ThreeVector field, G4double stepLength, G4double yOut[6])
G4double RadiusOfHelix() const
Public accessor for protected variable in base class.
virtual void Stepper(const G4double yIn[6], const G4double dydx[], G4double h, G4double yOut[6], G4double yErr[6])
Output error array.
BDSIntegratorDipoleRodrigues2()=delete
Private default constructor to force use of provided one.
Routine for drift algorithm.