#include <MomentumKinematicConstraint.h>
Public Member Functions | |
virtual MomentumKinematicConstraint * | clone () const |
virtual std::pair < AlgebraicMatrix, AlgebraicVector > | derivative (const AlgebraicVector &exPoint) const |
virtual std::pair < AlgebraicMatrix, AlgebraicVector > | derivative (const std::vector< RefCountedKinematicParticle > par) const |
virtual AlgebraicVector | deviations (int nStates) const |
MomentumKinematicConstraint (const AlgebraicVector &momentum, const AlgebraicVector &dev) | |
virtual int | numberOfEquations () const |
virtual std::pair < AlgebraicVector, AlgebraicVector > | value (const std::vector< RefCountedKinematicParticle > par) const |
virtual std::pair < AlgebraicVector, AlgebraicVector > | value (const AlgebraicVector &exPoint) const |
Private Attributes | |
AlgebraicVector | dd |
AlgebraicVector | mm |
Class constraining total 3-momentum of the particle (p_x,p_y,p_z) This constraint can not be implemented on multiple particles, without fitting the vertex. Current version supports one state refit only.
Kirill Prokofiev, October 2003 MultiState version: July 2004
Definition at line 16 of file MomentumKinematicConstraint.h.
MomentumKinematicConstraint::MomentumKinematicConstraint | ( | const AlgebraicVector & | momentum, |
const AlgebraicVector & | dev | ||
) |
Constructor with the 4-momentum vector as an argument
Definition at line 5 of file MomentumKinematicConstraint.cc.
Referenced by clone().
{ if((momentum.num_row() != 3) || (dev.num_row() != 3)) throw VertexException("MomentumKinemticConstraint::Momentum or Deviation vector passed is not 3-dimensional"); mm = momentum; AlgebraicVector dev_l(7,0); dev_l(4) = dev(1) * dev(1); dev_l(5) = dev(2) * dev(2); dev_l(6) = dev(3) * dev(3); dd = dev_l; }
virtual MomentumKinematicConstraint* MomentumKinematicConstraint::clone | ( | ) | const [inline, virtual] |
Clone method
Implements KinematicConstraint.
Definition at line 52 of file MomentumKinematicConstraint.h.
References MomentumKinematicConstraint().
{return new MomentumKinematicConstraint(*this);}
std::pair< AlgebraicMatrix, AlgebraicVector > MomentumKinematicConstraint::derivative | ( | const std::vector< RefCountedKinematicParticle > | par | ) | const [virtual] |
Vector of values and matrix of derivatives calculated using current state parameters as expansion point
Implements KinematicConstraint.
Definition at line 66 of file MomentumKinematicConstraint.cc.
References point.
{ int nStates = par.size(); if(nStates == 0) throw VertexException("MomentumKinematicConstraint::Empty vector of particles passed"); if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint"); AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector()); AlgebraicMatrix dr(3,7,0); dr(1,4) = 1.; dr(2,5) = 1.; dr(3,6) = 1.; return std::pair<AlgebraicMatrix,AlgebraicVector>(dr,point); }
std::pair< AlgebraicMatrix, AlgebraicVector > MomentumKinematicConstraint::derivative | ( | const AlgebraicVector & | exPoint | ) | const [virtual] |
Implements KinematicConstraint.
Definition at line 35 of file MomentumKinematicConstraint.cc.
{ if(exPoint.num_row() ==0 ) throw VertexException("MomentumKinematicConstraint::derivative requested for zero Linearization point"); //security check for extended cartesian parametrization int inSize = exPoint.num_row(); if((inSize%7) !=0) throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension"); int nStates = inSize/7; if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint"); AlgebraicVector pr = exPoint; AlgebraicMatrix dr(3,7,0); dr(1,4) = 1.; dr(2,5) = 1.; dr(3,6) = 1.; return std::pair<AlgebraicMatrix,AlgebraicVector>(dr,pr); }
AlgebraicVector MomentumKinematicConstraint::deviations | ( | int | nStates | ) | const [virtual] |
Returns vector of sigma squared associated to the KinematicParameters of refitted particles Initial deviations are given by user for the constraining parameters (mass, momentum components etc). In case of multiple states exactly the same values are added to every particle parameters
Implements KinematicConstraint.
Definition at line 79 of file MomentumKinematicConstraint.cc.
References dd.
{ if(nStates == 0) throw VertexException("MomentumKinematicConstraint::Empty vector of particles passed"); if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint"); AlgebraicVector res = dd; return res; }
int MomentumKinematicConstraint::numberOfEquations | ( | ) | const [virtual] |
Returns number of constraint equations used for fitting. Method is relevant for proper NDF calculations.
Implements KinematicConstraint.
Definition at line 87 of file MomentumKinematicConstraint.cc.
{return 3;}
std::pair< AlgebraicVector, AlgebraicVector > MomentumKinematicConstraint::value | ( | const std::vector< RefCountedKinematicParticle > | par | ) | const [virtual] |
Methods making value and derivative matrix using current state parameters as expansion 7-point. Constraint can be made equaly for single and multiple states
Implements KinematicConstraint.
Definition at line 53 of file MomentumKinematicConstraint.cc.
{ int nStates = par.size(); if(nStates == 0) throw VertexException("MomentumKinematicConstraint::Empty vector of particles passed"); if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint"); AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector()); AlgebraicVector vl(3,0); vl(1) = point(4) - mm(1); vl(2) = point(5) - mm(2); vl(3) = point(6) - mm(3); return std::pair<AlgebraicVector,AlgebraicVector>(vl,point); }
std::pair< AlgebraicVector, AlgebraicVector > MomentumKinematicConstraint::value | ( | const AlgebraicVector & | exPoint | ) | const [virtual] |
Vector of values and matrix of derivatives calculated at given expansion 7xNumberOfStates point
Implements KinematicConstraint.
Definition at line 18 of file MomentumKinematicConstraint.cc.
References mm.
{ if(exPoint.num_row() ==0 ) throw VertexException("MomentumKinematicConstraint::value requested for zero Linearization point"); //security check for extended cartesian parametrization int inSize = exPoint.num_row(); if((inSize%7) !=0) throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension"); int nStates = inSize/7; if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint"); AlgebraicVector pr = exPoint; AlgebraicVector vl(3,0); vl(1) = pr(4) - mm(1); vl(2) = pr(5) - mm(2); vl(3) = pr(6) - mm(3); return std::pair<AlgebraicVector,AlgebraicVector>(vl,pr); }
Definition at line 58 of file MomentumKinematicConstraint.h.
Referenced by deviations(), and MomentumKinematicConstraint().
Definition at line 57 of file MomentumKinematicConstraint.h.
Referenced by MomentumKinematicConstraint(), and value().