BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSFieldESinusoid.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 BDSFIELDESINUSOID_H
19#define BDSFIELDESINUSOID_H
20
21#include "BDSFieldE.hh"
22
23#include "globals.hh" // geant4 types / globals
24#include "G4ThreeVector.hh"
25
26class BDSCavityInfo;
28
38{
39public:
40 BDSFieldESinusoid() = delete;
42 explicit BDSFieldESinusoid(BDSMagnetStrength const* strength);
43
45 BDSFieldESinusoid(G4double eFieldAmplitude,
46 const G4ThreeVector& unitDirectionIn,
47 G4double frequencyIn,
48 G4double phaseOffsetIn,
49 G4double synchronousTIn);
50
51 virtual ~BDSFieldESinusoid(){;}
52
53 virtual G4bool TimeVarying() const {return true;}
54
56 virtual G4ThreeVector GetField(const G4ThreeVector& position,
57 const G4double t) const;
58
59protected:
60 G4double eField;
61 const G4ThreeVector unitDirection;
63 G4double phase;
64 G4double synchronousT;
65};
66
67#endif
Holder for all Geometrical information required to create an RF cavity.
A sinusoidal electric (only) field that doesn't vary with position. Uses cosine.
G4double angularFrequency
Angular frequency of field.
virtual G4ThreeVector GetField(const G4ThreeVector &position, const G4double t) const
Accessor for field value.
virtual G4bool TimeVarying() const
const G4ThreeVector unitDirection
Peak amplitude of electric field.
G4double synchronousT
Global T offset for 0 phase.
Interface for BDSIM electric fields that may or may not be local.
Definition BDSFieldE.hh:38
Efficient storage of magnet strengths.