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 "GeoModelHelpers/defineWorld.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 38 of file GeoModelSvc.cxx.

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