BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSIntegratorMag.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
4
5This file is part of BDSIM.
6
7BDSIM is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published
9by the Free Software Foundation version 3 of the License.
10
11BDSIM is distributed in the hope that it will be useful, but
12WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef BDSINTEGRATORMAG_H
20#define BDSINTEGRATORMAG_H
21
22#include "BDSAuxiliaryNavigator.hh"
23#include "BDSIntegratorDrift.hh"
24#include "BDSMagnetStrength.hh"
25
26#include "globals.hh" // geant4 types / globals
27#include "G4MagIntegratorStepper.hh"
28
29class G4Mag_EqRhs;
30
43class BDSIntegratorMag: public G4MagIntegratorStepper, public BDSIntegratorDrift, public BDSAuxiliaryNavigator
44{
45public:
46 BDSIntegratorMag(G4Mag_EqRhs* eqOfMIn,
47 G4int nVariablesIn);
48
49 virtual ~BDSIntegratorMag();
54
56 inline virtual G4double DistChord() const {return distChordPrivate;}
57
59 inline virtual G4int IntegratorOrder() const {return 2;}
60
63 static G4double thinElementLength;
64
68
72 static G4bool currentTrackIsPrimary;
73
74protected:
77 void ConvertToGlobal(const G4ThreeVector &localPos,
78 const G4ThreeVector &localMom,
79 G4double yOut[],
80 G4double yErr[],
81 const G4double momScaling = 1.0);
82
84 inline void SetDistChord(G4double distChordIn) {distChordPrivate = distChordIn;}
85
89 G4Mag_EqRhs* eqOfM;
90
92 const G4int nVariables;
93
97 G4MagIntegratorStepper* backupStepper;
98
102
106
107private:
110
113};
114
115#endif
Extra G4Navigator to get coordinate transforms.
Routine for drift algorithm.
Common functionality to BDSIM integrators.
G4double backupStepperMomLimit
static G4double nominalMatrixRelativeMomCut
G4Mag_EqRhs * eqOfM
BDSIntegratorMag(BDSIntegratorMag &)=delete
Assignment and copy constructor not implemented nor used.
void SetDistChord(G4double distChordIn)
Setter for distChord to private member.
static G4double thinElementLength
static G4bool currentTrackIsPrimary
G4double distChordPrivate
Variable used to record the distance from the chord calculated during the step.
BDSIntegratorMag & operator=(const BDSIntegratorMag &)=delete
Assignment and copy constructor not implemented nor used.
void ConvertToGlobal(const G4ThreeVector &localPos, const G4ThreeVector &localMom, G4double yOut[], G4double yErr[], const G4double momScaling=1.0)
scaling of momentum in case localMom is a unit vector
virtual G4int IntegratorOrder() const
Geant4 requires that the integrator order must be supplied by the derived class.
G4MagIntegratorStepper * backupStepper
const G4int nVariables
Cache of the number of variables.
BDSIntegratorMag()=delete
Private default constructor to force use of specific constructor.
virtual G4double DistChord() const
Estimate maximum distance of curved solution and chord.