CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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::MultiTrackVertexLinkKinematicConstraint ( GlobalPoint ref)
inline

Member Function Documentation

◆ clone()

MultiTrackVertexLinkKinematicConstraint* MultiTrackVertexLinkKinematicConstraint::clone ( void  ) const
inlineoverridevirtual

◆ numberOfEquations()

int MultiTrackVertexLinkKinematicConstraint::numberOfEquations ( ) const
overridevirtual

Number of equations per track used for the fit

Implements MultiTrackKinematicConstraint.

Definition at line 145 of file MultiTrackVertexLinkKinematicConstraint.cc.

145 { return 2; }

◆ parametersDerivative()

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 39 of file MultiTrackVertexLinkKinematicConstraint.cc.

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

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

◆ positionDerivative()

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 100 of file MultiTrackVertexLinkKinematicConstraint.cc.

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

101  {
102  int num = states.size();
103  if (num < 2)
104  throw VertexException("MultiTrackVertexLinkKinematicConstraint::positionDerivative <2 states passed");
105 
106  //2 equations (for all tracks)
107  AlgebraicMatrix matrix(2, 3, 0);
108  double dx = point.x() - refPoint.x();
109  double dy = point.y() - refPoint.y();
110  double dz = point.z() - refPoint.z();
111  double dT = sqrt(pow(dx, 2) + pow(dy, 2));
112  double ds = sqrt(pow(dx, 2) + pow(dy, 2) + pow(dz, 2));
113 
114  double pxSum = 0, pySum = 0, pzSum = 0, aSum = 0;
115  for (std::vector<KinematicState>::const_iterator i = states.begin(); i != states.end(); i++) {
116  double a = -i->particleCharge() * i->magneticField()->inInverseGeV(i->globalPosition()).z();
117  aSum += a;
118 
119  pxSum += i->kinematicParameters()(3) - a * (point.y() - i->kinematicParameters()(1));
120  pySum += i->kinematicParameters()(4) + a * (point.x() - i->kinematicParameters()(0));
121  pzSum += i->kinematicParameters()(5);
122  }
123  double pT = sqrt(pow(pxSum, 2) + pow(pySum, 2));
124  double pSum = sqrt(pow(pxSum, 2) + pow(pySum, 2) + pow(pzSum, 2));
125 
126  matrix(1, 1) =
127  (-1 + dx / dT) / dy +
128  (2 * dx * pT * (1 - (2 * pT) / sqrt(-(pow(aSum, 2) * pow(dT, 2)) + 4 * pow(pT, 2)))) / (aSum * pow(dT, 3)) +
129  aSum * (-(1 / pT) + pT / pow(pySum, 2) - pxSum / pow(pySum, 2)) +
130  (2 * (-(1 / pT) + 2 / sqrt(-(pow(aSum, 2) * pow(dT, 2)) + 4 * pow(pT, 2))) * pySum) / dT; //dH/dxv
131  matrix(1, 2) = 1 / dT + (-dT + dx) / pow(dy, 2) -
132  (dy * (-2 * pT + sqrt(-(pow(aSum, 2) * pow(dT, 2)) + 4 * pow(pT, 2)))) / (aSum * pow(dT, 3)) -
133  ((-2 + sqrt(4 - (pow(aSum, 2) * pow(dT, 2)) / pow(pT, 2))) * pxSum) / (dT * pT) -
134  (aSum * (dy * pow(pT, 2) + aSum * pow(dT, 2) * pxSum)) /
135  (dT * pow(pT, 2) * sqrt(-(pow(aSum, 2) * pow(dT, 2)) + 4 * pow(pT, 2))) +
136  (aSum * (-pT + pxSum)) / (pT * pySum); //dH/dyv
137  //dH/dzv=0
138  matrix(2, 1) = ((1 / ds - 1 / dT) * dx) / dz + (aSum * (pSum - pT) * pySum) / (pSum * pT * pzSum); //dH/dxv
139  matrix(2, 2) = ((1 / ds - 1 / dT) * dy) / dz - (aSum * (pSum - pT) * pxSum) / (pSum * pT * pzSum); //dH/dyv
140  matrix(2, 3) = 1 / ds + (-ds + dT) / pow(dz, 2); //dH/dzv
141 
142  return matrix;
143 }
T z() const
Definition: PV3DBase.h:61
Common base class.
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
CLHEP::HepMatrix AlgebraicMatrix
T sqrt(T t)
Definition: SSEVec.h:19
double a
Definition: hdecay.h:119
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
*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

◆ value()

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, EgammaValidation_cff::num, point, funct::pow(), PVValHelper::pT, refPoint, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), z, and PV3DBase< T, PVType, FrameType >::z().

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

Member Data Documentation

◆ refPoint

GlobalPoint MultiTrackVertexLinkKinematicConstraint::refPoint
private