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