BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSMagUsualEqRhs.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 BDSMAGUSUALEQRHS_H
20#define BDSMAGUSUALEQRHS_H
21
22#include "BDSAuxiliaryNavigator.hh"
23#include "BDSIntegratorDrift.hh"
24
25#include "globals.hh" // geant4 types / globals
26#include "G4MagIntegratorStepper.hh"
27#include "G4Mag_UsualEqRhs.hh"
28#include "G4ChargeState.hh"
29
36class BDSMagUsualEqRhs: public G4Mag_UsualEqRhs
37{
38public:
39 BDSMagUsualEqRhs(G4MagneticField* MagField);
40
41 virtual ~BDSMagUsualEqRhs(){;}
42
44 inline G4double FCof() const {return fCof_val;}
45
47 inline G4double Mass() const {return fMassCof;}
48
50 G4double Beta(const G4double y[6]);
51
53 G4double Beta(const G4ThreeVector& mom);
54
56 G4double TotalEnergy(const G4double y[]);
57
59 G4double TotalEnergy(const G4ThreeVector& mom);
60
62 virtual void SetChargeMomentumMass(G4ChargeState particleCharge,
63 G4double MomentumXc,
64 G4double particleMass);
65
66protected:
67 G4double fMassCof;
68 G4double fCof_val;
69
70};
71
72#endif
Override G4Mag_UsualEqRhs, provides BDSIM integrators access to particle attributes.
G4double fMassCof
Particle mass squared.
G4double TotalEnergy(const G4double y[])
Calculate total particle energy.
G4double Beta(const G4double y[6])
Calculate particle velocity W.R.T speed of light.
virtual void SetChargeMomentumMass(G4ChargeState particleCharge, G4double MomentumXc, G4double particleMass)
Copy of class method from G4Mag_UsualEqRhs.
G4double FCof() const
Accessor to variable for normalising to charge.
G4double Mass() const
Accessor to particle mass.