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
MomentumKinematicConstraint Class Reference

#include <MomentumKinematicConstraint.h>

Inheritance diagram for MomentumKinematicConstraint:
KinematicConstraint

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 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
 
AlgebraicVector mm
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

References dd, and mm.

Referenced by clone().

7 {
8  if((momentum.num_row() != 3) || (dev.num_row() != 3))
9  throw VertexException("MomentumKinemticConstraint::Momentum or Deviation vector passed is not 3-dimensional");
10  mm = momentum;
11  AlgebraicVector dev_l(7,0);
12  dev_l(4) = dev(1) * dev(1);
13  dev_l(5) = dev(2) * dev(2);
14  dev_l(6) = dev(3) * dev(3);
15  dd = dev_l;
16 }
Common base class.
CLHEP::HepVector AlgebraicVector

Member Function Documentation

virtual MomentumKinematicConstraint* MomentumKinematicConstraint::clone ( ) const
inlinevirtual

Clone method

Implements KinematicConstraint.

Definition at line 52 of file MomentumKinematicConstraint.h.

References MomentumKinematicConstraint().

53  {return new MomentumKinematicConstraint(*this);}
MomentumKinematicConstraint(const AlgebraicVector &momentum, const AlgebraicVector &dev)
std::pair< AlgebraicMatrix, AlgebraicVector > MomentumKinematicConstraint::derivative ( const AlgebraicVector exPoint) const
virtual

Implements KinematicConstraint.

Definition at line 35 of file MomentumKinematicConstraint.cc.

36 {
37  if(exPoint.num_row() ==0 ) throw VertexException("MomentumKinematicConstraint::derivative requested for zero Linearization point");
38 
39 //security check for extended cartesian parametrization
40  int inSize = exPoint.num_row();
41  if((inSize%7) !=0) throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension");
42  int nStates = inSize/7;
43  if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint");
44 
45  AlgebraicVector pr = exPoint;
46  AlgebraicMatrix dr(3,7,0);
47  dr(1,4) = 1.;
48  dr(2,5) = 1.;
49  dr(3,6) = 1.;
50  return std::pair<AlgebraicMatrix,AlgebraicVector>(dr,pr);
51 }
Common base class.
CLHEP::HepMatrix AlgebraicMatrix
CLHEP::HepVector AlgebraicVector
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.

67 {
68  int nStates = par.size();
69  if(nStates == 0) throw VertexException("MomentumKinematicConstraint::Empty vector of particles passed");
70  if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint");
71  AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
72  AlgebraicMatrix dr(3,7,0);
73  dr(1,4) = 1.;
74  dr(2,5) = 1.;
75  dr(3,6) = 1.;
76  return std::pair<AlgebraicMatrix,AlgebraicVector>(dr,point);
77 }
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 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.

80 {
81  if(nStates == 0) throw VertexException("MomentumKinematicConstraint::Empty vector of particles passed");
82  if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint");
83  AlgebraicVector res = dd;
84  return res;
85 }
Common base class.
CLHEP::HepVector AlgebraicVector
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.

88 {return 3;}
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.

19 {
20  if(exPoint.num_row() ==0 ) throw VertexException("MomentumKinematicConstraint::value requested for zero Linearization point");
21 
22 //security check for extended cartesian parametrization
23  int inSize = exPoint.num_row();
24  if((inSize%7) !=0) throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension");
25  int nStates = inSize/7;
26  if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint");
27  AlgebraicVector pr = exPoint;
28  AlgebraicVector vl(3,0);
29  vl(1) = pr(4) - mm(1);
30  vl(2) = pr(5) - mm(2);
31  vl(3) = pr(6) - mm(3);
32  return std::pair<AlgebraicVector,AlgebraicVector>(vl,pr);
33 }
Common base class.
CLHEP::HepVector AlgebraicVector
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.

References mm, and point.

54 {
55  int nStates = par.size();
56  if(nStates == 0) throw VertexException("MomentumKinematicConstraint::Empty vector of particles passed");
57  if(nStates != 1) throw VertexException("MomentumKinematicConstraint::Multistate refit is not foreseen for this constraint");
58  AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
59  AlgebraicVector vl(3,0);
60  vl(1) = point(4) - mm(1);
61  vl(2) = point(5) - mm(2);
62  vl(3) = point(6) - mm(3);
63  return std::pair<AlgebraicVector,AlgebraicVector>(vl,point);
64 }
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 MomentumKinematicConstraint::dd
private

Definition at line 58 of file MomentumKinematicConstraint.h.

Referenced by deviations(), and MomentumKinematicConstraint().

AlgebraicVector MomentumKinematicConstraint::mm
private

Definition at line 57 of file MomentumKinematicConstraint.h.

Referenced by MomentumKinematicConstraint(), and value().