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

#include <LArDetectorToolH62002.h>

Inheritance diagram for LArDetectorToolH62002:
Collaboration diagram for LArDetectorToolH62002:

Public Member Functions

 LArDetectorToolH62002 (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor(s) More...
 
virtual ~LArDetectorToolH62002 () override final
 Destructor. More...
 
virtual StatusCode create () override final
 Create the Detector Node corresponding to this tool. More...
 
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 LArDetectorToolH62002.h.

Constructor & Destructor Documentation

◆ LArDetectorToolH62002()

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

Constructor(s)

Definition at line 26 of file LArDetectorToolH62002.cxx.

28 {
29 }

◆ ~LArDetectorToolH62002()

LArDetectorToolH62002::~LArDetectorToolH62002 ( )
finaloverridevirtual

Destructor.

Definition at line 34 of file LArDetectorToolH62002.cxx.

35 {
36  // This will need to be modified once we register the Toy DetectorNode in
37  // the Transient Detector Store
38  if ( nullptr != m_detector ) {
39  delete m_detector;
40  m_detector = nullptr;
41  }
42 }

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 LArDetectorToolH62002::create ( )
finaloverridevirtual

Create the Detector Node corresponding to this tool.

Definition at line 48 of file LArDetectorToolH62002.cxx.

49 {
50  MsgStream log(msgSvc(), name());
51 
52  // Get the detector configuration.
53  IGeoDbTagSvc *geoDbTag;
54  ATH_CHECK(service ("GeoModelSvc",geoDbTag));
55 
56  std::string AtlasVersion = geoDbTag->atlasVersion();
57  std::string LArVersion = geoDbTag->LAr_VersionOverride();
58 
59  IRDBAccessSvc *accessSvc;
60  ATH_CHECK(service("RDBAccessSvc",accessSvc));
61 
62  std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
63  std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
64  log << MSG::INFO << "Keys for LAr are " << detectorKey << " " << detectorNode << endmsg;
65 
66 
67  log << MSG::INFO << "Creating the LAr " << endmsg;
68  log << MSG::INFO << "LAr Geometry Options:" << endmsg;
69 
70  //
71  // Locate the top level experiment node
72  //
73  GeoModelExperiment* theExpt = nullptr;
74  if (StatusCode::SUCCESS != detStore()->retrieve( theExpt, "ATLAS" )) {
75  log << MSG::ERROR
76  << "Could not find GeoModelExperiment ATLAS"
77  << endmsg;
78  return (StatusCode::FAILURE);
79  }
80 
81 
82  // determine the geometry layout - Atlas/Testbeam
83  std::string geometryLayout = "Atlas";
84  std::string LArTag = accessSvc->getChildTag("LAr",detectorKey,detectorNode);
85 
86  //if(LArTag.find("H6")!=std::string::npos) {
87  // geometryLayout = "H6";
88  //}
89 
90 
91  LArGeo::LArDetectorFactoryH62002 theLArFactory(detStore().operator->());
92 
93 
94 
95 
96 
97  if ( nullptr == m_detector ) {
98  // Create the H62002Node instance
99  try {
100  //
101  // This strange way of casting is to avoid an
102  // utterly brain damaged compiler warning.
103  //
104  GeoIntrusivePtr<GeoPhysVol>world=&*theExpt->getPhysVol();
105  theLArFactory.create(world);
106  } catch (const std::bad_alloc&) {
107  log << MSG::FATAL << "Could not create new H62002Node!" << endmsg;
108  return StatusCode::FAILURE;
109  }
110  // Register the H62002Node instance with the Transient Detector Store
111  theExpt->addManager(theLArFactory.getDetectorManager());
112  ATH_CHECK(detStore()->record(theLArFactory.getDetectorManager(),
113  theLArFactory.getDetectorManager()->getName()));
114 
115 
116  return StatusCode::SUCCESS;
117 
118 
119  }
120 
121 
122  return StatusCode::FAILURE;
123 }

◆ 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
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
IGeoDbTagSvc::LAr_VersionOverride
virtual const std::string & LAr_VersionOverride() const =0
LArGeo::LArDetectorFactoryH62002
Definition: LArDetectorFactoryH62002.h:17
EventInfoWrite.AtlasVersion
AtlasVersion
Definition: EventInfoWrite.py:17
IRDBAccessSvc::getChildTag
virtual std::string getChildTag(const std::string &childNode, const std::string &parentTag, const std::string &parentNode, const std::string &connName="ATLASDD")=0
Gets the tag name for the node by giving its parent node tag.
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
IRDBAccessSvc
IRDBAccessSvc is an abstract interface to the athena service that provides the following functionalit...
Definition: IRDBAccessSvc.h:45
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IGeoDbTagSvc
Definition: IGeoDbTagSvc.h:26
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
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IGeoDbTagSvc::atlasVersion
virtual const std::string & atlasVersion() const =0
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20