#include <BackToBackKinematicConstraint.h>
Public Member Functions | |
BackToBackKinematicConstraint () | |
virtual KinematicConstraint * | clone () const |
virtual std::pair < AlgebraicMatrix, AlgebraicVector > | derivative (const AlgebraicVector &exPoint) const |
virtual std::pair < AlgebraicMatrix, AlgebraicVector > | derivative (const std::vector< RefCountedKinematicParticle > par) const |
virtual AlgebraicVector | deviations (int nStates) const |
virtual int | numberOfEquations () const |
virtual std::pair < AlgebraicVector, AlgebraicVector > | value (const std::vector< RefCountedKinematicParticle > par) const |
virtual std::pair < AlgebraicVector, AlgebraicVector > | value (const AlgebraicVector &exPoint) const |
~BackToBackKinematicConstraint () |
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.
BackToBackKinematicConstraint::BackToBackKinematicConstraint | ( | ) | [inline] |
BackToBackKinematicConstraint::~BackToBackKinematicConstraint | ( | ) | [inline] |
Definition at line 27 of file BackToBackKinematicConstraint.h.
{}
KinematicConstraint * BackToBackKinematicConstraint::clone | ( | ) | const [virtual] |
Clone method
Implements KinematicConstraint.
Definition at line 86 of file BackToBackKinematicConstraint.cc.
References BackToBackKinematicConstraint().
{return new BackToBackKinematicConstraint(*this);}
std::pair< AlgebraicMatrix, AlgebraicVector > BackToBackKinematicConstraint::derivative | ( | const std::vector< RefCountedKinematicParticle > | par | ) | const [virtual] |
Implements KinematicConstraint.
Definition at line 60 of file BackToBackKinematicConstraint.cc.
{ int nStates = par.size(); if(nStates != 2) throw VertexException("BackToBackKinematicConstraint::number of tracks is not equal to 2"); AlgebraicVector point(14,0); int co = 0; for(std::vector<RefCountedKinematicParticle>::const_iterator i = par.begin(); i!=par.end(); i++) { AlgebraicVector7 cPar = (*i)->currentState().kinematicParameters().vector(); for(int j = 1; j<8; j++){point((co-1)*7+j) = cPar(j-1);} co++; } AlgebraicMatrix dr(3,14,0); return std::pair<AlgebraicMatrix, AlgebraicVector>(dr,point); }
std::pair< AlgebraicMatrix, AlgebraicVector > BackToBackKinematicConstraint::derivative | ( | const AlgebraicVector & | exPoint | ) | const [virtual] |
Implements KinematicConstraint.
Definition at line 20 of file BackToBackKinematicConstraint.cc.
{ //security check for extended cartesian parametrization int inSize = exPoint.num_row(); if(inSize != 14) throw VertexException("BackToBackKinematicConstraint::linearization point has a wrong dimension"); AlgebraicVector pr = exPoint; //number of states should be always equal to 2 for such a constraint AlgebraicMatrix dr(3,14,0); dr(1,4) = 1.; dr(1,11) = 1.; dr(2,5) = 1; dr(2,12) = 1; dr(3,6) = 1; dr(3,13) = 1; return std::pair<AlgebraicMatrix, AlgebraicVector>(dr,pr); }
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.
{ AlgebraicVector dd(7*nStates,0); return dd; }
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.
{return 3;}
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.
{ int nStates = par.size(); if(nStates != 2) throw VertexException("BackToBackKinematicConstraint::number of tracks is not equal to 2"); AlgebraicVector point(14,0); int co = 0; for(std::vector<RefCountedKinematicParticle>::const_iterator i = par.begin(); i!=par.end(); i++) { AlgebraicVector7 cPar = (*i)->currentState().kinematicParameters().vector(); for(int j = 1; j<8; j++){point((co-1)*7+j) = cPar(j-1);} co++; } AlgebraicVector vl(3,0); AlgebraicVector st1 = asHepVector<7>(par[0]->currentState().kinematicParameters().vector()); AlgebraicVector st2 = asHepVector<7>(par[1]->currentState().kinematicParameters().vector()); vl(1) = st1(4)+st2(4); vl(2) = st1(5)+st2(5); vl(3) = st1(6)+st2(6); return std::pair<AlgebraicVector, AlgebraicVector>(vl,point); }
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.
{ //security check for extended cartesian parametrization int inSize = exPoint.num_row(); if(inSize != 14) throw VertexException("BackToBackKinematicConstraint::linearization point has a wrong dimension"); AlgebraicVector pr = exPoint; //number of states should be always equal to 2 for such a constraint AlgebraicVector vl(3,0); vl(1) = pr(4)+pr(11); vl(2) = pr(5)+pr(12); vl(3) = pr(6)+pr(13); return std::pair<AlgebraicVector, AlgebraicVector>(vl,pr); }