CMS 3D CMS Logo

Public Member Functions | Private Attributes

CombinedKinematicConstraint Class Reference

#include <CombinedKinematicConstraint.h>

Inheritance diagram for CombinedKinematicConstraint:
MultiTrackKinematicConstraint

List of all members.

Public Member Functions

virtual
CombinedKinematicConstraint
clone () const
 CombinedKinematicConstraint (std::vector< MultiTrackKinematicConstraint * > constraintVector)
virtual int numberOfEquations () const
virtual AlgebraicMatrix parametersDerivative (const std::vector< KinematicState > states, const GlobalPoint &point) const
virtual AlgebraicMatrix positionDerivative (const std::vector< KinematicState > states, const GlobalPoint &point) const
virtual AlgebraicVector value (const std::vector< KinematicState > states, const GlobalPoint &point) const

Private Attributes

std::vector
< MultiTrackKinematicConstraint * > 
constraints

Detailed Description

This class combines several user defined constraints (by expanding the vector d and the matrices D and E). Usage: Add each constraint to a std::vector<MultiTrackKinematicConstraint* >. This vector has to be used in the constructor: MultiTrackKinematicConstraint *combiC = new CombinedKinematicConstraint(std::vector<MultiTrackKinematicConstraint* >) The produced object can be used by KinematicConstrainedVertexFitter.fit()

Lars Perchalla, Philip Sauerland, Dec 2009

Definition at line 20 of file CombinedKinematicConstraint.h.


Constructor & Destructor Documentation

CombinedKinematicConstraint::CombinedKinematicConstraint ( std::vector< MultiTrackKinematicConstraint * >  constraintVector) [inline]

Definition at line 23 of file CombinedKinematicConstraint.h.

References constraints.

Referenced by clone().

                                                                                                :constraints(constraintVector){
                if(constraints.size()<1) throw VertexException("CombinedKinematicConstraint::<1 constraints passed.");
        }

Member Function Documentation

virtual CombinedKinematicConstraint* CombinedKinematicConstraint::clone ( void  ) const [inline, virtual]

Implements MultiTrackKinematicConstraint.

Definition at line 53 of file CombinedKinematicConstraint.h.

References CombinedKinematicConstraint().

        {
                return new CombinedKinematicConstraint(*this);
        }
int CombinedKinematicConstraint::numberOfEquations ( ) const [virtual]

Number of equations per track used for the combined fit

Implements MultiTrackKinematicConstraint.

Definition at line 60 of file CombinedKinematicConstraint.cc.

References constraints.

{
        int noEq = 0;
        for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it) noEq += (*it)->numberOfEquations();
        
        return noEq;
}
AlgebraicMatrix CombinedKinematicConstraint::parametersDerivative ( const std::vector< KinematicState states,
const GlobalPoint point 
) const [virtual]

Returns a matrix of derivatives of the combined constraint equations w.r.t. particle parameters

Implements MultiTrackKinematicConstraint.

Definition at line 22 of file CombinedKinematicConstraint.cc.

References constraints, and makeMuonMisalignmentScenario::matrix.

{
        AlgebraicMatrix tmpMatrix;
        int row = 0;
        for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
                tmpMatrix = (*it)->parametersDerivative(states, point);
                row += tmpMatrix.num_row();
        }
        AlgebraicMatrix matrix(row,7*states.size(),0);
        int posRow = 1;
        for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
                tmpMatrix =  (*it)->parametersDerivative(states, point);
                matrix.sub(posRow, 1, tmpMatrix);
                posRow += tmpMatrix.num_row();
        }
        
        return matrix;
}
AlgebraicMatrix CombinedKinematicConstraint::positionDerivative ( const std::vector< KinematicState states,
const GlobalPoint point 
) const [virtual]

Returns a matrix of derivatives of constraint equations w.r.t. vertex position

Implements MultiTrackKinematicConstraint.

Definition at line 41 of file CombinedKinematicConstraint.cc.

References constraints, and makeMuonMisalignmentScenario::matrix.

{
        AlgebraicMatrix tmpMatrix;
        int row = 0;
        for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
                tmpMatrix = (*it)->positionDerivative(states, point);
                row += tmpMatrix.num_row();
        }
        AlgebraicMatrix matrix(row,3,0);
        int posRow = 1;
        for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
                tmpMatrix =  (*it)->positionDerivative(states, point);
                matrix.sub(posRow, 1, tmpMatrix);
                posRow += tmpMatrix.num_row();
        }
        
        return matrix;
}
AlgebraicVector CombinedKinematicConstraint::value ( const std::vector< KinematicState states,
const GlobalPoint point 
) const [virtual]

Returns a vector of values of the combined constraint equations at the point where the input particles are defined.

Implements MultiTrackKinematicConstraint.

Definition at line 3 of file CombinedKinematicConstraint.cc.

References constraints, position, findQualityFiles::size, and makeHLTPrescaleTable::values.

{
        AlgebraicVector tmpValue;
        int size = 0;
        for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
                tmpValue = (*it)->value(states, point);
                size += tmpValue.num_row();
        }
        AlgebraicVector values(size);
        int position = 1;
        for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
                tmpValue =  (*it)->value(states, point);
                values.sub(position, tmpValue);
                position += tmpValue.num_row();
        }
        
        return values;
}

Member Data Documentation