Belle II Software development
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
12#include <arich/dbobjects/ARICHGeoBase.h>
13#include <string>
14#include <Math/Vector3D.h>
15#include <Math/Rotation3D.h>
16#include <geometry/dbobjects/GeoOpticalSurface.h>
17
18namespace Belle2 {
30
31 public:
32
37 {}
38
42 bool isConsistent() const override;
43
48 void print(const std::string& title = "Mirror configuration parameters") const override;
49
58 void setMirrorPlate(double thick, double width, double length, const std::string& material, const GeoOpticalSurface& surf)
59 {
60 m_plateThickness = thick;
61 m_plateWidth = width;
62 m_plateLength = length;
63 m_material = material;
64 m_surface = surf;
65 };
66
71 void setNMirrors(unsigned nmir) {m_nMirrors = nmir;}
72
77 void setRadius(double r) {m_radius = r;}
78
83 void setStartAngle(double stang) {m_startAngle = stang;}
84
89 void setZPosition(double zPos) {m_z = zPos;}
90
95 double getZPosition() const {return m_z / s_unit;}
96
101 double getRadius() const {return m_radius / s_unit;};
102
107 double getStartAngle() const {return m_startAngle;};
108
113 double getPlateThickness() const {return m_plateThickness / s_unit;};
114
119 double getPlateWidth() const {return m_plateWidth / s_unit;};
120
125 double getPlateLength() const {return m_plateLength / s_unit;};
126
131 unsigned getNMirrors() const {return m_nMirrors;}
132
140 void setMirrorNormVector(unsigned mirID, double x, double y, double z)
141 {
142 if (mirID < 1 || mirID > m_normVector.size()) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
143 m_normVector[mirID - 1] = ROOT::Math::XYZVector(x, y, z).Unit();
144 }
145
153 void setMirrorPoint(unsigned mirID, double x, double y, double z)
154 {
155 if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
156 m_point[mirID - 1] = ROOT::Math::XYZVector(x, y, z);
157 }
158
163 const std::string& getMaterial() const {return m_material;}
164
170
176 const ROOT::Math::XYZVector& getNormVector(const unsigned mirID) const
177 {
178 if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
179 return m_normVector[mirID - 1];
180 }
181
187 const ROOT::Math::XYZVector& getPoint(const unsigned mirID) const
188 {
189 if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
190 return m_point[mirID - 1];
191 }
192
197 void initializeDefault();
198
204 void setInstalled(unsigned mirID, bool installed)
205 {
206 if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
207 m_installed[mirID - 1] = installed;
208 }
209
215 bool isInstalled(unsigned mirID) const
216 {
217 if (mirID < 1 || mirID > m_nMirrors) B2ERROR("ARICHGeoMirrors: invalid mirror plate ID number");
218 return m_installed[mirID - 1];
219 }
220
221
222 private:
223
224 std::vector<ROOT::Math::XYZVector> m_normVector;
225 std::vector<ROOT::Math::XYZVector> m_point;
226 std::vector<bool> m_installed;
228 std::string m_material;
229 double m_z = 0;
230 double m_radius = 0;
231 double m_startAngle = 0;
232 double m_plateThickness = 0;
233 double m_plateWidth = 0;
234 double m_plateLength = 0;
235 unsigned m_nMirrors = 0;
241 };
242
244} // 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
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 GeoOpticalSurface & getMirrorSurface() const
Returns mirror reflective optical surface.
double getZPosition() const
Get nominal Z position of mirror plates (center point in ARICH local frame)
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.
const ROOT::Math::XYZVector & getPoint(const unsigned mirID) const
Get vector to the center point of the mirror plate reflective surface.
ClassDefOverride(ARICHGeoMirrors, 2)
ClassDef.
double m_plateLength
length of mirror plate
const ROOT::Math::XYZVector & getNormVector(const unsigned mirID) const
Get normal vector of the i-th mirror plate surface.
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
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.
std::vector< ROOT::Math::XYZVector > m_point
vector of points on the reflective surface of all mirror plates
void setStartAngle(double stang)
Set phi angle of position of the first mirror plate.
const std::string & getMaterial() const
Get material name of mirror plates.
double m_startAngle
phi angle of the center of the 1st mirror plate
double getPlateLength() const
Get length of mirror plate.
std::vector< ROOT::Math::XYZVector > m_normVector
vector of normal vectors of all mirror plates
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.