ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkConditions
TrackingGeometryCondAlg
src
TrackingGeometryCondAlg.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#include "
TrkGeometry/TrackingGeometry.h
"
7
#include "GaudiKernel/EventContext.h"
8
#include "
AthenaKernel/IOVInfiniteRange.h
"
9
#include "
TrackingGeometryCondAlg/TrackingGeometryCondAlg.h
"
10
11
Trk::TrackingGeometryCondAlg::TrackingGeometryCondAlg
(
const
std::string& name,
12
ISvcLocator* pSvcLocator)
13
:
AthCondAlgorithm
(name, pSvcLocator)
14
{
15
}
16
17
StatusCode
Trk::TrackingGeometryCondAlg::initialize
()
18
{
19
ATH_MSG_DEBUG
(
"initialize "
<< name());
20
21
// Write Handle
22
ATH_CHECK
(
m_trackingGeometryWriteKey
.initialize());
23
// Retrieve tools
24
ATH_CHECK
(
m_trackingGeometryBuilder
.retrieve());
25
if
(
m_geometryProcessors
.retrieve().isFailure()){
26
ATH_MSG_FATAL
(
"Could not retrieve "
<<
m_geometryProcessors
);
27
return
StatusCode::FAILURE;
28
}
29
return
StatusCode::SUCCESS;
30
}
31
32
StatusCode
Trk::TrackingGeometryCondAlg::execute
(
const
EventContext& ctx)
const
{
33
//Set up write handle
34
SG::WriteCondHandle<Trk::TrackingGeometry>
writeHandle{
m_trackingGeometryWriteKey
, ctx};
35
if
(writeHandle.
isValid
()) {
36
ATH_MSG_DEBUG
(
"Found valid write handle"
);
37
return
StatusCode::SUCCESS;
38
}
39
40
// Start with infinite range and let the TG builder narrow it down.
41
writeHandle.
addDependency
(
IOVInfiniteRange::infiniteMixed
());
42
43
std::unique_ptr<Trk::TrackingGeometry> trackingGeometry =
44
m_trackingGeometryBuilder
->trackingGeometry(ctx,
nullptr
, writeHandle);
45
46
// loop over the recursive geometry processors
47
auto
gpIter =
m_geometryProcessors
.begin();
48
auto
gpIterE =
m_geometryProcessors
.end();
49
for
(; gpIter != gpIterE; ++gpIter) {
50
if
((*gpIter)->process(*trackingGeometry).isFailure()) {
51
ATH_MSG_FATAL
(
"Processing of TrackingGeometry did not succeed. Abort."
);
52
return
StatusCode::FAILURE;
53
}
else
{
54
ATH_MSG_VERBOSE
(
"Successfully processed the TrackingGeometry with "
55
<< (*gpIter));
56
}
57
}
58
if
(
m_dumpGeo
) trackingGeometry->dump(msgStream(),
"TrackingGeometryCondAlg"
);
59
ATH_CHECK
(writeHandle.
record
(std::move(trackingGeometry)));
60
61
return
StatusCode::SUCCESS;
62
}
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_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
IOVInfiniteRange.h
TrackingGeometryCondAlg.h
TrackingGeometry.h
AthCondAlgorithm
Base class for conditions algorithms.
Definition
AthCondAlgorithm.h:22
IOVInfiniteRange::infiniteMixed
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
Definition
IOVInfiniteRange.h:55
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition
WriteCondHandle.h:279
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition
WriteCondHandle.h:161
SG::WriteCondHandle::isValid
bool isValid() const
Definition
WriteCondHandle.h:252
Trk::TrackingGeometryCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition
TrackingGeometryCondAlg.cxx:32
Trk::TrackingGeometryCondAlg::TrackingGeometryCondAlg
TrackingGeometryCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TrackingGeometryCondAlg.cxx:11
Trk::TrackingGeometryCondAlg::m_trackingGeometryWriteKey
SG::WriteCondHandleKey< TrackingGeometry > m_trackingGeometryWriteKey
Output conditions object.
Definition
TrackingGeometryCondAlg.h:33
Trk::TrackingGeometryCondAlg::m_dumpGeo
Gaudi::Property< bool > m_dumpGeo
Definition
TrackingGeometryCondAlg.h:46
Trk::TrackingGeometryCondAlg::m_geometryProcessors
ToolHandleArray< Trk::IGeometryProcessor > m_geometryProcessors
Definition
TrackingGeometryCondAlg.h:45
Trk::TrackingGeometryCondAlg::m_trackingGeometryBuilder
ToolHandle< Trk::IGeometryBuilderCond > m_trackingGeometryBuilder
Definition
TrackingGeometryCondAlg.h:39
Trk::TrackingGeometryCondAlg::initialize
virtual StatusCode initialize() override final
Definition
TrackingGeometryCondAlg.cxx:17
Generated on
for ATLAS Offline Software by
1.17.0