6 int num = states.size();
8 throw VertexException(
"MultiTrackVertexLinkKinematicConstraint::value <2 states passed");
18 double pxSum = 0, pySum = 0, pzSum = 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();
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);
30 double pSum =
sqrt(
pow(pxSum, 2) +
pow(pySum, 2) +
pow(pzSum, 2));
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;
41 int num = states.size();
43 throw VertexException(
"MultiTrackVertexLinkKinematicConstraint::parametersDerivative <2 states passed");
51 double pxSum = 0, pySum = 0, pzSum = 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();
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);
63 double pSum =
sqrt(
pow(pxSum, 2) +
pow(pySum, 2) +
pow(pzSum, 2));
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();
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);
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);
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);
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;
86 matrix(2, 1 + col * 7) = (a * (-pSum +
pT) * pySum) / (pSum * pT * pzSum);
87 matrix(2, 2 + col * 7) = (a * (pSum -
pT) * pxSum) / (pSum * pT * pzSum);
89 matrix(2, 4 + col * 7) = ((-(1 / pSum) + 1 / pT) * pxSum) / pzSum;
90 matrix(2, 5 + col * 7) = ((-(1 / pSum) + 1 / pT) * pySum) / pzSum;
91 matrix(2, 6 + col * 7) = -(1 / pSum) + (pSum - pT) /
pow(pzSum, 2);
102 int num = states.size();
104 throw VertexException(
"MultiTrackVertexLinkKinematicConstraint::positionDerivative <2 states passed");
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();
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);
124 double pSum =
sqrt(
pow(pxSum, 2) +
pow(pySum, 2) +
pow(pzSum, 2));
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;
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)) /
136 (aSum * (-pT + pxSum)) / (pT * pySum);
138 matrix(2, 1) = ((1 / ds - 1 / dT) * dx) / dz + (aSum * (pSum -
pT) * pySum) / (pSum * pT * pzSum);
139 matrix(2, 2) = ((1 / ds - 1 / dT) * dy) / dz - (aSum * (pSum -
pT) * pxSum) / (pSum * pT * pzSum);
140 matrix(2, 3) = 1 / ds + (-ds + dT) /
pow(dz, 2);
AlgebraicMatrix parametersDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
int numberOfEquations() const override
AlgebraicVector value(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
CLHEP::HepMatrix AlgebraicMatrix
CLHEP::HepVector AlgebraicVector
AlgebraicMatrix positionDerivative(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