CMS 3D CMS Logo

MassKinematicConstraint.cc
Go to the documentation of this file.
3 
5  mass = m;
6  AlgebraicVector deviation_l(7, 0);
7  deviation_l(7) = sigma * sigma;
8  dd = deviation_l;
9 }
10 
11 std::pair<AlgebraicVector, AlgebraicVector> MassKinematicConstraint::value(const AlgebraicVector& exPoint) const {
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 }
29 
30 std::pair<AlgebraicMatrix, AlgebraicVector> MassKinematicConstraint::derivative(const AlgebraicVector& exPoint) const {
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 }
46 
47 std::pair<AlgebraicVector, AlgebraicVector> MassKinematicConstraint::value(
48  const std::vector<RefCountedKinematicParticle>& par) const {
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 }
60 
61 std::pair<AlgebraicMatrix, AlgebraicVector> MassKinematicConstraint::derivative(
62  const std::vector<RefCountedKinematicParticle>& par) const {
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 }
74 
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 }
83 
MassKinematicConstraint::derivative
std::pair< AlgebraicMatrix, AlgebraicVector > derivative(const AlgebraicVector &exPoint) const override
Definition: MassKinematicConstraint.cc:30
VertexException
Common base class.
Definition: VertexException.h:12
ParticleMass
double ParticleMass
Definition: ParticleMass.h:4
MassKinematicConstraint::deviations
AlgebraicVector deviations(int nStates) const override
Definition: MassKinematicConstraint.cc:75
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
MassKinematicConstraint::numberOfEquations
int numberOfEquations() const override
Definition: MassKinematicConstraint.cc:84
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
MassKinematicConstraint.h
VertexException.h
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
MassKinematicConstraint::value
std::pair< AlgebraicVector, AlgebraicVector > value(const AlgebraicVector &exPoint) const override
Definition: MassKinematicConstraint.cc:11