CMS 3D CMS Logo

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

◆ PointUV

Definition at line 79 of file ThirdHitPredictionFromInvLine.h.

◆ Range

Definition at line 21 of file ThirdHitPredictionFromInvLine.h.

◆ Rotation

Definition at line 20 of file ThirdHitPredictionFromInvLine.h.

Constructor & Destructor Documentation

◆ ThirdHitPredictionFromInvLine()

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 x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
Vector3DBase unit() const
Definition: Vector3DBase.h:54
Global3DVector GlobalVector
Definition: GlobalVector.h:10

Member Function Documentation

◆ add() [1/2]

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

Definition at line 58 of file ThirdHitPredictionFromInvLine.cc.

References AlCaHLTBitMon_ParallelJobs::p, sqr(), and theRotation.

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.)
Basic2DVector< double > Point2D

◆ add() [2/2]

void ThirdHitPredictionFromInvLine::add ( const ThirdHitPredictionFromInvLine::PointUV point,
double  weight 
)
private

Definition at line 63 of file ThirdHitPredictionFromInvLine.cc.

References check(), hasParameters, nPoints, point, sqr(), theSum, theSumU, theSumUU, theSumUV, theSumV, and theSumVV.

Referenced by counter.Counter::register().

63  {
64  hasParameters = false;
65  nPoints++;
66  theSum += weigth;
67  theSumU += point.u() * weigth;
68  theSumUU += sqr(point.u()) * weigth;
69  theSumV += point.v() * weigth;
70  theSumUV += point.u() * point.v() * weigth;
71  theSumVV += sqr(point.v()) * weigth;
72  check();
73 }
*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

◆ check()

void ThirdHitPredictionFromInvLine::check ( void  )
private

Definition at line 94 of file ThirdHitPredictionFromInvLine.cc.

References A, 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 }
Definition: APVGainStruct.h:7
T sqrt(T t)
Definition: SSEVec.h:23
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
Definition: APVGainStruct.h:7

◆ chi2()

double ThirdHitPredictionFromInvLine::chi2 ( void  ) const
inline

◆ crossing()

GlobalPoint ThirdHitPredictionFromInvLine::crossing ( double  radius) const

Definition at line 47 of file ThirdHitPredictionFromInvLine.cc.

References A, B, dumpMFGeometry_cfg::delta, CosmicsPD_Skims::radius, sqr(), mathSSE::sqrt(), theRotation, theSum, theSumU, theSumUU, theSumUV, theSumV, createJobs::tmp, and testProducerWithPsetDescEmpty_cfi::u1.

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 }
Definition: APVGainStruct.h:7
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T sqrt(T t)
Definition: SSEVec.h:23
Definition: APVGainStruct.h:7
tmp
align.sh
Definition: createJobs.py:716

◆ curvature()

double ThirdHitPredictionFromInvLine::curvature ( ) const
inline

◆ errorCurvature()

double ThirdHitPredictionFromInvLine::errorCurvature ( ) const
inline

◆ print()

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 }

◆ remove()

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

Definition at line 75 of file ThirdHitPredictionFromInvLine.cc.

References check(), hasParameters, nPoints, AlCaHLTBitMon_ParallelJobs::p, point, sqr(), theRotation, theSum, theSumU, theSumUU, theSumUV, theSumV, and theSumVV.

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 }
Basic2DVector< double > Point2D
*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

◆ size()

int ThirdHitPredictionFromInvLine::size ( void  ) const
inline

Member Data Documentation

◆ hasParameters

bool ThirdHitPredictionFromInvLine::hasParameters
private

Definition at line 87 of file ThirdHitPredictionFromInvLine.h.

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

◆ nPoints

int ThirdHitPredictionFromInvLine::nPoints
private

Definition at line 85 of file ThirdHitPredictionFromInvLine.h.

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

◆ theChi2

double ThirdHitPredictionFromInvLine::theChi2
private

Definition at line 88 of file ThirdHitPredictionFromInvLine.h.

Referenced by check(), and chi2().

◆ theCurvatureError

double ThirdHitPredictionFromInvLine::theCurvatureError
private

Definition at line 88 of file ThirdHitPredictionFromInvLine.h.

Referenced by check(), and errorCurvature().

◆ theCurvatureValue

double ThirdHitPredictionFromInvLine::theCurvatureValue
private

Definition at line 88 of file ThirdHitPredictionFromInvLine.h.

Referenced by check(), and curvature().

◆ theRotation

Rotation ThirdHitPredictionFromInvLine::theRotation
private

◆ theSum

long double ThirdHitPredictionFromInvLine::theSum
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

◆ theSumU

long double ThirdHitPredictionFromInvLine::theSumU
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

◆ theSumUU

long double ThirdHitPredictionFromInvLine::theSumUU
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

◆ theSumUV

long double ThirdHitPredictionFromInvLine::theSumUV
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

◆ theSumV

long double ThirdHitPredictionFromInvLine::theSumV
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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

◆ theSumVV

long double ThirdHitPredictionFromInvLine::theSumVV
private

Definition at line 86 of file ThirdHitPredictionFromInvLine.h.

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