#include <RecoVertex/KinematicFit/interface/BackToBackKinematicConstraint.h>
Public Member Functions | |
BackToBackKinematicConstraint () | |
virtual KinematicConstraint * | clone () const |
Clone method. | |
virtual pair< AlgebraicMatrix, AlgebraicVector > | derivative (const vector< RefCountedKinematicParticle > par) const |
virtual pair< AlgebraicMatrix, AlgebraicVector > | derivative (const AlgebraicVector &exPoint) const |
virtual AlgebraicVector | deviations (int nStates) const |
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). | |
virtual int | numberOfEquations () const |
Returns an actual number of equations in particular constraint (corresponds to the number of strings in constraint derivative matrix, for example). | |
virtual pair< AlgebraicVector, AlgebraicVector > | value (const vector< RefCountedKinematicParticle > par) const |
Derivatives and values calculated at expansion point, taken at current state of input particles. | |
virtual pair< AlgebraicVector, AlgebraicVector > | value (const AlgebraicVector &exPoint) const |
Derivatives and value calculated at given expansion point Vector should always be of size 14 (2 particles). | |
~BackToBackKinematicConstraint () |
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.
BackToBackKinematicConstraint::BackToBackKinematicConstraint | ( | ) | [inline] |
BackToBackKinematicConstraint::~BackToBackKinematicConstraint | ( | ) | [inline] |
KinematicConstraint * BackToBackKinematicConstraint::clone | ( | ) | const [virtual] |
Clone method.
Implements KinematicConstraint.
Definition at line 86 of file BackToBackKinematicConstraint.cc.
References BackToBackKinematicConstraint().
00087 {return new BackToBackKinematicConstraint(*this);}
pair< AlgebraicMatrix, AlgebraicVector > BackToBackKinematicConstraint::derivative | ( | const vector< RefCountedKinematicParticle > | par | ) | const [virtual] |
Implements KinematicConstraint.
Definition at line 60 of file BackToBackKinematicConstraint.cc.
00061 { 00062 int nStates = par.size(); 00063 if(nStates != 2) throw VertexException("BackToBackKinematicConstraint::number of tracks is not equal to 2"); 00064 AlgebraicVector point(14,0); 00065 int co = 0; 00066 for(vector<RefCountedKinematicParticle>::const_iterator i = par.begin(); i!=par.end(); i++) 00067 { 00068 AlgebraicVector7 cPar = (*i)->currentState().kinematicParameters().vector(); 00069 for(int j = 1; j<8; j++){point((co-1)*7+j) = cPar(j-1);} 00070 co++; 00071 } 00072 AlgebraicMatrix dr(3,14,0); 00073 00074 return pair<AlgebraicMatrix, AlgebraicVector>(dr,point); 00075 }
pair< AlgebraicMatrix, AlgebraicVector > BackToBackKinematicConstraint::derivative | ( | const AlgebraicVector & | exPoint | ) | const [virtual] |
Implements KinematicConstraint.
Definition at line 20 of file BackToBackKinematicConstraint.cc.
00021 { 00022 //security check for extended cartesian parametrization 00023 int inSize = exPoint.num_row(); 00024 if(inSize != 14) throw VertexException("BackToBackKinematicConstraint::linearization point has a wrong dimension"); 00025 AlgebraicVector pr = exPoint; 00026 00027 //number of states should be always equal to 2 for such a constraint 00028 AlgebraicMatrix dr(3,14,0); 00029 dr(1,4) = 1.; 00030 dr(1,11) = 1.; 00031 dr(2,5) = 1; 00032 dr(2,12) = 1; 00033 dr(3,6) = 1; 00034 dr(3,13) = 1; 00035 return pair<AlgebraicMatrix, AlgebraicVector>(dr,pr); 00036 }
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 dd.
00078 { 00079 AlgebraicVector dd(7*nStates,0); 00080 return dd; 00081 }
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.
pair< AlgebraicVector, AlgebraicVector > BackToBackKinematicConstraint::value | ( | const 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.
00039 { 00040 int nStates = par.size(); 00041 if(nStates != 2) throw VertexException("BackToBackKinematicConstraint::number of tracks is not equal to 2"); 00042 AlgebraicVector point(14,0); 00043 int co = 0; 00044 for(vector<RefCountedKinematicParticle>::const_iterator i = par.begin(); i!=par.end(); i++) 00045 { 00046 AlgebraicVector7 cPar = (*i)->currentState().kinematicParameters().vector(); 00047 for(int j = 1; j<8; j++){point((co-1)*7+j) = cPar(j-1);} 00048 co++; 00049 } 00050 AlgebraicVector vl(3,0); 00051 AlgebraicVector st1 = asHepVector<7>(par[0]->currentState().kinematicParameters().vector()); 00052 AlgebraicVector st2 = asHepVector<7>(par[1]->currentState().kinematicParameters().vector()); 00053 vl(1) = st1(4)+st2(4); 00054 vl(2) = st1(5)+st2(5); 00055 vl(3) = st1(6)+st2(6); 00056 00057 return pair<AlgebraicVector, AlgebraicVector>(vl,point); 00058 }
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.
00006 { 00007 //security check for extended cartesian parametrization 00008 int inSize = exPoint.num_row(); 00009 if(inSize != 14) throw VertexException("BackToBackKinematicConstraint::linearization point has a wrong dimension"); 00010 AlgebraicVector pr = exPoint; 00011 00012 //number of states should be always equal to 2 for such a constraint 00013 AlgebraicVector vl(3,0); 00014 vl(1) = pr(4)+pr(11); 00015 vl(2) = pr(5)+pr(12); 00016 vl(3) = pr(6)+pr(13); 00017 return pair<AlgebraicVector, AlgebraicVector>(vl,pr); 00018 }