CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MultiTrackVertexLinkKinematicConstraint Class Reference

#include <MultiTrackVertexLinkKinematicConstraint.h>

Inheritance diagram for MultiTrackVertexLinkKinematicConstraint:
MultiTrackKinematicConstraint

Public Member Functions

MultiTrackVertexLinkKinematicConstraintclone () const override
 
 MultiTrackVertexLinkKinematicConstraint (GlobalPoint &ref)
 
int numberOfEquations () const override
 
AlgebraicMatrix parametersDerivative (const std::vector< KinematicState > &states, const GlobalPoint &point) const override
 
AlgebraicMatrix positionDerivative (const std::vector< KinematicState > &states, const GlobalPoint &point) const override
 
AlgebraicVector value (const std::vector< KinematicState > &states, const GlobalPoint &point) const override
 
- Public Member Functions inherited from MultiTrackKinematicConstraint
 MultiTrackKinematicConstraint ()
 
virtual ~MultiTrackKinematicConstraint ()
 

Private Attributes

GlobalPoint refPoint
 

Detailed Description

This is an specialized version of MultiTrackVertexLinkKinematicConstraint. It constraints the sum of 4-vectors combined at a secondary vertex to be in parallel to the vertex link after considering the helix bend of the summed vector when propagating to the primary vertex.

Lars Perchalla, Philip Sauerland, July 2010

Definition at line 17 of file MultiTrackVertexLinkKinematicConstraint.h.

Constructor & Destructor Documentation

MultiTrackVertexLinkKinematicConstraint::MultiTrackVertexLinkKinematicConstraint ( GlobalPoint ref)
inline

Member Function Documentation

MultiTrackVertexLinkKinematicConstraint* MultiTrackVertexLinkKinematicConstraint::clone ( void  ) const
inlineoverridevirtual
int MultiTrackVertexLinkKinematicConstraint::numberOfEquations ( ) const
overridevirtual

Number of equations per track used for the fit

Implements MultiTrackKinematicConstraint.

Definition at line 121 of file MultiTrackVertexLinkKinematicConstraint.cc.

Referenced by MultiTrackVertexLinkKinematicConstraint().

121  {
122  return 2;
123 }
AlgebraicMatrix MultiTrackVertexLinkKinematicConstraint::parametersDerivative ( const std::vector< KinematicState > &  states,
const GlobalPoint point 
) const
overridevirtual

Returns a matrix of derivatives of constraint equations w.r.t. particle parameters

Implements MultiTrackKinematicConstraint.

Definition at line 37 of file MultiTrackVertexLinkKinematicConstraint.cc.

References a, cuy::col, PVValHelper::dx, PVValHelper::dy, mps_fire::i, makeMuonMisalignmentScenario::matrix, pileupDistInMC::num, funct::pow(), PVValHelper::pT, refPoint, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and z.

Referenced by MultiTrackVertexLinkKinematicConstraint().

37  {
38  int num = states.size();
39  if(num<2) throw VertexException("MultiTrackVertexLinkKinematicConstraint::parametersDerivative <2 states passed");
40 
41  //2 equations (for all tracks)
42  AlgebraicMatrix matrix(2,num*7,0);//AlgebraicMatrix starts from 1
43  double dx = point.x() - refPoint.x();
44  double dy = point.y() - refPoint.y();
45  double dT = sqrt(pow(dx,2) + pow(dy,2));
46 
47  double pxSum=0, pySum=0, pzSum=0;
48  double aSum = 0;
49  for(std::vector<KinematicState>::const_iterator i = states.begin(); i != states.end(); i++)
50  {
51  double a = - i->particleCharge() * i->magneticField()->inInverseGeV(i->globalPosition()).z();
52  aSum += a;
53 
54  pxSum += i->kinematicParameters()(3) - a*(point.y() - i->kinematicParameters()(1));
55  pySum += i->kinematicParameters()(4) + a*(point.x() - i->kinematicParameters()(0));
56  pzSum += i->kinematicParameters()(5);
57  }
58 
59  double pT = sqrt(pow(pxSum,2) + pow(pySum,2));
60  double pSum = sqrt(pow(pxSum,2) + pow(pySum,2) + pow(pzSum,2));
61 
62  int col=0;
63  for(std::vector<KinematicState>::const_iterator i = states.begin(); i != states.end(); i++){
64  double a = - i->particleCharge() * i->magneticField()->inInverseGeV(i->globalPosition()).z();
65 
66  matrix(1,1+col*7) = a*(-(pT/pow(pySum,2)) + pxSum/pow(pySum,2) - (4*pySum)/(aSum*dT*sqrt(-(pow(aSum,2)*pow(dT,2)) + 4*pow(pT,2))) + (1 + (2*pySum)/(aSum*dT))/pT);//dH/dx
67  matrix(1,2+col*7) = (a*(aSum*dT*(pT - pxSum) + 2*(-1 + (2*pT)/sqrt(-(pow(aSum,2)*pow(dT,2)) + 4*pow(pT,2)))*pxSum*pySum))/(aSum*dT*pT*pySum);//dH/dy
68  //dH/dz=0
69  matrix(1,4+col*7) = (aSum*dT*(pT - pxSum) + 2*(-1 + (2*pT)/sqrt(-(pow(aSum,2)*pow(dT,2)) + 4*pow(pT,2)))*pxSum*pySum)/(aSum*dT*pT*pySum);//dH/dpx
70  matrix(1,5+col*7) = pT/pow(pySum,2) - pxSum/pow(pySum,2) + (4*pySum)/(aSum*dT*sqrt(-(pow(aSum,2)*pow(dT,2)) + 4*pow(pT,2))) + (-1 - (2*pySum)/(aSum*dT))/pT;//dH/dpy
71  //dH/dpz=0
72  //dH/dm=0
73  matrix(2,1+col*7) = (a*(-pSum + pT)*pySum)/(pSum*pT*pzSum);//dH/dx
74  matrix(2,2+col*7) = (a*( pSum - pT)*pxSum)/(pSum*pT*pzSum);//dH/dy
75  //dH/dz
76  matrix(2,4+col*7) = ((-(1/pSum) + 1/pT)*pxSum)/pzSum;//dH/dpx
77  matrix(2,5+col*7) = ((-(1/pSum) + 1/pT)*pySum)/pzSum;//dH/dpy
78  matrix(2,6+col*7) = -(1/pSum) + (pSum - pT)/pow(pzSum,2);//dH/dpz
79  //dH/dm=0
80 
81  col++;
82  }
83 
84  return matrix;
85 }
Common base class.
T y() const
Definition: PV3DBase.h:63
CLHEP::HepMatrix AlgebraicMatrix
T sqrt(T t)
Definition: SSEVec.h:18
double a
Definition: hdecay.h:121
col
Definition: cuy.py:1008
T x() const
Definition: PV3DBase.h:62
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
AlgebraicMatrix MultiTrackVertexLinkKinematicConstraint::positionDerivative ( const std::vector< KinematicState > &  states,
const GlobalPoint point 
) const
overridevirtual

Returns a matrix of derivatives of constraint equations w.r.t. vertex position

Implements MultiTrackKinematicConstraint.

Definition at line 87 of file MultiTrackVertexLinkKinematicConstraint.cc.

References a, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, mps_fire::i, makeMuonMisalignmentScenario::matrix, pileupDistInMC::num, funct::pow(), PVValHelper::pT, refPoint, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by MultiTrackVertexLinkKinematicConstraint().

87  {
88  int num = states.size();
89  if(num<2) throw VertexException("MultiTrackVertexLinkKinematicConstraint::positionDerivative <2 states passed");
90 
91  //2 equations (for all tracks)
92  AlgebraicMatrix matrix(2,3,0);
93  double dx = point.x() - refPoint.x();
94  double dy = point.y() - refPoint.y();
95  double dz = point.z() - refPoint.z();
96  double dT = sqrt(pow(dx,2) + pow(dy,2));
97  double ds = sqrt(pow(dx,2) + pow(dy,2) + pow(dz,2));
98 
99  double pxSum=0, pySum=0, pzSum=0, aSum = 0;
100  for(std::vector<KinematicState>::const_iterator i = states.begin(); i != states.end(); i++){
101  double a = - i->particleCharge() * i->magneticField()->inInverseGeV(i->globalPosition()).z();
102  aSum += a;
103 
104  pxSum += i->kinematicParameters()(3) - a*(point.y() - i->kinematicParameters()(1));
105  pySum += i->kinematicParameters()(4) + a*(point.x() - i->kinematicParameters()(0));
106  pzSum += i->kinematicParameters()(5);
107  }
108  double pT = sqrt(pow(pxSum,2) + pow(pySum,2));
109  double pSum = sqrt(pow(pxSum,2) + pow(pySum,2) + pow(pzSum,2));
110 
111  matrix(1,1) = (-1 + dx/dT)/dy + (2*dx*pT*(1 - (2*pT)/sqrt(-(pow(aSum,2)*pow(dT,2)) + 4*pow(pT,2))))/(aSum*pow(dT,3)) + aSum*(-(1/pT) + pT/pow(pySum,2) - pxSum/pow(pySum,2)) + (2*(-(1/pT) + 2/sqrt(-(pow(aSum,2)*pow(dT,2)) + 4*pow(pT,2)))*pySum)/dT;//dH/dxv
112  matrix(1,2) = 1/dT + (-dT + dx)/pow(dy,2) - (dy*(-2*pT + sqrt(-(pow(aSum,2)*pow(dT,2)) + 4*pow(pT,2))))/(aSum*pow(dT,3)) - ((-2 + sqrt(4 - (pow(aSum,2)*pow(dT,2))/pow(pT,2)))*pxSum)/(dT*pT) - (aSum*(dy*pow(pT,2) + aSum*pow(dT,2)*pxSum))/(dT*pow(pT,2)*sqrt(-(pow(aSum,2)*pow(dT,2)) + 4*pow(pT,2))) + (aSum*(-pT + pxSum))/(pT*pySum);//dH/dyv
113  //dH/dzv=0
114  matrix(2,1) = ((1/ds - 1/dT)*dx)/dz + (aSum*(pSum - pT)*pySum)/(pSum*pT*pzSum);//dH/dxv
115  matrix(2,2) = ((1/ds - 1/dT)*dy)/dz - (aSum*(pSum - pT)*pxSum)/(pSum*pT*pzSum);//dH/dyv
116  matrix(2,3) = 1/ds + (-ds + dT)/pow(dz,2);//dH/dzv
117 
118  return matrix;
119 }
Common base class.
T y() const
Definition: PV3DBase.h:63
CLHEP::HepMatrix AlgebraicMatrix
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
double a
Definition: hdecay.h:121
T x() const
Definition: PV3DBase.h:62
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
AlgebraicVector MultiTrackVertexLinkKinematicConstraint::value ( const std::vector< KinematicState > &  states,
const GlobalPoint point 
) const
overridevirtual

Returns a vector of values of constraint equations at the point where the input particles are defined.

Implements MultiTrackKinematicConstraint.

Definition at line 4 of file MultiTrackVertexLinkKinematicConstraint.cc.

References a, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, mps_fire::i, pileupDistInMC::num, funct::pow(), PVValHelper::pT, refPoint, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by MultiTrackVertexLinkKinematicConstraint().

4  {
5  int num = states.size();
6  if(num<2) throw VertexException("MultiTrackVertexLinkKinematicConstraint::value <2 states passed");
7 
8  //2 equations (for all tracks)
9  AlgebraicVector vl(2,0);
10  double dx = point.x() - refPoint.x();
11  double dy = point.y() - refPoint.y();
12  double dz = point.z() - refPoint.z();
13  double dT = sqrt(pow(dx,2) + pow(dy,2));
14  double ds = sqrt(pow(dx,2) + pow(dy,2) + pow(dz,2));
15 
16  double pxSum=0, pySum=0, pzSum=0;
17  double aSum = 0;
18  for(std::vector<KinematicState>::const_iterator i = states.begin(); i != states.end(); i++)
19  {
20  double a = - i->particleCharge() * i->magneticField()->inInverseGeV(i->globalPosition()).z();
21  aSum += a;
22 
23  pxSum += i->kinematicParameters()(3) - a*(point.y() - i->kinematicParameters()(1));
24  pySum += i->kinematicParameters()(4) + a*(point.x() - i->kinematicParameters()(0));
25  pzSum += i->kinematicParameters()(5);
26  }
27 
28  double pT = sqrt(pow(pxSum,2) + pow(pySum,2));
29  double pSum = sqrt(pow(pxSum,2) + pow(pySum,2) + pow(pzSum,2));
30 
31  vl(1) = (dT - dx)/dy + (-2*pT + sqrt(-(pow(aSum,2)*pow(dT,2)) + 4*pow(pT,2)))/(aSum*dT) + (-pT + pxSum)/pySum;
32  vl(2) = (ds - dT)/dz + (pT - pSum)/pzSum;
33 
34  return vl;
35 }
Common base class.
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
CLHEP::HepVector AlgebraicVector
double a
Definition: hdecay.h:121
T x() const
Definition: PV3DBase.h:62
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

GlobalPoint MultiTrackVertexLinkKinematicConstraint::refPoint
private