ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkDetDescrSvc
src
TrackingVolumesSvc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// TrackingVolumesSvc.cxx, (c) ATLAS Detector software
8
9
// Trk
10
#include "
TrkDetDescrSvc/TrackingVolumesSvc.h
"
11
#include "
TrkVolumes/Volume.h
"
12
//#include "TrkVolumes/VolumesDummy.h"
13
#include "
TrkDetDescrInterfaces/IGeometryBuilder.h
"
14
#include "
TrkDetDescrUtils/BinnedArray.h
"
15
#include "
TrkGeometry/Layer.h
"
16
#include "
TrkGeometry/LayerMaterialProperties.h
"
17
#include "
TrkVolumes/CylinderVolumeBounds.h
"
18
// GaudiKernel && Control
19
#include "GaudiKernel/ISvcLocator.h"
20
#include "GaudiKernel/MsgStream.h"
21
#include "
StoreGate/StoreGateSvc.h
"
22
24
Trk::TrackingVolumesSvc::TrackingVolumesSvc
(
const
std::string& a_name,ISvcLocator* svc) :
25
base_class(a_name,svc),
26
m_pDetStore
(
"DetectorStore"
,name())
27
{
28
29
//set defaults
30
m_volumeNames
.reserve(
Trk::ITrackingVolumesSvc::NumIdentifiers
);
31
m_volumeNames
.emplace_back(
"CalorimeterEntryLayer"
);
32
m_volumeNames
.emplace_back(
"MuonSpectrometerEntryLayer"
);
33
m_volumeNames
.emplace_back(
"MuonSpectrometerExitLayer"
);
34
35
// For the moment, assuming volumes are at 0,0,0 and perfectly aligned (i.e. passing 0)
36
// Adding values by hand - this should be changed (i.e. retrieved from a database?)
37
// EJWM
38
39
m_volumes
.resize(
Trk::ITrackingVolumesSvc::NumIdentifiers
);
40
m_volumes
[
Trk::ITrackingVolumesSvc::CalorimeterEntryLayer
]
41
=
new
Trk::Volume
(
nullptr
, std::make_shared<Trk::CylinderVolumeBounds>(1100.0, 3200.0));
42
m_volumes
[
Trk::ITrackingVolumesSvc::MuonSpectrometerEntryLayer
]
43
=
new
Trk::Volume
(
nullptr
, std::make_shared<Trk::CylinderVolumeBounds>(4250.0, 6779.0));
44
m_volumes
[
Trk::ITrackingVolumesSvc::MuonSpectrometerExitLayer
]
45
=
new
Trk::Volume
(
nullptr
, std::make_shared<Trk::CylinderVolumeBounds>(15000.0, 21000.0));
// FIXME! Put in correct values. EJWM
46
47
// the name of the TrackingVolume to be built --------------------------------
48
//declareProperty( "VolumeNames", m_volumeNames, "The names of the TrackingVolume to be built");
49
// EJWM - no point configuring this if the volume dimensions can't be configured. EJWM.
50
51
}
52
53
55
Trk::TrackingVolumesSvc::~TrackingVolumesSvc
()
56
=
default
;
57
59
StatusCode
Trk::TrackingVolumesSvc::initialize
()
60
{
61
ATH_CHECK
( AthService::initialize());
62
63
// get the DetectorStore
64
ATH_CHECK
(
m_pDetStore
.retrieve() );
65
66
// record the volumes
67
for
(
unsigned
int
id
=0 ;
id
!=
ITrackingVolumesSvc::NumIdentifiers
;
id
++){
68
// create Volume.
69
StatusCode result =
m_pDetStore
->record(
m_volumes
[
id
],
m_volumeNames
[
id
]);
70
if
(result.isFailure()){
71
ATH_MSG_FATAL
(
"Couldn't write Volume "
<<
m_volumeNames
[
id
]<<
" to DetectorStore."
);
72
return
result;
73
}
else
{
74
ATH_MSG_INFO
(
"initialize() successful: TrackingVolume '"
<<
m_volumeNames
[
id
] <<
"' built and written to DetectorStore."
);
75
}
76
}
77
78
ATH_MSG_INFO
(
"initialize() successful! "
);
79
80
return
StatusCode::SUCCESS;
81
}
82
84
StatusCode
Trk::TrackingVolumesSvc::finalize
()
85
{
86
ATH_MSG_INFO
(
"finalize() successful."
);
87
return
StatusCode::SUCCESS;
88
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
BinnedArray.h
CylinderVolumeBounds.h
IGeometryBuilder.h
LayerMaterialProperties.h
Layer.h
StoreGateSvc.h
TrackingVolumesSvc.h
Volume.h
Trk::ITrackingVolumesSvc::NumIdentifiers
@ NumIdentifiers
Definition
ITrackingVolumesSvc.h:42
Trk::ITrackingVolumesSvc::MuonSpectrometerExitLayer
@ MuonSpectrometerExitLayer
Tracking Volume which defines the outer surfaces of the MS.
Definition
ITrackingVolumesSvc.h:41
Trk::ITrackingVolumesSvc::CalorimeterEntryLayer
@ CalorimeterEntryLayer
Tracking Volume which defines the entrance srufaces of the calorimeter.
Definition
ITrackingVolumesSvc.h:39
Trk::ITrackingVolumesSvc::MuonSpectrometerEntryLayer
@ MuonSpectrometerEntryLayer
Tracking Volume which defines the entrance surfaces of the MS.
Definition
ITrackingVolumesSvc.h:40
Trk::TrackingVolumesSvc::TrackingVolumesSvc
TrackingVolumesSvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
Definition
TrackingVolumesSvc.cxx:24
Trk::TrackingVolumesSvc::initialize
virtual StatusCode initialize() override
Initialize Service.
Definition
TrackingVolumesSvc.cxx:59
Trk::TrackingVolumesSvc::finalize
virtual StatusCode finalize() override
Finalize Service.
Definition
TrackingVolumesSvc.cxx:84
Trk::TrackingVolumesSvc::~TrackingVolumesSvc
virtual ~TrackingVolumesSvc()
Standard Destructor.
Trk::TrackingVolumesSvc::m_volumeNames
std::vector< std::string > m_volumeNames
the names of the TrackingVolumes
Definition
TrackingVolumesSvc.h:65
Trk::TrackingVolumesSvc::m_volumes
std::vector< const Trk::Volume * > m_volumes
Definition
TrackingVolumesSvc.h:63
Trk::TrackingVolumesSvc::m_pDetStore
ServiceHandle< StoreGateSvc > m_pDetStore
the cached volumes
Definition
TrackingVolumesSvc.h:60
Trk::Volume
Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume c...
Definition
Volume.h:36
Generated on
for ATLAS Offline Software by
1.17.0