9 #include <top/dbobjects/TOPGeoQBB.h>
21 std::vector<std::pair<double, double> > TOPGeoQBB::getForwardContour()
const
23 typedef std::pair<double, double>
Pair;
24 std::vector<Pair> contour;
26 double x1 = getWidth() / 2;
27 double x2 = x1 - m_sideRails.getThickness();
28 double x3 = getWidth() / 6;
29 double y1 = m_outerPanel.getY() + m_outerPanel.getMaxThickness();
30 double y2 = m_outerPanel.getY() + m_outerPanel.getMinThickness();
31 double y3 = y2 - m_sideRails.getHeight();
32 double y4 = m_innerPanel.getY() - m_innerPanel.getMaxThickness();
33 contour.push_back(
Pair(-x1, y2));
34 contour.push_back(
Pair(-x3, y1));
35 contour.push_back(
Pair(x3, y1));
36 contour.push_back(
Pair(x1, y2));
37 contour.push_back(
Pair(x1, y3));
38 contour.push_back(
Pair(x2, y4));
39 contour.push_back(
Pair(-x2, y4));
40 contour.push_back(
Pair(-x1, y3));
45 void TOPGeoQBB::printForwardContour()
const
47 auto contour = getForwardContour();
48 cout <<
"Forward contour [" << s_unitName <<
"]:" << endl;
49 for (
auto& xy : contour) cout << xy.first <<
" " << xy.second << endl;
54 std::vector<std::pair<double, double> > TOPGeoQBB::getInnerPanelContour()
const
56 typedef std::pair<double, double>
Pair;
57 std::vector<Pair> contour;
59 double x1 = getPanelWidth() / 2;
60 double y1 = m_innerPanel.getY();
61 double y2 = y1 - m_innerPanel.getMaxThickness();
62 contour.push_back(
Pair(-x1, y1));
63 contour.push_back(
Pair(x1, y1));
64 contour.push_back(
Pair(x1, y2));
65 m_innerPanel.appendContour(contour, y2,
false);
66 contour.push_back(
Pair(-x1, y2));
71 void TOPGeoQBB::printInnerPanelContour()
const
73 auto contour = getInnerPanelContour();
74 cout <<
"Inner panel contour [" << s_unitName <<
"]:" << endl;
75 for (
auto& xy : contour) cout << xy.first <<
" " << xy.second << endl;
80 std::vector<std::pair<double, double> > TOPGeoQBB::getOuterPanelContour()
const
82 typedef std::pair<double, double>
Pair;
83 std::vector<Pair> contour;
85 double x1 = getPanelWidth() / 2;
86 double y1 = m_outerPanel.getY();
87 double y2 = y1 + m_outerPanel.getMinThickness();
88 contour.push_back(
Pair(-x1, y2));
89 m_outerPanel.appendContour(contour, y2,
true);
90 contour.push_back(
Pair(x1, y2));
91 contour.push_back(
Pair(x1, y1));
92 contour.push_back(
Pair(-x1, y1));
97 void TOPGeoQBB::printOuterPanelContour()
const
99 auto contour = getOuterPanelContour();
100 cout <<
"Outer panel contour [" << s_unitName <<
"]:" << endl;
101 for (
auto& xy : contour) cout << xy.first <<
" " << xy.second << endl;
106 std::vector<std::pair<double, double> > TOPGeoQBB::getBackwardContour()
const
108 typedef std::pair<double, double>
Pair;
109 std::vector<Pair> contour;
111 double x1 = getWidth() / 2;
112 double x2 = x1 - m_prismEnclosure.getHeight() *
tan(m_prismEnclosure.getAngle());
113 double x3 = getWidth() / 6;
114 double y1 = m_outerPanel.getY() + m_outerPanel.getMaxThickness();
115 double y2 = m_outerPanel.getY() + m_outerPanel.getMinThickness();
116 double y3 = y2 - m_sideRails.getHeight();
117 double y4 = y3 - m_prismEnclosure.getHeight();
118 contour.push_back(
Pair(-x1, y2));
119 contour.push_back(
Pair(-x3, y1));
120 contour.push_back(
Pair(x3, y1));
121 contour.push_back(
Pair(x1, y2));
122 contour.push_back(
Pair(x1, y3));
123 contour.push_back(
Pair(x2, y4));
124 contour.push_back(
Pair(-x2, y4));
125 contour.push_back(
Pair(-x1, y3));
130 void TOPGeoQBB::printBackwardContour()
const
132 auto contour = getBackwardContour();
133 cout <<
"Backward contour [" << s_unitName <<
"]:" << endl;
134 for (
auto& xy : contour) cout << xy.first <<
" " << xy.second << endl;
139 std::vector<std::pair<double, double> > TOPGeoQBB::getPrismEnclosureContour()
const
141 typedef std::pair<double, double>
Pair;
142 std::vector<Pair> contour;
144 double tanAngle =
tan(m_prismEnclosure.getAngle());
145 double x1 = getWidth() / 2;
146 double x2 = x1 - m_prismEnclosure.getHeight() * tanAngle;
147 double x3 = x1 - m_prismEnclosure.getSideThickness();
148 double y1 = m_outerPanel.getY() + m_outerPanel.getMinThickness()
149 - m_sideRails.getHeight();
150 double y2 = y1 - m_prismEnclosure.getHeight();
151 double y3 = y2 + m_prismEnclosure.getBottomThickness();
152 double x4 = x1 - m_prismEnclosure.getSideThickness() - (y1 - y3) * tanAngle;
153 contour.push_back(
Pair(x1, y1));
154 contour.push_back(
Pair(x2, y2));
155 contour.push_back(
Pair(-x2, y2));
156 contour.push_back(
Pair(-x1, y1));
157 contour.push_back(
Pair(-x3, y1));
158 contour.push_back(
Pair(-x4, y3));
159 contour.push_back(
Pair(x4, y3));
160 contour.push_back(
Pair(x3, y1));
165 void TOPGeoQBB::printPrismEnclosureContour()
const
167 auto contour = getPrismEnclosureContour();
168 cout <<
"Prism enclosure contour [" << s_unitName <<
"]:" << endl;
169 for (
auto& xy : contour) cout << xy.first <<
" " << xy.second << endl;
174 std::vector<std::pair<double, double> > TOPGeoQBB::getBackPlateContour()
const
176 typedef std::pair<double, double>
Pair;
177 std::vector<Pair> contour;
179 double x1 = getWidth() / 2;
180 double x2 = x1 - m_prismEnclosure.getHeight() *
tan(m_prismEnclosure.getAngle());
181 double y1 = m_outerPanel.getY() + m_outerPanel.getMinThickness();
182 double y2 = y1 - m_sideRails.getHeight();
183 double y3 = y2 - m_prismEnclosure.getHeight();
184 contour.push_back(
Pair(-x1, y1));
185 contour.push_back(
Pair(x1, y1));
186 contour.push_back(
Pair(x1, y2));
187 contour.push_back(
Pair(x2, y3));
188 contour.push_back(
Pair(-x2, y3));
189 contour.push_back(
Pair(-x1, y2));
194 void TOPGeoQBB::printBackPlateContour()
const
196 auto contour = getBackPlateContour();
197 cout <<
"Prism enclosure back plate contour [" << s_unitName <<
"]:" << endl;
198 for (
auto& xy : contour) cout << xy.first <<
" " << xy.second << endl;
203 std::vector<std::pair<double, double> > TOPGeoQBB::getFrontPlateContour()
const
205 typedef std::pair<double, double>
Pair;
206 std::vector<Pair> contour;
208 double x1 = getWidth() / 2;
209 double x2 = x1 - m_prismEnclosure.getHeight() *
tan(m_prismEnclosure.getAngle());
210 double y1 = m_outerPanel.getY() + m_outerPanel.getMinThickness();
211 double y2 = y1 - m_sideRails.getHeight();
212 double y3 = y2 - m_prismEnclosure.getHeight();
213 contour.push_back(
Pair(x1, y2));
214 contour.push_back(
Pair(x2, y3));
215 contour.push_back(
Pair(-x2, y3));
216 contour.push_back(
Pair(-x1, y2));
221 void TOPGeoQBB::printFrontPlateContour()
const
223 auto contour = getFrontPlateContour();
224 cout <<
"Prism enclosure front plate contour [" << s_unitName <<
"]:" << endl;
225 for (
auto& xy : contour) cout << xy.first <<
" " << xy.second << endl;
230 bool TOPGeoQBB::isConsistent()
const
232 if (m_width <= 0)
return false;
233 if (m_length <= 0)
return false;
234 if (m_prismPosition <= 0)
return false;
235 if (m_material.empty())
return false;
236 if (!m_innerPanel.isConsistent())
return false;
237 if (!m_outerPanel.isConsistent())
return false;
238 if (!m_sideRails.isConsistent())
return false;
239 if (!m_prismEnclosure.isConsistent())
return false;
240 if (!m_endPlate.isConsistent())
return false;
241 if (!m_coldPlate.isConsistent())
return false;
246 void TOPGeoQBB::print(
const std::string& title)
const
248 TOPGeoBase::printUnderlined(title);
250 cout <<
" width = " << getWidth() <<
" " << s_unitName;
251 cout <<
", length = " << getLength() <<
" " << s_unitName;
252 cout <<
", prism-bar joint = " << getPrismPosition() <<
" " << s_unitName;
253 cout <<
", inside material = " << getMaterial() << endl;
255 m_innerPanel.print(
"QBB inner honeycomb panel geometry parameters");
256 m_outerPanel.print(
"QBB outer honeycomb panel geometry parameters");
258 m_prismEnclosure.print();
double tan(double a)
tan for double
std::pair< double, double > Pair
Shorthand for std::pair<double, double>
Abstract base class for different kinds of events.