Belle II Software  release-08-01-10
ARICHGeoMirrors.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 #include <framework/gearbox/Unit.h>
12 
13 #include <arich/dbobjects/ARICHGeoBase.h>
14 #include <string>
15 #include <TVector3.h>
16 #include <TRotation.h>
17 #include <geometry/dbobjects/GeoOpticalSurface.h>
18 
19 namespace Belle2 {
30  class ARICHGeoMirrors: public ARICHGeoBase {
31 
32  public:
33 
38  {}
39 
43  bool isConsistent() const override;
44 
49  void print(const std::string& title = "Mirror configuration parameters") const override;
50 
59  void setMirrorPlate(double thick, double width, double length, const std::string& material, const GeoOpticalSurface& surf)
60  {
61  m_plateThickness = thick;
62  m_plateWidth = width;
63  m_plateLength = length;
64  m_material = material;
65  m_surface = surf;
66  };
67 
72  void setNMirrors(unsigned nmir) {m_nMirrors = nmir;}
73 
78  void setRadius(double r) {m_radius = r;}
79 
84  void setStartAngle(double stang) {m_startAngle = stang;}
85 
90  void setZPosition(double zPos) {m_z = zPos;}
91 
96  double getZPosition() const {return m_z / s_unit;}
97 
102  double getRadius() const {return m_radius / s_unit;};
103 
108  double getStartAngle() const {return m_startAngle;};
109 
114  double getPlateThickness() const {return m_plateThickness / s_unit;};
115 
120  double getPlateWidth() const {return m_plateWidth / s_unit;};
121 
126  double getPlateLength() const {return m_plateLength / s_unit;};
127 
132  unsigned getNMirrors() const {return m_nMirrors;}
133 
141  void setMirrorNormVector(unsigned mirID, double x, double y, double z)
142  {
143  if (mirID < 1 || mirID > m_normVector.size()) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
144  m_normVector[mirID - 1] = TVector3(x, y, z).Unit();
145  }
146 
154  void setMirrorPoint(unsigned mirID, double x, double y, double z)
155  {
156  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
157  m_point[mirID - 1] = TVector3(x, y, z);
158  }
159 
164  const std::string& getMaterial() const {return m_material;}
165 
171 
177  const TVector3& getNormVector(const unsigned mirID) const
178  {
179  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
180  return m_normVector[mirID - 1];
181  }
182 
188  const TVector3& getPoint(const unsigned mirID) const
189  {
190  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
191  return m_point[mirID - 1];
192  }
193 
198  void initializeDefault();
199 
205  void setInstalled(unsigned mirID, bool installed)
206  {
207  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
208  m_installed[mirID - 1] = installed;
209  }
210 
216  bool isInstalled(unsigned mirID) const
217  {
218  if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
219  return m_installed[mirID - 1];
220  }
221 
222 
223  private:
224 
225  std::vector<TVector3> m_normVector;
226  std::vector<TVector3> m_point;
227  std::vector<bool> m_installed;
229  std::string m_material;
230  double m_z = 0;
231  double m_radius = 0;
232  double m_startAngle = 0;
233  double m_plateThickness = 0;
234  double m_plateWidth = 0;
235  double m_plateLength = 0;
236  unsigned m_nMirrors = 0;
242  };
243 
245 } // 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 HAPD.
bool isConsistent() const override
Consistency check of geometry parameters.
void initializeDefault()
Initializes default mirror position parameters (assuming plate position on the regular m_nMirrors-sid...
double m_radius
nominal radius at which mirror plates are placed
std::string m_material
material of mirror plates
std::vector< TVector3 > m_normVector
vector of normal vectors of all mirror plates
void print(const std::string &title="Mirror configuration parameters") const override
Print the content of the class.
double m_plateWidth
width of mirror plate
const TVector3 & getPoint(const unsigned mirID) const
Get vector to the center point of the mirror plate reflective surface.
const TVector3 & getNormVector(const unsigned mirID) const
Get normal vector of the i-th mirror plate surface.
double getZPosition() const
Get nominal Z position of mirror plates (center point in ARICH local frame)
const GeoOpticalSurface & getMirrorSurface() const
Returns mirror reflective optical surface.
void setMirrorNormVector(unsigned mirID, double x, double y, double z)
Set normal vector of the i-th mirror plate surface.
unsigned getNMirrors() const
Get number of mirror plates.
double getPlateWidth() const
Get width of mirror plate.
double m_plateLength
length of mirror plate
ClassDefOverride(ARICHGeoMirrors, 1)
ClassDef.
std::vector< bool > m_installed
vector of installed/not installed flags of all mirror plates
void setRadius(double r)
Set nominal radius at which mirror plates are placed (center of plate)
void setNMirrors(unsigned nmir)
Set number of mirror plates (slots)
ARICHGeoMirrors()
Default constructor.
GeoOpticalSurface m_surface
optical surface of mirror plates
std::vector< TVector3 > m_point
vector of points on the reflective surface of all mirror plates
void setInstalled(unsigned mirID, bool installed)
Set mirror plate installed/not installed (only installed plates are placed)
void setMirrorPoint(unsigned mirID, double x, double y, double z)
Set vector to the center point of the mirror plate reflective surface.
void setStartAngle(double stang)
Set phi angle of position of the first mirror plate.
double m_startAngle
phi angle of the center of the 1st mirror plate
const std::string & getMaterial() const
Get material name of mirror plates.
double getPlateLength() const
Get length of mirror plate.
double getRadius() const
Get nominal radius at which mirror plates are placed (center of plate)
double m_z
nominal Z position of mirror plates
double getStartAngle() const
Get phi angle of position of the first mirror plate.
bool isInstalled(unsigned mirID) const
Check if i-th mirror plate is installed.
double getPlateThickness() const
Get thickness of mirror plate.
void setMirrorPlate(double thick, double width, double length, const std::string &material, const GeoOpticalSurface &surf)
Set parameters of mirror plate.
double m_plateThickness
thickness of mirror plate
unsigned m_nMirrors
number of mirror plates (slots)
void setZPosition(double zPos)
Set nominal Z position of mirror plates (center point in ARICH local frame)
Represent an optical finish of a surface.
Abstract base class for different kinds of events.