ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
InDetServMatTool Class Referencefinal

#include <InDetServMatTool.h>

Inheritance diagram for InDetServMatTool:
Collaboration diagram for InDetServMatTool:

Public Member Functions

 InDetServMatTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor(s) More...
 
virtual ~InDetServMatTool () override=default
 
virtual StatusCode create () override
 Create the Detector Node corresponding to this tool. More...
 
virtual StatusCode clear () override
 
virtual GeoVDetectorManager * manager ()
 The Detector Node corresponding to this tool. More...
 
virtual const GeoVDetectorManager * manager () const
 
virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override
 
virtual StatusCode align (IOVSVC_CALLBACK_ARGS) override
 

Protected Attributes

GeoVDetectorManager * m_detector
 

Private Attributes

ServiceHandle< IGeoDbTagSvcm_geoDbTagSvc {this,"GeoDbTagSvc","GeoDbTagSvc"}
 
ServiceHandle< IGeometryDBSvcm_geometryDBSvc {this,"GeometryDBSvc","InDetGeometryDBSvc"}
 
ToolHandle< IInDetServMatBuilderToolm_builderTool {this,"ServiceBuilderTool",""}
 
StringProperty m_overrideVersionName {this,"OverrideVersionName",""}
 
const InDetDD::InDetServMatManagerm_manager {nullptr}
 
InDetServMatAthenaComps m_athenaComps {}
 

Detailed Description

Definition at line 23 of file InDetServMatTool.h.

Constructor & Destructor Documentation

◆ InDetServMatTool()

InDetServMatTool::InDetServMatTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor(s)

Definition at line 25 of file InDetServMatTool.cxx.

27 {
28 }

◆ ~InDetServMatTool()

virtual InDetServMatTool::~InDetServMatTool ( )
overridevirtualdefault

Member Function Documentation

◆ align()

StatusCode GeoModelTool::align ( IOVSVC_CALLBACK_ARGS  )
overridevirtualinherited

Reimplemented in ALFA_DetectorTool, HGTD_DetectorTool, TRT_DetectorTool, LArDetectorToolNV, PixelDetectorTool, and SCT_DetectorTool.

Definition at line 33 of file GeoModelTool.cxx.

34 {
35  return StatusCode::SUCCESS;
36 }

◆ ATLAS_NOT_THREAD_SAFE()

virtual StatusCode registerCallback GeoModelTool::ATLAS_NOT_THREAD_SAFE ( )
overridevirtualinherited

◆ clear()

StatusCode InDetServMatTool::clear ( )
overridevirtual

Reimplemented from GeoModelTool.

Definition at line 129 of file InDetServMatTool.cxx.

130 {
132  if(proxy) {
133  proxy->reset();
134  m_manager = nullptr;
135  }
136  return StatusCode::SUCCESS;
137 }

◆ create()

StatusCode InDetServMatTool::create ( )
overridevirtual

Create the Detector Node corresponding to this tool.

Definition at line 33 of file InDetServMatTool.cxx.

34 {
35 
36  //
37  // Locate the top level experiment node
38  //
39  GeoModelExperiment * theExpt{nullptr};
40  ATH_CHECK(detStore()->retrieve(theExpt,"ATLAS"));
41 
42  // Get the detector configuration.
43  ATH_CHECK(m_geoDbTagSvc.retrieve());
44 
45  ServiceHandle<IRDBAccessSvc> accessSvc(m_geoDbTagSvc->getParamSvcName(),name());
46  ATH_CHECK(accessSvc.retrieve());
47 
48  GeoPhysVol *world=theExpt->getPhysVol();
49 
50  GeoModelIO::ReadGeoModel* sqliteReader = m_geoDbTagSvc->getSqliteReader();
51 
52  if (sqliteReader) {
53  InDetServMatFactory_Lite factoryLite;;
54  factoryLite.create(world);
55  m_manager = factoryLite.getDetectorManager();
56  }
57  else {
58  DecodeVersionKey versionKey(m_geoDbTagSvc.get(), "InnerDetector");
59 
60  std::string versionTag = accessSvc->getChildTag("InDetServices", versionKey.tag(), versionKey.node());
61  ATH_MSG_DEBUG("versionTag=" << versionTag << " %%%");
62 
63  // If versionTag is NULL then don't build.
64  if (versionTag.empty()) {
65  ATH_MSG_INFO("No InDetService Version. InDetService will not be built.");
66  ATH_MSG_DEBUG("InnerDetector Version Tag: " << versionKey.tag() << " at Node: " << versionKey.node());
67  return StatusCode::SUCCESS;
68  }
69 
70  ATH_MSG_DEBUG("Keys for InDetServMat Switches are " << versionKey.tag() << " " << versionKey.node());
71 
72  std::string versionName{"CSC"};
73  if (!m_overrideVersionName.empty()) {
74  versionName = m_overrideVersionName;
75  ATH_MSG_INFO("Overriding version name: " << versionName);
76  }
77  ATH_MSG_INFO("Building Inner Detector Service Material. Version: " << versionName);
78 
79  // Retrieve the Geometry DB Interface
80  ATH_CHECK(m_geometryDBSvc.retrieve());
81 
82  // Pass athena services to factory, etc
85  m_athenaComps.setRDBAccessSvc(accessSvc.get());
87 
88  // Retrieve builder tool (SLHC only)
89  if (versionName == "SLHC") {
90  if (!m_builderTool.empty()) {
91  if(m_builderTool.retrieve().isFailure()) {
92  ATH_MSG_WARNING("Could not retrieve " << m_builderTool << ", some services will not be built.");
93  }
94  else {
95  ATH_MSG_INFO("Service builder tool retrieved: " << m_builderTool);
97  }
98  }
99  else {
100  // This will become an error once the tool is ready.
101  ATH_MSG_INFO("Service builder tool not specified.");
102  }
103  }
104 
105  if (versionName == "CSC") {
106  ATH_MSG_DEBUG("InDetServMat Factory CSC");
108  theIDSM.create(world);
109  m_manager=theIDSM.getDetectorManager();
110  } else {
111  // Unrecognized name.
112  ATH_MSG_FATAL("Unrecognized VersionName: " << versionName);
113  return StatusCode::FAILURE;
114  }
115  }
116 
117  if (m_manager) {
118  theExpt->addManager(m_manager);
119  ATH_CHECK(detStore()->record (m_manager, m_manager->getName()));
120  }
121  else {
122  ATH_MSG_FATAL("Could not create InDetServMatManager!");
123  return StatusCode::FAILURE;
124  }
125 
126  return StatusCode::SUCCESS;
127 }

◆ manager() [1/2]

GeoVDetectorManager * GeoModelTool::manager ( )
virtualinherited

The Detector Node corresponding to this tool.

Definition at line 21 of file GeoModelTool.cxx.

21  {
22  return m_detector;
23 }

◆ manager() [2/2]

const GeoVDetectorManager * GeoModelTool::manager ( ) const
virtualinherited

Definition at line 24 of file GeoModelTool.cxx.

24  {
25  return m_detector;
26 }

Member Data Documentation

◆ m_athenaComps

InDetServMatAthenaComps InDetServMatTool::m_athenaComps {}
private

Definition at line 41 of file InDetServMatTool.h.

◆ m_builderTool

ToolHandle<IInDetServMatBuilderTool> InDetServMatTool::m_builderTool {this,"ServiceBuilderTool",""}
private

Definition at line 37 of file InDetServMatTool.h.

◆ m_detector

GeoVDetectorManager* GeoModelTool::m_detector
protectedinherited

Definition at line 36 of file GeoModelTool.h.

◆ m_geoDbTagSvc

ServiceHandle< IGeoDbTagSvc > InDetServMatTool::m_geoDbTagSvc {this,"GeoDbTagSvc","GeoDbTagSvc"}
private

Definition at line 35 of file InDetServMatTool.h.

◆ m_geometryDBSvc

ServiceHandle< IGeometryDBSvc > InDetServMatTool::m_geometryDBSvc {this,"GeometryDBSvc","InDetGeometryDBSvc"}
private

Definition at line 36 of file InDetServMatTool.h.

◆ m_manager

const InDetDD::InDetServMatManager* InDetServMatTool::m_manager {nullptr}
private

Definition at line 40 of file InDetServMatTool.h.

◆ m_overrideVersionName

StringProperty InDetServMatTool::m_overrideVersionName {this,"OverrideVersionName",""}
private

Definition at line 38 of file InDetServMatTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
InDetServMatTool::m_athenaComps
InDetServMatAthenaComps m_athenaComps
Definition: InDetServMatTool.h:41
InDetServMatFactory_Lite
Definition: InDetServMatFactory_Lite.h:13
GeoModelExperiment
Definition: GeoModelExperiment.h:32
GeoModelTool::GeoModelTool
GeoModelTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor(s)
Definition: GeoModelTool.cxx:12
InDetDD::AthenaComps::setGeoDbTagSvc
void setGeoDbTagSvc(IGeoDbTagSvc *)
Definition: InDetDDAthenaComps.cxx:22
InDetDD::AthenaComps::setDetStore
void setDetStore(StoreGateSvc *)
Definition: InDetDDAthenaComps.cxx:17
InDetServMatFactory
Definition: InDetServMatFactory.h:15
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DecodeVersionKey
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Definition: DecodeVersionKey.h:18
InDetServMatAthenaComps::setBuilderTool
void setBuilderTool(IInDetServMatBuilderTool *builderTool)
Definition: InDetServMatAthenaComps.cxx:15
ClassID_traits
Default, invalid implementation of ClassID_traits.
Definition: Control/AthenaKernel/AthenaKernel/ClassID_traits.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDetDD::AthenaComps::setRDBAccessSvc
void setRDBAccessSvc(IRDBAccessSvc *)
Definition: InDetDDAthenaComps.cxx:27
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDetServMatTool::m_geometryDBSvc
ServiceHandle< IGeometryDBSvc > m_geometryDBSvc
Definition: InDetServMatTool.h:36
InDetServMatTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: InDetServMatTool.h:35
InDetServMatTool::m_builderTool
ToolHandle< IInDetServMatBuilderTool > m_builderTool
Definition: InDetServMatTool.h:37
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
GeoModelTool::m_detector
GeoVDetectorManager * m_detector
Definition: GeoModelTool.h:36
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDetServMatTool::m_manager
const InDetDD::InDetServMatManager * m_manager
Definition: InDetServMatTool.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDetDD::AthenaComps::setGeometryDBSvc
void setGeometryDBSvc(IGeometryDBSvc *)
Definition: InDetDDAthenaComps.cxx:32
InDetServMatFactory_Lite::getDetectorManager
virtual const InDetDD::InDetServMatManager * getDetectorManager() const override
Definition: InDetServMatFactory_Lite.cxx:22
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
SG::DataProxy
Definition: DataProxy.h:45
InDetServMatTool::m_overrideVersionName
StringProperty m_overrideVersionName
Definition: InDetServMatTool.h:38
InDetServMatFactory_Lite::create
virtual void create(GeoPhysVol *world) override
Definition: InDetServMatFactory_Lite.cxx:11
ServiceHandle< IRDBAccessSvc >