Belle II Software development
TOPGeoQBB.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/TOPGeoQBB.h>
10#include <math.h>
11#include <iostream>
12
13using namespace std;
14
15namespace Belle2 {
20
21 std::vector<std::pair<double, double> > TOPGeoQBB::getForwardContour() const
22 {
23 typedef std::pair<double, double> Pair;
24 std::vector<Pair> contour;
25
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));
41
42 return contour;
43 }
44
46 {
47 auto contour = getForwardContour();
48 cout << "Forward contour [" << s_unitName << "]:" << endl;
49 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
50 cout << endl;
51 }
52
53
54 std::vector<std::pair<double, double> > TOPGeoQBB::getInnerPanelContour() const
55 {
56 typedef std::pair<double, double> Pair;
57 std::vector<Pair> contour;
58
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));
67
68 return contour;
69 }
70
72 {
73 auto contour = getInnerPanelContour();
74 cout << "Inner panel contour [" << s_unitName << "]:" << endl;
75 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
76 cout << endl;
77 }
78
79
80 std::vector<std::pair<double, double> > TOPGeoQBB::getOuterPanelContour() const
81 {
82 typedef std::pair<double, double> Pair;
83 std::vector<Pair> contour;
84
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));
93
94 return contour;
95 }
96
98 {
99 auto contour = getOuterPanelContour();
100 cout << "Outer panel contour [" << s_unitName << "]:" << endl;
101 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
102 cout << endl;
103 }
104
105
106 std::vector<std::pair<double, double> > TOPGeoQBB::getBackwardContour() const
107 {
108 typedef std::pair<double, double> Pair;
109 std::vector<Pair> contour;
110
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));
126
127 return contour;
128 }
129
131 {
132 auto contour = getBackwardContour();
133 cout << "Backward contour [" << s_unitName << "]:" << endl;
134 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
135 cout << endl;
136 }
137
138
139 std::vector<std::pair<double, double> > TOPGeoQBB::getPrismEnclosureContour() const
140 {
141 typedef std::pair<double, double> Pair;
142 std::vector<Pair> contour;
143
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));
161
162 return contour;
163 }
164
166 {
167 auto contour = getPrismEnclosureContour();
168 cout << "Prism enclosure contour [" << s_unitName << "]:" << endl;
169 for (auto& xy : contour) cout << xy.first << " " << xy.second << endl;
170 cout << endl;
171 }
172
173
174 std::vector<std::pair<double, double> > TOPGeoQBB::getBackPlateContour() const
175 {
176 typedef std::pair<double, double> Pair;
177 std::vector<Pair> contour;
178
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));
190
191 return contour;
192 }
193
195 {
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;
199 cout << endl;
200 }
201
202
203 std::vector<std::pair<double, double> > TOPGeoQBB::getFrontPlateContour() const
204 {
205 typedef std::pair<double, double> Pair;
206 std::vector<Pair> contour;
207
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));
217
218 return contour;
219 }
220
222 {
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;
226 cout << endl;
227 }
228
229
231 {
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;
242 return true;
243 }
244
245
246 void TOPGeoQBB::print(const std::string& title) const
247 {
249
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;
254
255 m_innerPanel.print("QBB inner honeycomb panel geometry parameters");
256 m_outerPanel.print("QBB outer honeycomb panel geometry parameters");
257 m_sideRails.print();
258 m_prismEnclosure.print();
259 m_endPlate.print();
260 m_coldPlate.print();
261
262 }
263
265} // end Belle2 namespace
double getWidth() const
Returns full width.
Definition TOPGeoQBB.h:102
TOPGeoPrismEnclosure m_prismEnclosure
prism enclosure
Definition TOPGeoQBB.h:274
std::string m_material
material inside QBB
Definition TOPGeoQBB.h:270
TOPGeoHoneycombPanel m_outerPanel
outer honeycomb panel
Definition TOPGeoQBB.h:272
TOPGeoSideRails m_sideRails
side rails
Definition TOPGeoQBB.h:273
float m_prismPosition
position of prism-bar joint wrt QBB back
Definition TOPGeoQBB.h:269
TOPGeoHoneycombPanel m_innerPanel
inner honeycomb panel
Definition TOPGeoQBB.h:271
TOPGeoEndPlate m_endPlate
forward end plate
Definition TOPGeoQBB.h:275
double getPrismPosition() const
Returns the position of prism-bar joint wrt QBB back.
Definition TOPGeoQBB.h:132
TOPGeoColdPlate m_coldPlate
cold plate
Definition TOPGeoQBB.h:276
const std::string & getMaterial() const
Returns the name of material inside QBB.
Definition TOPGeoQBB.h:138
float m_length
full length
Definition TOPGeoQBB.h:268
double getLength() const
Returns full length.
Definition TOPGeoQBB.h:117
float m_width
full width
Definition TOPGeoQBB.h:267
double getPanelWidth() const
Returns panel width used in x-y contours of honeycomb panels.
Definition TOPGeoQBB.h:108
double tan(double a)
tan for double
Definition beamHelpers.h:31
void printPrismEnclosureContour() const
Print prism enclosure contour (polygon) - for debugging.
Definition TOPGeoQBB.cc:165
std::vector< std::pair< double, double > > getBackPlateContour() const
Returns prism enclosure back plate x-y contour.
Definition TOPGeoQBB.cc:174
bool isConsistent() const override
Check for consistency of data members.
Definition TOPGeoQBB.cc:230
std::vector< std::pair< double, double > > getPrismEnclosureContour() const
Returns prism enclosure wall x-y contour.
Definition TOPGeoQBB.cc:139
void printUnderlined(const std::string &title) const
Print the content of the class.
Definition TOPGeoBase.cc:35
void printInnerPanelContour() const
Print inner honeycomb panel contour (polygon) - for debugging.
Definition TOPGeoQBB.cc:71
void printBackwardContour() const
Print backward contour (polygon) - for debugging.
Definition TOPGeoQBB.cc:130
void printOuterPanelContour() const
Print outer honeycomb panel contour (polygon) - for debugging.
Definition TOPGeoQBB.cc:97
virtual void print(const std::string &title="QBB geometry parameters") const override
Print the content of the class.
Definition TOPGeoQBB.cc:246
std::vector< std::pair< double, double > > getFrontPlateContour() const
Returns prism enclosure front plate x-y contour.
Definition TOPGeoQBB.cc:203
void printFrontPlateContour() const
Print prism enclosure front plate contour (polygon) - for debugging.
Definition TOPGeoQBB.cc:221
std::vector< std::pair< double, double > > getOuterPanelContour() const
Returns outer honeycomb panel x-y contour.
Definition TOPGeoQBB.cc:80
void printForwardContour() const
Print forward contour (polygon) - for debugging.
Definition TOPGeoQBB.cc:45
std::vector< std::pair< double, double > > getForwardContour() const
Returns forward x-y contour.
Definition TOPGeoQBB.cc:21
std::pair< double, double > Pair
Shorthand for std::pair<double, double>
static std::string s_unitName
conversion unit name
Definition TOPGeoBase.h:87
std::vector< std::pair< double, double > > getBackwardContour() const
Returns backward x-y contour.
Definition TOPGeoQBB.cc:106
std::vector< std::pair< double, double > > getInnerPanelContour() const
Returns inner honeycomb panel x-y contour.
Definition TOPGeoQBB.cc:54
void printBackPlateContour() const
Print prism enclosure back plate contour (polygon) - for debugging.
Definition TOPGeoQBB.cc:194
Abstract base class for different kinds of events.
STL namespace.