CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
ThirdHitPredictionFromInvLine Class Reference

#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
 

Detailed Description

Definition at line 17 of file ThirdHitPredictionFromInvLine.h.

Member Typedef Documentation

Definition at line 69 of file ThirdHitPredictionFromInvLine.h.

Definition at line 22 of file ThirdHitPredictionFromInvLine.h.

Definition at line 21 of file ThirdHitPredictionFromInvLine.h.

Constructor & Destructor Documentation

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().

23  : nPoints(0), theSum(0.), theSumU(0.), theSumUU(0.), theSumV(0.), theSumUV(0.), theSumVV(0.),
25 {
26  GlobalVector aX = GlobalVector( P1.x(), P1.y(), 0.).unit();
27  GlobalVector aY( -aX.y(), aX.x(), 0.);
28  GlobalVector aZ( 0., 0., 1.);
29  theRotation = Rotation(aX,aY,aZ);
30 
31  add(P1, errorRPhiP1);
32  add(P2, errorRPhiP2);
33 
34 }
void add(const GlobalPoint &p, double erroriRPhi=1.)
T y() const
Definition: PV3DBase.h:62
Vector3DBase unit() const
Definition: Vector3DBase.h:57
T x() const
Definition: PV3DBase.h:61
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Function Documentation

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().

50 {
51  double weigth = sqr(sqr(p.perp())/errorRPhi);
52  add(PointUV(Point2D(p.x(),p.y()), &theRotation), weigth);
53 }
void add(const GlobalPoint &p, double erroriRPhi=1.)
T perp() const
Definition: PV3DBase.h:71
T y() const
Definition: PV3DBase.h:62
Basic2DVector< double > Point2D
Square< F >::type sqr(const F &f)
Definition: Square.h:13
T x() const
Definition: PV3DBase.h:61
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, hasParameters, rho, funct::sqr(), mathSSE::sqrt(), theChi2, theCurvatureError, theCurvatureValue, theSum, theSumU, theSumUU, theSumUV, theSumV, and theSumVV.

Referenced by chi2(), curvature(), and errorCurvature().

88 {
89  if (hasParameters) return;
90 
91  long double D = theSumUU*theSum - theSumU*theSumU;
92  long double A = (theSumUV*theSum-theSumU*theSumV)/D;
93  long double B = (theSumUU*theSumV-theSumUV*theSumU)/D;
94  double rho = 2.*fabs(B)/sqrt(1+sqr(A));
95  double sigmaA2 = theSum/D;
96  double sigmaB2 = theSumUU/D;
97 
98  hasParameters = true;
99  theCurvatureError = sqrt( sqr(rho/B)*sigmaB2+ sqr(rho/(1+sqr(A)))*sigmaA2);
100  theCurvatureValue = 2.*fabs(B)/sqrt(1+sqr(A));
101  theChi2 = theSumVV - 2*A*theSumUV - 2*B*theSumV + 2*A*B*theSumU + B*B*theSum + A*A*theSumUU;
102 }
Definition: DDAxes.h:10
T sqrt(T t)
Definition: SSEVec.h:46
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:150
Square< F >::type sqr(const F &f)
Definition: Square.h:13
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().

37 {
40  double delta = sqr(2.*A*B) - 4*(1+sqr(A))*(sqr(B)-sqr(1/radius));
41  double sqrtdelta = (delta > 0.) ? sqrt(delta) : 0.;
42  double u1 = (-2.*A*B + sqrtdelta)/2./(1+sqr(A));
43  double v1 = A*u1+B;
44  Point2D tmp = PointUV(u1,v1, &theRotation).unmap();
45  return GlobalPoint(tmp.x(), tmp.y(), 0.);
46 }
dbl * delta
Definition: mlp_gen.cc:36
double_binary B
Definition: DDStreamer.cc:234
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T sqrt(T t)
Definition: SSEVec.h:46
T y() const
Cartesian y coordinate.
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
Square< F >::type sqr(const F &f)
Definition: Square.h:13
T x() const
Cartesian x coordinate.
double ThirdHitPredictionFromInvLine::curvature ( ) const
inline
double ThirdHitPredictionFromInvLine::errorCurvature ( ) const
inline
void ThirdHitPredictionFromInvLine::print ( void  ) const

Definition at line 81 of file ThirdHitPredictionFromInvLine.cc.

References gather_cfg::cout, nPoints, theSumU, theSumUU, theSumUV, and theSumV.

82 {
83  std::cout <<" nPoints: " << nPoints <<" theSumU: "<< theSumU <<" theSumUU: "<<theSumUU
84  <<" theSumV: "<< theSumV <<" theSumUV: "<<theSumUV<<std::endl;
85 }
tuple cout
Definition: gather_cfg.py:121
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().

68 {
69  hasParameters = false;
70  PointUV point(Point2D(p.x(),p.y()), &theRotation);
71  double weigth = sqr(sqr(p.perp())/errorRPhi);
72  nPoints--;
73  theSum -= weigth;
74  theSumU -= point.u()*weigth;
75  theSumUU -= sqr(point.u())*weigth;
76  theSumV -= point.v()*weigth;
77  theSumUV -= point.u()*point.v()*weigth;
78  theSumVV -= sqr(point.v())*weigth;
79 }
T perp() const
Definition: PV3DBase.h:71
T y() const
Definition: PV3DBase.h:62
Basic2DVector< double > Point2D
Square< F >::type sqr(const F &f)
Definition: Square.h:13
T x() const
Definition: PV3DBase.h:61
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
int ThirdHitPredictionFromInvLine::size ( void  ) const
inline

Definition at line 26 of file ThirdHitPredictionFromInvLine.h.

References nPoints.

Member Data Documentation

bool ThirdHitPredictionFromInvLine::hasParameters
mutableprivate

Definition at line 77 of file ThirdHitPredictionFromInvLine.h.

Referenced by add(), check(), and remove().

int ThirdHitPredictionFromInvLine::nPoints
private

Definition at line 75 of file ThirdHitPredictionFromInvLine.h.

Referenced by add(), print(), remove(), and size().

double ThirdHitPredictionFromInvLine::theChi2
mutableprivate

Definition at line 78 of file ThirdHitPredictionFromInvLine.h.

Referenced by check(), and chi2().

double ThirdHitPredictionFromInvLine::theCurvatureError
mutableprivate

Definition at line 78 of file ThirdHitPredictionFromInvLine.h.

Referenced by check(), and errorCurvature().

double ThirdHitPredictionFromInvLine::theCurvatureValue
mutableprivate

Definition at line 78 of file ThirdHitPredictionFromInvLine.h.

Referenced by check(), and curvature().

Rotation ThirdHitPredictionFromInvLine::theRotation
private
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.

Referenced by add(), check(), and remove().