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

#include <ZDC_DetTool.h>

Inheritance diagram for ZDC_DetTool:
Collaboration diagram for ZDC_DetTool:

Public Member Functions

 ZDC_DetTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~ZDC_DetTool () override final
 
virtual StatusCode create () override final
 
virtual GeoVDetectorManager * manager ()
 The Detector Node corresponding to this tool. More...
 
virtual const GeoVDetectorManager * manager () const
 
virtual StatusCode clear () override
 
virtual StatusCode registerCallback ATLAS_NOT_THREAD_SAFE () override
 
virtual StatusCode align (IOVSVC_CALLBACK_ARGS) override
 

Protected Attributes

GeoVDetectorManager * m_detector
 

Detailed Description

Definition at line 10 of file ZDC_DetTool.h.

Constructor & Destructor Documentation

◆ ZDC_DetTool()

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

Definition at line 15 of file ZDC_DetTool.cxx.

17 {
18 
19  if (msgLevel(MSG::DEBUG))
20  msg(MSG::DEBUG) << "INSIDE CONSTRUCTOR OF DETTOOL" << endmsg
21  << "INSIDE CONSTRUCTOR OF DETTOOL string& type " << type << endmsg
22  << "INSIDE CONSTRUCTOR OF DETTOOL std::string& name " << name << endmsg;
23 }

◆ ~ZDC_DetTool()

ZDC_DetTool::~ZDC_DetTool ( )
finaloverridevirtual

Definition at line 25 of file ZDC_DetTool.cxx.

26 {
27  // This will need to be modified once we register the Toy DetectorNode in the Transient Detector Store
28 
29  if (nullptr != m_detector) {
30 
31  delete m_detector;
32  m_detector = nullptr;
33  }
34 }

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 GeoModelTool::clear ( )
overridevirtualinherited

◆ create()

StatusCode ZDC_DetTool::create ( )
finaloverridevirtual

Definition at line 36 of file ZDC_DetTool.cxx.

37 {
38 
39  // Locate the top level experiment node
40  GeoModelExperiment* theExpt = nullptr;
41 
42  ATH_CHECK( detStore()->retrieve(theExpt, "ATLAS") );
43 
44  ZDC_DetFactory theZDCFactory(detStore().operator->());
45 
46  ServiceHandle<IGeoDbTagSvc> geoDbTag("GeoDbTagSvc", name());
47  ATH_CHECK( geoDbTag.retrieve() );
48 
49  GeoModel::GeoConfig geoConfig = geoDbTag->geoConfig();
50 
51  //Set the geometry configuration
52  if(geoConfig==GeoModel::GEO_RUN2){
53  ATH_MSG_INFO("Initializing ZDC geometry for PbPb2015");
54  theZDCFactory.initializePbPb2015();
55  }else if(geoConfig==GeoModel::GEO_RUN3){
56  ATH_MSG_INFO("Initializing ZDC geometry for PbPb2023");
57  theZDCFactory.initializePbPb2023();
58  }else if(geoConfig==GeoModel::GEO_RUN4){
59  ATH_MSG_ERROR("No ZDC geometry defined for RUN4");
60  }
61 
62  if (nullptr == m_detector) { // Create the ZDCDetectorNode instance
63 
64  try {
65  // This strange way of casting is to avoid an utterly brain damaged compiler warning.
66  GeoPhysVol* world = &*theExpt->getPhysVol();
67  theZDCFactory.create(world);
68  }
69  catch (const std::bad_alloc&) {
70 
71  ATH_MSG_FATAL("Could not create new ZDC DetectorNode!");
72  return StatusCode::FAILURE;
73  }
74 
75  // Register the ZDC DetectorNode instance with the Transient Detector Store
76  theExpt->addManager(theZDCFactory.getDetectorManager());
77  ATH_CHECK( detStore()->record(theZDCFactory.getDetectorManager(),theZDCFactory.getDetectorManager()->getName()) );
78  }
79 
80  return StatusCode::SUCCESS;
81 }

◆ 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_detector

GeoVDetectorManager* GeoModelTool::m_detector
protectedinherited

Definition at line 36 of file GeoModelTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
GeoModel::GeoConfig
GeoConfig
Definition: IGeoDbTagSvc.h:17
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
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
test_pyathena.parent
parent
Definition: test_pyathena.py:15
GeoModel::GEO_RUN4
@ GEO_RUN4
Definition: IGeoDbTagSvc.h:21
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
GeoModel::GEO_RUN3
@ GEO_RUN3
Definition: IGeoDbTagSvc.h:20
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
GeoModel::GEO_RUN2
@ GEO_RUN2
Definition: IGeoDbTagSvc.h:19
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
ZDC_DetFactory
Definition: ZDC_DetFactory.h:24
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DEBUG
#define DEBUG
Definition: page_access.h:11
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
ServiceHandle< IGeoDbTagSvc >