ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArGeoModel
LArGeoTBEC
src
LArDetectorToolTBEC.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArDetectorToolTBEC.h
"
6
#include "
LArDetectorFactoryTBEC.h
"
7
#include "
GeoModelUtilities/GeoModelExperiment.h
"
8
#include "GaudiKernel/IService.h"
9
#include "GaudiKernel/ISvcLocator.h"
10
#include "GaudiKernel/MsgStream.h"
11
#include "
StoreGate/StoreGateSvc.h
"
12
#include "
GeoModelInterfaces/IGeoDbTagSvc.h
"
13
#include "
RDBAccessSvc/IRDBAccessSvc.h
"
14
15
LArDetectorToolTBEC::LArDetectorToolTBEC
(
const
std::string&
type
,
16
const
std::string& name,
17
const
IInterface* parent)
18
:
GeoModelTool
(
type
,name,parent),
19
m_ecVisLimit
(-1)
20
{
21
declareProperty(
"ECVisLimit"
,
m_ecVisLimit
);
22
}
23
24
LArDetectorToolTBEC::~LArDetectorToolTBEC
()
25
=
default
;
26
27
StatusCode
LArDetectorToolTBEC::create
()
28
{
29
MsgStream log(msgSvc(), name());
30
31
// Get the detector configuration.
32
SmartIF<IGeoDbTagSvc> geoDbTag{Gaudi::svcLocator()->service(
"GeoDbTagSvc"
)};
33
ATH_CHECK
(geoDbTag.isValid());
34
35
std::string AtlasVersion = geoDbTag->atlasVersion();
36
std::string LArVersion = geoDbTag->LAr_VersionOverride();
37
38
SmartIF<IRDBAccessSvc> accessSvc{Gaudi::svcLocator()->service(
"RDBAccessSvc"
)};
39
ATH_CHECK
(accessSvc.isValid());
40
41
std::string detectorKey = LArVersion.empty() ? AtlasVersion : LArVersion;
42
std::string detectorNode = LArVersion.empty() ?
"ATLAS"
:
"LAr"
;
43
log << MSG::INFO <<
"Keys for LAr are "
<< detectorKey <<
" "
<< detectorNode <<
endmsg
;
44
45
46
log << MSG::INFO <<
"Creating the LAr "
<<
endmsg
;
47
log << MSG::INFO <<
"LAr Geometry Options:"
<<
endmsg
;
48
49
// Locate the top level experiment node
50
GeoModelExperiment
* theExpt =
nullptr
;
51
if
(StatusCode::SUCCESS != detStore()->retrieve( theExpt,
"ATLAS"
))
52
{
53
log << MSG::ERROR <<
"Could not find GeoModelExperiment ATLAS"
<<
endmsg
;
54
return
(StatusCode::FAILURE);
55
}
56
57
// determine the geometry layout - Atlas/Testbeam
58
std::string geometryLayout =
"Atlas"
;
59
std::string LArTag = accessSvc->getChildTag(
"LAr"
,detectorKey,detectorNode);
60
61
LArGeo::LArDetectorFactoryTBEC
theLArFactory;
62
63
theLArFactory.
setECVisLimit
(
m_ecVisLimit
);
64
65
66
if
(
nullptr
==
m_detector
)
67
{
68
GeoIntrusivePtr<GeoPhysVol>world=&*theExpt->
getPhysVol
();
69
theLArFactory.
create
(world);
70
71
if
(StatusCode::SUCCESS != detStore()->record(theLArFactory.
getDetectorManager
(),theLArFactory.
getDetectorManager
()->getName()))
72
{
73
log << MSG::ERROR <<
"Could not record"
<<
endmsg
;
74
return
(StatusCode::FAILURE);
75
}
76
77
theExpt->
addManager
(theLArFactory.
getDetectorManager
());
78
79
80
return
StatusCode::SUCCESS;
81
}
82
83
84
return
StatusCode::FAILURE;
85
}
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
GeoModelExperiment.h
IGeoDbTagSvc.h
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
LArDetectorFactoryTBEC.h
LArDetectorToolTBEC.h
StoreGateSvc.h
GeoModelExperiment
Definition
GeoModelExperiment.h:32
GeoModelExperiment::getPhysVol
GeoPhysVol * getPhysVol()
Destructor.
Definition
GeoModelExperiment.cxx:21
GeoModelExperiment::addManager
void addManager(const GeoVDetectorManager *)
Definition
GeoModelExperiment.cxx:40
GeoModelTool
Definition
GeoModelTool.h:15
GeoModelTool::m_detector
GeoVDetectorManager * m_detector
Definition
GeoModelTool.h:28
LArDetectorToolTBEC::~LArDetectorToolTBEC
virtual ~LArDetectorToolTBEC() override final
LArDetectorToolTBEC::create
virtual StatusCode create() override final
Definition
LArDetectorToolTBEC.cxx:27
LArDetectorToolTBEC::m_ecVisLimit
int m_ecVisLimit
Definition
LArDetectorToolTBEC.h:25
LArDetectorToolTBEC::LArDetectorToolTBEC
LArDetectorToolTBEC(const std::string &type, const std::string &name, const IInterface *parent)
Definition
LArDetectorToolTBEC.cxx:15
LArGeo::LArDetectorFactoryTBEC
Definition
LArDetectorFactoryTBEC.h:14
LArGeo::LArDetectorFactoryTBEC::getDetectorManager
virtual const LArDetectorManager * getDetectorManager() const override
Definition
LArDetectorFactoryTBEC.cxx:183
LArGeo::LArDetectorFactoryTBEC::setECVisLimit
void setECVisLimit(int maxCell)
Definition
LArDetectorFactoryTBEC.h:35
LArGeo::LArDetectorFactoryTBEC::create
virtual void create(GeoPhysVol *world) override
Definition
LArDetectorFactoryTBEC.cxx:40
type
Generated on
for ATLAS Offline Software by
1.17.0