Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-22 07:51:44

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/GeometryIdentifier.hpp"
0013 #include "Acts/Material/ISurfaceMaterial.hpp"
0014 #include "Acts/Material/MaterialInteraction.hpp"
0015 #include "Acts/Material/interface/IAssignmentFinder.hpp"
0016 
0017 #include <map>
0018 #include <memory>
0019 #include <vector>
0020 
0021 namespace Acts {
0022 
0023 class Surface;
0024 
0025 /// @brief Interface for the material mapping, this is the accumulation step
0026 class ISurfaceMaterialAccumulater {
0027  public:
0028   /// The state of the material accumulater, this is used
0029   /// to cache information across tracks/events
0030   class State {
0031    public:
0032     virtual ~State() = default;
0033   };
0034 
0035   /// Virtual destructor
0036   virtual ~ISurfaceMaterialAccumulater() = default;
0037 
0038   /// Factory for creating the state
0039   /// @return Unique pointer to a new state object for material accumulation
0040   virtual std::unique_ptr<State> createState() const = 0;
0041 
0042   /// @brief Accumulate the material interaction on the surface
0043   ///
0044   /// @param state is the state of the accumulater
0045   /// @param interactions is the material interactions, with assigned surfaces
0046   /// @param surfacesWithoutAssignment are the surfaces without assignment
0047   ///
0048   /// @note this the track average over the binned material
0049   virtual void accumulate(
0050       State& state, const std::vector<MaterialInteraction>& interactions,
0051       const std::vector<IAssignmentFinder::SurfaceAssignment>&
0052           surfacesWithoutAssignment) const = 0;
0053 
0054   /// Finalize the surface material maps
0055   ///
0056   /// @param state the state of the accumulator
0057   ///
0058   /// @note this does the run average over the (binned) material
0059   /// @return Map of geometry IDs to finalized surface material objects
0060   virtual std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>
0061   finalizeMaterial(State& state) const = 0;
0062 };
0063 
0064 }  // namespace Acts