ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
LUCID
LUCID_GeoModel
src
LUCID_DetectorTool.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 "
LUCID_DetectorTool.h
"
6
#include "
LUCID_DetectorFactory.h
"
7
#include "
LUCID_GeoModel/LUCID_DetectorManager.h
"
8
9
#include "
GeoModelInterfaces/IGeoDbTagSvc.h
"
10
#include "
GeoModelUtilities/GeoModelExperiment.h
"
11
#include "GaudiKernel/IService.h"
12
#include "GaudiKernel/ISvcLocator.h"
13
#include "GaudiKernel/MsgStream.h"
14
#include "
GeoModelUtilities/GeoBorderSurfaceContainer.h
"
15
16
#include "
StoreGate/StoreGateSvc.h
"
17
18
#include "
RDBAccessSvc/IRDBAccessSvc.h
"
19
#include "
AthenaKernel/ClassID_traits.h
"
20
#include "
SGTools/DataProxy.h
"
21
22
LUCID_DetectorTool::LUCID_DetectorTool
(
const
std::string&
type
,
23
const
std::string& name,
24
const
IInterface* parent):
25
GeoModelTool
(
type
, name, parent),
26
m_manager
(nullptr)
27
{
28
}
29
30
LUCID_DetectorTool::~LUCID_DetectorTool
() {}
31
32
StatusCode
LUCID_DetectorTool::create
() {
33
34
MsgStream log(msgSvc(), name());
35
36
ATH_MSG_INFO
(
"Building LUCID geometry"
);
37
38
ServiceHandle<IGeoDbTagSvc>
geoDbTag(
"GeoDbTagSvc"
, name());
39
ATH_CHECK
( geoDbTag.retrieve() );
40
41
ServiceHandle<IRDBAccessSvc>
raccess(
"RDBAccessSvc"
, name());
42
ATH_CHECK
( raccess.retrieve() );
43
44
const
std::string AtlasVersion = geoDbTag->atlasVersion();
45
const
std::string LucidVersion = raccess->getChildTag(
"LUCID"
,AtlasVersion,
"ATLAS"
);
46
47
if
(LucidVersion.empty()) {
48
ATH_MSG_DEBUG
(
"LUCID is not part of the selected ATLAS geometry. Skipping"
);
49
return
StatusCode::SUCCESS;
50
}
51
52
GeoModelExperiment
* theExpt =
nullptr
;
53
ATH_CHECK
( detStore()->retrieve(theExpt,
"ATLAS"
) );
54
55
if
(
nullptr
==
m_detector
) {
56
57
GeoPhysVol* world = &*theExpt->
getPhysVol
();
58
59
LUCID_DetectorFactory
theLUCID_Factory(detStore().
get
(),raccess.get());
60
61
theLUCID_Factory.
create
(world);
62
m_manager
= theLUCID_Factory.
getDetectorManager
();
63
theExpt->
addManager
(
m_manager
);
64
65
ATH_CHECK
( detStore()->record(
m_manager
,
m_manager
->getName()) );
66
return
StatusCode::SUCCESS;
67
}
68
69
return
StatusCode::FAILURE;
70
}
71
72
StatusCode
LUCID_DetectorTool::clear
() {
73
74
SG::DataProxy
* proxy = detStore()->proxy(
ClassID_traits<LUCID_DetectorManager>::ID
(),
m_manager
->getName());
75
76
if
(proxy) {
77
proxy->reset();
78
m_manager
=
nullptr
;
79
}
80
81
proxy = detStore()->proxy(
ClassID_traits<GeoBorderSurfaceContainer>::ID
(),
"LUCID"
,
false
);
82
83
if
(proxy) {
84
proxy->reset();
85
}
86
87
return
StatusCode::SUCCESS;
88
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ClassID_traits.h
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
DataProxy.h
GeoBorderSurfaceContainer.h
GeoModelExperiment.h
IGeoDbTagSvc.h
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
LUCID_DetectorFactory.h
LUCID_DetectorManager.h
LUCID_DetectorTool.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
LUCID_DetectorFactory
Definition
LUCID_DetectorFactory.h:23
LUCID_DetectorFactory::getDetectorManager
virtual const LUCID_DetectorManager * getDetectorManager() const
Definition
LUCID_DetectorFactory.cxx:418
LUCID_DetectorFactory::create
virtual void create(GeoPhysVol *)
Definition
LUCID_DetectorFactory.cxx:54
LUCID_DetectorTool::~LUCID_DetectorTool
virtual ~LUCID_DetectorTool() override final
Definition
LUCID_DetectorTool.cxx:30
LUCID_DetectorTool::m_manager
const LUCID_DetectorManager * m_manager
Definition
LUCID_DetectorTool.h:22
LUCID_DetectorTool::create
virtual StatusCode create() override final
Definition
LUCID_DetectorTool.cxx:32
LUCID_DetectorTool::clear
virtual StatusCode clear() override final
Definition
LUCID_DetectorTool.cxx:72
LUCID_DetectorTool::LUCID_DetectorTool
LUCID_DetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
LUCID_DetectorTool.cxx:22
SG::DataProxy
Definition
DataProxy.h:45
ServiceHandle
Definition
ClusterMakerTool.h:36
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition
hcg.cxx:132
ClassID_traits::ID
static constexpr CLID ID()
Definition
Control/AthenaKernel/AthenaKernel/ClassID_traits.h:44
type
Generated on
for ATLAS Offline Software by
1.17.0