CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
MassKinematicConstraint Class Reference

#include <MassKinematicConstraint.h>

Inheritance diagram for MassKinematicConstraint:
KinematicConstraint

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 AlgebraicVector &exPoint) const
 
virtual std::pair
< AlgebraicVector,
AlgebraicVector
value (const std::vector< RefCountedKinematicParticle > &par) const
 
- Public Member Functions inherited from KinematicConstraint
 KinematicConstraint ()
 
virtual ~KinematicConstraint ()
 

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().

5 {
6  mass = m;
7  AlgebraicVector deviation_l(7,0);
8  deviation_l(7) = sigma * sigma;
9  dd = deviation_l;
10 }
CLHEP::HepVector AlgebraicVector

Member Function Documentation

virtual MassKinematicConstraint* MassKinematicConstraint::clone ( ) const
inlinevirtual

Clone method

Implements KinematicConstraint.

Definition at line 53 of file MassKinematicConstraint.h.

References MassKinematicConstraint().

54  {return new MassKinematicConstraint(*this);}
MassKinematicConstraint(const ParticleMass &m, const float sigma)
std::pair< AlgebraicMatrix, AlgebraicVector > MassKinematicConstraint::derivative ( const AlgebraicVector exPoint) const
virtual

Implements KinematicConstraint.

Definition at line 30 of file MassKinematicConstraint.cc.

References point.

31 {
32  if(exPoint.num_row() == 0) throw VertexException("MomentumKinematicConstraint::deriavtive requested for zero Linearization point");
33 
34 //security check for extended cartesian parametrization
35  int inSize = exPoint.num_row();
36  if((inSize%7) !=0) throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension");
37  int nStates = inSize/7;
38  if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
39  AlgebraicMatrix dr(1,7,0);
40  dr(1,7) = 1;
41  AlgebraicVector point = exPoint;
42  return std::pair<AlgebraicMatrix,AlgebraicVector>(dr,point);
43 }
Common base class.
CLHEP::HepMatrix AlgebraicMatrix
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
Definition: invegas.h:5
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.

58 {
59  int nStates = par.size();
60  if(nStates == 0) throw VertexException("MassKinematicConstraint::empty vector of particles passed");
61  if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
62 
63  AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
64  AlgebraicMatrix dr(1,7,0);
65  dr(1,7) = 1;
66  return std::pair<AlgebraicMatrix,AlgebraicVector>(dr,point);
67 }
Common base class.
CLHEP::HepMatrix AlgebraicMatrix
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
Definition: invegas.h:5
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.

70 {
71  if(nStates == 0) throw VertexException("MassKinematicConstraint::empty vector of particles passed");
72  if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
73  AlgebraicVector res = dd;
74  return res;
75 }
Common base class.
CLHEP::HepVector AlgebraicVector
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.

78 {return 1;}
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.

13 {
14 
15 //we have only one equation and only one track, means the constraint value
16 //for track parameters is just a single number
17  if(exPoint.num_row() ==0 ) throw VertexException("MomentumKinematicConstraint::value requested for zero Linearization point");
18 
19 //security check for extended cartesian parametrization
20  int inSize = exPoint.num_row();
21  if((inSize%7) !=0) throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension");
22  int nStates = inSize/7;
23  if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
24  AlgebraicVector vl(1,0);
25  AlgebraicVector point = exPoint;
26  vl(1) = point(7) - mass;
27  return std::pair<AlgebraicVector,AlgebraicVector>(vl,point);
28 }
Common base class.
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
Definition: invegas.h:5
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.

46 {
47  int nStates = par.size();
48  if(nStates == 0) throw VertexException("MassKinematicConstraint::empty vector of particles passed");
49  if(nStates !=1) throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
50 
51  AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
52  AlgebraicVector vl(1,0);
53  vl(1) = point(7) - mass;
54  return std::pair<AlgebraicVector,AlgebraicVector>(vl,point);
55 }
Common base class.
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
Definition: invegas.h:5

Member Data Documentation

AlgebraicVector MassKinematicConstraint::dd
private

Definition at line 58 of file MassKinematicConstraint.h.

Referenced by deviations(), and MassKinematicConstraint().

ParticleMass MassKinematicConstraint::mass
private