Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:49

0001 #include "ThirdHitZPrediction.h"
0002 
0003 namespace {
0004   template <class T>
0005   T sqr(T t) {
0006     return t * t;
0007   }
0008 }  // namespace
0009 
0010 ThirdHitZPrediction::Range ThirdHitZPrediction::operator()(const GlobalPoint& thePoint3, float erroRPhi3) const {
0011   double dR23 = (thePoint3 - thePoint2).perp();
0012 
0013   double slope = dR23 / dR12;
0014   if ((theCurvature > 1.e-4) && (std::abs(0.5 * dR23 * theCurvature) < 1.))
0015     slope = std::asin(0.5 * dR23 * theCurvature) / dS12;
0016 
0017   double z3 = thePoint2.z() + dZ12 * slope;
0018 
0019   double sqr_errorXY23 = sqr_errorXY2 + sqr(erroRPhi3);
0020   double error = sqrt(sqr((1 + dR23 / dR12) * theErrorZ2) + sqr(dR23 / dR12 * theErrorZ1) +
0021                       sqr(dZ12 / dR12) * sqr_errorXY23 + sqr((dZ12 / dR12) * (dR23 / dR12)) * sqr_errorXY12);
0022   error *= theNSigma;
0023   return Range(z3 - error, z3 + error);
0024 }