CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CombinedKinematicConstraint Class Reference

#include <CombinedKinematicConstraint.h>

Inheritance diagram for CombinedKinematicConstraint:
MultiTrackKinematicConstraint

Public Member Functions

virtual
CombinedKinematicConstraint
clone () const
 
 CombinedKinematicConstraint (const 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
 
- Public Member Functions inherited from MultiTrackKinematicConstraint
 MultiTrackKinematicConstraint ()
 
virtual ~MultiTrackKinematicConstraint ()
 

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 ( const std::vector< MultiTrackKinematicConstraint * > &  constraintVector)
inline

Definition at line 23 of file CombinedKinematicConstraint.h.

References constraints.

Referenced by clone().

23  :constraints(constraintVector){
24  if(constraints.size()<1) throw VertexException("CombinedKinematicConstraint::<1 constraints passed.");
25  }
Common base class.
std::vector< MultiTrackKinematicConstraint * > constraints

Member Function Documentation

virtual CombinedKinematicConstraint* CombinedKinematicConstraint::clone ( void  ) const
inlinevirtual

Implements MultiTrackKinematicConstraint.

Definition at line 53 of file CombinedKinematicConstraint.h.

References CombinedKinematicConstraint().

54  {
55  return new CombinedKinematicConstraint(*this);
56  }
CombinedKinematicConstraint(const std::vector< MultiTrackKinematicConstraint * > &constraintVector)
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.

61 {
62  int noEq = 0;
63  for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it) noEq += (*it)->numberOfEquations();
64 
65  return noEq;
66 }
std::vector< MultiTrackKinematicConstraint * > constraints
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.

23 {
24  AlgebraicMatrix tmpMatrix;
25  int row = 0;
26  for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
27  tmpMatrix = (*it)->parametersDerivative(states, point);
28  row += tmpMatrix.num_row();
29  }
30  AlgebraicMatrix matrix(row,7*states.size(),0);
31  int posRow = 1;
32  for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
33  tmpMatrix = (*it)->parametersDerivative(states, point);
34  matrix.sub(posRow, 1, tmpMatrix);
35  posRow += tmpMatrix.num_row();
36  }
37 
38  return matrix;
39 }
CLHEP::HepMatrix AlgebraicMatrix
std::vector< MultiTrackKinematicConstraint * > constraints
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.

42 {
43  AlgebraicMatrix tmpMatrix;
44  int row = 0;
45  for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
46  tmpMatrix = (*it)->positionDerivative(states, point);
47  row += tmpMatrix.num_row();
48  }
49  AlgebraicMatrix matrix(row,3,0);
50  int posRow = 1;
51  for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
52  tmpMatrix = (*it)->positionDerivative(states, point);
53  matrix.sub(posRow, 1, tmpMatrix);
54  posRow += tmpMatrix.num_row();
55  }
56 
57  return matrix;
58 }
CLHEP::HepMatrix AlgebraicMatrix
std::vector< MultiTrackKinematicConstraint * > constraints
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.

4 {
5  AlgebraicVector tmpValue;
6  int size = 0;
7  for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
8  tmpValue = (*it)->value(states, point);
9  size += tmpValue.num_row();
10  }
11  AlgebraicVector values(size);
12  int position = 1;
13  for (std::vector<MultiTrackKinematicConstraint* >::const_iterator it=constraints.begin(); it!=constraints.end(); ++it){
14  tmpValue = (*it)->value(states, point);
15  values.sub(position, tmpValue);
16  position += tmpValue.num_row();
17  }
18 
19  return values;
20 }
std::vector< MultiTrackKinematicConstraint * > constraints
CLHEP::HepVector AlgebraicVector
static int position[264][3]
Definition: ReadPGInfo.cc:509
tuple size
Write out results.

Member Data Documentation

std::vector<MultiTrackKinematicConstraint* > CombinedKinematicConstraint::constraints
private