Belle II Software development
TOPGeoMirrorSegment.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 <top/dbobjects/TOPGeoMirrorSegment.h>
10#include <math.h>
11#include <iostream>
12
13using namespace std;
14
15namespace Belle2 {
22 {
23 double dx = fabs(getXc()) - getWidth() / 2;
24 double dy = fabs(getYc()) - getThickness() / 2;
25 double z = getOuterRadius();
26 if (dx > 0) z = sqrt(z * z - dx * dx);
27 if (dy > 0) z = sqrt(z * z - dy * dy);
28
29 return getFullLength() / 2 - z;
30 }
31
32
34 {
35 if (m_radius <= 0) return false;
36 if (m_coatingThickness <= 0) return false;
37 if (m_coatingMaterial.empty()) return false;
38 if (m_coatingSurface.getName().empty() and !m_coatingSurface.hasProperties()) return false;
39 if (!TOPGeoBarSegment::isConsistent()) return false;
40 return true;
41 }
42
43
44 void TOPGeoMirrorSegment::print(const std::string& title) const
45 {
47 cout << " Radius of curvature: " << getRadius() << " " << s_unitName << endl;
48 cout << " Center of curvature: (" << getXc() << ", " << getYc()
49 << ") " << s_unitName << endl;
50 cout << " Reflective coating: " << getCoatingMaterial() << ", thickness: " <<
51 getCoatingThickness() << " " << s_unitName << endl;
53
54 }
55
57} // end Belle2 namespace
const std::string & getName() const
get name of the optical surface
bool hasProperties() const
check if the material has at least one property
double getWidth() const
Returns bar segment width.
double getFullLength() const
Returns bar segment length including glue.
double getThickness() const
Returns bar segment thickness.
float m_coatingThickness
reflective coating thickness
float m_radius
spherical mirror radius
double getCoatingThickness() const
Returns reflective coating thickness.
double getYc() const
Returns spherical mirror center of curvature in y.
double getOuterRadius() const
Returns spherical mirror outer radius of curvature.
std::string m_coatingMaterial
reflective coating material
const std::string & getCoatingMaterial() const
Returns reflective coating material.
GeoOpticalSurface m_coatingSurface
reflective coating optical surface
double getRadius() const
Returns spherical mirror radius of curvature.
double getXc() const
Returns spherical mirror center of curvature in x.
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
bool isConsistent() const override
Check for consistency of data members.
virtual void print(const std::string &title="Bar segment geometry parameters") const override
Print the content of the class.
double getZc() const
Returns spherical mirror center of curvature in z (in local frame of this segment)
virtual void printSurface(const GeoOpticalSurface &surface) const
Print the content of optical surface.
Definition: TOPGeoBase.cc:44
static std::string s_unitName
conversion unit name
Definition: TOPGeoBase.h:87
void print(const std::string &title="Mirror segment geometry parameters") const override
Print the content of the class.
Abstract base class for different kinds of events.
STL namespace.