EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MaterialMapping.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MaterialMapping.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2017-2019 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
16 
17 #include <climits>
18 #include <memory>
19 #include <mutex>
20 
21 namespace Acts {
22 
23 class TrackingGeometry;
24 class ISurfaceMaterial;
25 class IVolumeMaterial;
26 
27 using SurfaceMaterialMap =
28  std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>;
29 
30 using VolumeMaterialMap =
31  std::map<GeometryIdentifier, std::shared_ptr<const IVolumeMaterial>>;
32 
33 using DetectorMaterialMaps = std::pair<SurfaceMaterialMap, VolumeMaterialMap>;
34 } // namespace Acts
35 
36 namespace ActsExamples {
37 
54  public:
57  struct Config {
59  Config(std::reference_wrapper<const Acts::GeometryContext> gctx,
60  std::reference_wrapper<const Acts::MagneticFieldContext> mctx)
61  : geoContext(gctx), magFieldContext(mctx) {}
62 
64  std::string collection = "material-tracks";
65 
67  std::string mappingMaterialCollection = "MappedMaterialTracks";
68 
70  std::shared_ptr<Acts::SurfaceMaterialMapper> materialSurfaceMapper =
71  nullptr;
72 
74  std::shared_ptr<Acts::VolumeMaterialMapper> materialVolumeMapper = nullptr;
75 
77  std::vector<std::shared_ptr<IMaterialWriter>> materialWriters;
78 
80  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry = nullptr;
81 
82  // Geometry context for the state creation
83  std::reference_wrapper<const Acts::GeometryContext> geoContext;
84 
85  // MagneticField context for the state creation
86  std::reference_wrapper<const Acts::MagneticFieldContext> magFieldContext;
87  };
88 
93  MaterialMapping(const Config& cfg,
95 
99 
104  const AlgorithmContext& context) const final override;
105 
106  private:
112 };
113 
114 } // namespace ActsExamples