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 - 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 "blmplacement.h"
20
21using namespace GMAD;
22
24{
25 clear();
27}
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.
Definition: blmplacement.h:61
bool axisAngle
Flag to use the axis angle construction of rotation.
Definition: blmplacement.h:59
void PublishMembers()
publish members
Definition: blmplacement.cc:60
double theta
Euler angle for rotation.
Definition: blmplacement.h:50
double x
Offset in x.
Definition: blmplacement.h:45
std::string side
which side to attach to: top, bottom, left, right.
Definition: blmplacement.h:60
std::string referenceElement
Name of reference element w.r.t. to place to.
Definition: blmplacement.h:42
std::string name
Name of this samplerplacement.
Definition: blmplacement.h:41
double psi
Euler angle for rotation.
Definition: blmplacement.h:51
double phi
Euler angle for rotation.
Definition: blmplacement.h:49
void print() const
print some properties
Definition: blmplacement.cc:91
BLMPlacement()
constructor
Definition: blmplacement.cc:23
void clear()
reset
Definition: blmplacement.cc:29
double s
Curvilinear s position to place w.r.t..
Definition: blmplacement.h:44
int referenceElementNumber
Index of repetition of element if there are multiple uses.
Definition: blmplacement.h:43
double y
Offset in y.
Definition: blmplacement.h:46
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.