ATLAS Offline Software
Loading...
Searching...
No Matches
ActsMaterialMapping.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSMATERIALMAPPING_H
6#define ACTSMATERIALMAPPING_H
7
8// ATHENA
10#include "GaudiKernel/ToolHandle.h"
11#include "GaudiKernel/ServiceHandle.h"
12#include "Gaudi/Property.h" /*no forward decl: typedef*/
13#include "GaudiKernel/ISvcLocator.h"
16
17// ACTS
18#include "Acts/EventData/TrackParameters.hpp"
19#include "Acts/Geometry/GeometryIdentifier.hpp"
20#include "Acts/Utilities/Helpers.hpp"
21#include "Acts/Material/SurfaceMaterialMapper.hpp"
22#include "Acts/Material/VolumeMaterialMapper.hpp"
23// PACKAGE
25
26// STL
27#include <memory>
28#include <vector>
29#include <fstream>
30#include <mutex>
31
32namespace Acts {
33 class ISurfaceMaterial;
34 class IVolumeMaterial;
35
37 = std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>;
40 = std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>>;
41
42 using DetectorMaterialMaps = std::pair<SurfaceMaterialMap, VolumeMaterialMap>;
43}
44
50
51// Not reentrant due to the mutable State variables.
53public:
55 virtual StatusCode initialize() override;
56 virtual StatusCode execute() override;
57 virtual StatusCode finalize() override;
58
59private:
60 ServiceHandle<IActsMaterialTrackWriterSvc> m_materialTrackWriterSvc{this, "MaterialWriterSvc", "ActsMaterialTrackWriterSvc"};
61 PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"};
62 Gaudi::Property<bool> m_mapSurfaces{this, "mapSurfaces", true, "Map the material onto surfaces"};
63 Gaudi::Property<bool> m_mapVolumes{this, "mapVolumes", true, "Map the material onto volumes"};
64 ToolHandle<IActsMaterialStepConverterTool> m_materialStepConverterTool{this, "MaterialStepConverterTool", "ActsMaterialStepConverterTool"};
65 SG::ReadHandleKey<Trk::MaterialStepCollection> m_inputMaterialStepCollection{this, "MaterialStepRecordsKey", "MaterialStepRecords"};
66 ToolHandle<IActsSurfaceMappingTool> m_surfaceMappingTool{this, "SurfaceMappingTool", "ActsSurfaceMappingTool"};
67 ToolHandle<IActsVolumeMappingTool> m_volumeMappingTool{this, "VolumeMappingTool", "ActsVolumeMappingTool"};
68 ToolHandle<IActsMaterialJsonWriterTool> m_materialJsonWriterTool{this, "MaterialJsonWriterTool", "ActsMaterialJsonWriterTool"};
69
70 Acts::MagneticFieldContext m_mctx{};
71 Acts::GeometryContext m_gctx{};
72 Acts::SurfaceMaterialMapper::State m_mappingState{m_gctx, m_mctx};
73 Acts::VolumeMaterialMapper::State m_mappingStateVol{m_gctx,m_mctx};
74};
75
76#endif // ActsGeometry_ActsExtrapolation_h
Property holding a SG store/key/clid from which a ReadHandle is made.
ToolHandle< IActsSurfaceMappingTool > m_surfaceMappingTool
ServiceHandle< IActsMaterialTrackWriterSvc > m_materialTrackWriterSvc
virtual StatusCode finalize() override
Acts::MagneticFieldContext m_mctx
Acts::SurfaceMaterialMapper::State m_mappingState
virtual StatusCode initialize() override
ToolHandle< IActsMaterialStepConverterTool > m_materialStepConverterTool
SG::ReadHandleKey< Trk::MaterialStepCollection > m_inputMaterialStepCollection
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
ToolHandle< IActsMaterialJsonWriterTool > m_materialJsonWriterTool
Acts::VolumeMaterialMapper::State m_mappingStateVol
ToolHandle< IActsVolumeMappingTool > m_volumeMappingTool
Gaudi::Property< bool > m_mapVolumes
Acts::GeometryContext m_gctx
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Property< bool > m_mapSurfaces
virtual StatusCode execute() override
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Property holding a SG store/key/clid from which a ReadHandle is made.
std::pair< SurfaceMaterialMap, VolumeMaterialMap > DetectorMaterialMaps
std::map< GeometryIdentifier, std::shared_ptr< const ISurfaceMaterial > > SurfaceMaterialMap
std::map< GeometryIdentifier, std::shared_ptr< const IVolumeMaterial > > VolumeMaterialMap