82 #include "GeoModelKernel/GeoTube.h"
83 #include "GeoModelKernel/GeoTubs.h"
84 #include "GeoModelKernel/GeoCons.h"
85 #include "GeoModelKernel/GeoPgon.h"
86 #include "GeoModelKernel/GeoBox.h"
87 #include "GeoModelKernel/GeoTrap.h"
88 #include "GeoModelKernel/GeoShapeSubtraction.h"
89 #include "GaudiKernel/SystemOfUnits.h"
109 m_needsRotation(false),
126 : m_rmin(rhs.m_rmin),
128 m_rmin2(rhs.m_rmin2),
129 m_rmax2(rhs.m_rmax2),
133 m_zsymm(rhs.m_zsymm),
134 m_geoShape(rhs.m_geoShape),
135 m_material(rhs.m_material),
136 m_materialName(rhs.m_materialName),
137 m_volName(rhs.m_volName),
138 m_shapeType(rhs.m_shapeType),
139 m_phiLoc(rhs.m_phiLoc),
140 m_phiWidth(rhs.m_phiWidth),
141 m_needsRotation(rhs.m_needsRotation),
142 m_sides(rhs.m_sides),
143 m_nCopies(rhs.m_nCopies),
145 m_origVolume(rhs.m_origVolume),
146 m_volume(rhs.m_volume),
147 m_safety(rhs.m_safety),
148 m_region(rhs.m_region),
149 m_label(rhs.m_label),
150 m_lockGeoShape(rhs.m_lockGeoShape),
151 m_splittableR(rhs.m_splittableR),
152 m_splittableZ(rhs.m_splittableZ),
153 m_envNum(rhs.m_envNum),
154 m_envParentNum(rhs.m_envParentNum),
155 m_zShift(rhs.m_zShift),
162 if (
length() > 4. * safety) {
166 std::lock_guard<std::mutex> lock(
m_mutex);
167 m_geoShape =
nullptr;
184 std::cout <<
m_rmin <<
" "
195 std::lock_guard<std::mutex> lock(
m_mutex);
198 if (m_geoShape.get())
return m_geoShape.get();
212 double halflength = 0.5 *
length();
220 const GeoShape* serviceShape =
nullptr;
234 phiWidthTmp = 2 *
M_PI;
241 serviceShape = shapeTmp;
245 double cosalpha =
cos(alpha);
246 double rminB =
m_rmin / cosalpha;
247 double rmaxB =
m_rmax / cosalpha;
248 double rmin2B =
m_rmin2 / cosalpha;
249 double rmax2B =
m_rmax2 / cosalpha;
251 shapeTmp->addPlane(-halflength, rminB, rmaxB);
252 shapeTmp->addPlane(halflength, rmin2B, rmax2B);
253 serviceShape = shapeTmp;
256 GeoPgon* shapeTmp1 =
nullptr;
259 shapeTmp1->addPlane(-halflength, 0,
m_rmax);
260 shapeTmp1->addPlane(halflength, 0,
m_rmax2);
263 double cosalpha =
cos(alpha);
264 double rmaxB =
m_rmax / cosalpha;
265 double rmax2B =
m_rmax2 / cosalpha;
267 shapeTmp1->addPlane(-halflength, 0, rmaxB);
268 shapeTmp1->addPlane(halflength, 0, rmax2B);
271 volume = shapeTmp1->volume();
273 GeoShape* shapeTmp2 =
nullptr;
281 serviceShape = &(shapeTmp1->subtract(*shapeTmp2));
299 serviceShape =
new GeoTube(0, 0.5 *
m_phiWidth, halflength);
310 serviceShape =
new GeoTrap(halflength, 0, 0, thickness, w1, w2, 0, thickness, w1, w2, 0);
313 std::cout <<
"ServiceVolume: ERROR: Unrecognized shape for services" <<
m_shapeType << std::endl;
316 if (!
volume && serviceShape !=
nullptr)
volume = serviceShape->volume();
319 m_geoShape = serviceShape;
327 std::lock_guard<std::mutex> lock(
m_mutex);
338 if (!m_volume) m_volume = geoShape->volume();
339 m_geoShape = geoShape;