BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
modulator.cc
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#include "modulator.h"
20
21using namespace GMAD;
22
24{
25 clear();
27}
28
30{
31 name = "";
32 type = "";
33 frequency = 0;
34 phase = 0;
35 tOffset = 0;
37 amplitudeScale = 1.0;
38 T0 = 0;
39 T1 = 0;
40}
41
43{
44 publish("name", &Modulator::name);
45 publish("type", &Modulator::type);
46 publish("frequency", &Modulator::frequency);
47 publish("phase", &Modulator::phase);
48 publish("tOffset", &Modulator::tOffset);
49 publish("amplitudeOffset", &Modulator::amplitudeOffset);
50 publish("amplitudeScale", &Modulator::amplitudeScale);
51 publish("T0", &Modulator::T0);
52 publish("T1", &Modulator::T1);
53}
54
56{
57 std::cout << "modulator: "
58 << "name " << name << std::endl
59 << "type " << type << std::endl
60 << "frequency " << frequency << std::endl
61 << "phase " << phase << std::endl
62 << "tOffset " << tOffset << std::endl
63 << "amplitudeOffset " << amplitudeOffset << std::endl
64 << "amplitudeScale " << amplitudeScale << std::endl
65 << "T0 " << T0 << std::endl
66 << "T1 " << T1 << std::endl;
67}
double tOffset
time offset used for phase calculation (ns) for modulator on top of rf cavity
Definition: modulator.h:43
double T0
'on' time
Definition: modulator.h:47
void clear()
Reset.
Definition: modulator.cc:29
double amplitudeOffset
numerical value added to -1 -> 1 modulator as offset
Definition: modulator.h:44
void print() const
Print some properties.
Definition: modulator.cc:55
double frequency
frequency of modulation on top of rf cavity in Hz
Definition: modulator.h:41
double T1
'off' time
Definition: modulator.h:48
Modulator()
Constructor.
Definition: modulator.cc:23
void PublishMembers()
publish members
Definition: modulator.cc:42
double amplitudeScale
multiplier for amplitude of modulation
Definition: modulator.h:45
double phase
phase of modulation oscillator on top of rf cavity
Definition: modulator.h:42
void publish(const std::string &name, T C::*mp)
Make pointer to member from class C and type T with accessible with a name.
Definition: published.h:92
Parser namespace for GMAD language. Combination of Geant4 and MAD.