Belle II Software development
STRGeometryPar.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <vector>
11
12#include <TObject.h>
13#include <string>
14
15namespace Belle2 {
25 class STRGeometryPar: public TObject {
26
27 public:
28
31
34
35 //
36 // Setters and Getters
37 //
39
41 int getVersion() const { return m_Version; }
42
44 void setVersion(int version) { m_Version = version; }
45
46 //
47 // Shield parameters
48 //
49
50
52 int getNLayers(int shield) const { return m_NLayers[shield] ; }
53
55 void setNLayers(int shield, int nLayers)
56 {
57 m_NLayers[shield] = nLayers ;
58
59 // Resize std::vectors according to the number of layers
60 m_LayerMaterial[shield].resize(nLayers);
61 m_LayerNPlanes[shield].resize(nLayers);
62 m_LayerPlaneZ[shield].resize(nLayers);
63 m_LayerPlaneInnerRadius[shield].resize(nLayers);
64 m_LayerPlaneOuterRadius[shield].resize(nLayers);
65
66 }
67
69 std::string getLayerMaterial(int shield, int layer) const { return m_LayerMaterial[shield].at(layer);}
70
72 void setLayerMaterial(int shield, int layer, const std::string& material) { m_LayerMaterial[shield].at(layer) = material; }
73
75 int getLayerNPlanes(int shield, int layer) const
76 {
77 return m_LayerNPlanes[shield].at(layer);
78 }
79
81 void setLayerNPlanes(int shield, int layer, int nplanes)
82 {
83 m_LayerNPlanes[shield].at(layer) = nplanes;
84
85 // Resize std::vectors according to the number of planes in each layer
86 m_LayerPlaneZ[shield].at(layer).resize(nplanes);
87 m_LayerPlaneInnerRadius[shield].at(layer).resize(nplanes);
88 m_LayerPlaneOuterRadius[shield].at(layer).resize(nplanes);
89 }
90
92 double getLayerPlaneZ(int shield, int layer, int plane) const
93 {
94 return m_LayerPlaneZ[shield].at(layer).at(plane);
95 }
96
98 const double* getLayerPlaneZ(int shield, int layer) const
99 {
100 return &m_LayerPlaneZ[shield].at(layer).at(0);
101 }
102
103
105 void setLayerPlaneZ(int shield, int layer, int plane, double z)
106 {
107 m_LayerPlaneZ[shield].at(layer).at(plane) = z;
108 }
109
110
112 double getLayerPlaneInnerRadius(int shield, int layer, int plane) const
113 {
114 return m_LayerPlaneInnerRadius[shield].at(layer).at(plane);
115 }
116
118 const double* getLayerPlaneInnerRadius(int shield, int layer) const
119 {
120 return &m_LayerPlaneInnerRadius[shield].at(layer).at(0);
121 }
122
124 void setLayerPlaneInnerRadius(int shield, int layer, int plane, double r)
125 {
126 m_LayerPlaneInnerRadius[shield].at(layer).at(plane) = r;
127 }
128
130 double getLayerPlaneOuterRadius(int shield, int layer, int plane) const
131 {
132 return m_LayerPlaneOuterRadius[shield].at(layer).at(plane);
133 }
134
136 const double* getLayerPlaneOuterRadius(int shield, int layer) const
137 {
138 return &m_LayerPlaneOuterRadius[shield].at(layer).at(0);
139 }
140
142 void setLayerPlaneOuterRadius(int shield, int layer, int plane, double r)
143 {
144 m_LayerPlaneOuterRadius[shield].at(layer).at(plane) = r;
145 }
146
147 //
148 // POLE Pieces
149 //
151 std::string getPoleMaterial(int pole) const
152 {
153 return m_PoleMaterial[pole];
154 }
155
157 void setPoleMaterial(int pole, const std::string& material)
158 {
159 m_PoleMaterial[pole] = material;
160 }
161
163 int getPoleNPlanes(int pole) const
164 {
165 return m_PoleNPlanes[pole];
166 }
167
169 void setPoleNPlanes(int pole, int nplanes)
170 {
171 m_PoleNPlanes[pole] = nplanes;
172
173 // Resize std::vectors according to the number of planes in each layer
174 m_PolePlaneZ[pole].resize(nplanes);
175 m_PolePlaneInnerRadius[pole].resize(nplanes);
176 m_PolePlaneOuterRadius[pole].resize(nplanes);
177 }
178
180 double getPolePlaneZ(int pole, int plane) const
181 {
182 return m_PolePlaneZ[pole].at(plane);
183 }
184
186 const double* getPolePlaneZ(int pole) const
187 {
188 return &m_PolePlaneZ[pole].at(0);
189 }
190
191
193 void setPolePlaneZ(int pole, int plane, double z)
194 {
195 m_PolePlaneZ[pole].at(plane) = z;
196 }
197
198
200 double getPolePlaneInnerRadius(int pole, int plane) const
201 {
202 return m_PolePlaneInnerRadius[pole].at(plane);
203 }
204
206 const double* getPolePlaneInnerRadius(int pole) const
207 {
208 return &m_PolePlaneInnerRadius[pole].at(0);
209 }
210
212 void setPolePlaneInnerRadius(int pole, int plane, double r)
213 {
214 m_PolePlaneInnerRadius[pole].at(plane) = r;
215 }
216
218 double getPolePlaneOuterRadius(int pole, int plane) const
219 {
220 return m_PolePlaneOuterRadius[pole].at(plane);
221 }
222
224 const double* getPolePlaneOuterRadius(int pole) const
225 {
226 return &m_PolePlaneOuterRadius[pole].at(0);
227 }
228
230 void setPolePlaneOuterRadius(int pole, int plane, double r)
231 {
232 m_PolePlaneOuterRadius[pole].at(plane) = r;
233 }
234
235
236
237 //
238 // Constants that will _always_ be true
239 // These ate not design parameters but fundamental
240 // characteristics of the system. e.g. we will always
241 // have only one forward and one backward shield.
242 //
244 static const int NECLSHIELDS = 2;
246 static const int FWD_ECLSHIELD = 0;
248 static const int BWD_ECLSHIELD = 1;
249
251 static const int NPOLEPIECES = 2;
253 static const int FWD_POLEPIECE = 0;
255 static const int BWD_POLEPIECE = 1;
256
257
258
259 private:
260
261
264
265
266 //
267 // Data members:
268 // these are the geometry parameters
269 //
271
274
275 //
276 // ECL Shields
277 //
278
281
283 std::vector<std::string> m_LayerMaterial[NECLSHIELDS];
284
286 std::vector<int> m_LayerNPlanes[NECLSHIELDS];
287
289 std::vector< std::vector<double> > m_LayerPlaneZ[NECLSHIELDS];
290
292 std::vector< std::vector<double> > m_LayerPlaneInnerRadius[NECLSHIELDS];
293
295 std::vector< std::vector<double> > m_LayerPlaneOuterRadius[NECLSHIELDS];
296
297
298 //
299 // POLE Pieces
300 //
301
304
307
309 std::vector<double> m_PolePlaneZ[NPOLEPIECES];
310
313
316
317
318
319 //
320 // For ROOT objects
321 //
322
325 };
327} // end of namespace Belle2
328
329
The Class for STR geometry.
std::string getLayerMaterial(int shield, int layer) const
Get the material of a layer (as a std::string)
void setPolePlaneZ(int pole, int plane, double z)
Set Z-position of each plane (w.r.t. IP)
static const int NPOLEPIECES
Number of pole pieces in Belle2.
double getLayerPlaneZ(int shield, int layer, int plane) const
Get Z-position of one plane (w.r.t. IP)
int m_PoleNPlanes[NPOLEPIECES]
Number of polycone planes in each pole piece.
void setPoleNPlanes(int pole, int nplanes)
Set Number of polycone planes in each layer.
const double * getLayerPlaneOuterRadius(int shield, int layer) const
Get Outer radii of all planes.
STRGeometryPar()
Default constructor.
void setPolePlaneInnerRadius(int pole, int plane, double r)
Set Inner radii of the planes.
int m_NLayers[NECLSHIELDS]
Number of layers in the shield.
void setLayerPlaneOuterRadius(int shield, int layer, int plane, double r)
Set Outer radii of the planes.
void setPolePlaneOuterRadius(int pole, int plane, double r)
Set Outer radii of the planes.
std::vector< int > m_LayerNPlanes[NECLSHIELDS]
Number of polycone planes in each layer.
const double * getPolePlaneInnerRadius(int pole) const
Get Inner radius of all planes.
static const int NECLSHIELDS
Number of ECL shields in Belle2.
std::string m_PoleMaterial[NPOLEPIECES]
Material of each of the pole pieces.
const double * getPolePlaneZ(int pole) const
Get Z-positions of all planes (w.r.t. IP)
void setLayerPlaneInnerRadius(int shield, int layer, int plane, double r)
Set Inner radii of the planes.
int m_Version
Geometry version.
static const int BWD_ECLSHIELD
Index corresponding to the backward shield.
double getPolePlaneZ(int pole, int plane) const
Get Z-position of one plane (w.r.t. IP)
void setLayerMaterial(int shield, int layer, const std::string &material)
Set the material of a layer (as a std::string)
void setPoleMaterial(int pole, const std::string &material)
Set the material of a layer (as a std::string)
std::vector< std::vector< double > > m_LayerPlaneInnerRadius[NECLSHIELDS]
Inner radii of the planes.
int getPoleNPlanes(int pole) const
Get Number of polycone planes in each layer.
static const int BWD_POLEPIECE
Index corresponding to the backward pole piece.
std::vector< double > m_PolePlaneOuterRadius[NPOLEPIECES]
Outer radii of the planes.
const double * getLayerPlaneInnerRadius(int shield, int layer) const
Get Inner radius of all planes.
void setVersion(int version)
Set STR geometry version.
int getLayerNPlanes(int shield, int layer) const
Get Number of polycone planes in each layer.
void setLayerPlaneZ(int shield, int layer, int plane, double z)
Set Z-position of each plane (w.r.t. IP)
static const int FWD_POLEPIECE
Index corresponding to the forward pole piece.
int getNLayers(int shield) const
Get the number of layers in the shield.
void setLayerNPlanes(int shield, int layer, int nplanes)
Set Number of polycone planes in each layer.
std::vector< std::vector< double > > m_LayerPlaneZ[NECLSHIELDS]
Z-position of each plane (w.r.t. IP)
ClassDef(STRGeometryPar, 1)
ClassDef, must be the last term before the closing {}.
std::vector< double > m_PolePlaneInnerRadius[NPOLEPIECES]
Inner radii of the planes.
static const int FWD_ECLSHIELD
Index corresponding to the forward shield.
std::string getPoleMaterial(int pole) const
Get the material of a layer (as a std::string)
std::vector< std::string > m_LayerMaterial[NECLSHIELDS]
Material of each of the layers.
void setNLayers(int shield, int nLayers)
Set the number of layers in the shield, resize std::vectors.
std::vector< double > m_PolePlaneZ[NPOLEPIECES]
Z-position of each plane (w.r.t. IP)
std::vector< std::vector< double > > m_LayerPlaneOuterRadius[NECLSHIELDS]
Outer radii of the planes.
int getVersion() const
Get STR geometry version.
static STRGeometryPar * m_Instance
static pointer to the singleton instance of this class
double getLayerPlaneInnerRadius(int shield, int layer, int plane) const
Get Inner radius of one plane.
const double * getLayerPlaneZ(int shield, int layer) const
Get Z-positions of all planes (w.r.t. IP)
const double * getPolePlaneOuterRadius(int pole) const
Get Outer radii of all planes.
double getPolePlaneInnerRadius(int pole, int plane) const
Get Inner radius of one plane.
double getLayerPlaneOuterRadius(int shield, int layer, int plane) const
Get Outer radii of one planes.
~STRGeometryPar()
Destructor.
double getPolePlaneOuterRadius(int pole, int plane) const
Get Outer radii of one planes.
Abstract base class for different kinds of events.