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