Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-17 07:46:22

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/Geometry/GeometryIdentifier.hpp"
0014 #include "Acts/Material/ISurfaceMaterial.hpp"
0015 #include "Acts/Material/MaterialInteraction.hpp"
0016 #include "Acts/Material/interface/IAssignmentFinder.hpp"
0017 
0018 #include <map>
0019 #include <memory>
0020 #include <vector>
0021 
0022 namespace Acts {
0023 
0024 class Surface;
0025 
0026 /// @brief Interface for the material mapping, this is the accumulation step
0027 class ISurfaceMaterialAccumulator {
0028  public:
0029   /// The state of the material accumulator, this is used
0030   /// to cache information across tracks/events
0031   class State {
0032    public:
0033     virtual ~State() = default;
0034   };
0035 
0036   /// Virtual destructor
0037   virtual ~ISurfaceMaterialAccumulator() = default;
0038 
0039   /// Factory for creating the state
0040   /// @param gctx the geometry context
0041   /// @return Unique pointer to a new state object for material accumulation
0042   virtual std::unique_ptr<State> createState(
0043       const GeometryContext& gctx) const = 0;
0044 
0045   /// @brief Accumulate the material interaction on the surface
0046   ///
0047   /// @param state is the state of the accumulator
0048   /// @param gctx the geometry context
0049   /// @param interactions is the material interactions, with assigned surfaces
0050   /// @param surfacesWithoutAssignment are the surfaces without assignment
0051   ///
0052   /// @note this the track average over the binned material
0053   virtual void accumulate(
0054       State& state, const GeometryContext& gctx,
0055       const std::vector<MaterialInteraction>& interactions,
0056       const std::vector<IAssignmentFinder::SurfaceAssignment>&
0057           surfacesWithoutAssignment) const = 0;
0058 
0059   /// Finalize the surface material maps
0060   ///
0061   /// @param state the state of the accumulator
0062   /// @param gctx the geometry context
0063   ///
0064   /// @note this does the run average over the (binned) material
0065   /// @return Map of geometry IDs to finalized surface material objects
0066   virtual std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>
0067   finalizeMaterial(State& state, const GeometryContext& gctx) const = 0;
0068 };
0069 
0070 }  // namespace Acts