#include <MultiTrackMassKinematicConstraint.h>
Public Member Functions | |
virtual MultiTrackMassKinematicConstraint * | clone () const |
MultiTrackMassKinematicConstraint (const ParticleMass &theMass, const unsigned int nbrParticles) | |
virtual int | numberOfEquations () const |
virtual AlgebraicMatrix | parametersDerivative (const std::vector< KinematicState > states, const GlobalPoint &point) const |
virtual AlgebraicMatrix | positionDerivative (const std::vector< KinematicState > states, const GlobalPoint &point) const |
virtual AlgebraicVector | value (const std::vector< KinematicState > states, const GlobalPoint &point) const |
Private Attributes | |
const ParticleMass | mass |
const unsigned int | nPart |
Constraint to force some of the particles in the fit to have a certain invariant mass.
Definition at line 13 of file MultiTrackMassKinematicConstraint.h.
MultiTrackMassKinematicConstraint::MultiTrackMassKinematicConstraint | ( | const ParticleMass & | theMass, |
const unsigned int | nbrParticles | ||
) | [inline] |
Constructor
theMass | the mass to constrain the states |
nbrParticles | the number of particles to use (in case more than that number are present in the fit, the first will be used) |
Definition at line 22 of file MultiTrackMassKinematicConstraint.h.
Referenced by clone().
virtual MultiTrackMassKinematicConstraint* MultiTrackMassKinematicConstraint::clone | ( | void | ) | const [inline, virtual] |
Implements MultiTrackKinematicConstraint.
Definition at line 57 of file MultiTrackMassKinematicConstraint.h.
References MultiTrackMassKinematicConstraint().
{return new MultiTrackMassKinematicConstraint(*this);}
virtual int MultiTrackMassKinematicConstraint::numberOfEquations | ( | ) | const [inline, virtual] |
Number of equations per track used for the fit
Implements MultiTrackKinematicConstraint.
Definition at line 55 of file MultiTrackMassKinematicConstraint.h.
{return 1;}
AlgebraicMatrix MultiTrackMassKinematicConstraint::parametersDerivative | ( | const std::vector< KinematicState > | states, |
const GlobalPoint & | point | ||
) | const [virtual] |
Returns a matrix of derivatives of constraint equations w.r.t. particle parameters
Implements MultiTrackKinematicConstraint.
Definition at line 29 of file MultiTrackMassKinematicConstraint.cc.
References a, i, nPart, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
{ if(states.size()<nPart) throw VertexException("MultiTrackMassKinematicConstraint::not enough states given"); AlgebraicMatrix res(1,states.size()*7,0); double sumEnergy = 0, sumPx=0, sumPy=0., sumPz=0.; double a; for (unsigned int i=0;i<nPart;++i) { a = -states[i].particleCharge() * states[i].magneticField()->inInverseGeV(states[i].globalPosition()).z(); sumEnergy += states[i].kinematicParameters().energy(); sumPx += states[i].kinematicParameters()(3) - a*(point.y() - states[i].kinematicParameters()(1)); sumPy += states[i].kinematicParameters()(4) + a*(point.x() - states[i].kinematicParameters()(0)); sumPz += states[i].kinematicParameters()(5); } for (unsigned int i=0;i<nPart;++i) { a = -states[i].particleCharge() * states[i].magneticField()->inInverseGeV(states[i].globalPosition()).z(); //x derivatives: res(1,1+i*7) = 2*a*sumPy; //y derivatives: res(1,2+i*7) = -2*a*sumPx; //z components: res(1,3+i*7) = 0.; //px components: res(1,4+i*7) = 2*sumEnergy/states[i].kinematicParameters().energy()*states[i].kinematicParameters()(3) - 2*sumPx; //py components: res(1,5+i*7) = 2*sumEnergy/states[i].kinematicParameters().energy()*states[i].kinematicParameters()(4) - 2*sumPy; //pz1 components: res(1,6+i*7) = 2*sumEnergy/states[i].kinematicParameters().energy()*states[i].kinematicParameters()(5) - 2*sumPz; //mass components: res(1,7+i*7) = 2*states[i].kinematicParameters().mass()*sumEnergy/states[i].kinematicParameters().energy(); } return res; }
AlgebraicMatrix MultiTrackMassKinematicConstraint::positionDerivative | ( | const std::vector< KinematicState > | states, |
const GlobalPoint & | point | ||
) | const [virtual] |
Returns a matrix of derivatives of constraint equations w.r.t. vertex position
Implements MultiTrackKinematicConstraint.
Definition at line 75 of file MultiTrackMassKinematicConstraint.cc.
References a, i, nPart, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
{ AlgebraicMatrix res(1,3,0); if(states.size()<nPart) throw VertexException("MultiTrackMassKinematicConstraint::not enough states given"); double sumA = 0, sumPx=0, sumPy=0.; double a; for (unsigned int i=0;i<nPart;++i) { a = -states[i].particleCharge() * states[i].magneticField()->inInverseGeV(states[i].globalPosition()).z(); sumA += a; sumPx += states[i].kinematicParameters()(3) - a*(point.y() - states[i].kinematicParameters()(1)); sumPy += states[i].kinematicParameters()(4) + a*(point.x() - states[i].kinematicParameters()(0)); } //xv component res(1,1) = - 2 * sumPy * sumA; //yv component res(1,2) = 2 * sumPx * sumA; //zv component res(1,3) = 0.; return res; }
AlgebraicVector MultiTrackMassKinematicConstraint::value | ( | const std::vector< KinematicState > | states, |
const GlobalPoint & | point | ||
) | const [virtual] |
Returns a vector of values of constraint equations at the point where the input particles are defined.
Implements MultiTrackKinematicConstraint.
Definition at line 5 of file MultiTrackMassKinematicConstraint.cc.
References a, i, mass, nPart, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().
{ if(states.size()<nPart) throw VertexException("MultiTrackMassKinematicConstraint::not enough states given"); double sumEnergy = 0, sumPx=0, sumPy=0., sumPz=0.; double a; for (unsigned int i=0;i<nPart;++i) { a = -states[i].particleCharge() * states[i].magneticField()->inInverseGeV(states[i].globalPosition()).z(); sumEnergy += states[i].kinematicParameters().energy(); sumPx += states[i].kinematicParameters()(3) - a*(point.y() - states[i].kinematicParameters()(1)); sumPy += states[i].kinematicParameters()(4) + a*(point.x() - states[i].kinematicParameters()(0)); sumPz += states[i].kinematicParameters()(5); } double j_m = sumPx*sumPx + sumPy*sumPy + sumPz*sumPz; AlgebraicVector res(1,0); res(1) = sumEnergy*sumEnergy - j_m - mass*mass; return res; }
const ParticleMass MultiTrackMassKinematicConstraint::mass [private] |
Definition at line 62 of file MultiTrackMassKinematicConstraint.h.
Referenced by value().
const unsigned int MultiTrackMassKinematicConstraint::nPart [private] |
Definition at line 63 of file MultiTrackMassKinematicConstraint.h.
Referenced by parametersDerivative(), positionDerivative(), and value().