CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 ()
 

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 18 of file ThirdHitPredictionFromInvLine.h.

Member Typedef Documentation

Definition at line 79 of file ThirdHitPredictionFromInvLine.h.

Definition at line 21 of file ThirdHitPredictionFromInvLine.h.

Definition at line 20 of file ThirdHitPredictionFromInvLine.h.

Constructor & Destructor Documentation

ThirdHitPredictionFromInvLine::ThirdHitPredictionFromInvLine ( const GlobalPoint P1,
const GlobalPoint P2,
double  errorRPhiP1 = 1.,
double  errorRPhiP2 = 1. 
)

Definition at line 23 of file ThirdHitPredictionFromInvLine.cc.

References add(), theRotation, Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

27  : nPoints(0),
28  theSum(0.),
29  theSumU(0.),
30  theSumUU(0.),
31  theSumV(0.),
32  theSumUV(0.),
33  theSumVV(0.),
34  hasParameters(false),
37  theChi2(0.) {
38  GlobalVector aX = GlobalVector(P1.x(), P1.y(), 0.).unit();
39  GlobalVector aY(-aX.y(), aX.x(), 0.);
40  GlobalVector aZ(0., 0., 1.);
41  theRotation = Rotation(aX, aY, aZ);
42 
43  add(P1, errorRPhiP1);
44  add(P2, errorRPhiP2);
45 }
void add(const GlobalPoint &p, double erroriRPhi=1.)
T y() const
Definition: PV3DBase.h:60
Vector3DBase unit() const
Definition: Vector3DBase.h:54
T x() const
Definition: PV3DBase.h:59
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Function Documentation

void ThirdHitPredictionFromInvLine::add ( const GlobalPoint p,
double  erroriRPhi = 1. 
)

Definition at line 58 of file ThirdHitPredictionFromInvLine.cc.

References PV3DBase< T, PVType, FrameType >::perp(), sqr(), theRotation, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by counter.Counter::register(), and ThirdHitPredictionFromInvLine().

58  {
59  double weigth = sqr(sqr(p.perp()) / errorRPhi);
60  add(PointUV(Point2D(p.x(), p.y()), &theRotation), weigth);
61 }
void add(const GlobalPoint &p, double erroriRPhi=1.)
T perp() const
Definition: PV3DBase.h:69
Basic2DVector< double > Point2D
T y() const
Definition: PV3DBase.h:60
int sqr(const T &t)
T x() const
Definition: PV3DBase.h:59
void ThirdHitPredictionFromInvLine::add ( const ThirdHitPredictionFromInvLine::PointUV point,
double  weight 
)
private

Definition at line 63 of file ThirdHitPredictionFromInvLine.cc.

References check(), hasParameters, nPoints, sqr(), theSum, theSumU, theSumUU, theSumUV, theSumV, theSumVV, ThirdHitPredictionFromInvLine::MappedPoint< T >::u(), and ThirdHitPredictionFromInvLine::MappedPoint< T >::v().

Referenced by counter.Counter::register().

void ThirdHitPredictionFromInvLine::check ( void  )
private

Definition at line 94 of file ThirdHitPredictionFromInvLine.cc.

References funct::A, TtFullHadDaughter::B, hasParameters, rho, sqr(), mathSSE::sqrt(), theChi2, theCurvatureError, theCurvatureValue, theSum, theSumU, theSumUU, theSumUV, theSumV, and theSumVV.

Referenced by add(), and remove().

94  {
95  if (hasParameters)
96  return;
97 
98  long double D = theSumUU * theSum - theSumU * theSumU;
99  long double A = (theSumUV * theSum - theSumU * theSumV) / D;
100  long double B = (theSumUU * theSumV - theSumUV * theSumU) / D;
101  double rho = 2. * fabs(B) / sqrt(1 + sqr(A));
102  double sigmaA2 = theSum / D;
103  double sigmaB2 = theSumUU / D;
104 
105  hasParameters = true;
106  theCurvatureError = sqrt(sqr(rho / B) * sigmaB2 + sqr(rho / (1 + sqr(A))) * sigmaA2);
107  theCurvatureValue = 2. * fabs(B) / sqrt(1 + sqr(A));
108  theChi2 = theSumVV - 2 * A * theSumUV - 2 * B * theSumV + 2 * A * B * theSumU + B * B * theSum + A * A * theSumUU;
109 }
int sqr(const T &t)
T sqrt(T t)
Definition: SSEVec.h:19
static const std::string B
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
double ThirdHitPredictionFromInvLine::chi2 ( void  ) const
inline
GlobalPoint ThirdHitPredictionFromInvLine::crossing ( double  radius) const

Definition at line 47 of file ThirdHitPredictionFromInvLine.cc.

References funct::A, TtFullHadDaughter::B, CommonMethods::delta(), sqr(), mathSSE::sqrt(), theRotation, theSum, theSumU, theSumUU, theSumUV, theSumV, createJobs::tmp, MetAnalyzer::u1, Basic2DVector< T >::x(), and Basic2DVector< T >::y().

47  {
48  double A = -(theSum * theSumUV - theSumU * theSumV) / (sqr(theSumU) - theSum * theSumUU);
49  double B = (theSumU * theSumUV - theSumUU * theSumV) / (sqr(theSumU) - theSum * theSumUU);
50  double delta = sqr(2. * A * B) - 4 * (1 + sqr(A)) * (sqr(B) - sqr(1 / radius));
51  double sqrtdelta = (delta > 0.) ? sqrt(delta) : 0.;
52  double u1 = (-2. * A * B + sqrtdelta) / 2. / (1 + sqr(A));
53  double v1 = A * u1 + B;
54  Point2D tmp = PointUV(u1, v1, &theRotation).unmap();
55  return GlobalPoint(tmp.x(), tmp.y(), 0.);
56 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
int sqr(const T &t)
T sqrt(T t)
Definition: SSEVec.h:19
static const std::string B
T y() const
Cartesian y coordinate.
tmp
align.sh
Definition: createJobs.py:716
T x() const
Cartesian x coordinate.
double ThirdHitPredictionFromInvLine::curvature ( ) const
inline
double ThirdHitPredictionFromInvLine::errorCurvature ( ) const
inline
void ThirdHitPredictionFromInvLine::print ( void  ) const

Definition at line 89 of file ThirdHitPredictionFromInvLine.cc.

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

89  {
90  std::cout << " nPoints: " << nPoints << " theSumU: " << theSumU << " theSumUU: " << theSumUU
91  << " theSumV: " << theSumV << " theSumUV: " << theSumUV << std::endl;
92 }
tuple cout
Definition: gather_cfg.py:144
void ThirdHitPredictionFromInvLine::remove ( const GlobalPoint p,
double  erroriRPhi = 1. 
)

Definition at line 75 of file ThirdHitPredictionFromInvLine.cc.

References check(), hasParameters, nPoints, PV3DBase< T, PVType, FrameType >::perp(), point, 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().

75  {
76  hasParameters = false;
77  PointUV point(Point2D(p.x(), p.y()), &theRotation);
78  double weigth = sqr(sqr(p.perp()) / errorRPhi);
79  nPoints--;
80  theSum -= weigth;
81  theSumU -= point.u() * weigth;
82  theSumUU -= sqr(point.u()) * weigth;
83  theSumV -= point.v() * weigth;
84  theSumUV -= point.u() * point.v() * weigth;
85  theSumVV -= sqr(point.v()) * weigth;
86  check();
87 }
T perp() const
Definition: PV3DBase.h:69
Basic2DVector< double > Point2D
T y() const
Definition: PV3DBase.h:60
int sqr(const T &t)
T x() const
Definition: PV3DBase.h:59
*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

Member Data Documentation

bool ThirdHitPredictionFromInvLine::hasParameters
private

Definition at line 87 of file ThirdHitPredictionFromInvLine.h.

Referenced by add(), check(), chi2(), curvature(), errorCurvature(), and remove().

int ThirdHitPredictionFromInvLine::nPoints
private

Definition at line 85 of file ThirdHitPredictionFromInvLine.h.

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

double ThirdHitPredictionFromInvLine::theChi2
private

Definition at line 88 of file ThirdHitPredictionFromInvLine.h.

Referenced by check(), and chi2().

double ThirdHitPredictionFromInvLine::theCurvatureError
private

Definition at line 88 of file ThirdHitPredictionFromInvLine.h.

Referenced by check(), and errorCurvature().

double ThirdHitPredictionFromInvLine::theCurvatureValue
private

Definition at line 88 of file ThirdHitPredictionFromInvLine.h.

Referenced by check(), and curvature().

Rotation ThirdHitPredictionFromInvLine::theRotation
private
long double ThirdHitPredictionFromInvLine::theSum
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

long double ThirdHitPredictionFromInvLine::theSumU
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

long double ThirdHitPredictionFromInvLine::theSumUU
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

long double ThirdHitPredictionFromInvLine::theSumUV
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

long double ThirdHitPredictionFromInvLine::theSumV
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

long double ThirdHitPredictionFromInvLine::theSumVV
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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