Belle II Software development
ARICHGeoMirrors.cc
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#include <arich/dbobjects/ARICHGeoMirrors.h>
10#include <math.h>
11#include <iostream>
12#include <iomanip>
13
14using namespace std;
15using namespace Belle2;
16
17
19{
20 double rmir = m_radius - m_plateThickness / 2.;
21 for (unsigned i = 0; i < m_nMirrors; i++) {
22 ROOT::Math::XYZVector norm(cos(i * 2.*M_PI / m_nMirrors + m_startAngle),
23 sin(i * 2.*M_PI / m_nMirrors + m_startAngle), 0);
24 m_normVector.push_back(norm);
25 m_point.push_back(rmir * norm);
26 m_installed.push_back(true);
27 }
28}
29
31{
32 if (m_nMirrors == 0) { B2INFO("ARICHGeoMirrors: no mirrors will be placed"); return true;}
33
34 if (m_radius <= 0) return false;
35 if (m_plateThickness <= 0 || m_plateWidth <= 0 || m_plateLength <= 0) return false;
36 if (m_plateWidth == 0) return false;
37 if (m_radius == 0) return false;
38 if (m_point.size() != m_nMirrors) return false;
39 if (m_normVector.size() != m_nMirrors) return false;
40 if (m_installed.size() != m_nMirrors) return false;
41 if (m_material.empty()) return false;
43 B2INFO("ARICHGeoMirrors: no optical properties are specified for mirrors! (no photons will be reflected)");
44 return true;
45}
46
47
48void ARICHGeoMirrors::print(const std::string& title) const
49{
51 cout << " mirror plate:" << endl;
52 cout << " thickness: " << getPlateThickness() << " " << s_unitName << ", width: " << getPlateWidth() << " " << s_unitName <<
53 ", length: "
54 << getPlateLength() << " " << s_unitName << endl;
55 cout << " material: " << getMaterial() << endl;
56 cout << " number of plates: " << getNMirrors() << endl;
57 cout << " nominal phi angle of 1st plate: " << getStartAngle() << endl;
58 cout << " nominal radius at which plates are placed: " << getRadius() << " " << s_unitName << endl;
59 cout << " nominal Z position of plates: " << getZPosition() << " " << s_unitName << endl;
60
61 cout << " installed plates " << endl;
62
63 cout << " ID: ";
64 for (unsigned imir = 1; imir < getNMirrors() + 1; imir++) {
65 cout << setw(3) << imir << " ";
66 }
67 cout << endl;
68 cout << " flag: ";
69 for (unsigned imir = 1; imir < getNMirrors() + 1; imir++) {
70 cout << setw(3) << isInstalled(imir) << " ";
71 }
72 cout << endl;
73
75}
virtual void printSurface(const GeoOpticalSurface &surface) const
Print the content of optical surface.
Definition: ARICHGeoBase.cc:32
virtual void print(const std::string &title) const
Print the content of the class.
Definition: ARICHGeoBase.cc:20
static std::string s_unitName
conversion unit name
Definition: ARICHGeoBase.h:84
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
double getZPosition() const
Get nominal Z position of mirror plates (center point in ARICH local frame)
unsigned getNMirrors() const
Get number of mirror plates.
double getPlateWidth() const
Get width of mirror plate.
double m_plateLength
length of mirror plate
std::vector< bool > m_installed
vector of installed/not installed flags of all mirror plates
GeoOpticalSurface m_surface
optical surface of mirror plates
std::vector< ROOT::Math::XYZVector > m_point
vector of points on the reflective surface of all mirror plates
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 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.
double m_plateThickness
thickness of mirror plate
unsigned m_nMirrors
number of mirror plates (slots)
bool hasProperties() const
check if the material has at least one property
Abstract base class for different kinds of events.
STL namespace.