ATLAS Offline Software
Loading...
Searching...
No Matches
TrackingGeometryCondAlgTest.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#include "GaudiKernel/ISvcLocator.h"
6
7
8// Trk includes
10#include "TrkGeometry/Layer.h"
11
12
13Trk::TrackingGeometryCondAlgTest::TrackingGeometryCondAlgTest(const std::string& name, ISvcLocator* pSvcLocator)
14 : AthCondAlgorithm(name, pSvcLocator),
15 m_trackingGeometrySvc("AtlasTrackingGeometrySvc", name),
17{
18 declareProperty("GeometryProcessors", m_trackingGeometryProcessors);
19}
20
22{
23 ATH_MSG_DEBUG("initialize " << name());
24
25 // Read Handle Key
27
28
31 return StatusCode::SUCCESS;
32}
33
34StatusCode Trk::TrackingGeometryCondAlgTest::execute(const EventContext& ctx) const {
35
36 //Set up read handle
38 if (!readHandle.isValid() || *readHandle == nullptr) {
39 ATH_MSG_WARNING(m_trackingGeometryReadKey.fullKey() << " is not available.");
40 return StatusCode::FAILURE;
41 }
42 const Trk::TrackingGeometry* trkGeom = *readHandle;
43 ATH_MSG_INFO( "eventID: " << ctx.eventID());
44 const TrackingGeometry* trackingGeometry = m_trackingGeometrySvc->trackingGeometry();
45 if( trackingGeometry == nullptr){
46 ATH_MSG_FATAL( "TRACKING GEOMETRY NOT FOUND IN SVC");
47 return StatusCode::FAILURE;
48 }
49
50 for (const ToolHandle<Trk::IGeometryProcessor>& proc : m_trackingGeometryProcessors) {
51 ATH_MSG_VERBOSE("PRINT SVC TG");
52 StatusCode sc1 = proc->process(const_cast<Trk::TrackingGeometry&>(*trackingGeometry));
53 ATH_CHECK(sc1);
54 ATH_MSG_VERBOSE("PRINT COND TG");
55 StatusCode sc2 = proc->process(const_cast<Trk::TrackingGeometry&>(*trkGeom));
56 ATH_CHECK(sc2);
57 }
58 return StatusCode::SUCCESS;
59}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Base class for conditions algorithms.
ToolHandleArray< Trk::IGeometryProcessor > m_trackingGeometryProcessors
Tool to write out a Display format for external viewers.
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
Input conditions object.
ServiceHandle< Trk::ITrackingGeometrySvc > m_trackingGeometrySvc
ToolHandle to the TrackingGeometrySvc.
TrackingGeometryCondAlgTest(const std::string &name, ISvcLocator *pSvcLocator)
The TrackingGeometry class is the owner of the constructed TrackingVolumes.