Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /acts/Core/src/Seeding/GbtsSeedFit.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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/GbtsSeedFit.hpp"
0010 
0011 #include "Acts/Utilities/MathHelpers.hpp"
0012 
0013 #include <cmath>
0014 
0015 namespace Acts::Experimental {
0016 
0017 std::optional<FreeVector> freeParametersFromGbtsSeedFit(const GbtsSeedFit& fit,
0018                                                         const Vector3& bField) {
0019   const Vector2 transverseDirection(std::cos(fit.phi), std::sin(fit.phi));
0020   const double transverseField = bField.head<2>().dot(transverseDirection);
0021   const double bendingField = bField.z() - fit.cotTheta * transverseField;
0022   if (bendingField == 0) {
0023     return std::nullopt;
0024   }
0025 
0026   const Vector3 direction =
0027       Vector3(transverseDirection.x(), transverseDirection.y(), fit.cotTheta)
0028           .normalized();
0029   const double qOverPt = fit.curvature / bendingField;
0030 
0031   FreeVector params = FreeVector::Zero();
0032   params.segment<3>(eFreePos0) = fit.position;
0033   params.segment<3>(eFreeDir0) = direction;
0034   params[eFreeQOverP] = qOverPt / fastHypot(1., fit.cotTheta);
0035   return params;
0036 }
0037 
0038 }  // namespace Acts::Experimental