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"
110 m_needsRotation(false),
127 : m_rmin(rhs.m_rmin),
129 m_rmin2(rhs.m_rmin2),
130 m_rmax2(rhs.m_rmax2),
134 m_zsymm(rhs.m_zsymm),
135 m_geoShape(rhs.m_geoShape),
136 m_material(rhs.m_material),
137 m_materialName(rhs.m_materialName),
138 m_volName(rhs.m_volName),
139 m_shapeType(rhs.m_shapeType),
140 m_phiLoc(rhs.m_phiLoc),
141 m_phiWidth(rhs.m_phiWidth),
142 m_needsRotation(rhs.m_needsRotation),
143 m_sides(rhs.m_sides),
144 m_nCopies(rhs.m_nCopies),
146 m_origVolume(rhs.m_origVolume),
147 m_volume(rhs.m_volume),
148 m_safety(rhs.m_safety),
149 m_region(rhs.m_region),
150 m_label(rhs.m_label),
151 m_lockGeoShape(rhs.m_lockGeoShape),
152 m_splittableR(rhs.m_splittableR),
153 m_splittableZ(rhs.m_splittableZ),
154 m_envNum(rhs.m_envNum),
155 m_envParentNum(rhs.m_envParentNum),
156 m_zShift(rhs.m_zShift),
163 if (
length() > 4. * safety) {
167 std::lock_guard<std::mutex> lock(
m_mutex);
168 m_geoShape =
nullptr;
173 std::ostringstream o;
175 o <<
name << std::setw(2) << volId;
188 std::cout <<
m_rmin <<
" "
199 std::lock_guard<std::mutex> lock(
m_mutex);
202 if (m_geoShape.get())
return m_geoShape.get();
216 double halflength = 0.5 *
length();
224 const GeoShape* serviceShape =
nullptr;
238 phiWidthTmp = 2 *
M_PI;
245 serviceShape = shapeTmp;
249 double cosalpha =
cos(alpha);
250 double rminB =
m_rmin / cosalpha;
251 double rmaxB =
m_rmax / cosalpha;
252 double rmin2B =
m_rmin2 / cosalpha;
253 double rmax2B =
m_rmax2 / cosalpha;
255 shapeTmp->addPlane(-halflength, rminB, rmaxB);
256 shapeTmp->addPlane(halflength, rmin2B, rmax2B);
257 serviceShape = shapeTmp;
260 GeoPgon* shapeTmp1 =
nullptr;
263 shapeTmp1->addPlane(-halflength, 0,
m_rmax);
264 shapeTmp1->addPlane(halflength, 0,
m_rmax2);
267 double cosalpha =
cos(alpha);
268 double rmaxB =
m_rmax / cosalpha;
269 double rmax2B =
m_rmax2 / cosalpha;
271 shapeTmp1->addPlane(-halflength, 0, rmaxB);
272 shapeTmp1->addPlane(halflength, 0, rmax2B);
275 volume = shapeTmp1->volume();
277 GeoShape* shapeTmp2 =
nullptr;
285 serviceShape = &(shapeTmp1->subtract(*shapeTmp2));
303 serviceShape =
new GeoTube(0, 0.5 *
m_phiWidth, halflength);
314 serviceShape =
new GeoTrap(halflength, 0, 0, thickness, w1, w2, 0, thickness, w1, w2, 0);
317 std::cout <<
"ServiceVolume: ERROR: Unrecognized shape for services" <<
m_shapeType << std::endl;
320 if (!
volume && serviceShape !=
nullptr)
volume = serviceShape->volume();
323 m_geoShape = serviceShape;
331 std::lock_guard<std::mutex> lock(
m_mutex);
342 if (!m_volume) m_volume = geoShape->volume();
343 m_geoShape = geoShape;