BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSIntegratorDipoleQuadrupole.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 BDSINTEGRATORDIPOLEQUADRUPOLE_H
19#define BDSINTEGRATORDIPOLEQUADRUPOLE_H
20
21#include "BDSIntegratorMag.hh"
22#include "BDSMagUsualEqRhs.hh"
23
24#include "globals.hh"
25
29class BDSStep;
30class G4Mag_EqRhs;
31
39{
40public:
42 G4double brhoIn,
43 G4Mag_EqRhs* eqOfMIn,
44 G4double minimumRadiusOfCurvatureIn,
45 const BDSParticleDefinition* designParticle,
46 const G4double& tiltIn);
47
49
54
58 virtual void Stepper(const G4double y[6],
59 const G4double dydx[6],
60 const G4double h,
61 G4double yOut[6],
62 G4double yErr[6]);
63
64protected:
65
69 void OneStep(const G4ThreeVector& posIn,
70 const G4ThreeVector& momIn,
71 const G4ThreeVector& momUIn, // assumed unit momentum of momIn
72 const G4double& h,
73 const G4double& fcof,
74 G4ThreeVector& posOut,
75 G4ThreeVector& momOut,
76 const G4double rho,
77 const G4double beta,
78 const G4double deltaEnergy) const;
79
80
81
82private:
85
86 const G4double nominalBRho;
88 const G4double bPrime;
89 const G4double nominalBeta;
90 G4double nominalRho;
91 const G4double nominalField;
92 G4double fieldRatio;
93 const G4double nominalEnergy;
94 const G4double nominalMass;
95 const G4double nominalCharge;
96 G4ThreeVector unitField;
97 const G4double fieldArcLength;
98 const G4double nominalAngle;
99 G4double angleForCL;
100 G4double tilt;
101 const G4double scaling;
102 G4bool isScaled;
103
105};
106
107#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:32