00001 #include "ThirdHitZPrediction.h" 00002 00003 namespace { 00004 template<class T> T sqr(T t) { return t * t; } 00005 } 00006 00007 00008 ThirdHitZPrediction::Range ThirdHitZPrediction::operator()( 00009 const GlobalPoint& thePoint3, float erroRPhi3) const 00010 { 00011 double dR23 = (thePoint3-thePoint2).perp(); 00012 00013 double slope = dR23/dR12; 00014 if ( (theCurvature > 1.e-4) 00015 && (std::abs(0.5*dR23*theCurvature) < 1.) 00016 ) slope = std::asin(0.5*dR23*theCurvature)/dS12; 00017 00018 double z3 = thePoint2.z() + dZ12*slope; 00019 00020 double sqr_errorXY23 = sqr_errorXY2+sqr(erroRPhi3); 00021 double error = sqrt( sqr( (1+dR23/dR12)*theErrorZ2 ) 00022 + sqr( dR23/dR12 * theErrorZ1 ) 00023 + sqr(dZ12/dR12 )*sqr_errorXY23 00024 + sqr((dZ12/dR12)*(dR23/dR12))*sqr_errorXY12 00025 ); 00026 error *= theNSigma; 00027 return Range(z3-error,z3+error); 00028 } 00029