ATLAS Offline Software
InDetGeoModelTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "InDetGeoModelTool.h"
6 
9 
10 #include "InDetIdentifier/SCT_ID.h"
11 
13 
15 
16 namespace JiveXML {
17 
24  InDetGeoModelTool::InDetGeoModelTool(const std::string& type,const std::string& name,const IInterface* parent):
26 
27  //Only declare the interface
28  declareInterface<IInDetGeoModelTool>(this);
29  }
30 
35 
40  // Get identifier helper
41  if (detStore()->retrieve(m_PixelIDHelper, "PixelID").isFailure()) {
42  ATH_MSG_ERROR( "Could not get Pixel ID helper" );
43  return StatusCode::RECOVERABLE;
44  }
45 
50  // Get identifier helper
51  if (detStore()->retrieve(m_SCTIDHelper, "SCT_ID").isFailure()) {
52  ATH_MSG_ERROR( "Could not get SCT ID helper" );
53  return StatusCode::RECOVERABLE;
54  }
55 
56  // check if SLHC geo is used (TRT not implemented)
57  // if not SLHC, get the TRT Det Descr manager
58  bool isSLHC = false;
59  const IdDictManager* idDictMgr = nullptr;
60  if (detStore()->retrieve(idDictMgr, "IdDict").isFailure()) {
61  ATH_MSG_ERROR( "Could not get IdDictManager !" );
62  return StatusCode::RECOVERABLE;
63  } else {
64  const IdDictDictionary* dict = idDictMgr->manager()->find_dictionary("InnerDetector");
65  if(!dict) {
66  ATH_MSG_ERROR( " Cannot access InnerDetector dictionary " );
67  return StatusCode::RECOVERABLE;
68  }else{
69  // if (dict->file_name().find("SLHC")!=std::string::npos) isSLHC=true;
70  if (dict->m_version.find("SLHC")!=std::string::npos) isSLHC=true;
71  }
72  }
73 
74  if(!isSLHC){
79  // Get geo model manager
80  if ( detStore()->retrieve(m_TRTGeoManager, "TRT").isFailure()) {
81  ATH_MSG_ERROR( "Could not get TRT GeoModel Manager!" );
82  return StatusCode::RECOVERABLE;
83  }
84 
85  // Get identifier helper
86  if (detStore()->retrieve(m_TRTIDHelper, "TRT_ID").isFailure()) {
87  ATH_MSG_ERROR( "Could not get TRT ID helper" );
88  return StatusCode::RECOVERABLE;
89  }
90  }
91 
92  return StatusCode::SUCCESS;
93  }
94 
95 }//namespace
96 
97 
98 
99 
100 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
JiveXML::InDetGeoModelTool::m_TRTIDHelper
const TRT_ID * m_TRTIDHelper
Definition: InDetGeoModelTool.h:48
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
TRT_DetectorManager.h
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
IdDictManager.h
IdDictDictionary::m_version
std::string m_version
Definition: IdDictDefs.h:284
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
JiveXML::InDetGeoModelTool::initialize
virtual StatusCode initialize()
Initialize.
Definition: InDetGeoModelTool.cxx:34
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:161
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
JiveXML::InDetGeoModelTool::m_PixelIDHelper
const PixelID * m_PixelIDHelper
Definition: InDetGeoModelTool.h:43
JiveXML
This header is shared inbetween the C-style server thread and the C++ Athena ServerSvc.
Definition: BadLArRetriever.cxx:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
IdDictManager
IdDictManager is the interface to identifier dictionaries.
Definition: IdDictManager.h:36
IdDictDictionary
Definition: IdDictDefs.h:97
JiveXML::InDetGeoModelTool::m_SCTIDHelper
const SCT_ID * m_SCTIDHelper
Definition: InDetGeoModelTool.h:45
JiveXML::InDetGeoModelTool::m_TRTGeoManager
const InDetDD::TRT_DetectorManager * m_TRTGeoManager
Definition: InDetGeoModelTool.h:47
JiveXML::InDetGeoModelTool::InDetGeoModelTool
InDetGeoModelTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Constructor with flags for requested geometry managers.
Definition: InDetGeoModelTool.cxx:24
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IdDictManager::manager
const IdDictMgr * manager(void) const
Definition: IdDictManager.cxx:37
InDetGeoModelTool.h
AthAlgTool
Definition: AthAlgTool.h:26