BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
scorermesh.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 "scorermesh.h"
20
21using namespace GMAD;
22
24{
25 clear();
27}
28
30{
31 name = "";
32 scoreQuantity = "";
33 geometryType = "box";
34
35 nx = 0;
36 ny = 0;
37 nz = 0;
38 nr = 0;
39 nphi = 0;
40 ne = 1;
41 xsize = 0;
42 ysize = 0;
43 zsize = 0;
44 rsize = 0;
45 eLow = 1e-12;
46 eHigh = 1e4;
47 eScale = "linear";
49 sequence = "";
52 s = 0;
53 x = 0;
54 y = 0;
55 z = 0;
56 phi = 0;
57 theta = 0;
58 psi = 0;
59 axisX = 0;
60 axisY = 0;
61 axisZ = 0;
62 angle = 0;
63 axisAngle = false;
64}
65
67{
68 publish("name", &ScorerMesh::name);
69 publish("scoreQuantity", &ScorerMesh::scoreQuantity);
70 publish("geometryType", &ScorerMesh::geometryType);
71 publish("nx", &ScorerMesh::nx);
72 publish("ny", &ScorerMesh::ny);
73 publish("nz", &ScorerMesh::nz);
74 publish("nr", &ScorerMesh::nr);
75 publish("nphi", &ScorerMesh::nphi);
76 publish("ne", &ScorerMesh::ne);
77 publish("xsize", &ScorerMesh::xsize);
78 publish("ysize", &ScorerMesh::ysize);
79 publish("zsize", &ScorerMesh::zsize);
80 publish("rsize", &ScorerMesh::rsize);
81 publish("eLow", &ScorerMesh::eLow);
82 publish("eHigh", &ScorerMesh::eHigh);
83 publish("eScale", &ScorerMesh::eScale);
84 publish("eBinsEdgesFilenamePath", &ScorerMesh::eBinsEdgesFilenamePath);
85 publish("sequence", &ScorerMesh::sequence);
86 publish("referenceElement", &ScorerMesh::referenceElement);
87 publish("referenceElementNumber", &ScorerMesh::referenceElementNumber);
92 publish("phi", &ScorerMesh::phi);
93 publish("theta", &ScorerMesh::theta);
94 publish("psi", &ScorerMesh::psi);
95 publish("axisX", &ScorerMesh::axisX);
96 publish("axisY", &ScorerMesh::axisY);
97 publish("axisZ", &ScorerMesh::axisZ);
98 publish("angle", &ScorerMesh::angle);
99 publish("axisAngle", &ScorerMesh::axisAngle);
100}
101
103{
104 std::cout << "ScorerMesh: "
105 << "name " << name << std::endl
106 << "scoreQuantity " << scoreQuantity << std::endl
107 << "nx " << nx << std::endl
108 << "ny " << ny << std::endl
109 << "nz " << nz << std::endl
110 << "ne " << ne << std::endl
111 << "xsize " << xsize << std::endl
112 << "ysize " << ysize << std::endl
113 << "zsize " << zsize << std::endl
114 << "eLow " << eLow << std::endl
115 << "eHigh " << eHigh << std::endl
116 << "eScale " << eScale << std::endl
117 << "sequence " << sequence << std::endl
118 << "referenceElement" << referenceElement << std::endl
119 << "referenceElementNumber" << referenceElementNumber << std::endl
120 << "s" << s << std::endl
121 << "x " << x << std::endl
122 << "y " << y << std::endl
123 << "z " << z << std::endl
124 << "phi " << phi << std::endl
125 << "theta " << theta << std::endl
126 << "psi " << psi << std::endl
127 << "axisX " << axisX << std::endl
128 << "axisY " << axisY << std::endl
129 << "axisZ " << axisZ << std::endl
130 << "angle " << angle << std::endl
131 << "axisAngle " << axisAngle << std::endl;
132}
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
void clear()
reset
Definition: scorermesh.cc:29
double phi
Euler angle for rotation.
Definition: scorermesh.h:68
std::string referenceElement
Name of reference element w.r.t. to place to.
Definition: scorermesh.h:61
int ny
Number of bins in y.
Definition: scorermesh.h:45
int ne
Number of bins in E.
Definition: scorermesh.h:49
int nx
Number of bins in x.
Definition: scorermesh.h:44
int nphi
Number of bins in Phi.
Definition: scorermesh.h:48
int nz
Number of bins in z.
Definition: scorermesh.h:46
void print() const
print some properties
Definition: scorermesh.cc:102
double s
Curvilinear s position to place w.r.t..
Definition: scorermesh.h:63
std::string scoreQuantity
Name of scorer object to use.
Definition: scorermesh.h:41
double psi
Euler angle for rotation.
Definition: scorermesh.h:70
int referenceElementNumber
Index of repetition of element if there are multiple uses.
Definition: scorermesh.h:62
std::string eScale
E scaling type.
Definition: scorermesh.h:56
std::string name
Name of this placement.
Definition: scorermesh.h:40
double xsize
X total width.
Definition: scorermesh.h:50
ScorerMesh()
constructor
Definition: scorermesh.cc:23
void PublishMembers()
publish members
Definition: scorermesh.cc:66
double eHigh
E High limit.
Definition: scorermesh.h:55
int nr
Number of bins in R.
Definition: scorermesh.h:47
double eLow
E Low limit.
Definition: scorermesh.h:54
double ysize
Y total width.
Definition: scorermesh.h:51
std::string geometryType
Name of scorermesh geometry to use.
Definition: scorermesh.h:42
double rsize
R total length.
Definition: scorermesh.h:53
std::string sequence
Name of sequence to place.
Definition: scorermesh.h:60
std::string eBinsEdgesFilenamePath
E bins edges filename path.
Definition: scorermesh.h:57
double theta
Euler angle for rotation.
Definition: scorermesh.h:69
double x
Offset in x.
Definition: scorermesh.h:64
double zsize
Z total width.
Definition: scorermesh.h:52
bool axisAngle
Flag to use the axis angle construction of rotation.
Definition: scorermesh.h:78
double y
Offset in y.
Definition: scorermesh.h:65
Parser namespace for GMAD language. Combination of Geant4 and MAD.