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) 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#include "modulator.h"
19
20using namespace GMAD;
21
27
29{
30 name = "";
31 type = "";
32 frequency = 0;
33 phase = 0;
34 tOffset = 0;
36 amplitudeScale = 1.0;
37 T0 = 0;
38 T1 = 0;
39}
40
42{
43 publish("name", &Modulator::name);
44 publish("type", &Modulator::type);
45 publish("frequency", &Modulator::frequency);
46 publish("phase", &Modulator::phase);
47 publish("tOffset", &Modulator::tOffset);
48 publish("amplitudeOffset", &Modulator::amplitudeOffset);
49 publish("amplitudeScale", &Modulator::amplitudeScale);
50 publish("T0", &Modulator::T0);
51 publish("T1", &Modulator::T1);
52}
53
55{
56 std::cout << "modulator: "
57 << "name " << name << std::endl
58 << "type " << type << std::endl
59 << "frequency " << frequency << std::endl
60 << "phase " << phase << std::endl
61 << "tOffset " << tOffset << std::endl
62 << "amplitudeOffset " << amplitudeOffset << std::endl
63 << "amplitudeScale " << amplitudeScale << std::endl
64 << "T0 " << T0 << std::endl
65 << "T1 " << T1 << std::endl;
66}
double tOffset
time offset used for phase calculation (ns) for modulator on top of rf cavity
Definition modulator.h:42
double T0
'on' time
Definition modulator.h:46
void clear()
Reset.
Definition modulator.cc:28
double amplitudeOffset
numerical value added to -1 -> 1 modulator as offset
Definition modulator.h:43
void print() const
Print some properties.
Definition modulator.cc:54
double frequency
frequency of modulation on top of rf cavity in Hz
Definition modulator.h:40
double T1
'off' time
Definition modulator.h:47
Modulator()
Constructor.
Definition modulator.cc:22
void PublishMembers()
publish members
Definition modulator.cc:41
double amplitudeScale
multiplier for amplitude of modulation
Definition modulator.h:44
double phase
phase of modulation oscillator on top of rf cavity
Definition modulator.h:41
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:93
Parser namespace for GMAD language. Combination of Geant4 and MAD.