Belle II Software  release-05-01-25
ARICHGeoMirrors.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 #include <framework/gearbox/Unit.h>
14 
15 #include <arich/dbobjects/ARICHGeoBase.h>
16 #include <string>
17 #include <TVector3.h>
18 #include <TRotation.h>
19 #include <geometry/dbobjects/GeoOpticalSurface.h>
20 
21 namespace Belle2 {
32  class ARICHGeoMirrors: public ARICHGeoBase {
33 
34  public:
35 
40  {}
41 
45  bool isConsistent() const override;
46 
51  void print(const std::string& title = "Mirror configuration parameters") const override;
52 
61  void setMirrorPlate(double thick, double width, double length, const std::string& material, const GeoOpticalSurface& surf)
62  {
63  m_plateThickness = thick;
64  m_plateWidth = width;
65  m_plateLength = length;
66  m_material = material;
67  m_surface = surf;
68  };
69 
74  void setNMirrors(unsigned nmir) {m_nMirrors = nmir;}
75 
80  void setRadius(double r) {m_radius = r;}
81 
86  void setStartAngle(double stang) {m_startAngle = stang;}
87 
92  void setZPosition(double zPos) {m_z = zPos;}
93 
98  double getZPosition() const {return m_z / s_unit;}
99 
104  double getRadius() const {return m_radius / s_unit;};
105 
110  double getStartAngle() const {return m_startAngle;};
111 
116  double getPlateThickness() const {return m_plateThickness / s_unit;};
117 
122  double getPlateWidth() const {return m_plateWidth / s_unit;};
123 
128  double getPlateLength() const {return m_plateLength / s_unit;};
129 
134  unsigned getNMirrors() const {return m_nMirrors;}
135 
143  void setMirrorNormVector(unsigned mirID, double x, double y, double z)
144  {
145  if (mirID < 1 || mirID > m_normVector.size()) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
146  m_normVector[mirID - 1] = TVector3(x, y, z).Unit();
147  }
148 
156  void setMirrorPoint(unsigned mirID, double x, double y, double z)
157  {
158  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
159  m_point[mirID - 1] = TVector3(x, y, z);
160  }
161 
166  const std::string& getMaterial() const {return m_material;}
167 
172  const GeoOpticalSurface& getMirrorSurface() const {return m_surface;}
173 
179  const TVector3& getNormVector(const unsigned mirID) const
180  {
181  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
182  return m_normVector[mirID - 1];
183  }
184 
190  const TVector3& getPoint(const unsigned mirID) const
191  {
192  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
193  return m_point[mirID - 1];
194  }
195 
200  void initializeDefault();
201 
207  void setInstalled(unsigned mirID, bool installed)
208  {
209  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
210  m_installed[mirID - 1] = installed;
211  }
212 
218  bool isInstalled(unsigned mirID) const
219  {
220  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
221  return m_installed[mirID - 1];
222  }
223 
224 
225  private:
226 
227  std::vector<TVector3> m_normVector;
228  std::vector<TVector3> m_point;
229  std::vector<bool> m_installed;
231  std::string m_material;
232  double m_z = 0;
233  double m_radius = 0;
234  double m_startAngle = 0;
235  double m_plateThickness = 0;
236  double m_plateWidth = 0;
237  double m_plateLength = 0;
238  unsigned m_nMirrors = 0;
244  };
245 
247 } // end namespace Belle2
Belle2::ARICHGeoMirrors::getRadius
double getRadius() const
Get nominal radius at which mirror plates are placed (center of plate)
Definition: ARICHGeoMirrors.h:112
Belle2::ARICHGeoMirrors::getMaterial
const std::string & getMaterial() const
Get material name of mirror plates.
Definition: ARICHGeoMirrors.h:174
Belle2::ARICHGeoMirrors::getZPosition
double getZPosition() const
Get nominal Z position of mirror plates (center point in ARICH local frame)
Definition: ARICHGeoMirrors.h:106
Belle2::ARICHGeoMirrors::getPlateWidth
double getPlateWidth() const
Get width of mirror plate.
Definition: ARICHGeoMirrors.h:130
Belle2::ARICHGeoMirrors::isInstalled
bool isInstalled(unsigned mirID) const
Check if i-th mirror plate is installed.
Definition: ARICHGeoMirrors.h:226
Belle2::ARICHGeoMirrors::m_surface
GeoOpticalSurface m_surface
optical surface of mirror plates
Definition: ARICHGeoMirrors.h:248
Belle2::ARICHGeoMirrors::m_startAngle
double m_startAngle
phi angle of the center of the 1st mirror plate
Definition: ARICHGeoMirrors.h:242
Belle2::ARICHGeoMirrors::m_installed
std::vector< bool > m_installed
vector of installed/not installed flags of all mirror plates
Definition: ARICHGeoMirrors.h:237
Belle2::ARICHGeoMirrors::m_z
double m_z
nominal Z position of mirror plates
Definition: ARICHGeoMirrors.h:240
Belle2::ARICHGeoMirrors::getMirrorSurface
const GeoOpticalSurface & getMirrorSurface() const
Returns mirror reflective optical surface.
Definition: ARICHGeoMirrors.h:180
Belle2::ARICHGeoMirrors::isConsistent
bool isConsistent() const override
Consistency check of geometry parameters.
Definition: ARICHGeoMirrors.cc:32
Belle2::ARICHGeoMirrors::m_radius
double m_radius
nominal radius at which mirror plates are placed
Definition: ARICHGeoMirrors.h:241
Belle2::ARICHGeoMirrors::ClassDefOverride
ClassDefOverride(ARICHGeoMirrors, 1)
ClassDef.
Belle2::ARICHGeoMirrors::getNMirrors
unsigned getNMirrors() const
Get number of mirror plates.
Definition: ARICHGeoMirrors.h:142
Belle2::ARICHGeoMirrors
Geometry parameters of HAPD.
Definition: ARICHGeoMirrors.h:40
Belle2::ARICHGeoMirrors::setRadius
void setRadius(double r)
Set nominal radius at which mirror plates are placed (center of plate)
Definition: ARICHGeoMirrors.h:88
Belle2::GeoOpticalSurface
Represent an optical finish of a surface.
Definition: GeoOpticalSurface.h:31
Belle2::ARICHGeoMirrors::print
void print(const std::string &title="Mirror configuration parameters") const override
Print the content of the class.
Definition: ARICHGeoMirrors.cc:50
Belle2::ARICHGeoMirrors::getNormVector
const TVector3 & getNormVector(const unsigned mirID) const
Get normal vector of the i-th mirror plate surface.
Definition: ARICHGeoMirrors.h:187
Belle2::ARICHGeoBase::s_unit
static double s_unit
conversion unit for length
Definition: ARICHGeoBase.h:93
Belle2::ARICHGeoMirrors::m_plateLength
double m_plateLength
length of mirror plate
Definition: ARICHGeoMirrors.h:245
Belle2::ARICHGeoMirrors::m_plateWidth
double m_plateWidth
width of mirror plate
Definition: ARICHGeoMirrors.h:244
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ARICHGeoMirrors::setZPosition
void setZPosition(double zPos)
Set nominal Z position of mirror plates (center point in ARICH local frame)
Definition: ARICHGeoMirrors.h:100
Belle2::ARICHGeoMirrors::getPoint
const TVector3 & getPoint(const unsigned mirID) const
Get vector to the center point of the mirror plate reflective surface.
Definition: ARICHGeoMirrors.h:198
Belle2::ARICHGeoMirrors::getPlateLength
double getPlateLength() const
Get length of mirror plate.
Definition: ARICHGeoMirrors.h:136
Belle2::ARICHGeoMirrors::setMirrorPoint
void setMirrorPoint(unsigned mirID, double x, double y, double z)
Set vector to the center point of the mirror plate reflective surface.
Definition: ARICHGeoMirrors.h:164
Belle2::ARICHGeoMirrors::initializeDefault
void initializeDefault()
Initializes default mirror position parameters (assuming plate position on the regular m_nMirrors-sid...
Definition: ARICHGeoMirrors.cc:20
Belle2::ARICHGeoMirrors::setMirrorPlate
void setMirrorPlate(double thick, double width, double length, const std::string &material, const GeoOpticalSurface &surf)
Set parameters of mirror plate.
Definition: ARICHGeoMirrors.h:69
Belle2::ARICHGeoMirrors::m_nMirrors
unsigned m_nMirrors
number of mirror plates (slots)
Definition: ARICHGeoMirrors.h:246
Belle2::ARICHGeoMirrors::setMirrorNormVector
void setMirrorNormVector(unsigned mirID, double x, double y, double z)
Set normal vector of the i-th mirror plate surface.
Definition: ARICHGeoMirrors.h:151
Belle2::ARICHGeoMirrors::setInstalled
void setInstalled(unsigned mirID, bool installed)
Set mirror plate installed/not installed (only installed plates are placed)
Definition: ARICHGeoMirrors.h:215
Belle2::ARICHGeoMirrors::setStartAngle
void setStartAngle(double stang)
Set phi angle of position of the first mirror plate.
Definition: ARICHGeoMirrors.h:94
Belle2::ARICHGeoMirrors::m_point
std::vector< TVector3 > m_point
vector of points on the reflective surface of all mirror plates
Definition: ARICHGeoMirrors.h:236
Belle2::ARICHGeoMirrors::getStartAngle
double getStartAngle() const
Get phi angle of position of the first mirror plate.
Definition: ARICHGeoMirrors.h:118
Belle2::ARICHGeoMirrors::m_plateThickness
double m_plateThickness
thickness of mirror plate
Definition: ARICHGeoMirrors.h:243
Belle2::ARICHGeoMirrors::setNMirrors
void setNMirrors(unsigned nmir)
Set number of mirror plates (slots)
Definition: ARICHGeoMirrors.h:82
Belle2::ARICHGeoMirrors::m_material
std::string m_material
material of mirror plates
Definition: ARICHGeoMirrors.h:239
Belle2::ARICHGeoMirrors::m_normVector
std::vector< TVector3 > m_normVector
vector of normal vectors of all mirror plates
Definition: ARICHGeoMirrors.h:235
Belle2::ARICHGeoMirrors::ARICHGeoMirrors
ARICHGeoMirrors()
Default constructor.
Definition: ARICHGeoMirrors.h:47
Belle2::ARICHGeoMirrors::getPlateThickness
double getPlateThickness() const
Get thickness of mirror plate.
Definition: ARICHGeoMirrors.h:124