BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSIntegratorDipoleRodrigues.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 BDSINTEGRATORDIPOLERODRIGUES_H
19#define BDSINTEGRATORDIPOLERODRIGUES_H
20
21#include "BDSIntegratorMag.hh"
22
23#include "globals.hh"
24#include "G4ThreeVector.hh"
25
26#include <utility>
27
28class G4Mag_EqRhs;
30
43{
44public:
46 G4double brho,
47 G4Mag_EqRhs* eqOfMIn);
48
50
53 virtual void Stepper(const G4double yIn[],
54 const G4double dydx[],
55 const G4double h,
56 G4double yOut[],
57 G4double yErr[]);
58
59protected:
61 void AdvanceHelix(const G4double yIn[],
62 const G4double dydx[],
63 G4double h,
64 G4double yOut[],
65 G4double yErr[]);
66
68 G4double cOverGeV;
69
71 const G4double angle;
72
74 const G4double length;
75
77 G4double bField;
78
81
82 std::pair<G4ThreeVector,G4ThreeVector> UpdatePandR(G4double rho,
83 G4double h,
84 G4ThreeVector localPos,
85 G4ThreeVector localMomUnit);
86
87private:
89 G4ThreeVector yInitial, yMidPoint, yFinal;
90
93};
94
95#endif
Stepper that calculates trajectory through uniform magnetic field.
void AdvanceHelix(const G4double yIn[], const G4double dydx[], G4double h, G4double yOut[], G4double yErr[])
Calculate the new particle coordinates.
const G4double angle
Angle that the dipole induces in the reference trajectory.
virtual void Stepper(const G4double yIn[], const G4double dydx[], const G4double h, G4double yOut[], G4double yErr[])
const G4double minimumRadiusOfCurvature
Minimum tolerable radius of curvature - used to prevent spiraling particles.
G4double bField
Uniform magnetic field in global Y direction.
G4double cOverGeV
Scaling factor in brho calculation.
BDSMagnetStrength const * strength
Magnet strength object needed by curvilinear transforms.
G4ThreeVector yInitial
Data stored in order to find the chord.
const G4double length
Arc length of the magnetic field.
Common functionality to BDSIM integrators.
Efficient storage of magnet strengths.