CMS 3D CMS Logo

ThirdHitPredictionFromInvParabola Class Reference

#include <RecoPixelVertexing/PixelTriplets/interface/ThirdHitPredictionFromInvParabola.h>

List of all members.

Public Types

typedef PixelRecoRange< float > Range
typedef TkRotation< double > Rotation

Public Member Functions

void init (const GlobalPoint &P1, const GlobalPoint &P2, double ip, double curv)
Range operator() (double radius, int charge) const
 ThirdHitPredictionFromInvParabola (const GlobalPoint &P1, const GlobalPoint &P2, double ip, double curv, double tolerance)

Private Types

typedef MappedPoint< double > PointUV

Private Member Functions

double coeffA (const double &impactParameter, int charge) const
double coeffB (const double &impactParameter, int charge) const
double ipFromCurvature (const double &curvature, int charge) const
double predV (const double &u, const double &ip, int charge) const

Private Attributes

PointUV p1
PointUV p2
Range theIpRangeMinus
Range theIpRangePlus
Rotation theRotation
float theTolerance

Classes

class  MappedPoint


Detailed Description

Definition at line 24 of file ThirdHitPredictionFromInvParabola.h.


Member Typedef Documentation

typedef MappedPoint<double> ThirdHitPredictionFromInvParabola::PointUV [private]

Definition at line 75 of file ThirdHitPredictionFromInvParabola.h.

typedef PixelRecoRange<float> ThirdHitPredictionFromInvParabola::Range

Definition at line 29 of file ThirdHitPredictionFromInvParabola.h.

typedef TkRotation<double> ThirdHitPredictionFromInvParabola::Rotation

Definition at line 28 of file ThirdHitPredictionFromInvParabola.h.


Constructor & Destructor Documentation

ThirdHitPredictionFromInvParabola::ThirdHitPredictionFromInvParabola ( const GlobalPoint P1,
const GlobalPoint P2,
double  ip,
double  curv,
double  tolerance 
)

Definition at line 22 of file ThirdHitPredictionFromInvParabola.cc.

References init().

00024   : theTolerance(torlerance)
00025 {
00026   init(P1,P2,ip,fabs(curv));
00027 }


Member Function Documentation

double ThirdHitPredictionFromInvParabola::coeffA ( const double &  impactParameter,
int  charge 
) const [private]

Definition at line 118 of file ThirdHitPredictionFromInvParabola.cc.

References p1, p2, pv, ThirdHitPredictionFromInvParabola::MappedPoint< T >::u(), and ThirdHitPredictionFromInvParabola::MappedPoint< T >::v().

Referenced by predV().

00119 {
00120   double u1u2 = p1.u()*p2.u();
00121   double du = p2.u() - p1.u();
00122   double pv = p1.v()*p2.u() - p2.v()*p1.u();
00123   return -charge*pv/du - u1u2*impactParameter;
00124 }

double ThirdHitPredictionFromInvParabola::coeffB ( const double &  impactParameter,
int  charge 
) const [private]

Definition at line 127 of file ThirdHitPredictionFromInvParabola.cc.

References p1, p2, ThirdHitPredictionFromInvParabola::MappedPoint< T >::u(), and ThirdHitPredictionFromInvParabola::MappedPoint< T >::v().

Referenced by predV().

00128 {
00129   double dv = p2.v() - p1.v();
00130   double du = p2.u() - p1.u();
00131   double su = p2.u() + p1.u();
00132   return charge*dv/du - su*impactParameter;
00133 }

void ThirdHitPredictionFromInvParabola::init ( const GlobalPoint P1,
const GlobalPoint P2,
double  ip,
double  curv 
)

Definition at line 31 of file ThirdHitPredictionFromInvParabola.cc.

References PixelRecoRange< T >::intersection(), ipFromCurvature(), p1, p2, PixelRecoRange< T >::sort(), theIpRangeMinus, theIpRangePlus, theRotation, Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by ThirdHitPredictionFromInvParabola().

00032 {
00033 //  GlobalVector aX = GlobalVector( P2.x()-P1.x(), P2.y()-P1.y(), 0.).unit();
00034   GlobalVector aX = GlobalVector( P1.x(), P1.y(), 0.).unit();
00035   GlobalVector aY( -aX.y(), aX.x(), 0.); 
00036   GlobalVector aZ( 0., 0., 1.);
00037   theRotation = Rotation(aX,aY,aZ); 
00038 
00039   p1 = PointUV(Point2D(P1.x(),P1.y()), &theRotation);
00040   p2 = PointUV(Point2D(P2.x(),P2.y()), &theRotation);
00041 
00042   Range ipRange(-ip, ip); 
00043   ipRange.sort();
00044   
00045   double ipIntyPlus = ipFromCurvature(0.,1);
00046   double ipCurvPlus = ipFromCurvature(fabs(curv), 1);
00047   double ipCurvMinus = ipFromCurvature(fabs(curv), -1);
00048 
00049   
00050   Range ipRangePlus = Range(ipIntyPlus, ipCurvPlus); ipRangePlus.sort();
00051   Range ipRangeMinus = Range(-ipIntyPlus, ipCurvMinus); ipRangeMinus.sort();
00052 
00053   theIpRangePlus  = ipRangePlus.intersection(ipRange);
00054   theIpRangeMinus = ipRangeMinus.intersection(ipRange);
00055 }

double ThirdHitPredictionFromInvParabola::ipFromCurvature ( const double &  curvature,
int  charge 
) const [private]

Definition at line 107 of file ThirdHitPredictionFromInvParabola.cc.

References p1, p2, pv, ThirdHitPredictionFromInvParabola::MappedPoint< T >::u(), and ThirdHitPredictionFromInvParabola::MappedPoint< T >::v().

Referenced by init().

00108 {
00109   double u1u2 = p1.u()*p2.u();
00110   double du = p2.u() - p1.u();
00111   double pv = p1.v()*p2.u() - p2.v()*p1.u();
00112 
00113   double inInf = -charge*pv/du/u1u2;
00114   return inInf-curvature/2./u1u2;
00115 }

ThirdHitPredictionFromInvParabola::Range ThirdHitPredictionFromInvParabola::operator() ( double  radius,
int  charge 
) const

Definition at line 57 of file ThirdHitPredictionFromInvParabola.cc.

References d2, PixelRecoRange< T >::empty(), i, PixelRecoRange< T >::intersection(), PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), predV(), r, r1, r2, PixelRecoRange< T >::sort(), sqr(), funct::sqrt(), theIpRangeMinus, theIpRangePlus, theRotation, theTolerance, ThirdHitPredictionFromInvParabola::MappedPoint< T >::unmap(), and v.

00059 {
00060   Range predRPhi(1.,-1.);
00061 
00062   double invr2 = 1/radius/radius;
00063   double u = invr2;
00064   double v = 0.;
00065   int nIter=10;
00066 
00067   Range ip = (charge > 0) ? theIpRangePlus : theIpRangeMinus;
00068 
00069   for (int i=0; i < nIter; ++i) {
00070     v = predV(u, ip.min(), charge); 
00071     double d2 = invr2-sqr(v);
00072     u = (d2 > 0) ? sqrt(d2) : 0.;
00073   }
00074   PointUV  pred_tmp1(u, v,  &theRotation);
00075   double phi1 = pred_tmp1.unmap().phi(); 
00076   while ( phi1 >= M_PI) phi1 -= 2*M_PI;
00077   while ( phi1 < -M_PI) phi1 += 2*M_PI;
00078 
00079 
00080   for (int i=0; i < nIter; ++i) {
00081     v = predV(u, ip.max(), charge); 
00082     double d2 = invr2-sqr(v);
00083     u = (d2 > 0) ? sqrt(d2) : 0.;
00084   }
00085   PointUV  pred_tmp2(u, v,  &theRotation);
00086   double phi2 = pred_tmp2.unmap().phi(); 
00087   while ( phi2-phi1 >= M_PI) phi2 -= 2*M_PI;
00088   while ( phi2-phi1 < -M_PI) phi2 += 2*M_PI;
00089 
00090 // check faster alternative, without while(..) it is enough to:
00091 //  phi2 = phi1+radius*(pred_tmp2.v()-pred_tmp1.v()); 
00092 
00093   if (ip.empty()) {
00094     Range r1(phi1*radius-theTolerance, phi1*radius+theTolerance); 
00095     Range r2(phi2*radius-theTolerance, phi2*radius+theTolerance); 
00096     predRPhi = r1.intersection(r2);
00097   } else {
00098     Range r(phi1, phi2); 
00099     r.sort();
00100     predRPhi= Range(radius*r.min()-theTolerance, radius*r.max()+theTolerance);
00101   }
00102   return predRPhi;
00103 
00104 }

double ThirdHitPredictionFromInvParabola::predV ( const double &  u,
const double &  ip,
int  charge 
) const [private]

Definition at line 136 of file ThirdHitPredictionFromInvParabola.cc.

References coeffA(), coeffB(), and sqr().

Referenced by operator()().

00137 {
00138   return -charge*( coeffA(ip,charge) - coeffB(ip,charge)*u - ip*sqr(u));
00139 }


Member Data Documentation

PointUV ThirdHitPredictionFromInvParabola::p1 [private]

Definition at line 76 of file ThirdHitPredictionFromInvParabola.h.

Referenced by coeffA(), coeffB(), init(), and ipFromCurvature().

PointUV ThirdHitPredictionFromInvParabola::p2 [private]

Definition at line 76 of file ThirdHitPredictionFromInvParabola.h.

Referenced by coeffA(), coeffB(), init(), and ipFromCurvature().

Range ThirdHitPredictionFromInvParabola::theIpRangeMinus [private]

Definition at line 78 of file ThirdHitPredictionFromInvParabola.h.

Referenced by init(), and operator()().

Range ThirdHitPredictionFromInvParabola::theIpRangePlus [private]

Definition at line 78 of file ThirdHitPredictionFromInvParabola.h.

Referenced by init(), and operator()().

Rotation ThirdHitPredictionFromInvParabola::theRotation [private]

Definition at line 74 of file ThirdHitPredictionFromInvParabola.h.

Referenced by init(), and operator()().

float ThirdHitPredictionFromInvParabola::theTolerance [private]

Definition at line 79 of file ThirdHitPredictionFromInvParabola.h.

Referenced by operator()().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:33:26 2009 for CMSSW by  doxygen 1.5.4