Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-13 08:16:35

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 #include "Acts/Seeding/CompositeSpacePointLineFitter.hpp"
0010 
0011 namespace Acts::Experimental {
0012 
0013 CompositeSpacePointLineFitter::CompositeSpacePointLineFitter(
0014     const Config& cfg, std::unique_ptr<const Logger> logger)
0015     : m_cfg{cfg}, m_logger{std::move(logger)} {}
0016 
0017 detail::FastStrawLineFitter::Config
0018 CompositeSpacePointLineFitter::fastFitterCfg() const {
0019   detail::FastStrawLineFitter::Config fastCfg{};
0020   fastCfg.maxIter = m_cfg.maxIter;
0021   fastCfg.precCutOff = m_cfg.precCutOff;
0022   return fastCfg;
0023 }
0024 
0025 std::vector<CompositeSpacePointLineFitter::FitParIndex>
0026 CompositeSpacePointLineFitter::extractFitablePars(
0027     const std::array<std::size_t, 3>& hitCounts) {
0028   std::vector<FitParIndex> pars{};
0029   using enum FitParIndex;
0030   const auto& [nLoc0, nLoc1, nTime] = hitCounts;
0031   if (nLoc0 > 1) {
0032     pars.insert(pars.end(), {x0, phi});
0033   }
0034   // Measurements in the bending direction
0035   if (nLoc1 > 1) {
0036     pars.insert(pars.end(), {y0, theta});
0037   }
0038   // Time measurements
0039   if (nTime > 1) {
0040     pars.push_back(t0);
0041   }
0042   std::ranges::sort(pars);
0043   return pars;
0044 }
0045 
0046 void CompositeSpacePointLineFitter::FitParameters::print(
0047     std::ostream& ostr) const {
0048   using namespace Acts::UnitLiterals;
0049   using enum FitParIndex;
0050   ostr << "parameters converged: " << (converged ? "yes" : "no") << ", ";
0051   ostr << "# iterations: " << nIter << ", ";
0052   ostr << "chi2: " << chi2 << ", ";
0053   ostr << "parameters - ";
0054   ostr << std::format("theta: {:.3f}, ",
0055                       parameters[toUnderlying(theta)] / 1._degree);
0056   ostr << std::format("phi: {:.3f}, ",
0057                       parameters[toUnderlying(phi)] / 1._degree);
0058   ostr << std::format("y0: {:.3f}, ", parameters[toUnderlying(y0)]);
0059   ostr << std::format("x0: {:.3f}, ", parameters[toUnderlying(x0)]);
0060   ostr << std::format("t0: {:.3f}, ", parameters[toUnderlying(t0)] / 1._ns);
0061   ostr << "covariance - \n" << covariance << ",\n";
0062 }
0063 }  // namespace Acts::Experimental