BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
blmplacement.cc
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) Royal Holloway,
3University of London 2001 - 2024.
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 "blmplacement.h"
20
21using namespace GMAD;
22
28
30{
31 name = "";
34 s = 0;
35 x = 0;
36 y = 0;
37 z = 0;
38 phi = 0;
39 theta = 0;
40 psi = 0;
41 axisX = 0;
42 axisY = 0;
43 axisZ = 0;
44 angle = 0;
45 axisAngle = false;
46 side = "";
47 sideOffset = 0;
48
49 geometryFile = "";
50 geometryType = "";
51 blmMaterial = "";
52 blm1 = 0;
53 blm2 = 0;
54 blm3 = 0;
55 blm4 = 0;
56 scoreQuantity = "";
57 bias = "";
58}
59
61{
63 publish("referenceElement", &BLMPlacement::referenceElement);
64 publish("referenceElementNumber", &BLMPlacement::referenceElementNumber);
76 publish("axisAngle", &BLMPlacement::axisAngle);
78 publish("sideOffset", &BLMPlacement::sideOffset);
79
80 publish("geometryFile", &BLMPlacement::geometryFile);
81 publish("geometryType", &BLMPlacement::geometryType);
82 publish("blmMaterial", &BLMPlacement::blmMaterial);
83 publish("blm1", &BLMPlacement::blm1);
84 publish("blm2", &BLMPlacement::blm2);
85 publish("blm3", &BLMPlacement::blm3);
86 publish("blm4", &BLMPlacement::blm4);
87 publish("scoreQuantity", &BLMPlacement::scoreQuantity);
88 publish("bias", &BLMPlacement::bias);
89}
90
92{
93 std::cout << "BLMPlacement: "
94 << "name " << name << std::endl
95 << "referenceElement" << referenceElement << std::endl
96 << "referenceElementNumber" << referenceElementNumber << std::endl
97 << "s" << s << std::endl
98 << "x " << x << std::endl
99 << "y " << y << std::endl
100 << "z " << z << std::endl
101 << "phi " << phi << std::endl
102 << "theta " << theta << std::endl
103 << "psi " << psi << std::endl
104 << "axisX " << axisX << std::endl
105 << "axisY " << axisY << std::endl
106 << "axisZ " << axisZ << std::endl
107 << "angle " << angle << std::endl
108 << "axisAngle " << axisAngle << std::endl
109 << "side " << side << std::endl
110 << "sideOffset " << sideOffset << std::endl
111 << "geometryFile " << geometryFile << std::endl
112 << "geometryType " << geometryType << std::endl
113 << "blmMaterial " << blmMaterial << std::endl
114 << "blm1 " << blm1 << std::endl
115 << "blm2 " << blm2 << std::endl
116 << "blm3 " << blm3 << std::endl
117 << "blm4 " << blm4 << std::endl
118 << "scoreQuantity " << scoreQuantity << std::endl
119 << "bias " << bias << std::endl;
120}
double sideOffset
Offset between the geometry and the BLM.
bool axisAngle
Flag to use the axis angle construction of rotation.
void PublishMembers()
publish members
double theta
Euler angle for rotation.
double x
Offset in x.
std::string side
which side to attach to: top, bottom, left, right.
std::string referenceElement
Name of reference element w.r.t. to place to.
std::string name
Name of this samplerplacement.
double psi
Euler angle for rotation.
double phi
Euler angle for rotation.
void print() const
print some properties
BLMPlacement()
constructor
double s
Curvilinear s position to place w.r.t..
int referenceElementNumber
Index of repetition of element if there are multiple uses.
double y
Offset in y.
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:94
Parser namespace for GMAD language. Combination of Geant4 and MAD.