9 #include <top/dbobjects/TOPGeoHoneycombPanel.h>
21 void TOPGeoHoneycombPanel::appendContour(std::vector<std::pair<double, double> >& contour,
23 bool fromLeftToRight)
const
27 typedef std::pair<double, double>
Pair;
29 double R = getRadius();
30 double yc = getMaxThickness() - getMinThickness() -
R;
31 double x0 =
sqrt(
R *
R - yc * yc);
32 if (!fromLeftToRight) x0 = -x0;
33 double dx = 2.0 * x0 / m_N;
35 contour.push_back(
Pair(x, y0));
36 for (
int i = 1; i < m_N; i++) {
38 double y = y0 +
sqrt(
R *
R - x * x) + yc;
39 contour.push_back(
Pair(x, y));
41 contour.push_back(
Pair(x0, y0));
46 bool TOPGeoHoneycombPanel::isConsistent()
const
48 if (m_width <= 0)
return false;
49 if (m_length <= 0)
return false;
50 if (m_minThickness <= 0)
return false;
51 if (m_maxThickness < m_minThickness)
return false;
52 if (m_radius <= 0)
return false;
53 if (m_edgeWidth <= 0)
return false;
54 if (m_material.empty())
return false;
55 if (m_edgeMaterial.empty())
return false;
60 void TOPGeoHoneycombPanel::print(
const std::string& title)
const
62 TOPGeoBase::print(title);
64 cout <<
" width = " << getWidth() <<
" " << s_unitName;
65 cout <<
", length = " << getLength() <<
" " << s_unitName;
66 cout <<
", thickness: min = " << getMinThickness() <<
" " << s_unitName;
67 cout <<
", max = " << getMaxThickness() <<
" " << s_unitName;
68 cout <<
", radius = " << getRadius() <<
" " << s_unitName << endl;
70 cout <<
" edge width = " << getEdgeWidth() <<
" " << s_unitName;
71 cout <<
", y = " << getY() <<
" " << s_unitName;
72 cout <<
", N = " << m_N << endl;
74 cout <<
" materials: body = " << getMaterial();
75 cout <<
", edge = " << getEdgeMaterial() << endl;
double sqrt(double a)
sqrt for double
std::pair< double, double > Pair
Shorthand for std::pair<double, double>
Abstract base class for different kinds of events.