Belle II Software  release-05-01-25
ARICHGeoSupport.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Luka Santelj *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 #include <framework/logging/Logger.h>
13 
14 #include <arich/dbobjects/ARICHGeoBase.h>
15 #include <string>
16 
17 namespace Belle2 {
27  class ARICHGeoSupport: public ARICHGeoBase {
28  public:
29 
34  {}
35 
39  struct tube {
40  double innerR;
41  double outerR;
42  double length;
43  double zPosition;
44  std::string material;
45  std::string name;
46  };
47 
51  struct wedge {
52  int type;
53  double r;
54  double phi;
55  double z;
56  std::string material;
57  };
58 
62  struct box {
63  double size[3];
64  double position[3];
65  double rotation[3];
66  std::string name;
67  std::string material;
68  };
69 
70 
75  bool isConsistent() const override;
76 
81  void print(const std::string& title = "Parameters of ARICH support structure and neutron shield") const override;
82 
88  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;};
89 
98  void addWedge(int type, double r, double phi, double z, const std::string& material)
99  {
100  m_wedges.push_back({type, r, phi, z, material});
101  }
102 
107  void setMaterial(const std::string& material) { m_material = material;};
108 
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 
272  void clearBoxes()
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
Belle2::ARICHGeoSupport::m_material
std::string m_material
default material of support structure
Definition: ARICHGeoSupport.h:290
Belle2::ARICHGeoSupport::ClassDefOverride
ClassDefOverride(ARICHGeoSupport, 1)
ClassDef.
Belle2::ARICHGeoSupport::wedge
Struct to hold wedge parameters.
Definition: ARICHGeoSupport.h:59
Belle2::ARICHGeoSupport::getWedgeZ
double getWedgeZ(unsigned i) const
Get Z position of i-th wedge.
Definition: ARICHGeoSupport.h:195
Belle2::ARICHGeoSupport::getTubeOuterR
double getTubeOuterR(unsigned i) const
Get tube outer radius.
Definition: ARICHGeoSupport.h:147
Belle2::ARICHGeoSupport::m_nWedgeType
static const unsigned m_nWedgeType
number of wedge types
Definition: ARICHGeoSupport.h:291
Belle2::ARICHGeoSupport::clearBoxes
void clearBoxes()
Clear container of boxes.
Definition: ARICHGeoSupport.h:280
Belle2::ARICHGeoSupport::getNBoxes
unsigned getNBoxes() const
Get number of box volumes.
Definition: ARICHGeoSupport.h:262
Belle2::ARICHGeoSupport::m_boxes
std::vector< box > m_boxes
vector of box volumes to be places
Definition: ARICHGeoSupport.h:294
Belle2::ARICHGeoSupport::m_tubes
std::vector< tube > m_tubes
vector of tube volumes to be placed
Definition: ARICHGeoSupport.h:289
Belle2::ARICHGeoSupport::getTubeMaterial
const std::string & getTubeMaterial(unsigned i) const
Get material of i-th tube.
Definition: ARICHGeoSupport.h:202
Belle2::ARICHGeoSupport::getWedgeMaterial
const std::string & getWedgeMaterial(unsigned i) const
Get material of i-th wedge.
Definition: ARICHGeoSupport.h:209
Belle2::ARICHGeoSupport::getTubeName
const std::string & getTubeName(unsigned i) const
Get name of i-th tube.
Definition: ARICHGeoSupport.h:216
Belle2::ARICHGeoSupport::m_wedgePar
std::vector< double > m_wedgePar[m_nWedgeType]
parameters of support wedges (joints)
Definition: ARICHGeoSupport.h:292
Belle2::ARICHGeoSupport::addWedge
void addWedge(int type, double r, double phi, double z, const std::string &material)
Add wedge (all added wedges are placed)
Definition: ARICHGeoSupport.h:106
Belle2::ARICHGeoSupport::getWedgePhi
double getWedgePhi(unsigned i) const
Get phi angle at which i-th wedge is placed.
Definition: ARICHGeoSupport.h:188
Belle2::ARICHGeoBase::s_unit
static double s_unit
conversion unit for length
Definition: ARICHGeoBase.h:93
Belle2::ARICHGeoSupport::addBox
void addBox(const std::string &name, const std::string &material, double size[3], double position[3], double rotation[3])
Add box volume.
Definition: ARICHGeoSupport.h:239
Belle2::ARICHGeoSupport::tube
Struct to hold tube parameters.
Definition: ARICHGeoSupport.h:47
Belle2::ARICHGeoSupport::setBox
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.
Definition: ARICHGeoSupport.h:253
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ARICHGeoSupport::getTubeZPosition
double getTubeZPosition(unsigned i) const
Get tube Z position.
Definition: ARICHGeoSupport.h:161
Belle2::ARICHGeoSupport::print
void print(const std::string &title="Parameters of ARICH support structure and neutron shield") const override
Print the content of the class.
Definition: ARICHGeoSupport.cc:25
Belle2::ARICHGeoSupport::getWedgeType
int getWedgeType(unsigned i) const
Get type of i-th wedge.
Definition: ARICHGeoSupport.h:174
Belle2::ARICHGeoSupport::getWedge
const std::vector< double > getWedge(unsigned i) const
Get parameters of wedge.
Definition: ARICHGeoSupport.h:229
Belle2::ARICHGeoSupport::getTubeLength
double getTubeLength(unsigned i) const
Get tube length.
Definition: ARICHGeoSupport.h:154
Belle2::ARICHGeoSupport::setWedge
void setWedge(unsigned i, const std::vector< double > &par)
Set parameters of support wedge volumes.
Definition: ARICHGeoSupport.h:96
Belle2::ARICHGeoSupport::getWedgeR
double getWedgeR(unsigned i) const
Get radius at which i-th wedge is placed.
Definition: ARICHGeoSupport.h:181
Belle2::ARICHGeoSupport::getBox
box getBox(unsigned i) const
Get box paramaters.
Definition: ARICHGeoSupport.h:272
Belle2::ARICHGeoSupport::getTubeInnerR
double getTubeInnerR(unsigned i) const
Get tube inner radius.
Definition: ARICHGeoSupport.h:140
Belle2::ARICHGeoSupport::isConsistent
bool isConsistent() const override
Consistency check of geometry parameters.
Definition: ARICHGeoSupport.cc:19
Belle2::ARICHGeoSupport::addTube
void addTube(double inR, double outR, double length, double zPosition, const std::string &material, const std::string &name)
Add volume of cylindrical shape (tube)
Definition: ARICHGeoSupport.h:124
Belle2::ARICHGeoSupport::getNTubes
unsigned getNTubes() const
Get number of tube volumes to be placed.
Definition: ARICHGeoSupport.h:133
Belle2::ARICHGeoSupport::box
Struct to hold parameters of box volumes (examples, scintilators for cosmic test)
Definition: ARICHGeoSupport.h:70
Belle2::ARICHGeoSupport::getNWedges
unsigned getNWedges() const
Get number of wedges to be placed.
Definition: ARICHGeoSupport.h:167
Belle2::ARICHGeoSupport::setMaterial
void setMaterial(const std::string &material)
Set default material of support structures.
Definition: ARICHGeoSupport.h:115
Belle2::ARICHGeoSupport::m_wedges
std::vector< wedge > m_wedges
vector of wedge volumes to be placed
Definition: ARICHGeoSupport.h:293
Belle2::ARICHGeoSupport::ARICHGeoSupport
ARICHGeoSupport()
Default constructor.
Definition: ARICHGeoSupport.h:41
Belle2::ARICHGeoSupport
Geometry parameters of ARICH support structures and neutron shield.
Definition: ARICHGeoSupport.h:35
Belle2::ARICHGeoSupport::getMaterial
const std::string & getMaterial() const
Get default material of support structures.
Definition: ARICHGeoSupport.h:222