ATLAS Offline Software
Loading...
Searching...
No Matches
GeoModelSvc.cxx File Reference
#include "GeoModelSvc.h"
#include <fstream>
#include "AthenaKernel/ClassID_traits.h"
#include "GaudiKernel/ConcurrencyFlags.h"
#include "GaudiKernel/IConversionSvc.h"
#include "GaudiKernel/ISvcLocator.h"
#include "GaudiKernel/SystemOfUnits.h"
#include "GeoDbTagSvc.h"
#include "GeoModelHelpers/ThreadPool.h"
#include "GeoModelHelpers/defineWorld.h"
#include "GeoModelKernel/GeoBox.h"
#include "GeoModelKernel/GeoLogVol.h"
#include "GeoModelKernel/GeoMaterial.h"
#include "GeoModelKernel/GeoPerfUtils.h"
#include "GeoModelKernel/GeoPhysVol.h"
#include "GeoModelKernel/GeoVolumeCursor.h"
#include "GeoModelUtilities/GeoModelExperiment.h"
#include "PathResolver/PathResolver.h"
#include "RDBAccessSvc/IRDBAccessSvc.h"
#include "RDBAccessSvc/IRDBRecord.h"
#include "RDBAccessSvc/IRDBRecordset.h"
#include "RDBMaterialManager.h"
#include "SGTools/DataProxy.h"

Go to the source code of this file.

Functions

StatusCode GeoModelSvc::initialize ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options.

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

StatusCode GeoModelSvc::initialize ATLAS_NOT_THREAD_SAFE ( void )
inline

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Definition at line 34 of file GeoModelSvc.cxx.

36{
37 if (!m_sqliteDb && m_supportedGeometry == 0) {
39 "The Supported Geometry flag was not set in Job Options! Exiting ...");
40 return StatusCode::FAILURE;
41 }
42
43 ATH_CHECK(m_detStore.retrieve());
44
45 // --- Sebastien
46 // clients (detector tools) are assuming the DetDescrCnvSvc has been
47 // correctly initialized.
48 // We ensure this is indeed correct by manually initialize it so there is
49 // no more service-ordering problem triggered by jobO mix-up
50 ServiceHandle<IConversionSvc> conversionSvc("DetDescrCnvSvc", this->name());
51 ATH_CHECK(conversionSvc.retrieve());
52 // --- Sebastien
53
54 // Working around Gaudi Issue https://gitlab.cern.ch/gaudi/Gaudi/issues/82
55 Service *convSvc = dynamic_cast<Service *>(conversionSvc.get());
56 if (not convSvc) {
57 ATH_MSG_ERROR("Dynamic cast to service failed");
58 return StatusCode::FAILURE;
59 }
60 if (convSvc->FSMState() < Gaudi::StateMachine::INITIALIZED) {
61 ATH_MSG_INFO("Explicitly initializing DetDescrCnvSvc");
62 ATH_CHECK(convSvc->sysInitialize());
63 }
64
65 ATH_CHECK(m_detectorTools.retrieve());
66
67 ToolHandleArray<IGeoModelTool>::iterator itPriv = m_detectorTools.begin(),
68 itPrivEnd = m_detectorTools.end();
69
70 if (m_useTagInfo) {
71 ATH_CHECK(m_tagInfoMgr.retrieve());
72 }
73
74 // build regular geometry
75 ATH_CHECK(geoInit());
76
77 if (!m_callBackON) {
78 // _________________ Align functions NOT registered as callbacks
79 // _____________
80
81 // Apply possible alignments to detectors.
82 // Dummy parameters for the callback
83 int par1 = 0;
84 std::list<std::string> par2;
85 for (; itPriv != itPrivEnd; ++itPriv) {
86 if ((*itPriv)->align(par1, par2) != StatusCode::SUCCESS) {
87 ATH_MSG_DEBUG("align() failed for the tool " << (*itPriv)->name());
88 }
89 }
90
91 // Fill in the contents of TagInfo
92 if (m_useTagInfo) {
93 ATH_CHECK(fillTagInfo());
94 }
95 } else {
96 // Register align() functions for all Tools
97 for (; itPriv != itPrivEnd; ++itPriv) {
98 IGeoModelTool *theTool = (*itPriv).get();
99
100 if (StatusCode::SUCCESS != theTool->registerCallback()) {
102 "IGeoModelTool::align() was not registerred on CondDB object for "
103 "the tool "
104 << theTool->name());
105 }
106 }
107
108 // Register a callback on TagInfo in order to compare geometry
109 // configurations defined in job options to the one read from the input file
110 if (m_useTagInfo) {
111 m_tagInfoMgr->addListener(this);
112 // Fill in the contents of TagInfo
113 ATH_CHECK(fillTagInfo());
114 }
115 }
116
117 return StatusCode::SUCCESS;
118}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)