CMS 3D CMS Logo

List of all members | Public Member Functions
BackToBackKinematicConstraint Class Reference

#include <BackToBackKinematicConstraint.h>

Inheritance diagram for BackToBackKinematicConstraint:
KinematicConstraint

Public Member Functions

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

Detailed Description

Class implementing the back-to-back geometry constraints for 2 KinematicParticles. Current version does not implement an actual back-to-back. Current class forces 2 tracks to have the opposite direction, bud does not force them to emerge from the single point. Coorect version to be implemented later.

This is just an illustrative piece of code, showing possible approach to constraint application on multiple tracks.

Kirill Prokofiev, July 2004

Definition at line 21 of file BackToBackKinematicConstraint.h.

Constructor & Destructor Documentation

◆ BackToBackKinematicConstraint()

BackToBackKinematicConstraint::BackToBackKinematicConstraint ( )
inline

Definition at line 23 of file BackToBackKinematicConstraint.h.

23 {}

Referenced by clone().

◆ ~BackToBackKinematicConstraint()

BackToBackKinematicConstraint::~BackToBackKinematicConstraint ( )
inlineoverride

Definition at line 25 of file BackToBackKinematicConstraint.h.

25 {}

Member Function Documentation

◆ clone()

KinematicConstraint * BackToBackKinematicConstraint::clone ( ) const
overridevirtual

Clone method

Implements KinematicConstraint.

Definition at line 89 of file BackToBackKinematicConstraint.cc.

89 { return new BackToBackKinematicConstraint(*this); }

References BackToBackKinematicConstraint().

◆ derivative() [1/2]

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

Implements KinematicConstraint.

Definition at line 20 of file BackToBackKinematicConstraint.cc.

21  {
22  //security check for extended cartesian parametrization
23  int inSize = exPoint.num_row();
24  if (inSize != 14)
25  throw VertexException("BackToBackKinematicConstraint::linearization point has a wrong dimension");
26  AlgebraicVector pr = exPoint;
27 
28  //number of states should be always equal to 2 for such a constraint
29  AlgebraicMatrix dr(3, 14, 0);
30  dr(1, 4) = 1.;
31  dr(1, 11) = 1.;
32  dr(2, 5) = 1;
33  dr(2, 12) = 1;
34  dr(3, 6) = 1;
35  dr(3, 13) = 1;
36  return std::pair<AlgebraicMatrix, AlgebraicVector>(dr, pr);
37 }

References flavorHistoryFilter_cfi::dr.

◆ derivative() [2/2]

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

Implements KinematicConstraint.

Definition at line 63 of file BackToBackKinematicConstraint.cc.

64  {
65  int nStates = par.size();
66  if (nStates != 2)
67  throw VertexException("BackToBackKinematicConstraint::number of tracks is not equal to 2");
68  AlgebraicVector point(14, 0);
69  int co = 0;
70  for (std::vector<RefCountedKinematicParticle>::const_iterator i = par.begin(); i != par.end(); i++) {
71  AlgebraicVector7 cPar = (*i)->currentState().kinematicParameters().vector();
72  for (int j = 1; j < 8; j++) {
73  point((co - 1) * 7 + j) = cPar(j - 1);
74  }
75  co++;
76  }
77  AlgebraicMatrix dr(3, 14, 0);
78 
79  return std::pair<AlgebraicMatrix, AlgebraicVector>(dr, point);
80 }

References cms::cuda::co, flavorHistoryFilter_cfi::dr, mps_fire::i, dqmiolumiharvest::j, and point.

◆ deviations()

AlgebraicVector BackToBackKinematicConstraint::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 82 of file BackToBackKinematicConstraint.cc.

82  {
83  AlgebraicVector dd(7 * nStates, 0);
84  return dd;
85 }

References createTree::dd.

◆ numberOfEquations()

int BackToBackKinematicConstraint::numberOfEquations ( ) const
overridevirtual

Returns an actual number of equations in particular constraint (corresponds to the number of strings in constraint derivative matrix, for example)

Implements KinematicConstraint.

Definition at line 87 of file BackToBackKinematicConstraint.cc.

87 { return 3; }

◆ value() [1/2]

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

Derivatives and value calculated at given expansion point Vector should always be of size 14 (2 particles)

Implements KinematicConstraint.

Definition at line 5 of file BackToBackKinematicConstraint.cc.

5  {
6  //security check for extended cartesian parametrization
7  int inSize = exPoint.num_row();
8  if (inSize != 14)
9  throw VertexException("BackToBackKinematicConstraint::linearization point has a wrong dimension");
10  AlgebraicVector pr = exPoint;
11 
12  //number of states should be always equal to 2 for such a constraint
13  AlgebraicVector vl(3, 0);
14  vl(1) = pr(4) + pr(11);
15  vl(2) = pr(5) + pr(12);
16  vl(3) = pr(6) + pr(13);
17  return std::pair<AlgebraicVector, AlgebraicVector>(vl, pr);
18 }

◆ value() [2/2]

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

Derivatives and values calculated at expansion point, taken at current state of input particles. Number of input particles should be always equal to 2

Implements KinematicConstraint.

Definition at line 39 of file BackToBackKinematicConstraint.cc.

40  {
41  int nStates = par.size();
42  if (nStates != 2)
43  throw VertexException("BackToBackKinematicConstraint::number of tracks is not equal to 2");
44  AlgebraicVector point(14, 0);
45  int co = 0;
46  for (std::vector<RefCountedKinematicParticle>::const_iterator i = par.begin(); i != par.end(); i++) {
47  AlgebraicVector7 cPar = (*i)->currentState().kinematicParameters().vector();
48  for (int j = 1; j < 8; j++) {
49  point((co - 1) * 7 + j) = cPar(j - 1);
50  }
51  co++;
52  }
53  AlgebraicVector vl(3, 0);
54  AlgebraicVector st1 = asHepVector<7>(par[0]->currentState().kinematicParameters().vector());
55  AlgebraicVector st2 = asHepVector<7>(par[1]->currentState().kinematicParameters().vector());
56  vl(1) = st1(4) + st2(4);
57  vl(2) = st1(5) + st2(5);
58  vl(3) = st1(6) + st2(6);
59 
60  return std::pair<AlgebraicVector, AlgebraicVector>(vl, point);
61 }

References cms::cuda::co, mps_fire::i, dqmiolumiharvest::j, point, and trackerHitRTTI::vector.

mps_fire.i
i
Definition: mps_fire.py:428
VertexException
Common base class.
Definition: VertexException.h:12
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
cms::cuda::co
__host__ __device__ VT * co
Definition: prefixScan.h:47
createTree.dd
string dd
Definition: createTree.py:154
sipixeldigitoraw
Definition: SiPixelDigiToRaw.cc:32
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
AlgebraicVector7
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:8
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
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
BackToBackKinematicConstraint::BackToBackKinematicConstraint
BackToBackKinematicConstraint()
Definition: BackToBackKinematicConstraint.h:23