Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:23:23

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2024 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 http://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   virtual std::unique_ptr<State> createState() const = 0;
0040 
0041   /// @brief Accumulate the material interaction on the surface
0042   ///
0043   /// @param state is the state of the accumulater
0044   /// @param interactions is the material interactions, with assigned surfaces
0045   /// @param surfacesWithoutAssignment are the surfaces without assignment
0046   ///
0047   /// @note this the track average over the binned material
0048   virtual void accumulate(
0049       State& state, const std::vector<MaterialInteraction>& interactions,
0050       const std::vector<IAssignmentFinder::SurfaceAssignment>&
0051           surfacesWithoutAssignment) const = 0;
0052 
0053   /// Finalize the surface material maps
0054   ///
0055   /// @param state the state of the accumulator
0056   ///
0057   /// @note this does the run average over the (binned) material
0058   virtual std::map<GeometryIdentifier, std::shared_ptr<const ISurfaceMaterial>>
0059   finalizeMaterial(State& state) const = 0;
0060 };
0061 
0062 }  // namespace Acts