ATLAS Offline Software
Loading...
Searching...
No Matches
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
7#include "GaudiKernel/EventContext.h"
10
12 ISvcLocator* pSvcLocator)
13 : AthCondAlgorithm(name, pSvcLocator)
14{
15}
16
18{
19 ATH_MSG_DEBUG("initialize " << name());
20
21 // Write Handle
23 // Retrieve tools
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
32StatusCode Trk::TrackingGeometryCondAlg::execute(const EventContext& ctx) const{
33 //Set up write handle
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.
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
Base class for conditions algorithms.
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
void addDependency(const EventIDRange &range)
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
virtual StatusCode execute(const EventContext &ctx) const override final
TrackingGeometryCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteCondHandleKey< TrackingGeometry > m_trackingGeometryWriteKey
Output conditions object.
ToolHandleArray< Trk::IGeometryProcessor > m_geometryProcessors
ToolHandle< Trk::IGeometryBuilderCond > m_trackingGeometryBuilder
virtual StatusCode initialize() override final