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 ()
 
virtual KinematicConstraintclone () const
 
virtual std::pair< AlgebraicMatrix, AlgebraicVectorderivative (const AlgebraicVector &exPoint) const
 
virtual std::pair< AlgebraicMatrix, AlgebraicVectorderivative (const std::vector< RefCountedKinematicParticle > &par) const
 
virtual AlgebraicVector deviations (int nStates) const
 
virtual int numberOfEquations () const
 
virtual std::pair< AlgebraicVector, AlgebraicVectorvalue (const AlgebraicVector &exPoint) const
 
virtual std::pair< AlgebraicVector, AlgebraicVectorvalue (const std::vector< RefCountedKinematicParticle > &par) const
 
 ~BackToBackKinematicConstraint ()
 
- 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 ( )
inline

Definition at line 25 of file BackToBackKinematicConstraint.h.

Referenced by clone().

25 {}
BackToBackKinematicConstraint::~BackToBackKinematicConstraint ( )
inline

Definition at line 27 of file BackToBackKinematicConstraint.h.

References clone(), derivative(), deviations(), numberOfEquations(), and value().

27 {}

Member Function Documentation

KinematicConstraint * BackToBackKinematicConstraint::clone ( ) const
virtual
std::pair< AlgebraicMatrix, AlgebraicVector > BackToBackKinematicConstraint::derivative ( const AlgebraicVector exPoint) const
virtual

Implements KinematicConstraint.

Definition at line 20 of file BackToBackKinematicConstraint.cc.

References runTauDisplay::dr.

Referenced by ~BackToBackKinematicConstraint().

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

Implements KinematicConstraint.

Definition at line 60 of file BackToBackKinematicConstraint.cc.

References runTauDisplay::dr, mps_fire::i, and point.

61 {
62  int nStates = par.size();
63  if(nStates != 2) throw VertexException("BackToBackKinematicConstraint::number of tracks is not equal to 2");
64  AlgebraicVector point(14,0);
65  int co = 0;
66  for(std::vector<RefCountedKinematicParticle>::const_iterator i = par.begin(); i!=par.end(); i++)
67  {
68  AlgebraicVector7 cPar = (*i)->currentState().kinematicParameters().vector();
69  for(int j = 1; j<8; j++){point((co-1)*7+j) = cPar(j-1);}
70  co++;
71  }
72  AlgebraicMatrix dr(3,14,0);
73 
74  return std::pair<AlgebraicMatrix, AlgebraicVector>(dr,point);
75 }
Common base class.
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:8
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 BackToBackKinematicConstraint::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 77 of file BackToBackKinematicConstraint.cc.

References createTree::dd.

Referenced by ~BackToBackKinematicConstraint().

78 {
79  AlgebraicVector dd(7*nStates,0);
80  return dd;
81 }
CLHEP::HepVector AlgebraicVector
int BackToBackKinematicConstraint::numberOfEquations ( ) const
virtual

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 83 of file BackToBackKinematicConstraint.cc.

Referenced by ~BackToBackKinematicConstraint().

84 {return 3;}
std::pair< AlgebraicVector, AlgebraicVector > BackToBackKinematicConstraint::value ( const AlgebraicVector exPoint) const
virtual

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.

Referenced by ~BackToBackKinematicConstraint().

6 {
7 //security check for extended cartesian parametrization
8  int inSize = exPoint.num_row();
9  if(inSize != 14) 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 }
Common base class.
CLHEP::HepVector AlgebraicVector
std::pair< AlgebraicVector, AlgebraicVector > BackToBackKinematicConstraint::value ( const std::vector< RefCountedKinematicParticle > &  par) const
virtual

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 38 of file BackToBackKinematicConstraint.cc.

References mps_fire::i, and point.

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