Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:59

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2019 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/MagneticField/MagneticFieldContext.hpp"
0012 #include "Acts/MagneticField/MagneticFieldProvider.hpp"
0013 #include "Acts/Propagator/EigenStepper.hpp"
0014 #include "Acts/Propagator/Propagator.hpp"
0015 #include "Acts/Utilities/Logger.hpp"
0016 #include "Acts/Utilities/Result.hpp"
0017 #include "Acts/Vertexing/HelicalTrackLinearizer.hpp"
0018 #include "Acts/Vertexing/TrackLinearizer.hpp"
0019 #include "Acts/Vertexing/Vertex.hpp"
0020 #include "Acts/Vertexing/VertexingOptions.hpp"
0021 
0022 namespace Acts {
0023 
0024 /// @class FullBilloirVertexFitter
0025 ///
0026 /// @brief Vertex fitter class implementing the Billoir vertex fitter
0027 ///
0028 /// This class implements the Billoir vertex fitter from Ref. (1). It is also
0029 /// useful to have a look at Ref. (2). The cross-covariance matrices are derived
0030 /// in Ref. (3). Note that the Billoir vertex fitter outputs one 4D vertex
0031 /// position and nTrack momenta at this very point.
0032 ///
0033 /// Ref. (1):
0034 /// Fast vertex fitting with a local parametrization of tracks.
0035 /// Author(s) Billoir, P ; Qian, S
0036 /// In: Nucl. Instrum. Methods Phys. Res., A 311 (1992) 139-150
0037 /// DOI 10.1016/0168-9002(92)90859-3
0038 ///
0039 /// Ref. (2):
0040 /// Pattern Recognition, Tracking and Vertex Reconstruction in Particle
0041 /// Detectors.
0042 /// Author(s) Fruehwirth, R ; Strandli, A
0043 ///
0044 /// Ref. (3):
0045 /// ACTS White Paper: Cross-Covariance Matrices in the Billoir Vertex Fit
0046 /// https://acts.readthedocs.io/en/latest/white_papers/billoir-covariances.html
0047 /// Author(s) Russo, F
0048 class FullBilloirVertexFitter {
0049  public:
0050   struct Config {
0051     /// Maximum number of iterations in fitter
0052     int maxIterations = 5;
0053 
0054     // Function to extract parameters from InputTrack
0055     InputTrack::Extractor extractParameters;
0056 
0057     TrackLinearizer trackLinearizer;
0058   };
0059 
0060   /// @brief Constructor for user-defined InputTrack type
0061   ///
0062   /// @param cfg Configuration object
0063   /// @param logger Logging instance
0064   FullBilloirVertexFitter(const Config& cfg,
0065                           std::unique_ptr<const Logger> logger =
0066                               getDefaultLogger("FullBilloirVertexFitter",
0067                                                Logging::INFO))
0068       : m_cfg(cfg), m_logger(std::move(logger)) {
0069     if (!m_cfg.extractParameters.connected()) {
0070       throw std::invalid_argument(
0071           "FullBilloirVertexFitter: "
0072           "No function to extract parameters "
0073           "provided.");
0074     }
0075 
0076     if (!m_cfg.trackLinearizer.connected()) {
0077       throw std::invalid_argument(
0078           "FullBilloirVertexFitter: "
0079           "No track linearizer provided.");
0080     }
0081   }
0082 
0083   /// @brief Fit method, fitting vertex for provided tracks with constraint
0084   ///
0085   /// @param paramVector Vector of track objects to fit vertex to
0086   /// @param vertexingOptions Vertexing options
0087   /// @param fieldCache The magnetic field cache
0088   ///
0089   /// @return Fitted vertex
0090   Result<Vertex> fit(const std::vector<InputTrack>& paramVector,
0091                      const VertexingOptions& vertexingOptions,
0092                      MagneticFieldProvider::Cache& fieldCache) const;
0093 
0094  private:
0095   /// Configuration object
0096   Config m_cfg;
0097 
0098   /// Logging instance
0099   std::unique_ptr<const Logger> m_logger;
0100 
0101   /// Private access to logging instance
0102   const Logger& logger() const { return *m_logger; }
0103 };
0104 
0105 }  // namespace Acts