Belle II Software development
ARICHGeoSupport.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
9#pragma once
10#include <framework/logging/Logger.h>
11
12#include <arich/dbobjects/ARICHGeoBase.h>
13#include <string>
14
15namespace Belle2 {
26 public:
27
32 {}
33
37 struct tube {
38 double innerR;
39 double outerR;
40 double length;
41 double zPosition;
42 std::string material;
43 std::string name;
44 };
45
49 struct wedge {
50 int type;
51 double r;
52 double phi;
53 double z;
54 std::string material;
55 };
56
60 struct box {
61 double size[3];
62 double position[3];
63 double rotation[3];
64 std::string name;
65 std::string material;
66 };
67
68
73 bool isConsistent() const override;
74
79 void print(const std::string& title = "Parameters of ARICH support structure and neutron shield") const override;
80
86 void setWedge(unsigned i, const std::vector<double>& par) {if (i > m_nWedgeType || i == 0) { B2ERROR("invalid wedge number"); return;}; m_wedgePar[i - 1] = par;};
87
96 void addWedge(int type, double r, double phi, double z, const std::string& material)
97 {
98 m_wedges.push_back({type, r, phi, z, material});
99 }
100
105 void setMaterial(const std::string& material) { m_material = material;};
106
116 void addTube(double inR, double outR, double length, double zPosition, const std::string& material, const std::string& name)
117 {
118 m_tubes.push_back({inR, outR, length, zPosition, material, name});
119 }
120
125 unsigned getNTubes() const {return m_tubes.size();};
126
132 double getTubeInnerR(unsigned i) const {return m_tubes.at(i).innerR / s_unit;}
133
139 double getTubeOuterR(unsigned i) const {return m_tubes.at(i).outerR / s_unit;}
140
146 double getTubeLength(unsigned i) const {return m_tubes.at(i).length / s_unit;}
147
153 double getTubeZPosition(unsigned i) const {return m_tubes.at(i).zPosition / s_unit;}
154
159 unsigned getNWedges() const {return m_wedges.size();};
160
166 int getWedgeType(unsigned i) const {return m_wedges.at(i).type;}
167
173 double getWedgeR(unsigned i) const {return m_wedges.at(i).r / s_unit;}
174
180 double getWedgePhi(unsigned i) const {return m_wedges.at(i).phi;}
181
187 double getWedgeZ(unsigned i) const {return m_wedges.at(i).z / s_unit;}
188
194 const std::string& getTubeMaterial(unsigned i) const {return m_tubes.at(i).material;}
195
201 const std::string& getWedgeMaterial(unsigned i) const {return m_wedges.at(i).material;}
202
208 const std::string& getTubeName(unsigned i) const {return m_tubes.at(i).name;}
209
214 const std::string& getMaterial() const {return m_material;}
215
221 const std::vector<double> getWedge(unsigned i) const {std::vector<double> pars; if (i > m_nWedgeType || i == 0) { B2ERROR("invalid wedge number"); return pars;}; for (auto par : m_wedgePar[i - 1]) pars.push_back(par / s_unit); return pars;}
222
231 void addBox(const std::string& name, const std::string& material, double size[3], double position[3], double rotation[3])
232 {
233 m_boxes.push_back({{size[0], size[1], size[2]}, {position[0], position[1], position[2]}, {rotation[0], rotation[1], rotation[2]}, name, material});
234 }
235
245 void setBox(int i, const std::string& name, const std::string& material, double size[3], double position[3], double rotation[3])
246 {
247 m_boxes[i] = {{size[0], size[1], size[2]}, {position[0], position[1], position[2]}, {rotation[0], rotation[1], rotation[2]}, name, material};
248 }
249
254 unsigned getNBoxes() const
255 {
256 return m_boxes.size();
257 }
258
264 box getBox(unsigned i) const
265 {
266 return m_boxes[i];
267 }
268
273 {
274 m_boxes.clear();
275 }
276
277
278
279 private:
280
281 std::vector<tube> m_tubes;
282 std::string m_material;
283 static const unsigned m_nWedgeType = 3;
284 std::vector<double> m_wedgePar[m_nWedgeType];
285 std::vector<wedge> m_wedges;
286 std::vector<box> m_boxes;
290 };
291
293} // end namespace Belle2
Base class for geometry parameters.
Definition: ARICHGeoBase.h:24
static double s_unit
conversion unit for length
Definition: ARICHGeoBase.h:83
Geometry parameters of ARICH support structures and neutron shield.
double getWedgeR(unsigned i) const
Get radius at which i-th wedge is placed.
bool isConsistent() const override
Consistency check of geometry parameters.
double getWedgePhi(unsigned i) const
Get phi angle at which i-th wedge is placed.
ClassDefOverride(ARICHGeoSupport, 1)
ClassDef.
void clearBoxes()
Clear container of boxes.
const std::vector< double > getWedge(unsigned i) const
Get parameters of wedge.
void addTube(double inR, double outR, double length, double zPosition, const std::string &material, const std::string &name)
Add volume of cylindrical shape (tube)
void setWedge(unsigned i, const std::vector< double > &par)
Set parameters of support wedge volumes.
std::string m_material
default material of support structure
void setMaterial(const std::string &material)
Set default material of support structures.
std::vector< double > m_wedgePar[m_nWedgeType]
parameters of support wedges (joints)
double getTubeInnerR(unsigned i) const
Get tube inner radius.
double getTubeLength(unsigned i) const
Get tube length.
void addBox(const std::string &name, const std::string &material, double size[3], double position[3], double rotation[3])
Add box volume.
std::vector< tube > m_tubes
vector of tube volumes to be placed
ARICHGeoSupport()
Default constructor.
double getTubeOuterR(unsigned i) const
Get tube outer radius.
std::vector< box > m_boxes
vector of box volumes to be places
double getWedgeZ(unsigned i) const
Get Z position of i-th wedge.
unsigned getNTubes() const
Get number of tube volumes to be placed.
std::vector< wedge > m_wedges
vector of wedge volumes to be placed
const std::string & getTubeMaterial(unsigned i) const
Get material of i-th tube.
int getWedgeType(unsigned i) const
Get type of i-th wedge.
const std::string & getMaterial() const
Get default material of support structures.
unsigned getNWedges() const
Get number of wedges to be placed.
double getTubeZPosition(unsigned i) const
Get tube Z position.
const std::string & getWedgeMaterial(unsigned i) const
Get material of i-th wedge.
static const unsigned m_nWedgeType
number of wedge types
box getBox(unsigned i) const
Get box paramaters.
void addWedge(int type, double r, double phi, double z, const std::string &material)
Add wedge (all added wedges are placed)
const std::string & getTubeName(unsigned i) const
Get name of i-th tube.
void print(const std::string &title="Parameters of ARICH support structure and neutron shield") const override
Print the content of the class.
void setBox(int i, const std::string &name, const std::string &material, double size[3], double position[3], double rotation[3])
Re-set parameters of existing box.
unsigned getNBoxes() const
Get number of box volumes.
Abstract base class for different kinds of events.
Struct to hold parameters of box volumes (examples, scintilators for cosmic test)
std::string material
material
double rotation[3]
rotation coordinates
double position[3]
position coordinates
double size[3]
size coordinates
Struct to hold tube parameters.
std::string material
material
Struct to hold wedge parameters.
std::string material
material