ATLAS Offline Software
LArDetectorToolH62003.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include "GaudiKernel/IService.h"
9 #include "GaudiKernel/ISvcLocator.h"
10 #include "GaudiKernel/MsgStream.h"
11 #include "StoreGate/StoreGateSvc.h"
16 
18  const std::string& name,
19  const IInterface* parent)
21  m_fcalVisLimit(-1),
22  m_axisVisState(-1)
23 {
24  declareProperty("FCALVisLimit", m_fcalVisLimit);
25  declareProperty("axisVisState", m_axisVisState=false);
26 }
27 
29 = default;
30 
32 {
33  MsgStream log(msgSvc(), name());
34 
35  // Get the detector configuration.
36  IGeoDbTagSvc *geoDbTag;
37  ATH_CHECK(service ("GeoDbTagSvc",geoDbTag));
38 
39  std::string AtlasVersion = geoDbTag->atlasVersion();
40  std::string LArVersion = geoDbTag->LAr_VersionOverride();
41 
42  IRDBAccessSvc *accessSvc;
43  ATH_CHECK(service("RDBAccessSvc",accessSvc));
44 
45  std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
46  std::string detectorNode = LArVersion.empty() ? "ATLAS" : "LAr";
47 
48  log << MSG::INFO << "Keys for LAr are " << detectorKey << " " << detectorNode << endmsg;
49 
50  log << MSG::INFO << "Creating the LAr " << endmsg;
51  log << MSG::INFO << "LAr Geometry Options:" << endmsg;
52 
53  // Locate the top level experiment node
54  GeoModelExperiment* theExpt = nullptr;
55  if (StatusCode::SUCCESS != detStore()->retrieve( theExpt, "ATLAS" ))
56  {
57  log << MSG::ERROR << "Could not find GeoModelExperiment ATLAS" << endmsg;
58  return (StatusCode::FAILURE);
59  }
60 
61  // determine the geometry layout - Atlas/Testbeam
62  std::string geometryLayout = "Atlas";
63  std::string LArTag = accessSvc->getChildTag("LAr",detectorKey,detectorNode);
64 
65  //if(LArTag.find("H6")!=std::string::npos) {
66  // geometryLayout = "H6";
67  //}
69 
70  theLArFactory.setFCALVisLimit (m_fcalVisLimit);
71  theLArFactory.setAxisVisState(m_axisVisState);
72 
73 
74  if (nullptr == m_detector)
75  {
76  GeoIntrusivePtr<GeoPhysVol>world=&*theExpt->getPhysVol();
77  theLArFactory.create(world);
78 
79  if (StatusCode::SUCCESS != detStore()->record(theLArFactory.getDetectorManager(),theLArFactory.getDetectorManager()->getName()))
80  {
81  log << MSG::ERROR << "Could not record" << endmsg;
82  return (StatusCode::FAILURE);
83  }
84 
85  theExpt->addManager(theLArFactory.getDetectorManager());
86  return StatusCode::SUCCESS;
87  }
88 
89  return StatusCode::FAILURE;
90 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition: GeoModelExperiment.cxx:21
LArGeo::LArDetectorFactoryH62003::create
virtual void create(GeoPhysVol *world)
Definition: LArDetectorFactoryH62003.cxx:39
GeoModelExperiment
Definition: GeoModelExperiment.h:32
IGeoDbTagSvc::LAr_VersionOverride
virtual const std::string & LAr_VersionOverride() const =0
GeoModelExperiment.h
EventInfoWrite.AtlasVersion
AtlasVersion
Definition: EventInfoWrite.py:17
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
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
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArGeo::LArDetectorFactoryH62003::setFCALVisLimit
void setFCALVisLimit(int maxCell)
Definition: LArDetectorFactoryH62003.h:31
LArDetectorToolH62003::create
virtual StatusCode create() override final
Definition: LArDetectorToolH62003.cxx:31
test_pyathena.parent
parent
Definition: test_pyathena.py:15
GeoModelTool
Definition: GeoModelTool.h:17
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IGeoDbTagSvc
Definition: IGeoDbTagSvc.h:26
LArGeo::LArDetectorFactoryH62003::setAxisVisState
void setAxisVisState(bool axis)
Definition: LArDetectorFactoryH62003.h:32
LArDetectorFactoryH62003.h
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
LArGeo::LArDetectorFactoryH62003
Definition: LArDetectorFactoryH62003.h:13
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition: GeoModelExperiment.cxx:40
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
LArDetectorToolH62003::LArDetectorToolH62003
LArDetectorToolH62003(const std::string &type, const std::string &name, const IInterface *parent)
Definition: LArDetectorToolH62003.cxx:17
LArDetectorToolH62003::m_fcalVisLimit
int m_fcalVisLimit
Definition: LArDetectorToolH62003.h:25
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IGeoDbTagSvc::atlasVersion
virtual const std::string & atlasVersion() const =0
LArDetectorToolH62003::m_axisVisState
bool m_axisVisState
Definition: LArDetectorToolH62003.h:26
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
LArGeo::LArDetectorFactoryH62003::getDetectorManager
virtual const LArDetectorManager * getDetectorManager() const
Definition: LArDetectorFactoryH62003.cxx:116
StoreGateSvc.h
LArDetectorToolH62003.h
IGeoDbTagSvc.h
LArDetectorToolH62003::~LArDetectorToolH62003
virtual ~LArDetectorToolH62003() override final