Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:54

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/MagneticField/MagneticFieldContext.hpp"
0014 #include "Acts/Material/MaterialInteraction.hpp"
0015 #include "Acts/Utilities/Logger.hpp"
0016 
0017 #include <memory>
0018 
0019 namespace Acts {
0020 
0021 class IAssignmentFinder;
0022 
0023 /// @brief The material validater is a tool that allows to record the material
0024 /// seen by a ray through a set of material surfaces.
0025 ///
0026 /// It does uses a material assigner that can be either done using the
0027 /// propagator or a more sinmple trial and error intersection;
0028 class MaterialValidater {
0029  public:
0030   /// Nested configuration struct
0031   struct Config {
0032     std::shared_ptr<const IAssignmentFinder> materialAssigner = nullptr;
0033   };
0034 
0035   /// Constructor
0036   /// @param cfg The configuration struct carrying the used tools
0037   /// @param mlogger The logging object
0038   MaterialValidater(const Config& cfg,
0039                     std::unique_ptr<const Logger> mlogger =
0040                         getDefaultLogger("MaterialValidater", Logging::INFO));
0041 
0042   /// Method to record the material along a ray
0043   /// @param gctx the geometry context
0044   /// @param mctx the magnetic field context
0045   /// @param position the starting position of the ray
0046   /// @param direction the direction of the ray (unit vector)
0047   ///
0048   /// @return a rerorded material track
0049   RecordedMaterialTrack recordMaterial(const GeometryContext& gctx,
0050                                        const MagneticFieldContext& mctx,
0051                                        const Vector3& position,
0052                                        const Vector3& direction) const;
0053 
0054  private:
0055   /// Access method to the logger
0056   const Logger& logger() const { return *m_logger; }
0057 
0058   /// The configuration
0059   Config m_cfg;
0060 
0061   // The logger
0062   std::unique_ptr<const Logger> m_logger;
0063 };
0064 
0065 }  // namespace Acts