#include <RecoVertex/KinematicFit/interface/MassKinematicConstraint.h>
Public Member Functions | |
virtual MassKinematicConstraint * | clone () const |
Clone method. | |
virtual pair< AlgebraicMatrix, AlgebraicVector > | derivative (const vector< RefCountedKinematicParticle > par) const |
virtual pair< AlgebraicMatrix, AlgebraicVector > | derivative (const AlgebraicVector &exPoint) const |
virtual AlgebraicVector | deviations (int nStates) const |
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). | |
MassKinematicConstraint (const ParticleMass &m, const float sigma) | |
Constructor with mass to be used as constraint value. | |
virtual int | numberOfEquations () const |
Returns number of constraint equations used for fitting. | |
virtual pair< AlgebraicVector, AlgebraicVector > | value (const vector< RefCountedKinematicParticle > par) const |
Vector of values and matrix of derivatives calculated using current state parameters as expansion point. | |
virtual pair< AlgebraicVector, AlgebraicVector > | value (const AlgebraicVector &exPoint) const |
Vector of values and matrix of derivatives calculated at given 7xNumberOfStates point. | |
Private Attributes | |
AlgebraicVector | dd |
ParticleMass | mass |
Provides a way to compute derivative matrix and vector of values for mass constraint on the single trajectory. This class does not have the multistate version, since vertex definition needed to calculate a joint mass of several particles.
Kirill Prokofiev December 2002 Multitrack interface: July 2004
Definition at line 17 of file MassKinematicConstraint.h.
MassKinematicConstraint::MassKinematicConstraint | ( | const ParticleMass & | m, | |
const float | sigma | |||
) |
Constructor with mass to be used as constraint value.
Definition at line 4 of file MassKinematicConstraint.cc.
Referenced by clone().
00005 { 00006 mass = m; 00007 AlgebraicVector deviation_l(7,0); 00008 deviation_l(7) = sigma * sigma; 00009 dd = deviation_l; 00010 }
virtual MassKinematicConstraint* MassKinematicConstraint::clone | ( | ) | const [inline, virtual] |
Clone method.
Implements KinematicConstraint.
Definition at line 53 of file MassKinematicConstraint.h.
References MassKinematicConstraint().
00054 {return new MassKinematicConstraint(*this);}
pair< AlgebraicMatrix, AlgebraicVector > MassKinematicConstraint::derivative | ( | const vector< RefCountedKinematicParticle > | par | ) | const [virtual] |
Implements KinematicConstraint.
Definition at line 57 of file MassKinematicConstraint.cc.
00058 { 00059 int nStates = par.size(); 00060 if(nStates == 0) throw VertexException("MassKinematicConstraint::empty vector of particles passed"); 00061 if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version"); 00062 00063 AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector()); 00064 AlgebraicMatrix dr(1,7,0); 00065 dr(1,7) = 1; 00066 return pair<AlgebraicMatrix,AlgebraicVector>(dr,point); 00067 }
pair< AlgebraicMatrix, AlgebraicVector > MassKinematicConstraint::derivative | ( | const AlgebraicVector & | exPoint | ) | const [virtual] |
Implements KinematicConstraint.
Definition at line 30 of file MassKinematicConstraint.cc.
00031 { 00032 if(exPoint.num_row() == 0) throw VertexException("MomentumKinematicConstraint::deriavtive requested for zero Linearization point"); 00033 00034 //security check for extended cartesian parametrization 00035 int inSize = exPoint.num_row(); 00036 if((inSize%7) !=0) throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension"); 00037 int nStates = inSize/7; 00038 if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version"); 00039 AlgebraicMatrix dr(1,7,0); 00040 dr(1,7) = 1; 00041 AlgebraicVector point = exPoint; 00042 return pair<AlgebraicMatrix,AlgebraicVector>(dr,point); 00043 }
AlgebraicVector MassKinematicConstraint::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 69 of file MassKinematicConstraint.cc.
00070 { 00071 if(nStates == 0) throw VertexException("MassKinematicConstraint::empty vector of particles passed"); 00072 if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version"); 00073 AlgebraicVector res = dd; 00074 return res; 00075 }
int MassKinematicConstraint::numberOfEquations | ( | ) | const [virtual] |
Returns number of constraint equations used for fitting.
Method is relevant for proper NDF calculations.
Implements KinematicConstraint.
Definition at line 77 of file MassKinematicConstraint.cc.
pair< AlgebraicVector, AlgebraicVector > MassKinematicConstraint::value | ( | const 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 45 of file MassKinematicConstraint.cc.
References mass.
00046 { 00047 int nStates = par.size(); 00048 if(nStates == 0) throw VertexException("MassKinematicConstraint::empty vector of particles passed"); 00049 if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version"); 00050 00051 AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector()); 00052 AlgebraicVector vl(1,0); 00053 vl(1) = point(7) - mass; 00054 return pair<AlgebraicVector,AlgebraicVector>(vl,point); 00055 }
pair< AlgebraicVector, AlgebraicVector > MassKinematicConstraint::value | ( | const AlgebraicVector & | exPoint | ) | const [virtual] |
Vector of values and matrix of derivatives calculated at given 7xNumberOfStates point.
Implements KinematicConstraint.
Definition at line 12 of file MassKinematicConstraint.cc.
References mass.
00013 { 00014 00015 //we have only one equation and only one track, means the constraint value 00016 //for track parameters is just a single number 00017 if(exPoint.num_row() ==0 ) throw VertexException("MomentumKinematicConstraint::value requested for zero Linearization point"); 00018 00019 //security check for extended cartesian parametrization 00020 int inSize = exPoint.num_row(); 00021 if((inSize%7) !=0) throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension"); 00022 int nStates = inSize/7; 00023 if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version"); 00024 AlgebraicVector vl(1,0); 00025 AlgebraicVector point = exPoint; 00026 vl(1) = point(7) - mass; 00027 return pair<AlgebraicVector,AlgebraicVector>(vl,point); 00028 }
AlgebraicVector MassKinematicConstraint::dd [private] |
Definition at line 58 of file MassKinematicConstraint.h.
Referenced by deviations(), and MassKinematicConstraint().
ParticleMass MassKinematicConstraint::mass [private] |
Definition at line 57 of file MassKinematicConstraint.h.
Referenced by MassKinematicConstraint(), and value().