6 if (states.size() <
nPart)
7 throw VertexException(
"MultiTrackMassKinematicConstraint::not enough states given");
9 double sumEnergy = 0, sumPx = 0, sumPy = 0., sumPz = 0.;
12 for (
unsigned int i = 0;
i <
nPart; ++
i) {
13 a = -states[
i].particleCharge() * states[
i].magneticField()->inInverseGeV(states[
i].globalPosition()).z();
15 sumEnergy += states[
i].kinematicParameters().energy();
16 sumPx += states[
i].kinematicParameters()(3) -
a * (
point.y() - states[
i].kinematicParameters()(1));
17 sumPy += states[
i].kinematicParameters()(4) +
a * (
point.x() - states[
i].kinematicParameters()(0));
18 sumPz += states[
i].kinematicParameters()(5);
21 double j_m = sumPx * sumPx + sumPy * sumPy + sumPz * sumPz;
30 if (states.size() <
nPart)
31 throw VertexException(
"MultiTrackMassKinematicConstraint::not enough states given");
35 double sumEnergy = 0, sumPx = 0, sumPy = 0., sumPz = 0.;
38 for (
unsigned int i = 0;
i <
nPart; ++
i) {
39 a = -states[
i].particleCharge() * states[
i].magneticField()->inInverseGeV(states[
i].globalPosition()).z();
41 sumEnergy += states[
i].kinematicParameters().energy();
42 sumPx += states[
i].kinematicParameters()(3) -
a * (
point.y() - states[
i].kinematicParameters()(1));
43 sumPy += states[
i].kinematicParameters()(4) +
a * (
point.x() - states[
i].kinematicParameters()(0));
44 sumPz += states[
i].kinematicParameters()(5);
47 for (
unsigned int i = 0;
i <
nPart; ++
i) {
48 a = -states[
i].particleCharge() * states[
i].magneticField()->inInverseGeV(states[
i].globalPosition()).z();
51 res(1, 1 +
i * 7) = 2 *
a * sumPy;
54 res(1, 2 +
i * 7) = -2 *
a * sumPx;
57 res(1, 3 +
i * 7) = 0.;
61 2 * sumEnergy / states[
i].kinematicParameters().energy() * states[
i].kinematicParameters()(3) - 2 * sumPx;
65 2 * sumEnergy / states[
i].kinematicParameters().energy() * states[
i].kinematicParameters()(4) - 2 * sumPy;
69 2 * sumEnergy / states[
i].kinematicParameters().energy() * states[
i].kinematicParameters()(5) - 2 * sumPz;
73 2 * states[
i].kinematicParameters().mass() * sumEnergy / states[
i].kinematicParameters().energy();
81 if (states.size() <
nPart)
82 throw VertexException(
"MultiTrackMassKinematicConstraint::not enough states given");
84 double sumA = 0, sumPx = 0, sumPy = 0.;
87 for (
unsigned int i = 0;
i <
nPart; ++
i) {
88 a = -states[
i].particleCharge() * states[
i].magneticField()->inInverseGeV(states[
i].globalPosition()).z();
91 sumPx += states[
i].kinematicParameters()(3) -
a * (
point.y() - states[
i].kinematicParameters()(1));
92 sumPy += states[
i].kinematicParameters()(4) +
a * (
point.x() - states[
i].kinematicParameters()(0));
96 res(1, 1) = -2 * sumPy * sumA;
99 res(1, 2) = 2 * sumPx * sumA;