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;
275 shapeTmp2 =
new GeoTube(0,
m_rmin, halflength + 0.1 * Gaudi::Units::mm);
278 shapeTmp2 =
new GeoCons(0, 0,
m_rmin,
m_rmin2, halflength + 0.1 * Gaudi::Units::mm, 0, 2 *
M_PI);
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;