5 int num = states.size();
6 if(num<2)
throw VertexException(
"MultiTrackPointingKinematicConstraint::value <2 states passed");
16 double pxSum=0, pySum=0, pzSum=0;
17 for(std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++)
19 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
21 pxSum +=
i->kinematicParameters()(3) - a*(point.
y() -
i->kinematicParameters()(1));
22 pySum +=
i->kinematicParameters()(4) + a*(point.
x() -
i->kinematicParameters()(0));
23 pzSum +=
i->kinematicParameters()(5);
27 double pSum =
sqrt(
pow(pxSum,2) +
pow(pySum,2) +
pow(pzSum,2));
29 vl(1) = (dT - dx)/dy + (pxSum - pT)/pySum;
30 vl(2) = (ds - dT)/dz + (pT - pSum)/pzSum;
36 int num = states.size();
37 if(num<2)
throw VertexException(
"MultiTrackPointingKinematicConstraint::parametersDerivative <2 states passed");
42 double pxSum=0, pySum=0, pzSum=0;
43 for(std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++)
45 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
47 pxSum +=
i->kinematicParameters()(3) - a*(point.
y() -
i->kinematicParameters()(1));
48 pySum +=
i->kinematicParameters()(4) + a*(point.
x() -
i->kinematicParameters()(0));
49 pzSum +=
i->kinematicParameters()(5);
53 double pSum =
sqrt(
pow(pxSum,2) +
pow(pySum,2) +
pow(pzSum,2));
56 for(std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++){
57 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
59 matrix(1,1+col*7) = a*(1/pT + (-pT + pxSum)/
pow(pySum,2));
60 matrix(1,2+col*7) = (a - (a*pxSum)/pT)/pySum;
62 matrix(1,4+col*7) = (pT - pxSum)/(pT*pySum);
63 matrix(1,5+col*7) = -(1/pT) + (pT - pxSum)/
pow(pySum,2);
66 matrix(2,1+col*7) = (a*(-pSum + pT)*pySum)/(pSum*pT*pzSum);
67 matrix(2,2+col*7) = (a*( pSum - pT)*pxSum)/(pSum*pT*pzSum);
69 matrix(2,4+col*7) = ((-(1/pSum) + 1/pT)*pxSum)/pzSum;
70 matrix(2,5+col*7) = ((-(1/pSum) + 1/pT)*pySum)/pzSum;
71 matrix(2,6+col*7) = -(1/pSum) + (pSum - pT)/
pow(pzSum,2);
81 int num = states.size();
82 if(num<2)
throw VertexException(
"MultiTrackPointingKinematicConstraint::positionDerivative <2 states passed");
92 double pxSum=0, pySum=0, pzSum=0, aSum = 0;
93 for(std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++){
94 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
97 pxSum +=
i->kinematicParameters()(3) - a*(point.
y() -
i->kinematicParameters()(1));
98 pySum +=
i->kinematicParameters()(4) + a*(point.
x() -
i->kinematicParameters()(0));
99 pzSum +=
i->kinematicParameters()(5);
101 double pT =
sqrt(
pow(pxSum,2) +
pow(pySum,2));
102 double pSum =
sqrt(
pow(pxSum,2) +
pow(pySum,2) +
pow(pzSum,2));
104 matrix(1,1) = (-1 + dx/dT)/dy - aSum/pT + (aSum*(pT - pxSum))/
pow(pySum,2);
105 matrix(1,2) = 1/dT + (-dT + dx)/
pow(dy,2) - (aSum*(pT - pxSum))/(pT*pySum);
107 matrix(2,1) = ((1/ds - 1/dT)*dx)/dz + (aSum*(pSum - pT)*pySum)/(pSum*pT*pzSum);
108 matrix(2,2) = ((1/ds - 1/dT)*dy)/dz - (aSum*(pSum - pT)*pxSum)/(pSum*pT*pzSum);
109 matrix(2,3) = 1/ds + (-ds + dT)/
pow(dz,2);
virtual AlgebraicMatrix parametersDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const
CLHEP::HepMatrix AlgebraicMatrix
virtual AlgebraicVector value(const std::vector< KinematicState > &states, const GlobalPoint &point) const
virtual AlgebraicMatrix positionDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const
CLHEP::HepVector AlgebraicVector
virtual int numberOfEquations() const
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