BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
BDSFieldEMRFCavity.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 BDSFIELDEMRFCAVITY_H
20#define BDSFIELDEMRFCAVITY_H
21
22#include "BDSFieldEM.hh"
23
24#include "globals.hh"
25#include "G4ThreeVector.hh"
26
27#include <utility>
28
29class BDSCavityInfo;
31
39{
40public:
42 G4double brho);
43
44 BDSFieldEMRFCavity(G4double eFieldAmplitude,
45 G4double frequency,
46 G4double phaseOffset,
47 G4double cavityRadius);
48
49 virtual ~BDSFieldEMRFCavity(){;}
50
52 virtual std::pair<G4ThreeVector, G4ThreeVector> GetField(const G4ThreeVector& position,
53 const G4double t) const;
54
55private:
58
59 G4double eFieldMax;
60 G4double frequency;
61 G4double phase;
62 G4double cavityRadius;
63
65 static const G4double j0FirstZero;
66
68 static const G4double Z0;
69
71 const G4double normalisedCavityRadius;
72
74 const G4double angularFrequency;
75};
76
77#endif
Holder for all Geometrical information required to create an RF cavity.
Pill box cavity electro-magnetic field.
virtual std::pair< G4ThreeVector, G4ThreeVector > GetField(const G4ThreeVector &position, const G4double t) const
Accessor to get B and E field.
const G4double angularFrequency
Angular frequency calculated from frequency - cached to avoid repeated calculation.
G4double phase
Phase offset of the oscillator.
BDSFieldEMRFCavity()
Private constructor to force use of provided one.
static const G4double j0FirstZero
X coordinate of first 0 point for bessel J0.
static const G4double Z0
Impedance of free space.
G4double frequency
Angular frequency.
G4double eFieldMax
Maximum field in V/m.
G4double cavityRadius
Radius at maximum extent of cavity.
const G4double normalisedCavityRadius
Pre-calculated normalised calculated radius w.r.t. bessel first 0.
Interface for BDSIM electro-magnetic fields that may or may not be local.
Definition: BDSFieldEM.hh:39
Efficient storage of magnet strengths.