diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt b/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt index f96cfa344304b089c97de6ffe3dd13f07258c9c2..60964ae54c07e03f83948ad59569b94b3718f0b2 100644 --- a/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt +++ b/AtlasGeometryCommon/BeamPipeGeoModel/CMakeLists.txt @@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC Control/CLIDSvc Control/SGTools Control/StoreGate + Control/AthenaKernel DetectorDescription/GeoModel/GeoModelInterfaces GaudiKernel ) @@ -27,7 +28,7 @@ atlas_add_library( BeamPipeGeoModelLib PUBLIC_HEADERS BeamPipeGeoModel INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} LINK_LIBRARIES ${Boost_LIBRARIES} ${CORAL_LIBRARIES} GeoModelKernel GeoModelUtilities StoreGateLib SGtests - PRIVATE_LINK_LIBRARIES SGTools GaudiKernel ) + PRIVATE_LINK_LIBRARIES SGTools AthenaKernel GaudiKernel ) atlas_add_component( BeamPipeGeoModel src/components/*.cxx diff --git a/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorFactory.cxx b/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorFactory.cxx index 7451c402d084f06359c9879a45b7109737c532f8..680541da22083232dc8382f7381dbd07499c240d 100755 --- a/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorFactory.cxx +++ b/AtlasGeometryCommon/BeamPipeGeoModel/src/BeamPipeDetectorFactory.cxx @@ -25,6 +25,9 @@ #include "RDBAccessSvc/IRDBRecordset.h" #include "RDBAccessSvc/IRDBAccessSvc.h" +#include "AthenaKernel/getMessageSvc.h" +#include "GaudiKernel/MsgStream.h" + #include <iomanip> #include <vector> @@ -240,9 +243,15 @@ void BeamPipeDetectorFactory::addSections(GeoPhysVol* parent, int region) GeoNameTag* ntSection = new GeoNameTag(name); if (addToFirstSection && secNum!=1) { - //std::cout << "Placing section " << secNum << " in Section1" << std::endl; - pvMotherSection->add(ntSection); - pvMotherSection->add(pvSection); + if (!pvMotherSection) { + MsgStream gLog(Athena::getMessageSvc(), "BeamPipeDetectorFactory"); + gLog << MSG::ERROR << "Logic error building beam pipe." << endmsg; + } + else { + //std::cout << "Placing section " << secNum << " in Section1" << std::endl; + pvMotherSection->add(ntSection); + pvMotherSection->add(pvSection); + } } else { //std::cout << "Placing section " << secNum << " in mother envelope" << std::endl; parent->add(ntSection);