BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
crystal.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 "crystal.h"
20
21using namespace GMAD;
22
24{
25 clear();
27}
28
30{
31 name = "";
32 material = "";
33 data = "";
34 shape = "";
35 lengthX = 0;
36 lengthY = 0;
37 lengthZ = 0;
38 sizeA = 0;
39 sizeB = 0;
40 sizeC = 0;
41 alpha = 0;
42 beta = 0;
43 gamma = 0;
44 spaceGroup = 0;
47 miscutAngleY = 0;
48}
49
51{
52 publish("name", &Crystal::name);
53 publish("material", &Crystal::material);
54 publish("data", &Crystal::data);
55 publish("shape", &Crystal::shape);
56 publish("lengthX", &Crystal::lengthX);
57 publish("lengthY", &Crystal::lengthY);
58 publish("lengthZ", &Crystal::lengthZ);
59 publish("sizeA", &Crystal::sizeA);
60 publish("sizeB", &Crystal::sizeB);
61 publish("sizeC", &Crystal::sizeC);
62 publish("alpha", &Crystal::alpha);
63 publish("beta", &Crystal::beta);
64 publish("gamma", &Crystal::gamma);
65 publish("spaceGroup", &Crystal::spaceGroup);
66 publish("bendingAngleYAxis", &Crystal::bendingAngleYAxis);
67 publish("bendingAngleZAxis", &Crystal::bendingAngleZAxis);
68 publish("miscutAngleY", &Crystal::miscutAngleY);
69}
70
71void Crystal::print()const
72{
73 std::cout << "crystal: "
74 << "name " << name << std::endl
75 << "material " << material << std::endl
76 << "data " << data << std::endl
77 << "shape " << shape << std::endl
78 << "lengthX " << lengthX << std::endl
79 << "lengthY " << lengthY << std::endl
80 << "lengthZ " << lengthZ << std::endl
81 << "sizeA " << sizeA << std::endl
82 << "sizeB " << sizeB << std::endl
83 << "sizeC " << sizeC << std::endl
84 << "alpha " << alpha << std::endl
85 << "beta " << beta << std::endl
86 << "gamma " << gamma << std::endl
87 << "spaceGroup " << spaceGroup << std::endl
88 << "bendingAngleYAxis " << bendingAngleYAxis << std::endl
89 << "bendingAngleZAxis " << bendingAngleZAxis << std::endl
90 << "miscutAngleY " << miscutAngleY << std::endl;
91}
void clear()
Reset.
Definition: crystal.cc:29
std::string name
Name of object.
Definition: crystal.h:39
double lengthX
X size.
Definition: crystal.h:43
void PublishMembers()
publish members
Definition: crystal.cc:50
std::string shape
Which geometry to create.
Definition: crystal.h:42
void print() const
Print some properties.
Definition: crystal.cc:71
double bendingAngleYAxis
Bending angle about Y axis.
Definition: crystal.h:53
Crystal()
Constructor.
Definition: crystal.cc:23
double lengthZ
Z size.
Definition: crystal.h:45
std::string data
Which channelling data to use.
Definition: crystal.h:41
double bendingAngleZAxis
Bending angle about Z axis.
Definition: crystal.h:54
std::string material
Material of crystal.
Definition: crystal.h:40
double lengthY
Y size.
Definition: crystal.h:44
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.