CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MassKinematicConstraint Class Reference

#include <MassKinematicConstraint.h>

Inheritance diagram for MassKinematicConstraint:
KinematicConstraint

Public Member Functions

MassKinematicConstraintclone () const override
 
std::pair< AlgebraicMatrix, AlgebraicVectorderivative (const AlgebraicVector &exPoint) const override
 
std::pair< AlgebraicMatrix, AlgebraicVectorderivative (const std::vector< RefCountedKinematicParticle > &par) const override
 
AlgebraicVector deviations (int nStates) const override
 
 MassKinematicConstraint (const ParticleMass &m, const float sigma)
 
int numberOfEquations () const override
 
std::pair< AlgebraicVector, AlgebraicVectorvalue (const AlgebraicVector &exPoint) const override
 
std::pair< AlgebraicVector, AlgebraicVectorvalue (const std::vector< RefCountedKinematicParticle > &par) const override
 
- 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::MassKinematicConstraint ( const ParticleMass m,
const float  sigma 
)

Constructor with mass to be used as constraint value

Definition at line 4 of file MassKinematicConstraint.cc.

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

References dd, visualization-live-secondInstance_cfg::m, and mass.

Referenced by clone().

Member Function Documentation

◆ clone()

MassKinematicConstraint* MassKinematicConstraint::clone ( ) const
inlineoverridevirtual

Clone method

Implements KinematicConstraint.

Definition at line 50 of file MassKinematicConstraint.h.

50 { return new MassKinematicConstraint(*this); }

References MassKinematicConstraint().

◆ derivative() [1/2]

std::pair< AlgebraicMatrix, AlgebraicVector > MassKinematicConstraint::derivative ( const AlgebraicVector exPoint) const
overridevirtual

Implements KinematicConstraint.

Definition at line 30 of file MassKinematicConstraint.cc.

30  {
31  if (exPoint.num_row() == 0)
32  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)
37  throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension");
38  int nStates = inSize / 7;
39  if (nStates != 1)
40  throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
41  AlgebraicMatrix dr(1, 7, 0);
42  dr(1, 7) = 1;
43  AlgebraicVector point = exPoint;
44  return std::pair<AlgebraicMatrix, AlgebraicVector>(dr, point);
45 }

References flavorHistoryFilter_cfi::dr, and point.

◆ derivative() [2/2]

std::pair< AlgebraicMatrix, AlgebraicVector > MassKinematicConstraint::derivative ( const std::vector< RefCountedKinematicParticle > &  par) const
overridevirtual

Implements KinematicConstraint.

Definition at line 61 of file MassKinematicConstraint.cc.

62  {
63  int nStates = par.size();
64  if (nStates == 0)
65  throw VertexException("MassKinematicConstraint::empty vector of particles passed");
66  if (nStates != 1)
67  throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
68 
69  AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
70  AlgebraicMatrix dr(1, 7, 0);
71  dr(1, 7) = 1;
72  return std::pair<AlgebraicMatrix, AlgebraicVector>(dr, point);
73 }

References flavorHistoryFilter_cfi::dr, and point.

◆ deviations()

AlgebraicVector MassKinematicConstraint::deviations ( int  nStates) const
overridevirtual

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 75 of file MassKinematicConstraint.cc.

75  {
76  if (nStates == 0)
77  throw VertexException("MassKinematicConstraint::empty vector of particles passed");
78  if (nStates != 1)
79  throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
81  return res;
82 }

References dd.

◆ numberOfEquations()

int MassKinematicConstraint::numberOfEquations ( ) const
overridevirtual

Returns number of constraint equations used for fitting. Method is relevant for proper NDF calculations.

Implements KinematicConstraint.

Definition at line 84 of file MassKinematicConstraint.cc.

84 { return 1; }

◆ value() [1/2]

std::pair< AlgebraicVector, AlgebraicVector > MassKinematicConstraint::value ( const AlgebraicVector exPoint) const
overridevirtual

Vector of values and matrix of derivatives calculated at given 7xNumberOfStates point

Implements KinematicConstraint.

Definition at line 11 of file MassKinematicConstraint.cc.

11  {
12  //we have only one equation and only one track, means the constraint value
13  //for track parameters is just a single number
14  if (exPoint.num_row() == 0)
15  throw VertexException("MomentumKinematicConstraint::value requested for zero Linearization point");
16 
17  //security check for extended cartesian parametrization
18  int inSize = exPoint.num_row();
19  if ((inSize % 7) != 0)
20  throw VertexException("MomentumKinematicConstraint::linearization point has a wrong dimension");
21  int nStates = inSize / 7;
22  if (nStates != 1)
23  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 }

References mass, and point.

◆ value() [2/2]

std::pair< AlgebraicVector, AlgebraicVector > MassKinematicConstraint::value ( const std::vector< RefCountedKinematicParticle > &  par) const
overridevirtual

Vector of values and matrix of derivatives calculated using current state parameters as expansion point

Implements KinematicConstraint.

Definition at line 47 of file MassKinematicConstraint.cc.

48  {
49  int nStates = par.size();
50  if (nStates == 0)
51  throw VertexException("MassKinematicConstraint::empty vector of particles passed");
52  if (nStates != 1)
53  throw VertexException("MassKinematicConstraint::multiple state refit is not supported in this version");
54 
55  AlgebraicVector point = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
56  AlgebraicVector vl(1, 0);
57  vl(1) = point(7) - mass;
58  return std::pair<AlgebraicVector, AlgebraicVector>(vl, point);
59 }

References mass, and point.

Member Data Documentation

◆ dd

AlgebraicVector MassKinematicConstraint::dd
private

Definition at line 54 of file MassKinematicConstraint.h.

Referenced by deviations(), and MassKinematicConstraint().

◆ mass

ParticleMass MassKinematicConstraint::mass
private
VertexException
Common base class.
Definition: VertexException.h:12
MassKinematicConstraint::dd
AlgebraicVector dd
Definition: MassKinematicConstraint.h:54
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
MassKinematicConstraint::mass
ParticleMass mass
Definition: MassKinematicConstraint.h:53
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
res
Definition: Electron.h:6
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
point
*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
MassKinematicConstraint::MassKinematicConstraint
MassKinematicConstraint(const ParticleMass &m, const float sigma)
Definition: MassKinematicConstraint.cc:4