5 int num = states.size();
6 if(num<2)
throw VertexException(
"MultiTrackVertexLinkKinematicConstraint::value <2 states passed");
16 double pxSum=0, pySum=0, pzSum=0;
18 for(std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++)
20 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
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);
29 double pSum =
sqrt(
pow(pxSum,2) +
pow(pySum,2) +
pow(pzSum,2));
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;
38 int num = states.size();
39 if(num<2)
throw VertexException(
"MultiTrackVertexLinkKinematicConstraint::parametersDerivative <2 states passed");
47 double pxSum=0, pySum=0, pzSum=0;
49 for(std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++)
51 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
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);
60 double pSum =
sqrt(
pow(pxSum,2) +
pow(pySum,2) +
pow(pzSum,2));
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();
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);
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);
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);
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;
73 matrix(2,1+col*7) = (a*(-pSum +
pT)*pySum)/(pSum*pT*pzSum);
74 matrix(2,2+col*7) = (a*( pSum -
pT)*pxSum)/(pSum*pT*pzSum);
76 matrix(2,4+col*7) = ((-(1/pSum) + 1/pT)*pxSum)/pzSum;
77 matrix(2,5+col*7) = ((-(1/pSum) + 1/pT)*pySum)/pzSum;
78 matrix(2,6+col*7) = -(1/pSum) + (pSum - pT)/
pow(pzSum,2);
88 int num = states.size();
89 if(num<2)
throw VertexException(
"MultiTrackVertexLinkKinematicConstraint::positionDerivative <2 states passed");
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();
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);
109 double pSum =
sqrt(
pow(pxSum,2) +
pow(pySum,2) +
pow(pzSum,2));
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;
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);
114 matrix(2,1) = ((1/ds - 1/dT)*dx)/dz + (aSum*(pSum -
pT)*pySum)/(pSum*pT*pzSum);
115 matrix(2,2) = ((1/ds - 1/dT)*dy)/dz - (aSum*(pSum -
pT)*pxSum)/(pSum*pT*pzSum);
116 matrix(2,3) = 1/ds + (-ds + dT)/
pow(dz,2);
AlgebraicMatrix positionDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
int numberOfEquations() const override
AlgebraicMatrix parametersDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
CLHEP::HepMatrix AlgebraicMatrix
CLHEP::HepVector AlgebraicVector
AlgebraicVector value(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
Power< A, B >::type pow(const A &a, const B &b)
*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