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.

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 }

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

Member Function Documentation

◆ add() [1/2]

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

Definition at line 58 of file ThirdHitPredictionFromInvLine.cc.

58  {
59  double weigth = sqr(sqr(p.perp()) / errorRPhi);
60  add(PointUV(Point2D(p.x(), p.y()), &theRotation), weigth);
61 }

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

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

◆ add() [2/2]

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

Definition at line 63 of file ThirdHitPredictionFromInvLine.cc.

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 }

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

Referenced by counter.Counter::register().

◆ check()

void ThirdHitPredictionFromInvLine::check ( void  )
private

Definition at line 94 of file ThirdHitPredictionFromInvLine.cc.

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 }

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

Referenced by add(), and remove().

◆ chi2()

double ThirdHitPredictionFromInvLine::chi2 ( void  ) const
inline

Definition at line 46 of file ThirdHitPredictionFromInvLine.h.

46  {
48  return theChi2;
49  }

References cms::cuda::assert(), hasParameters, and theChi2.

◆ crossing()

GlobalPoint ThirdHitPredictionFromInvLine::crossing ( double  radius) const

Definition at line 47 of file ThirdHitPredictionFromInvLine.cc.

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 }

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

◆ curvature()

double ThirdHitPredictionFromInvLine::curvature ( ) const
inline

Definition at line 36 of file ThirdHitPredictionFromInvLine.h.

36  {
38  return theCurvatureValue;
39  }

References cms::cuda::assert(), hasParameters, and theCurvatureValue.

◆ errorCurvature()

double ThirdHitPredictionFromInvLine::errorCurvature ( ) const
inline

Definition at line 41 of file ThirdHitPredictionFromInvLine.h.

41  {
43  return theCurvatureError;
44  }

References cms::cuda::assert(), hasParameters, and theCurvatureError.

◆ print()

void ThirdHitPredictionFromInvLine::print ( void  ) const

Definition at line 89 of file ThirdHitPredictionFromInvLine.cc.

89  {
90  std::cout << " nPoints: " << nPoints << " theSumU: " << theSumU << " theSumUU: " << theSumUU
91  << " theSumV: " << theSumV << " theSumUV: " << theSumUV << std::endl;
92 }

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

◆ remove()

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

Definition at line 75 of file ThirdHitPredictionFromInvLine.cc.

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 }

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

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

Vector3DBase
Definition: Vector3DBase.h:8
ThirdHitPredictionFromInvLine::theSumUV
long double theSumUV
Definition: ThirdHitPredictionFromInvLine.h:86
ThirdHitPredictionFromInvLine::add
void add(const GlobalPoint &p, double erroriRPhi=1.)
Definition: ThirdHitPredictionFromInvLine.cc:58
ThirdHitPredictionFromInvLine::theCurvatureValue
double theCurvatureValue
Definition: ThirdHitPredictionFromInvLine.h:88
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
sqr
T sqr(T t)
Definition: ThirdHitPredictionFromInvLine.cc:11
cms::cuda::assert
assert(be >=bs)
ThirdHitPredictionFromInvLine::theCurvatureError
double theCurvatureError
Definition: ThirdHitPredictionFromInvLine.h:88
ThirdHitPredictionFromInvLine::theRotation
Rotation theRotation
Definition: ThirdHitPredictionFromInvLine.h:84
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Point2D
Basic2DVector< double > Point2D
Definition: ThirdHitPredictionFromInvLine.cc:16
ThirdHitPredictionFromInvLine::theSumV
long double theSumV
Definition: ThirdHitPredictionFromInvLine.h:86
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ThirdHitPredictionFromInvLine::theSum
long double theSum
Definition: ThirdHitPredictionFromInvLine.h:86
DDAxes::rho
Basic2DVector< double >
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
ThirdHitPredictionFromInvLine::theChi2
double theChi2
Definition: ThirdHitPredictionFromInvLine.h:88
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
testProducerWithPsetDescEmpty_cfi.u1
u1
Definition: testProducerWithPsetDescEmpty_cfi.py:49
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
funct::D
DecomposeProduct< arg, typename Div::arg > D
Definition: Factorize.h:141
ThirdHitPredictionFromInvLine::check
void check()
Definition: ThirdHitPredictionFromInvLine.cc:94
ThirdHitPredictionFromInvLine::nPoints
int nPoints
Definition: ThirdHitPredictionFromInvLine.h:85
ThirdHitPredictionFromInvLine::theSumVV
long double theSumVV
Definition: ThirdHitPredictionFromInvLine.h:86
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
ThirdHitPredictionFromInvLine::PointUV
MappedPoint< double > PointUV
Definition: ThirdHitPredictionFromInvLine.h:79
ThirdHitPredictionFromInvLine::Rotation
TkRotation< double > Rotation
Definition: ThirdHitPredictionFromInvLine.h:20
point
*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
ThirdHitPredictionFromInvLine::theSumU
long double theSumU
Definition: ThirdHitPredictionFromInvLine.h:86
A
ThirdHitPredictionFromInvLine::theSumUU
long double theSumUU
Definition: ThirdHitPredictionFromInvLine.h:86
ThirdHitPredictionFromInvLine::hasParameters
bool hasParameters
Definition: ThirdHitPredictionFromInvLine.h:87