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

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 36 of file GeoModelSvc.cxx.

38 {
39  // Activate the initialization from SQLite if the overrider has been used
40  if(!m_sqliteDbFullPath.empty()) m_sqliteDb=true;
41 
42  if(!m_sqliteDb && m_supportedGeometry==0) {
43  ATH_MSG_FATAL("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 (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  // Apply possible alignments to detectors.
81  // Dummy parameters for the callback
82  int par1 = 0;
83  std::list<std::string> par2;
84  for(; itPriv!=itPrivEnd; ++itPriv) {
85  if((*itPriv)->align(par1,par2) != StatusCode::SUCCESS) {
86  ATH_MSG_DEBUG("align() failed for the tool " << (*itPriv)->name());
87  }
88  }
89 
90  // Fill in the contents of TagInfo
91  if(m_useTagInfo) {
92  ATH_CHECK(fillTagInfo());
93  }
94  }
95  else {
96  // Register align() functions for all Tools
97  for (; itPriv!=itPrivEnd; ++itPriv) {
98  IGeoModelTool* theTool = &(**itPriv);
99 
100  if(StatusCode::SUCCESS != theTool->registerCallback()) {
101  ATH_MSG_DEBUG("IGeoModelTool::align() was not registerred on CondDB object for the tool " << theTool->name());
102  }
103  }
104 
105  // Register a callback on TagInfo in order to compare geometry configurations defined in job options
106  // to the one read from the input file
107  if(m_useTagInfo) {
108  m_tagInfoMgr->addListener( this );
109  // Fill in the contents of TagInfo
110  ATH_CHECK(fillTagInfo());
111  }
112  }
113 
114  return StatusCode::SUCCESS;
115 }
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
python.FakeAthena.Service
def Service(name)
Definition: FakeAthena.py:38
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:192
IGeoModelTool
Definition: IGeoModelTool.h:12
ServiceHandle< IConversionSvc >