ATLAS Offline Software
Functions
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. More...
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

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