6 int num = states.size();
8 throw VertexException(
"MultiTrackPointingKinematicConstraint::value <2 states passed");
18 double pxSum = 0, pySum = 0, pzSum = 0;
19 for (std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++) {
20 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
22 pxSum +=
i->kinematicParameters()(3) - a * (point.
y() -
i->kinematicParameters()(1));
23 pySum +=
i->kinematicParameters()(4) + a * (point.
x() -
i->kinematicParameters()(0));
24 pzSum +=
i->kinematicParameters()(5);
28 double pSum =
sqrt(
pow(pxSum, 2) +
pow(pySum, 2) +
pow(pzSum, 2));
30 vl(1) = (dT -
dx) / dy + (pxSum - pT) / pySum;
31 vl(2) = (ds - dT) / dz + (pT - pSum) / pzSum;
38 int num = states.size();
40 throw VertexException(
"MultiTrackPointingKinematicConstraint::parametersDerivative <2 states passed");
45 double pxSum = 0, pySum = 0, pzSum = 0;
46 for (std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++) {
47 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
49 pxSum +=
i->kinematicParameters()(3) - a * (point.
y() -
i->kinematicParameters()(1));
50 pySum +=
i->kinematicParameters()(4) + a * (point.
x() -
i->kinematicParameters()(0));
51 pzSum +=
i->kinematicParameters()(5);
55 double pSum =
sqrt(
pow(pxSum, 2) +
pow(pySum, 2) +
pow(pzSum, 2));
58 for (std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++) {
59 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
61 matrix(1, 1 + col * 7) = a * (1 / pT + (-pT + pxSum) /
pow(pySum, 2));
62 matrix(1, 2 + col * 7) = (a - (a * pxSum) / pT) / pySum;
64 matrix(1, 4 + col * 7) = (pT - pxSum) / (pT * pySum);
65 matrix(1, 5 + col * 7) = -(1 /
pT) + (pT - pxSum) /
pow(pySum, 2);
68 matrix(2, 1 + col * 7) = (a * (-pSum +
pT) * pySum) / (pSum * pT * pzSum);
69 matrix(2, 2 + col * 7) = (a * (pSum -
pT) * pxSum) / (pSum * pT * pzSum);
71 matrix(2, 4 + col * 7) = ((-(1 / pSum) + 1 / pT) * pxSum) / pzSum;
72 matrix(2, 5 + col * 7) = ((-(1 / pSum) + 1 / pT) * pySum) / pzSum;
73 matrix(2, 6 + col * 7) = -(1 / pSum) + (pSum - pT) /
pow(pzSum, 2);
84 int num = states.size();
86 throw VertexException(
"MultiTrackPointingKinematicConstraint::positionDerivative <2 states passed");
96 double pxSum = 0, pySum = 0, pzSum = 0, aSum = 0;
97 for (std::vector<KinematicState>::const_iterator
i = states.begin();
i != states.end();
i++) {
98 double a = -
i->particleCharge() *
i->magneticField()->inInverseGeV(
i->globalPosition()).
z();
101 pxSum +=
i->kinematicParameters()(3) - a * (point.
y() -
i->kinematicParameters()(1));
102 pySum +=
i->kinematicParameters()(4) + a * (point.
x() -
i->kinematicParameters()(0));
103 pzSum +=
i->kinematicParameters()(5);
106 double pSum =
sqrt(
pow(pxSum, 2) +
pow(pySum, 2) +
pow(pzSum, 2));
108 matrix(1, 1) = (-1 + dx / dT) / dy - aSum / pT + (aSum * (pT - pxSum)) /
pow(pySum, 2);
109 matrix(1, 2) = 1 / dT + (-dT +
dx) /
pow(dy, 2) - (aSum * (pT - pxSum)) / (pT * pySum);
111 matrix(2, 1) = ((1 / ds - 1 / dT) * dx) / dz + (aSum * (pSum -
pT) * pySum) / (pSum * pT * pzSum);
112 matrix(2, 2) = ((1 / ds - 1 / dT) * dy) / dz - (aSum * (pSum -
pT) * pxSum) / (pSum * pT * pzSum);
113 matrix(2, 3) = 1 / ds + (-ds + dT) /
pow(dz, 2);
AlgebraicVector value(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
CLHEP::HepMatrix AlgebraicMatrix
AlgebraicMatrix positionDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
AlgebraicMatrix parametersDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
CLHEP::HepVector AlgebraicVector
int numberOfEquations() 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