8 if(states.size()<
nPart)
throw VertexException(
"MultiTrackMassKinematicConstraint::not enough states given");
10 double sumEnergy = 0, sumPx=0, sumPy=0., sumPz=0.;
14 a = -states[
i].particleCharge() * states[
i].magneticField()->inInverseGeV(states[
i].globalPosition()).z();
16 sumEnergy += states[
i].kinematicParameters().energy();
17 sumPx += states[
i].kinematicParameters()(3) - a*(point.
y() - states[
i].kinematicParameters()(1));
18 sumPy += states[
i].kinematicParameters()(4) + a*(point.
x() - states[
i].kinematicParameters()(0));
19 sumPz += states[
i].kinematicParameters()(5);
22 double j_m = sumPx*sumPx + sumPy*sumPy + sumPz*sumPz;
25 res(1) = sumEnergy*sumEnergy - j_m -
mass*
mass;
32 if(states.size()<
nPart)
throw VertexException(
"MultiTrackMassKinematicConstraint::not enough states given");
36 double sumEnergy = 0, sumPx=0, sumPy=0., sumPz=0.;
40 a = -states[
i].particleCharge() * states[
i].magneticField()->inInverseGeV(states[
i].globalPosition()).z();
42 sumEnergy += states[
i].kinematicParameters().energy();
43 sumPx += states[
i].kinematicParameters()(3) - a*(point.
y() - states[
i].kinematicParameters()(1));
44 sumPy += states[
i].kinematicParameters()(4) + a*(point.
x() - states[
i].kinematicParameters()(0));
45 sumPz += states[
i].kinematicParameters()(5);
49 a = -states[
i].particleCharge() * states[
i].magneticField()->inInverseGeV(states[
i].globalPosition()).z();
52 res(1,1+
i*7) = 2*a*sumPy;
55 res(1,2+
i*7) = -2*a*sumPx;
61 res(1,4+
i*7) = 2*sumEnergy/states[
i].kinematicParameters().energy()*states[
i].kinematicParameters()(3) - 2*sumPx;
64 res(1,5+
i*7) = 2*sumEnergy/states[
i].kinematicParameters().energy()*states[
i].kinematicParameters()(4) - 2*sumPy;
67 res(1,6+
i*7) = 2*sumEnergy/states[
i].kinematicParameters().energy()*states[
i].kinematicParameters()(5) - 2*sumPz;
70 res(1,7+
i*7) = 2*states[
i].kinematicParameters().mass()*sumEnergy/states[
i].kinematicParameters().energy();
79 if(states.size()<
nPart)
throw VertexException(
"MultiTrackMassKinematicConstraint::not enough states given");
81 double sumA = 0, sumPx=0, sumPy=0.;
85 a = -states[
i].particleCharge() * states[
i].magneticField()->inInverseGeV(states[
i].globalPosition()).z();
88 sumPx += states[
i].kinematicParameters()(3) - a*(point.
y() - states[
i].kinematicParameters()(1));
89 sumPy += states[
i].kinematicParameters()(4) + a*(point.
x() - states[
i].kinematicParameters()(0));
93 res(1,1) = - 2 * sumPy * sumA;
96 res(1,2) = 2 * sumPx * sumA;
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::HepMatrix AlgebraicMatrix
virtual AlgebraicMatrix parametersDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const
CLHEP::HepVector AlgebraicVector
*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