#include <ThirdHitPredictionFromInvLine.h>
Classes | |
class | MappedPoint |
Public Types | |
typedef PixelRecoRange< float > | Range |
typedef TkRotation< double > | Rotation |
Public Member Functions | |
void | add (const GlobalPoint &p, double erroriRPhi=1.) |
double | chi2 () const |
GlobalPoint | crossing (double radius) const |
double | curvature () const |
double | errorCurvature () const |
void | print () const |
void | remove (const GlobalPoint &p, double erroriRPhi=1.) |
int | size () const |
ThirdHitPredictionFromInvLine (const GlobalPoint &P1, const GlobalPoint &P2, double errorRPhiP1=1., double errorRPhiP2=1.) | |
Private Types | |
typedef MappedPoint< double > | PointUV |
Private Member Functions | |
void | add (const ThirdHitPredictionFromInvLine::PointUV &point, double weight) |
void | check () const |
Private Attributes | |
bool | hasParameters |
int | nPoints |
double | theChi2 |
double | theCurvatureError |
double | theCurvatureValue |
Rotation | theRotation |
long double | theSum |
long double | theSumU |
long double | theSumUU |
long double | theSumUV |
long double | theSumV |
long double | theSumVV |
Definition at line 17 of file ThirdHitPredictionFromInvLine.h.
typedef MappedPoint<double> ThirdHitPredictionFromInvLine::PointUV [private] |
Definition at line 69 of file ThirdHitPredictionFromInvLine.h.
typedef PixelRecoRange<float> ThirdHitPredictionFromInvLine::Range |
Definition at line 22 of file ThirdHitPredictionFromInvLine.h.
typedef TkRotation<double> ThirdHitPredictionFromInvLine::Rotation |
Definition at line 21 of file ThirdHitPredictionFromInvLine.h.
ThirdHitPredictionFromInvLine::ThirdHitPredictionFromInvLine | ( | const GlobalPoint & | P1, |
const GlobalPoint & | P2, | ||
double | errorRPhiP1 = 1. , |
||
double | errorRPhiP2 = 1. |
||
) |
Definition at line 20 of file ThirdHitPredictionFromInvLine.cc.
References add(), theRotation, Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
: nPoints(0), theSum(0.), theSumU(0.), theSumUU(0.), theSumV(0.), theSumUV(0.), theSumVV(0.), hasParameters(false), theCurvatureValue(0.), theCurvatureError(0.), theChi2(0.) { GlobalVector aX = GlobalVector( P1.x(), P1.y(), 0.).unit(); GlobalVector aY( -aX.y(), aX.x(), 0.); GlobalVector aZ( 0., 0., 1.); theRotation = Rotation(aX,aY,aZ); add(P1, errorRPhiP1); add(P2, errorRPhiP2); }
void ThirdHitPredictionFromInvLine::add | ( | const GlobalPoint & | p, |
double | erroriRPhi = 1. |
||
) |
Definition at line 49 of file ThirdHitPredictionFromInvLine.cc.
References PV3DBase< T, PVType, FrameType >::perp(), funct::sqr(), theRotation, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
Referenced by ThirdHitPredictionFromInvLine().
void ThirdHitPredictionFromInvLine::add | ( | const ThirdHitPredictionFromInvLine::PointUV & | point, |
double | weight | ||
) | [private] |
Definition at line 55 of file ThirdHitPredictionFromInvLine.cc.
References hasParameters, nPoints, funct::sqr(), theSum, theSumU, theSumUU, theSumUV, theSumV, theSumVV, ThirdHitPredictionFromInvLine::MappedPoint< T >::u(), and ThirdHitPredictionFromInvLine::MappedPoint< T >::v().
void ThirdHitPredictionFromInvLine::check | ( | void | ) | const [private] |
Definition at line 87 of file ThirdHitPredictionFromInvLine.cc.
References funct::A, funct::D, hasParameters, rho, funct::sqr(), mathSSE::sqrt(), theChi2, theCurvatureError, theCurvatureValue, theSum, theSumU, theSumUU, theSumUV, theSumV, and theSumVV.
Referenced by chi2(), curvature(), and errorCurvature().
{ if (hasParameters) return; long double D = theSumUU*theSum - theSumU*theSumU; long double A = (theSumUV*theSum-theSumU*theSumV)/D; long double B = (theSumUU*theSumV-theSumUV*theSumU)/D; double rho = 2.*fabs(B)/sqrt(1+sqr(A)); double sigmaA2 = theSum/D; double sigmaB2 = theSumUU/D; hasParameters = true; theCurvatureError = sqrt( sqr(rho/B)*sigmaB2+ sqr(rho/(1+sqr(A)))*sigmaA2); theCurvatureValue = 2.*fabs(B)/sqrt(1+sqr(A)); theChi2 = theSumVV - 2*A*theSumUV - 2*B*theSumV + 2*A*B*theSumU + B*B*theSum + A*A*theSumUU; }
double ThirdHitPredictionFromInvLine::chi2 | ( | void | ) | const [inline] |
GlobalPoint ThirdHitPredictionFromInvLine::crossing | ( | double | radius | ) | const |
Definition at line 36 of file ThirdHitPredictionFromInvLine.cc.
References funct::A, delta, funct::sqr(), mathSSE::sqrt(), theRotation, theSum, theSumU, theSumUU, theSumUV, theSumV, tmp, Basic2DVector< T >::x(), and Basic2DVector< T >::y().
{ double A = -(theSum*theSumUV-theSumU*theSumV)/(sqr(theSumU)-theSum*theSumUU); double B = (theSumU*theSumUV - theSumUU*theSumV)/(sqr(theSumU)-theSum*theSumUU); double delta = sqr(2.*A*B) - 4*(1+sqr(A))*(sqr(B)-sqr(1/radius)); double sqrtdelta = (delta > 0.) ? sqrt(delta) : 0.; double u1 = (-2.*A*B + sqrtdelta)/2./(1+sqr(A)); double v1 = A*u1+B; Point2D tmp = PointUV(u1,v1, &theRotation).unmap(); return GlobalPoint(tmp.x(), tmp.y(), 0.); }
double ThirdHitPredictionFromInvLine::curvature | ( | ) | const [inline] |
Definition at line 34 of file ThirdHitPredictionFromInvLine.h.
References check(), and theCurvatureValue.
{ check(); return theCurvatureValue; }
double ThirdHitPredictionFromInvLine::errorCurvature | ( | ) | const [inline] |
Definition at line 36 of file ThirdHitPredictionFromInvLine.h.
References check(), and theCurvatureError.
{ check(); return theCurvatureError; }
void ThirdHitPredictionFromInvLine::print | ( | void | ) | const |
void ThirdHitPredictionFromInvLine::remove | ( | const GlobalPoint & | p, |
double | erroriRPhi = 1. |
||
) |
Definition at line 67 of file ThirdHitPredictionFromInvLine.cc.
References hasParameters, nPoints, PV3DBase< T, PVType, FrameType >::perp(), point, funct::sqr(), theRotation, theSum, theSumU, theSumUU, theSumUV, theSumV, theSumVV, ThirdHitPredictionFromInvLine::MappedPoint< T >::u(), ThirdHitPredictionFromInvLine::MappedPoint< T >::v(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
{ hasParameters = false; PointUV point(Point2D(p.x(),p.y()), &theRotation); double weigth = sqr(sqr(p.perp())/errorRPhi); nPoints--; theSum -= weigth; theSumU -= point.u()*weigth; theSumUU -= sqr(point.u())*weigth; theSumV -= point.v()*weigth; theSumUV -= point.u()*point.v()*weigth; theSumVV -= sqr(point.v())*weigth; }
int ThirdHitPredictionFromInvLine::size | ( | void | ) | const [inline] |
Definition at line 26 of file ThirdHitPredictionFromInvLine.h.
References nPoints.
{ return nPoints;}
bool ThirdHitPredictionFromInvLine::hasParameters [mutable, private] |
Definition at line 77 of file ThirdHitPredictionFromInvLine.h.
int ThirdHitPredictionFromInvLine::nPoints [private] |
double ThirdHitPredictionFromInvLine::theChi2 [mutable, private] |
Definition at line 78 of file ThirdHitPredictionFromInvLine.h.
double ThirdHitPredictionFromInvLine::theCurvatureError [mutable, private] |
Definition at line 78 of file ThirdHitPredictionFromInvLine.h.
Referenced by check(), and errorCurvature().
double ThirdHitPredictionFromInvLine::theCurvatureValue [mutable, private] |
Definition at line 78 of file ThirdHitPredictionFromInvLine.h.
Referenced by check(), and curvature().
Definition at line 74 of file ThirdHitPredictionFromInvLine.h.
Referenced by add(), crossing(), remove(), and ThirdHitPredictionFromInvLine().
long double ThirdHitPredictionFromInvLine::theSum [private] |
Definition at line 76 of file ThirdHitPredictionFromInvLine.h.
Referenced by add(), check(), crossing(), and remove().
long double ThirdHitPredictionFromInvLine::theSumU [private] |
Definition at line 76 of file ThirdHitPredictionFromInvLine.h.
Referenced by add(), check(), crossing(), print(), and remove().
long double ThirdHitPredictionFromInvLine::theSumUU [private] |
Definition at line 76 of file ThirdHitPredictionFromInvLine.h.
Referenced by add(), check(), crossing(), print(), and remove().
long double ThirdHitPredictionFromInvLine::theSumUV [private] |
Definition at line 76 of file ThirdHitPredictionFromInvLine.h.
Referenced by add(), check(), crossing(), print(), and remove().
long double ThirdHitPredictionFromInvLine::theSumV [private] |
Definition at line 76 of file ThirdHitPredictionFromInvLine.h.
Referenced by add(), check(), crossing(), print(), and remove().
long double ThirdHitPredictionFromInvLine::theSumVV [private] |
Definition at line 76 of file ThirdHitPredictionFromInvLine.h.