ECCE @ 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 
13 #include <climits>
14 #include <memory>
15 #include <mutex>
16 
19 
20 namespace Acts {
21 
22 class TrackingGeometry;
23 class ISurfaceMaterial;
24 class IVolumeMaterial;
25 
26 using SurfaceMaterialMap =
27  std::map<GeometryID, std::shared_ptr<const ISurfaceMaterial>>;
28 
29 using VolumeMaterialMap =
30  std::map<GeometryID, std::shared_ptr<const IVolumeMaterial>>;
31 
32 using DetectorMaterialMaps = std::pair<SurfaceMaterialMap, VolumeMaterialMap>;
33 } // namespace Acts
34 
35 namespace FW {
36 
53  public:
56  struct Config {
58  Config(std::reference_wrapper<const Acts::GeometryContext> gctx,
59  std::reference_wrapper<const Acts::MagneticFieldContext> mctx)
60  : geoContext(gctx), magFieldContext(mctx) {}
61 
63  std::string collection = "material-tracks";
64 
66  std::string mappingMaterialCollection = "MappedMaterialTracks";
67 
69  std::shared_ptr<Acts::SurfaceMaterialMapper> materialMapper = nullptr;
70 
72  std::vector<std::shared_ptr<IMaterialWriter>> materialWriters;
73 
75  std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry = nullptr;
76 
77  // Geometry context for the state creation
78  std::reference_wrapper<const Acts::GeometryContext> geoContext;
79 
80  // MagneticField context for the state creation
81  std::reference_wrapper<const Acts::MagneticFieldContext> magFieldContext;
82  };
83 
88  MaterialMapping(const Config& cfg,
90 
94 
98  FW::ProcessCode execute(const AlgorithmContext& context) const final override;
99 
100  private:
104 };
105 
106 } // namespace FW