BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
tunnel.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 "tunnel.h"
20
21using namespace GMAD;
22
24 aper1(0.0),aper2(0.0),
25 offsetX(0.0),offsetY(0.0),
26 thickness(0.0),soilThickness(0.0),
27 floorOffset(0.0),visible(true)
28{
30}
31
33{
34 name = "";
35 type = "";
36
37 aper1 = 0.0;
38 aper2 = 0.0;
39 offsetX = 0.0;
40 offsetY = 0.0;
41 thickness = 0.0;
42 soilThickness = 0.0;
43 floorOffset = 0.0;
44 visible = true;
45
46 material = "";
47 soilMaterial = "";
48 startElement = "";
49 endElement = "";
50}
51
53{
54 publish("name",&Tunnel::name);
55 publish("type",&Tunnel::type);
56 publish("radius",&Tunnel::aper1);
57 publish("aper1",&Tunnel::aper1);
58 publish("aper2",&Tunnel::aper2);
59 publish("offsetX",&Tunnel::offsetX);
60 publish("offsetY",&Tunnel::offsetY);
61 publish("thickness",&Tunnel::thickness);
62 publish("soilThickness",&Tunnel::soilThickness);
63 publish("floorOffset",&Tunnel::floorOffset);
64 publish("visible",&Tunnel::visible);
65 publish("material",&Tunnel::material);
66 publish("soilMaterial",&Tunnel::soilMaterial);
67 publish("startElement",&Tunnel::startElement);
68 publish("endElement",&Tunnel::endElement);
69}
70
71void Tunnel::print()const
72{
73 std::cout << "tunnel: "
74 << name << " "
75 << type << " "
76 << aper1 << " "
77 << aper2 << " "
78 << offsetX << " "
79 << offsetY << " "
80 << thickness << " "
81 << soilThickness << " "
82 << floorOffset << " "
83 << material << " "
84 << soilMaterial << " "
85 << startElement << " "
86 << endElement
87 << std::endl;
88}
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
double aper1
radius, aperture parameters
Definition: tunnel.h:43
void PublishMembers()
Publish members.
Definition: tunnel.cc:52
std::string soilMaterial
soil
Definition: tunnel.h:58
std::string startElement
start and end element by name
Definition: tunnel.h:61
double thickness
tunnel geometry parameters
Definition: tunnel.h:48
int visible
visibility
Definition: tunnel.h:53
std::string material
material
Definition: tunnel.h:56
void clear()
reset
Definition: tunnel.cc:32
std::string name
Definition: tunnel.h:38
std::string type
geometry type
Definition: tunnel.h:40
Tunnel()
constructor
Definition: tunnel.cc:23
double offsetX
offset x and y
Definition: tunnel.h:46
void print() const
print some properties
Definition: tunnel.cc:71
Parser namespace for GMAD language. Combination of Geant4 and MAD.