BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSIntegratorDipoleQuadrupole.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2022.
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 BDSINTEGRATORDIPOLEQUADRUPOLE_H
20#define BDSINTEGRATORDIPOLEQUADRUPOLE_H
21
22#include "BDSIntegratorMag.hh"
23#include "BDSMagUsualEqRhs.hh"
24
25#include "globals.hh"
26
30class BDSStep;
31class G4Mag_EqRhs;
32
40{
41public:
43 G4double brhoIn,
44 G4Mag_EqRhs* eqOfMIn,
45 G4double minimumRadiusOfCurvatureIn,
46 const BDSParticleDefinition* designParticle,
47 const G4double& tiltIn);
48
50
55
59 virtual void Stepper(const G4double y[6],
60 const G4double dydx[6],
61 const G4double h,
62 G4double yOut[6],
63 G4double yErr[6]);
64
65protected:
66
70 void OneStep(const G4ThreeVector& posIn,
71 const G4ThreeVector& momIn,
72 const G4ThreeVector& momUIn, // assumed unit momentum of momIn
73 const G4double& h,
74 const G4double& fcof,
75 G4ThreeVector& posOut,
76 G4ThreeVector& momOut,
77 const G4double rho,
78 const G4double beta,
79 const G4double deltaEnergy) const;
80
81
82
83private:
86
87 const G4double nominalBRho;
89 const G4double bPrime;
90 const G4double nominalBeta;
91 G4double nominalRho;
92 const G4double nominalField;
93 G4double fieldRatio;
94 const G4double nominalEnergy;
95 const G4double nominalMass;
96 const G4double nominalCharge;
97 G4ThreeVector unitField;
98 const G4double fieldArcLength;
99 const G4double nominalAngle;
100 G4double angleForCL;
101 G4double tilt;
102 const G4double scaling;
103 G4bool isScaled;
104
106};
107
108#endif
Integrator for combined dipole and quadrupolar field.
G4double nominalRho
Cached magnet property, nominal bending radius.
BDSIntegratorDipoleQuadrupole(BDSIntegratorDipoleQuadrupole &)=delete
Assignment and copy constructor not implemented nor used.
G4double fieldRatio
Ratio of supplied field to nominal field. Needed for over/underpowered magnets.
virtual void Stepper(const G4double y[6], const G4double dydx[6], const G4double h, G4double yOut[6], G4double yErr[6])
const G4double fieldArcLength
Cache of the field arc length.
BDSIntegratorDipoleQuadrupole()=delete
Private default constructor to enforce use of supplied constructor.
void OneStep(const G4ThreeVector &posIn, const G4ThreeVector &momIn, const G4ThreeVector &momUIn, const G4double &h, const G4double &fcof, G4ThreeVector &posOut, G4ThreeVector &momOut, const G4double rho, const G4double beta, const G4double deltaEnergy) const
const G4double nominalField
Cached magnet property, nominal field strength.
BDSIntegratorDipoleQuadrupole & operator=(const BDSIntegratorDipoleQuadrupole &)=delete
Assignment and copy constructor not implemented nor used.
const G4double nominalCharge
Nominal beam charge.
const G4double bPrime
Cached magnet property, B field gradient for calculating K1.
const G4double nominalAngle
Cache of the field angle.
G4double angleForCL
Angle used for curvilinear transforms.
G4ThreeVector unitField
Cache of the unit field direction.
G4double tilt
Tilt offset transform for field.
const G4double nominalMass
Primary particle mass. Needed for recalculating nominal energy with scaling.
const G4double nominalBeta
Cached nominal relativistic beta of the nominal beam particle.
const G4double scaling
Cache field scaling factor.
G4bool isScaled
Cache if field is scaled.
BDSMagUsualEqRhs * eq
BDSIM's eqRhs class to give access to particle properties.
const G4double nominalBRho
Cached magnet property, nominal magnetic rigidity.
const G4double nominalEnergy
Nominal beam energy.
BDSIntegratorDipoleRodrigues2 * dipole
Backup integrator.
Exact helix through pure dipole field.
Common functionality to BDSIM integrators.
Override G4Mag_UsualEqRhs, provides BDSIM integrators access to particle attributes.
Efficient storage of magnet strengths.
Wrapper for particle definition.
A simple class to represent the positions of a step.
Definition: BDSStep.hh:33