9 #include <top/dbobjects/TOPGeoMirrorSegment.h>
21 double TOPGeoMirrorSegment::getZc()
const
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);
29 return getFullLength() / 2 - z;
33 bool TOPGeoMirrorSegment::isConsistent()
const
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;
44 void TOPGeoMirrorSegment::print(
const std::string& title)
const
46 TOPGeoBarSegment::print(title);
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;
52 printSurface(m_coatingSurface);
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.