9 #include "GeoModelKernel/GeoLogVol.h"
10 #include "GeoModelKernel/GeoPhysVol.h"
11 #include "GeoModelKernel/GeoFullPhysVol.h"
12 #include "GeoModelKernel/GeoMaterial.h"
13 #include "GeoModelKernel/GeoTransform.h"
14 #include "GeoModelKernel/GeoDefinitions.h"
15 #include "GaudiKernel/SystemOfUnits.h"
25 m_servEnvelope(nullptr),
27 m_matManager(nullptr) {
36 m_servEnvelope(nullptr),
42 const std::vector<const ServiceVolume* >& servEnvelope,
43 const std::vector<const ServiceVolume* >& servChild)
48 m_servEnvelope(&servEnvelope),
49 m_servChild(&servChild),
50 m_matManager(nullptr) {
65 const std::vector<const ServiceVolume* >&
72 const std::vector<const ServiceVolume* >&
77 const std::vector<const ServiceVolume* >&
86 for (
unsigned int iElement = 0; iElement <
services().size(); ++iElement)
90 for (
int iCopy = 0; iCopy <
numCopies(iElement); ++iCopy) {
102 for (
unsigned int iElement = 0; iElement <
services().size(); ++iElement) {
106 for (
int iCopy = 0; iCopy <
numCopies(iElement); ++iCopy) {
114 if (region.compare(
"Pixel") != 0)
return;
116 for (
unsigned int iElement = 0; iElement <
services().size(); ++iElement) {
128 for (
unsigned int iChild = 0; iChild <
services().size(); ++iChild) {
134 for (
unsigned int iChild = 0; iChild <
services().size(); ++iChild) {
139 for (
int iCopy2 = 0; iCopy2 <
numCopies(iChild); ++iCopy2) {
141 physVol->add(physVol_child);
146 for (
int iCopy = 0; iCopy <
numCopies(iElement); ++iCopy) {
160 for (
unsigned int iChild = 0; iChild <
services().size(); ++iChild) {
166 for (
unsigned int iChild = 0; iChild <
services().size(); ++iChild) {
171 for (
int iCopy2 = 0; iCopy2 <
numCopies(iChild); ++iCopy2) {
173 physVol->add(physVol_child);
178 for (
int iCopy = 0; iCopy <
numCopies(iElement); ++iCopy) {
196 const GeoShape* serviceShape = param.
getShape();
199 const GeoMaterial* serviceMat = param.
material();
200 std::string materialName;
208 ATH_MSG_ERROR(
"Material manager not available. Cannot build material.");
212 materialName = serviceMat->getName();
219 << param.
rmin() <<
", "
220 << param.
rmax() <<
", "
221 << param.
zmin() <<
", "
226 GeoLogVol* serviceLog =
new GeoLogVol(logName, serviceShape, serviceMat);
227 PhysVolPtr servicePhys{
new GeoPhysVol(serviceLog)};
252 return (param.
zmin() + param.
zmax()) * 0.5;
260 if (param1.
zsymm() == 1) {
270 return services()[iElement]->nCopies();
279 double zshift = param.
zShift();
282 bool rotateAroundY =
false;
285 rotateAroundY =
true;
291 const std::string& shapeType = param.
shapeType();
292 if (shapeType ==
"TRAP" || shapeType ==
"TRAP2") {
296 if (shapeType ==
"TRAP2") {
299 if (shapeType ==
"BOX" || shapeType ==
"TRAP" || shapeType ==
"TRAP2") {
301 xform = GeoTrf::TranslateX3D(
radius) * xform;
302 phiStart = param.
phiLoc();
303 }
else if (shapeType ==
"ROD" || shapeType ==
"ROD2") {
305 xform = GeoTrf::TranslateX3D(
radius) * xform;
306 phiStart = param.
phiLoc();
313 double phi = phiStart +
deltaPhi * iCopy;
315 xform = GeoTrf::RotateZ3D(phi) * xform;
321 return new GeoTransform(xform);
328 double zCenter = (paramEnv.
zmin() + paramEnv.
zmax()) * 0.5;
330 bool bMoveToCenter =
false;
331 if (paramEnv.
shapeType() ==
"BOX") bMoveToCenter =
true;
332 if (paramEnv.
shapeType() ==
"TUBE" && paramEnv.
zsymm() == 1 && fabs(paramEnv.
zmin()) > 0.01) bMoveToCenter =
true;
333 if (bMoveToCenter) rCenter = (paramEnv.
rmin() + paramEnv.
rmax()) * 0.5;
335 double zpos = param.
zposition() - zCenter;
337 bool rotateAroundY =
false;
340 rotateAroundY =
true;
344 const std::string& shapeType = param.
shapeType();
347 if (shapeType ==
"TRAP") {
351 if (shapeType ==
"TRAP2") {
355 if (shapeType ==
"BOX" || shapeType ==
"TRAP" || shapeType ==
"TRAP2") {
357 xform = GeoTrf::TranslateX3D(
radius) * xform;
358 phiStart = param.
phiLoc();
359 }
else if (shapeType ==
"ROD" || shapeType ==
"ROD2") {
361 xform = GeoTrf::TranslateX3D(
radius) * xform;
362 phiStart = param.
phiLoc();
369 double phi = phiStart +
deltaPhi * iCopy;
371 xform = GeoTrf::RotateZ3D(phi) * xform;
377 return new GeoTransform(xform);