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) 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 BDSINTEGRATORMAG_H
19#define BDSINTEGRATORMAG_H
20
21#include "BDSAuxiliaryNavigator.hh"
22#include "BDSIntegratorDrift.hh"
23#include "BDSMagnetStrength.hh"
24
25#include "globals.hh" // geant4 types / globals
26#include "G4MagIntegratorStepper.hh"
27
28class G4Mag_EqRhs;
29
42class BDSIntegratorMag: public G4MagIntegratorStepper, public BDSIntegratorDrift, public BDSAuxiliaryNavigator
43{
44public:
45 BDSIntegratorMag(G4Mag_EqRhs* eqOfMIn,
46 G4int nVariablesIn);
47
48 virtual ~BDSIntegratorMag();
53
55 inline virtual G4double DistChord() const {return distChordPrivate;}
56
58 inline virtual G4int IntegratorOrder() const {return 2;}
59
62 static G4double thinElementLength;
63
67
71 static G4bool currentTrackIsPrimary;
72
73protected:
76 void ConvertToGlobal(const G4ThreeVector &localPos,
77 const G4ThreeVector &localMom,
78 G4double yOut[],
79 G4double yErr[],
80 const G4double momScaling = 1.0);
81
83 inline void SetDistChord(G4double distChordIn) {distChordPrivate = distChordIn;}
84
88 G4Mag_EqRhs* eqOfM;
89
91 const G4int nVariables;
92
96 G4MagIntegratorStepper* backupStepper;
97
101
105
106private:
109
112};
113
114#endif
Extra G4Navigator to get coordinate transforms.
Routine for drift algorithm.
Common functionality to BDSIM integrators.
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.