10 #include "GeoModelKernel/GeoVDetectorManager.h"
11 #include "GeoModelKernel/GeoShapeUnion.h"
12 #include "GeoModelKernel/GeoShapeShift.h"
13 #include "GeoModelKernel/GeoMaterial.h"
14 #include "GeoModelKernel/GeoLogVol.h"
15 #include "GeoModelKernel/GeoPhysVol.h"
16 #include "GeoModelKernel/GeoTransform.h"
23 #include "GaudiKernel/ISvcLocator.h"
24 #include "GaudiKernel/Bootstrap.h"
27 #include "G4ReflectionFactory.hh"
28 #include "G4LogicalBorderSurface.hh"
29 #include "G4OpticalSurface.hh"
30 #include "GeoModelHelpers/throwExcept.h"
38 , m_detectorName(detectorName)
39 , m_motherTransform(GeoTrf::
Transform3D::Identity())
41 ISvcLocator* svcLocator = Gaudi::svcLocator();
44 THROW_EXCEPTION(
"ERROR: Geo2G4Builder for detector "<< detectorName <<
" could not access the detector store.");
56 for(
unsigned int i=0;
i<theManager->getNumTreeTops(); ++
i) {
68 if(theMaterialManager) {
83 <<
"\n Use 'DefaultBuilder' property of Geo2G4Svc or"
84 <<
"\n 'GetVolumeBuilder' method of Geo2G4Builder");
91 G4LogicalVolume*
result =
nullptr;
98 if(
sc.isSuccess() && surface_container->size()>0) {
112 const GeoShape* shResult = &shFirst;
119 GeoPhysVol* pvEnvelope =
new GeoPhysVol(lvEnvelope);
124 PVConstLink world =
m_treeTops[0]->getParent();
130 Query<unsigned int> childIndx = world->indexOf(
pv);
137 Query<int> Qint = world->getIdOfChildVol(childIndx);
138 if(Qint.isValid())
id = Qint;
141 std::string nameTT = world->getNameOfChildVol(childIndx);
142 if (nameTT ==
"ANON") nameTT =
pv->getLogVol()->getName();
146 G4ReflectionFactory::Instance()->Place(theG4Position,
157 if(optical_volumes) {
158 if(optical_volumes->size()>0) {
162 ATH_MSG_WARNING(
"Optical volumes apparently requested, but none found! Deleting temps");
164 delete optical_volumes;
188 G4OpticalSurface* g4OptSurface = surfaceFactory.
Build(border_surface.getOptSurface());
190 G4VPhysicalVolume* g4PV1 = 0;
191 G4VPhysicalVolume* g4PV2 = 0;
192 OpticalVolumesMap::const_iterator volIt;
195 volIt = optical_volumes->find(border_surface.getPV1());
196 if(volIt == optical_volumes->end())
198 ATH_MSG_WARNING(
"Unable to find " << border_surface.getPV1()->getLogVol()->getName() <<
" in Optical Volumes map");
201 g4PV1 = volIt.operator->()->second;
204 volIt = optical_volumes->find(border_surface.getPV2());
205 if(volIt == optical_volumes->end())
207 ATH_MSG_WARNING(
"Unable to find " << border_surface.getPV2()->getLogVol()->getName() <<
" in Optical Volumes map");
210 g4PV2 = volIt.operator->()->second;
213 G4LogicalBorderSurface* g4BorderSurface
__attribute__((
unused)) =
new G4LogicalBorderSurface(border_surface.getName(),g4PV1,g4PV2,g4OptSurface);