11 #include <top/dbobjects/TOPGeoMirrorSegment.h>
23 double TOPGeoMirrorSegment::getZc()
const
25 double dx = fabs(getXc()) - getWidth() / 2;
26 double dy = fabs(getYc()) - getThickness() / 2;
27 double z = getOuterRadius();
28 if (dx > 0) z = sqrt(z * z - dx * dx);
29 if (dy > 0) z = sqrt(z * z - dy * dy);
31 return getFullLength() / 2 - z;
35 bool TOPGeoMirrorSegment::isConsistent()
const
37 if (m_radius <= 0)
return false;
38 if (m_coatingThickness <= 0)
return false;
39 if (m_coatingMaterial.empty())
return false;
40 if (m_coatingSurface.getName().empty() and !m_coatingSurface.hasProperties())
return false;
41 if (!TOPGeoBarSegment::isConsistent())
return false;
46 void TOPGeoMirrorSegment::print(
const std::string& title)
const
48 TOPGeoBarSegment::print(title);
49 cout <<
" Radius of curvature: " << getRadius() <<
" " << s_unitName << endl;
50 cout <<
" Center of curvature: (" << getXc() <<
", " << getYc()
51 <<
") " << s_unitName << endl;
52 cout <<
" Reflective coating: " << getCoatingMaterial() <<
", thickness: " <<
53 getCoatingThickness() <<
" " << s_unitName << endl;
54 printSurface(m_coatingSurface);