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  if (msgLevel(MSG::DEBUG)) msg(MSG::DEBUG) << " Building ZDC geometry " << endmsg;
39 
40  // Locate the top level experiment node
41  GeoModelExperiment* theExpt = nullptr;
42 
43  if (StatusCode::SUCCESS != detStore()->retrieve(theExpt, "ATLAS")) {
44 
45  if (msgLevel(MSG::ERROR)) msg(MSG::ERROR) << " Could not find GeoModelExperiment ATLAS " << endmsg;
46  return (StatusCode::FAILURE);
47  }
48 
49 
50  ZDC_DetFactory theZDCFactory(detStore().operator->());
51 
52  IGeoDbTagSvc *geoDbTag;
53  StatusCode sc = service ("GeoDbTagSvc",geoDbTag);
54  if (sc.isFailure()) {
55  msg(MSG::FATAL) << "Could not locate GeoDbTagSvc" << endmsg;
56  return StatusCode::FAILURE;
57  }
58 
59  GeoModel::GeoConfig geoConfig = geoDbTag->geoConfig();
60 
61  //Set the geometry configuration
62  if(geoConfig==GeoModel::GEO_RUN2){
63  msg(MSG::INFO) << "Initializing ZDC geometry for PbPb2015" << endmsg;
64  theZDCFactory.initializePbPb2015();
65  }else if(geoConfig==GeoModel::GEO_RUN3){
66  msg(MSG::INFO) << "Initializing ZDC geometry for PbPb2023" << endmsg;
67  theZDCFactory.initializePbPb2023();
68  }else if(geoConfig==GeoModel::GEO_RUN4){
69  msg(MSG::ERROR) << "No ZDC geometry defined for RUN4" << endmsg;
70  }
71 
72  if (nullptr == m_detector) { // Create the ZDCDetectorNode instance
73 
74  try {
75  // This strange way of casting is to avoid an utterly brain damaged compiler warning.
76  GeoPhysVol* world = &*theExpt->getPhysVol();
77  theZDCFactory.create(world);
78  }
79  catch (const std::bad_alloc&) {
80 
81  if (msgLevel(MSG::FATAL)) msg(MSG::FATAL) << "Could not create new ZDC DetectorNode!" << endmsg;
82  return StatusCode::FAILURE;
83  }
84 
85  // Register the ZDC DetectorNode instance with the Transient Detector Store
86  theExpt->addManager(theZDCFactory.getDetectorManager());
87  if(detStore()->record(theZDCFactory.getDetectorManager(),theZDCFactory.getDetectorManager()->getName())==StatusCode::SUCCESS){
88  return StatusCode::SUCCESS;}
89  else{
90  msg(MSG::FATAL) << "Could not register ZDC detector manager" << endmsg;}
91 
92  }
93 
94  return StatusCode::FAILURE;
95 }

◆ 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
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
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
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
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
GeoModel::GEO_RUN4
@ GEO_RUN4
Definition: IGeoDbTagSvc.h:21
IGeoDbTagSvc
Definition: IGeoDbTagSvc.h:26
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:195
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