BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSFieldEMRFCavity.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2024.
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:
41 BDSFieldEMRFCavity() = delete;
42 explicit BDSFieldEMRFCavity(BDSMagnetStrength const* strength);
43
44 BDSFieldEMRFCavity(G4double eFieldAmplitude,
45 G4double frequency,
46 G4double phaseOffset,
47 G4double cavityRadius,
48 G4double synchronousTIn);
49
50 virtual ~BDSFieldEMRFCavity(){;}
51
53 virtual std::pair<G4ThreeVector, G4ThreeVector> GetField(const G4ThreeVector& position,
54 const G4double t) const;
55
56 virtual G4bool TimeVarying() const {return true;}
57
59 static G4double TransitTimeFactor(G4double frequency,
60 G4double phase,
61 G4double zLength,
62 G4double beta);
63
64private:
65 G4double eFieldMax;
66 G4double phase;
67 G4double cavityRadius;
68 G4double synchronousT;
69
70 static const G4double j0FirstZero;
71 static const G4double Z0;
72 const G4double normalisedCavityRadius;
73 const G4double angularFrequency;
74};
75
76#endif
Holder for all Geometrical information required to create an RF cavity.
Pill box cavity electromagnetic field.
virtual G4bool TimeVarying() const
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.
static const G4double j0FirstZero
X coordinate of first 0 point for bessel J0.
static const G4double Z0
Impedance of free space.
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.
static G4double TransitTimeFactor(G4double frequency, G4double phase, G4double zLength, G4double beta)
General function put here as it represents the equations in this class.
Interface for BDSIM electro-magnetic fields that may or may not be local.
Definition BDSFieldEM.hh:41
Efficient storage of magnet strengths.