ATLAS Offline Software
ActsVolumeMappingTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 // ATHENA
8 #include "GaudiKernel/IInterface.h"
9 
10 // PACKAGE
12 #include "ActsInterop/Logger.h"
16 
17 // ACTS
18 #include "Acts/Propagator/Navigator.hpp"
19 #include "Acts/Propagator/Propagator.hpp"
20 #include "Acts/Propagator/StraightLineStepper.hpp"
21 #include "Acts/Geometry/GeometryContext.hpp"
22 
23 // STL
24 #include <iostream>
25 #include <memory>
26 
27 
28 ActsVolumeMappingTool::ActsVolumeMappingTool(const std::string& type, const std::string& name,
29  const IInterface* parent)
30  : base_class(type, name, parent)
31 {
32 }
33 
36 {
37  ATH_MSG_INFO("Initializing ACTS Volume Mapper");
38 
39  ATH_CHECK( m_trackingGeometryTool.retrieve() );
40 
41  m_trackingGeometry = m_trackingGeometryTool->trackingGeometry();
42 
43  Acts::Navigator navigator( Acts::Navigator::Config{ m_trackingGeometry } );
44  // Make stepper and propagator
45  SlStepper stepper;
46  StraightLinePropagator propagator = StraightLinePropagator(std::move(stepper), std::move(navigator));
47 
49  Acts::VolumeMaterialMapper::Config smmConfig;
50  smmConfig.mappingStep = 10;
51  m_mapper = std::make_shared<Acts::VolumeMaterialMapper>(
52  smmConfig,
53  std::move(propagator),
54  makeActsAthenaLogger(this, "VolumeMaterialMapper"));
55 
56  m_geoContext = m_trackingGeometryTool->getNominalGeometryContext().context();
57 
58  ATH_MSG_INFO("ACTS Surface Mapper successfully initialized");
59  return StatusCode::SUCCESS;
60 }
61 
64 {
65  auto mappingState = m_mapper->createState(
67 
68  return mappingState;
69 }
ActsVolumeMappingTool::initialize
virtual StatusCode initialize() override
Definition: ActsVolumeMappingTool.cxx:35
ActsVolumeMappingTool::m_geoContext
Acts::GeometryContext m_geoContext
Definition: ActsVolumeMappingTool.h:56
ActsVolumeMappingTool::m_magFieldContext
Acts::MagneticFieldContext m_magFieldContext
Definition: ActsVolumeMappingTool.h:55
ActsVolumeMappingTool::m_trackingGeometry
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
Definition: ActsVolumeMappingTool.h:61
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ActsGeometryContext.h
ActsTrk::detail::Navigator
Acts::Navigator Navigator
Definition: Tracking/Acts/ActsTrackReconstruction/src/detail/Definitions.h:31
ActsVolumeMappingTool::ActsVolumeMappingTool
ActsVolumeMappingTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ActsVolumeMappingTool.cxx:28
makeActsAthenaLogger
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Definition: Tracking/Acts/ActsInterop/src/Logger.cxx:64
ActsVolumeMappingTool::StraightLinePropagator
Acts::Propagator< SlStepper, Acts::Navigator > StraightLinePropagator
Definition: ActsVolumeMappingTool.h:58
ActsTrackingGeometryTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonR4::State
CalibratedSpacePoint::State State
Definition: SpacePointCalibrator.cxx:24
ActsVolumeMappingTool::m_mapper
std::shared_ptr< Acts::VolumeMaterialMapper > m_mapper
Definition: ActsVolumeMappingTool.h:60
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ActsVolumeMappingTool::m_trackingGeometryTool
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: ActsVolumeMappingTool.h:59
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsVolumeMappingTool::SlStepper
Acts::StraightLineStepper SlStepper
Definition: ActsVolumeMappingTool.h:57
ActsVolumeMappingTool.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ActsVolumeMappingTool::mappingState
virtual Acts::VolumeMaterialMapper::State mappingState() const override
Definition: ActsVolumeMappingTool.cxx:63
Logger.h
IActsTrackingGeometryTool.h