Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 10:03:08

0001 #include "OuterHitPhiPrediction.h"
0002 #include "DataFormats/Math/interface/approx_asin.h"
0003 
0004 OuterHitPhiPrediction::Range OuterHitPhiPrediction::sym(float radius) const {
0005   auto arc = radius * theCurvature.max() * 0.5f + theOriginRBound / radius;
0006 
0007   auto Phi_r = unsafe_asin07<5>(arc);
0008   return Range(thePhiAtVertex.min() - Phi_r - theTolerance, thePhiAtVertex.max() + Phi_r + theTolerance);
0009 }
0010 
0011 // in case somebody comes with a RELEVANT use case...
0012 OuterHitPhiPrediction::Range OuterHitPhiPrediction::asym(float radius) const {
0013   auto invr = 1.f / radius;
0014   if (std::max(std::abs(theCurvature.min()), std::abs(theCurvature.max())) > invr)
0015     return Range(-M_PI, M_PI);
0016 
0017   float Phi_r = std::asin(radius * theCurvature.max() * 0.5f + theOriginRBound * invr);
0018 
0019   if (theCurvature.max() == -theCurvature.min())
0020     return Range(thePhiAtVertex.min() - Phi_r - theTolerance, thePhiAtVertex.max() + Phi_r + theTolerance);
0021 
0022   float curv0 = theCurvature.mean();
0023   float Phi_0 = std::asin(radius * curv0 * 0.5f);
0024   float Phi_m = std::asin(radius * theCurvature.min() * 0.5f - theOriginRBound * invr);
0025   return Range(thePhiAtVertex.min() + Phi_0 + Phi_m - theTolerance,
0026                thePhiAtVertex.max() + Phi_0 + Phi_r + theTolerance);
0027 }