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) 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 "blmplacement.h"
19
20using namespace GMAD;
21
27
29{
30 name = "";
33 s = 0;
34 x = 0;
35 y = 0;
36 z = 0;
37 phi = 0;
38 theta = 0;
39 psi = 0;
40 axisX = 0;
41 axisY = 0;
42 axisZ = 0;
43 angle = 0;
44 axisAngle = false;
45 side = "";
46 sideOffset = 0;
47
48 geometryFile = "";
49 geometryType = "";
50 blmMaterial = "";
51 blm1 = 0;
52 blm2 = 0;
53 blm3 = 0;
54 blm4 = 0;
55 scoreQuantity = "";
56 bias = "";
57}
58
60{
62 publish("referenceElement", &BLMPlacement::referenceElement);
63 publish("referenceElementNumber", &BLMPlacement::referenceElementNumber);
75 publish("axisAngle", &BLMPlacement::axisAngle);
77 publish("sideOffset", &BLMPlacement::sideOffset);
78
79 publish("geometryFile", &BLMPlacement::geometryFile);
80 publish("geometryType", &BLMPlacement::geometryType);
81 publish("blmMaterial", &BLMPlacement::blmMaterial);
82 publish("blm1", &BLMPlacement::blm1);
83 publish("blm2", &BLMPlacement::blm2);
84 publish("blm3", &BLMPlacement::blm3);
85 publish("blm4", &BLMPlacement::blm4);
86 publish("scoreQuantity", &BLMPlacement::scoreQuantity);
87 publish("bias", &BLMPlacement::bias);
88}
89
91{
92 std::cout << "BLMPlacement: "
93 << "name " << name << std::endl
94 << "referenceElement" << referenceElement << std::endl
95 << "referenceElementNumber" << referenceElementNumber << std::endl
96 << "s" << s << std::endl
97 << "x " << x << std::endl
98 << "y " << y << std::endl
99 << "z " << z << std::endl
100 << "phi " << phi << std::endl
101 << "theta " << theta << std::endl
102 << "psi " << psi << std::endl
103 << "axisX " << axisX << std::endl
104 << "axisY " << axisY << std::endl
105 << "axisZ " << axisZ << std::endl
106 << "angle " << angle << std::endl
107 << "axisAngle " << axisAngle << std::endl
108 << "side " << side << std::endl
109 << "sideOffset " << sideOffset << std::endl
110 << "geometryFile " << geometryFile << std::endl
111 << "geometryType " << geometryType << std::endl
112 << "blmMaterial " << blmMaterial << std::endl
113 << "blm1 " << blm1 << std::endl
114 << "blm2 " << blm2 << std::endl
115 << "blm3 " << blm3 << std::endl
116 << "blm4 " << blm4 << std::endl
117 << "scoreQuantity " << scoreQuantity << std::endl
118 << "bias " << bias << std::endl;
119}
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:93
Parser namespace for GMAD language. Combination of Geant4 and MAD.