CMS 3D CMS Logo

Public Member Functions | Private Attributes

MassKinematicConstraint Class Reference

#include <MassKinematicConstraint.h>

Inheritance diagram for MassKinematicConstraint:
KinematicConstraint

List of all members.

Public Member Functions

virtual MassKinematicConstraintclone () 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
 MassKinematicConstraint (const ParticleMass &m, const float sigma)
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
ParticleMass mass

Detailed Description

Mass track constraint class. 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.


Constructor & Destructor Documentation

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.

References dd, m, and mass.

Referenced by clone().

{
 mass = m;
 AlgebraicVector deviation_l(7,0);
 deviation_l(7) = sigma * sigma; 
 dd = deviation_l;
}

Member Function Documentation

virtual MassKinematicConstraint* MassKinematicConstraint::clone ( ) const [inline, virtual]

Clone method

Implements KinematicConstraint.

Definition at line 53 of file MassKinematicConstraint.h.

References MassKinematicConstraint().

 {return new MassKinematicConstraint(*this);}
std::pair< AlgebraicMatrix, AlgebraicVector > MassKinematicConstraint::derivative ( const std::vector< RefCountedKinematicParticle par) const [virtual]

Implements KinematicConstraint.

Definition at line 57 of file MassKinematicConstraint.cc.

References point.

{
 int nStates = par.size();
 if(nStates == 0) throw VertexException("MassKinematicConstraint::empty vector of particles passed");
 if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");

 AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
 AlgebraicMatrix dr(1,7,0);
 dr(1,7) = 1;
 return std::pair<AlgebraicMatrix,AlgebraicVector>(dr,point);
}
std::pair< AlgebraicMatrix, AlgebraicVector > MassKinematicConstraint::derivative ( const AlgebraicVector exPoint) const [virtual]

Implements KinematicConstraint.

Definition at line 30 of file MassKinematicConstraint.cc.

References point.

{
 if(exPoint.num_row() == 0) throw VertexException("MomentumKinematicConstraint::deriavtive 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("MassKinematicConstraint::multiple state refit is not supported in this version");
 AlgebraicMatrix dr(1,7,0);
 dr(1,7) = 1; 
 AlgebraicVector point = exPoint;
 return std::pair<AlgebraicMatrix,AlgebraicVector>(dr,point); 
}
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.

References dd.

{
 if(nStates == 0) throw VertexException("MassKinematicConstraint::empty vector of particles passed");
 if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
 AlgebraicVector res = dd;
 return res;
}
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.

{return 1;}
std::pair< AlgebraicVector, AlgebraicVector > MassKinematicConstraint::value ( 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 45 of file MassKinematicConstraint.cc.

References mass, and point.

{
 int nStates = par.size();
 if(nStates == 0) throw VertexException("MassKinematicConstraint::empty vector of particles passed");
 if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
 
 AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
 AlgebraicVector vl(1,0);
 vl(1) = point(7) - mass;
 return std::pair<AlgebraicVector,AlgebraicVector>(vl,point);
} 
std::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, and point.

{

//we have only one equation and only one track, means the constraint value 
//for track parameters is just a single number
 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("MassKinematicConstraint::multiple state refit is not supported in this version");
 AlgebraicVector vl(1,0);
 AlgebraicVector point = exPoint;
 vl(1) = point(7) - mass; 
 return std::pair<AlgebraicVector,AlgebraicVector>(vl,point);
}

Member Data Documentation

Definition at line 58 of file MassKinematicConstraint.h.

Referenced by deviations(), and MassKinematicConstraint().

Definition at line 57 of file MassKinematicConstraint.h.

Referenced by MassKinematicConstraint(), and value().