ATLAS Offline Software
ActsMaterialMapping.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 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 
32 namespace Acts {
33  class ISurfaceMaterial;
34  class IVolumeMaterial;
35 
37  = std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>;
38 
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.
53 public:
54  ActsMaterialMapping (const std::string& name, ISvcLocator* pSvcLocator);
55  virtual StatusCode initialize() override;
56  virtual StatusCode execute() override;
57  virtual StatusCode finalize() override;
58 
59 private:
61  Gaudi::Property<bool> m_mapSurfaces{this, "mapSurfaces", true, "Map the material onto surfaces"};
62  Gaudi::Property<bool> m_mapVolumes{this, "mapVolumes", true, "Map the material onto volumes"};
63  ToolHandle<IActsMaterialStepConverterTool> m_materialStepConverterTool{this, "MaterialStepConverterTool", "ActsMaterialStepConverterTool"};
64  SG::ReadHandleKey<Trk::MaterialStepCollection> m_inputMaterialStepCollection{this, "MaterialStepRecordsKey", "MaterialStepRecords"};
65  ToolHandle<IActsSurfaceMappingTool> m_surfaceMappingTool{this, "SurfaceMappingTool", "ActsSurfaceMappingTool"};
66  ToolHandle<IActsVolumeMappingTool> m_volumeMappingTool{this, "VolumeMappingTool", "ActsVolumeMappingTool"};
67  ToolHandle<IActsMaterialJsonWriterTool> m_materialJsonWriterTool{this, "MaterialJsonWriterTool", "ActsMaterialJsonWriterTool"};
68 
69  Acts::MagneticFieldContext m_mctx;
70  Acts::GeometryContext m_gctx;
73 };
74 
75 #endif // ActsGeometry_ActsExtrapolation_h
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
ActsMaterialMapping::m_gctx
Acts::GeometryContext m_gctx
Definition: ActsMaterialMapping.h:70
ActsMaterialMapping::m_materialStepConverterTool
ToolHandle< IActsMaterialStepConverterTool > m_materialStepConverterTool
Definition: ActsMaterialMapping.h:63
ActsMaterialMapping
Definition: ActsMaterialMapping.h:52
ActsMaterialMapping::finalize
virtual StatusCode finalize() override
Definition: ActsMaterialMapping.cxx:96
ActsMaterialMapping::m_materialJsonWriterTool
ToolHandle< IActsMaterialJsonWriterTool > m_materialJsonWriterTool
Definition: ActsMaterialMapping.h:67
MaterialStepCollection.h
ActsMaterialMapping::m_volumeMappingTool
ToolHandle< IActsVolumeMappingTool > m_volumeMappingTool
Definition: ActsMaterialMapping.h:66
IActsMaterialStepConverterTool
Definition: IActsMaterialStepConverterTool.h:13
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
ActsMaterialMapping::initialize
virtual StatusCode initialize() override
Definition: ActsMaterialMapping.cxx:48
Acts::VolumeMaterialMap
std::map< GeometryIdentifier, std::shared_ptr< const IVolumeMaterial > > VolumeMaterialMap
Definition: ActsMaterialMapping.h:40
Acts::DetectorMaterialMaps
std::pair< SurfaceMaterialMap, VolumeMaterialMap > DetectorMaterialMaps
Definition: ActsMaterialMapping.h:42
AthAlgorithm.h
Acts
Definition: ChamberAssembleTool.h:18
ActsMaterialMapping::m_mctx
Acts::MagneticFieldContext m_mctx
Definition: ActsMaterialMapping.h:69
ActsMaterialMapping::ActsMaterialMapping
ActsMaterialMapping(const std::string &name, ISvcLocator *pSvcLocator)
Definition: ActsMaterialMapping.cxx:40
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
IActsMaterialJsonWriterTool
Definition: IActsMaterialJsonWriterTool.h:17
AthAlgorithm
Definition: AthAlgorithm.h:47
ActsMaterialMapping::m_mapVolumes
Gaudi::Property< bool > m_mapVolumes
Definition: ActsMaterialMapping.h:62
ActsMaterialMapping::m_surfaceMappingTool
ToolHandle< IActsSurfaceMappingTool > m_surfaceMappingTool
Definition: ActsMaterialMapping.h:65
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsMaterialMapping::m_mappingState
Acts::SurfaceMaterialMapper::State m_mappingState
Definition: ActsMaterialMapping.h:71
ActsMaterialMapping::m_inputMaterialStepCollection
SG::ReadHandleKey< Trk::MaterialStepCollection > m_inputMaterialStepCollection
Definition: ActsMaterialMapping.h:64
ActsMaterialMapping::m_mapSurfaces
Gaudi::Property< bool > m_mapSurfaces
Definition: ActsMaterialMapping.h:61
ActsMaterialMapping::m_mappingStateVol
Acts::VolumeMaterialMapper::State m_mappingStateVol
Definition: ActsMaterialMapping.h:72
ActsMaterialMapping::m_materialTrackWriterSvc
ServiceHandle< IActsMaterialTrackWriterSvc > m_materialTrackWriterSvc
Definition: ActsMaterialMapping.h:60
ActsMaterialMapping::execute
virtual StatusCode execute() override
Definition: ActsMaterialMapping.cxx:71
Acts::SurfaceMaterialMap
std::map< GeometryIdentifier, std::shared_ptr< const ISurfaceMaterial > > SurfaceMaterialMap
Definition: ActsMaterialMapping.h:37
IActsMaterialTrackWriterSvc
Definition: IActsMaterialTrackWriterSvc.h:13
IActsSurfaceMappingTool
Definition: IActsSurfaceMappingTool.h:17
IActsVolumeMappingTool
Definition: IActsVolumeMappingTool.h:17
ServiceHandle< IActsMaterialTrackWriterSvc >