BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSModulatorSinT.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2023.
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 BDSMODULATORSINT_H
20#define BDSMODULATORSINT_H
21#include "BDSModulator.hh"
22
23#include "G4Types.hh"
24
34{
35public:
36 BDSModulatorSinT() = delete;
37 explicit BDSModulatorSinT(G4double frequencyIn,
38 G4double phaseIn = 0,
39 G4double amplitudeOffsetIn = 0,
40 G4double amplitudeScaleIn = 1.0);
41 virtual ~BDSModulatorSinT() = default;
42
44 virtual G4double Factor(const G4ThreeVector& xyz,
45 G4double T) const;
46
47 virtual G4bool VariesWithTime() const {return true;}
48
50 virtual G4double RecommendedMaxStepLength() const;
51
52private:
53 G4double angularFrequency;
54 G4double phase;
55 G4double offset;
56 G4double scale;
57};
58
59#endif
Sinusoidal modulator as a function of global time.
virtual G4double Factor(const G4ThreeVector &xyz, G4double T) const
Returns value of equation in brief at the top of this file.
virtual G4bool VariesWithTime() const
Each derived class should override this.
virtual G4double RecommendedMaxStepLength() const
Return the wavlength / 20 of the oscillator.
Base class for a modulator.
Definition: BDSModulator.hh:37