ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SurfaceMaterialMapper.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SurfaceMaterialMapper.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2018-2020 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 
24 
25 namespace Acts {
26 
27 class TrackingGeometry;
28 
31  bool operator()(const Surface& sf) const {
32  return (sf.surfaceMaterial() != nullptr);
33  }
34 };
35 
38  bool operator()(const TrackingVolume& vf) const {
39  return (vf.volumeMaterial() != nullptr);
40  }
41 };
42 
69  public:
71 
75  struct Config {
77  std::array<double, 2> etaRange = {{-6., 6.}};
79  bool emptyBinCorrection = true;
81  bool mapperDebugOutput = false;
82  };
83 
87  struct State {
89  State(std::reference_wrapper<const GeometryContext> gctx,
90  std::reference_wrapper<const MagneticFieldContext> mctx)
91  : geoContext(gctx), magFieldContext(mctx) {}
92 
94  std::map<GeometryID, AccumulatedSurfaceMaterial> accumulatedMaterial;
95 
97  std::map<GeometryID, std::unique_ptr<const ISurfaceMaterial>>
99 
101  std::reference_wrapper<const GeometryContext> geoContext;
102 
104  std::reference_wrapper<const MagneticFieldContext> magFieldContext;
105  };
106 
108  SurfaceMaterialMapper() = delete;
109 
115  SurfaceMaterialMapper(const Config& cfg, StraightLinePropagator propagator,
116  std::unique_ptr<const Logger> slogger =
117  getDefaultLogger("SurfaceMaterialMapper",
118  Logging::INFO));
119 
128  const MagneticFieldContext& mctx,
129  const TrackingGeometry& tGeometry) const;
130 
138  void finalizeMaps(State& mState) const;
139 
147  void mapMaterialTrack(State& mState, RecordedMaterialTrack& mTrack) const;
148 
149  private:
154  void resolveMaterialSurfaces(State& mState,
155  const TrackingVolume& tVolume) const;
156 
161  void checkAndInsert(State& /*mState*/, const Surface& surface) const;
162 
164  const Logger& logger() const { return *m_logger; }
165 
168 
171 
173  std::unique_ptr<const Logger> m_logger;
174 };
175 } // namespace Acts