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
8
9// Trk includes
11#include "TrkGeometry/Layer.h"
12
13
14Trk::TrackingGeometryCondAlgTest::TrackingGeometryCondAlgTest(const std::string& name, ISvcLocator* pSvcLocator)
15 : AthCondAlgorithm(name, pSvcLocator),
16 m_trackingGeometrySvc("AtlasTrackingGeometrySvc", name),
18{
19 declareProperty("GeometryProcessors", m_trackingGeometryProcessors);
20}
21
23{
24 ATH_MSG_DEBUG("initialize " << name());
25
26 // Read Handle Key
28
29
32 return StatusCode::SUCCESS;
33}
34
35StatusCode Trk::TrackingGeometryCondAlgTest::execute(const EventContext& ctx) const {
36
37 //Set up read handle
39 if (!readHandle.isValid() || *readHandle == nullptr) {
40 ATH_MSG_WARNING(m_trackingGeometryReadKey.fullKey() << " is not available.");
41 return StatusCode::FAILURE;
42 }
43 const Trk::TrackingGeometry* trkGeom = *readHandle;
44 ATH_MSG_INFO( "eventID: " << ctx.eventID());
45 const TrackingGeometry* trackingGeometry = m_trackingGeometrySvc->trackingGeometry();
46 if( trackingGeometry == nullptr){
47 ATH_MSG_FATAL( "TRACKING GEOMETRY NOT FOUND IN SVC");
48 return StatusCode::FAILURE;
49 }
50
51 for (const ToolHandle<Trk::IGeometryProcessor>& proc : m_trackingGeometryProcessors) {
52 ATH_MSG_VERBOSE("PRINT SVC TG");
53 StatusCode sc1 = proc->process(const_cast<Trk::TrackingGeometry&>(*trackingGeometry));
54 ATH_CHECK(sc1);
55 ATH_MSG_VERBOSE("PRINT COND TG");
56 StatusCode sc2 = proc->process(const_cast<Trk::TrackingGeometry&>(*trkGeom));
57 ATH_CHECK(sc2);
58 }
59 return StatusCode::SUCCESS;
60}
#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)
defines and typedefs for IOVSvc
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.