ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkDetDescr
TrkDetDescrUnitTests
src
TrackingGeometryTest.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// TrackingGeometryTest.cxx, (c) ATLAS Detector software
8
9
// Trk includes
10
#include "
TrkDetDescrUnitTests/TrackingGeometryTest.h
"
11
#include "
TrkDetDescrInterfaces/IGeometryProcessor.h
"
12
#include "
TrkGeometry/Layer.h
"
13
#include "
TrkGeometry/TrackingGeometry.h
"
14
#include "
TrkGeometry/TrackingVolume.h
"
15
16
// monitor memory usage
17
#ifdef TRKDETDESCR_MEMUSAGE
18
#include <unistd.h>
19
#endif
20
21
22
StatusCode
Trk::TrackingGeometryTest::initializeTest
()
23
{
24
#ifdef TRKDETDESCR_MEMUSAGE
25
m_memoryLogger.refresh(getpid());
26
ATH_MSG_INFO
(
"[ memory usage ] Memory monitoring activated through TRKDETDESCR_MEMUSAGE "
);
27
ATH_MSG_INFO
(
"[ memory usage ] initialize (start) : "
);
28
ATH_MSG_INFO
( m_memoryLogger );
29
#endif
30
31
// Get the TrackingGeometry from StoreGate
32
// initialize the TrackingGeometrySvc
33
if
(
m_trackingGeometrySvc
.retrieve().isFailure()) {
34
ATH_MSG_FATAL
(
"Cannot retrieve TrackingGeometrySvc. Abort job. "
);
35
return
StatusCode::FAILURE;
36
}
37
m_trackingGeometryName
=
m_trackingGeometrySvc
->trackingGeometryName();
38
39
// The Processors -------------------------------------------------------------
40
if
(
m_trackingGeometryProcessors
.retrieve().isFailure())
41
{
42
ATH_MSG_FATAL
(
"Failed to retrieve tool(s) in "
<<
m_trackingGeometryProcessors
);
43
return
StatusCode::FAILURE;
44
}
else
45
ATH_MSG_INFO
(
"Retrieved tools : "
<<
m_trackingGeometryProcessors
);
46
47
#ifdef TRKDETDESCR_MEMUSAGE
48
m_memoryLogger.refresh(getpid());
49
ATH_MSG_INFO
(
"[ memory usage ] initialize (end) : "
);
50
ATH_MSG_INFO
( m_memoryLogger );
51
#endif
52
53
return
StatusCode::SUCCESS;
54
}
55
56
57
StatusCode
Trk::TrackingGeometryTest::runTest
()
58
{
59
ATH_MSG_VERBOSE
(
"Running the TrackingGeometryTest Test"
);
60
61
// ------------------------------- get the trackingGeometry at first place
62
if
(!
m_trackingGeometry
) {
63
if
((
detStore
()->retrieve(
m_trackingGeometry
,
m_trackingGeometryName
)).isFailure())
64
ATH_MSG_FATAL
(
"Could not retrieve TrackingGeometry '"
<<
m_trackingGeometryName
<<
"' from DetectorStore."
);
65
else
66
ATH_MSG_INFO
(
"TrackingGeometry '"
<<
m_trackingGeometryName
<<
"' successfully retrieved from DetectorStore."
);
67
}
68
// only run if it didn't already run before
69
if
(!
m_executed
&&
m_trackingGeometry
){
70
// push the geometry through the different processors
71
for
(ToolHandle<Trk::IGeometryProcessor> proc :
m_trackingGeometryProcessors
) {
72
ATH_MSG_INFO
(
"Parse geometry with processor "
<< proc->name() );
73
//test so const_cast prb fine
74
if
((proc->process(
const_cast<
Trk::TrackingGeometry
&
>
(*
m_trackingGeometry
))).isFailure()){
75
ATH_MSG_FATAL
(
"Could not process the TrackingGeometry with '"
<< proc->name() <<
"'. Aborting test."
);
76
return
StatusCode::FAILURE;
77
}
78
}
79
m_executed
=
true
;
80
}
81
return
StatusCode::SUCCESS;
82
83
}
84
85
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x,...)
Definition
AthMsgStreamMacros.h:42
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x,...)
Definition
AthMsgStreamMacros.h:48
IGeometryProcessor.h
Layer.h
TrackingGeometryTest.h
TrackingGeometry.h
TrackingVolume.h
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
Trk::TrackingGeometryTest::m_trackingGeometry
const TrackingGeometry * m_trackingGeometry
The TrackingGeometry to be retrieved.
Definition
TrackingGeometryTest.h:59
Trk::TrackingGeometryTest::m_trackingGeometryProcessors
ToolHandleArray< Trk::IGeometryProcessor > m_trackingGeometryProcessors
Definition
TrackingGeometryTest.h:62
Trk::TrackingGeometryTest::initializeTest
StatusCode initializeTest()
Definition
TrackingGeometryTest.cxx:22
Trk::TrackingGeometryTest::m_trackingGeometrySvc
ServiceHandle< Trk::ITrackingGeometrySvc > m_trackingGeometrySvc
Definition
TrackingGeometryTest.h:57
Trk::TrackingGeometryTest::runTest
StatusCode runTest()
Definition
TrackingGeometryTest.cxx:57
Trk::TrackingGeometryTest::m_trackingGeometryName
std::string m_trackingGeometryName
Definition
TrackingGeometryTest.h:60
Trk::TrackingGeometryTest::m_executed
bool m_executed
Make sure it only runs once.
Definition
TrackingGeometryTest.h:54
Trk::TrackingGeometry
The TrackingGeometry class is the owner of the constructed TrackingVolumes.
Definition
TrackingGeometry.h:68
Generated on
for ATLAS Offline Software by
1.17.0