CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CombinedKinematicConstraint Class Reference

#include <CombinedKinematicConstraint.h>

Inheritance diagram for CombinedKinematicConstraint:
MultiTrackKinematicConstraint

Public Member Functions

CombinedKinematicConstraintclone () const override
 
 CombinedKinematicConstraint (const std::vector< MultiTrackKinematicConstraint * > &constraintVector)
 
int numberOfEquations () const override
 
AlgebraicMatrix parametersDerivative (const std::vector< KinematicState > &states, const GlobalPoint &point) const override
 
AlgebraicMatrix positionDerivative (const std::vector< KinematicState > &states, const GlobalPoint &point) const override
 
AlgebraicVector value (const std::vector< KinematicState > &states, const GlobalPoint &point) const override
 
- 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::CombinedKinematicConstraint ( const std::vector< MultiTrackKinematicConstraint * > &  constraintVector)
inline

Definition at line 22 of file CombinedKinematicConstraint.h.

23  : constraints(constraintVector) {
24  if (constraints.empty())
25  throw VertexException("CombinedKinematicConstraint::<1 constraints passed.");
26  }

References constraints.

Referenced by clone().

Member Function Documentation

◆ clone()

CombinedKinematicConstraint* CombinedKinematicConstraint::clone ( void  ) const
inlineoverridevirtual

Implements MultiTrackKinematicConstraint.

Definition at line 56 of file CombinedKinematicConstraint.h.

56 { return new CombinedKinematicConstraint(*this); }

References CombinedKinematicConstraint().

◆ numberOfEquations()

int CombinedKinematicConstraint::numberOfEquations ( ) const
overridevirtual

Number of equations per track used for the combined fit

Implements MultiTrackKinematicConstraint.

Definition at line 66 of file CombinedKinematicConstraint.cc.

66  {
67  int noEq = 0;
68  for (std::vector<MultiTrackKinematicConstraint*>::const_iterator it = constraints.begin(); it != constraints.end();
69  ++it)
70  noEq += (*it)->numberOfEquations();
71 
72  return noEq;
73 }

References constraints.

◆ parametersDerivative()

AlgebraicMatrix CombinedKinematicConstraint::parametersDerivative ( const std::vector< KinematicState > &  states,
const GlobalPoint point 
) const
overridevirtual

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

Implements MultiTrackKinematicConstraint.

Definition at line 24 of file CombinedKinematicConstraint.cc.

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

References constraints, makeMuonMisalignmentScenario::matrix, and point.

◆ positionDerivative()

AlgebraicMatrix CombinedKinematicConstraint::positionDerivative ( const std::vector< KinematicState > &  states,
const GlobalPoint point 
) const
overridevirtual

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

Implements MultiTrackKinematicConstraint.

Definition at line 45 of file CombinedKinematicConstraint.cc.

46  {
47  AlgebraicMatrix tmpMatrix;
48  int row = 0;
49  for (std::vector<MultiTrackKinematicConstraint*>::const_iterator it = constraints.begin(); it != constraints.end();
50  ++it) {
51  tmpMatrix = (*it)->positionDerivative(states, point);
52  row += tmpMatrix.num_row();
53  }
54  AlgebraicMatrix matrix(row, 3, 0);
55  int posRow = 1;
56  for (std::vector<MultiTrackKinematicConstraint*>::const_iterator it = constraints.begin(); it != constraints.end();
57  ++it) {
58  tmpMatrix = (*it)->positionDerivative(states, point);
59  matrix.sub(posRow, 1, tmpMatrix);
60  posRow += tmpMatrix.num_row();
61  }
62 
63  return matrix;
64 }

References constraints, makeMuonMisalignmentScenario::matrix, and point.

◆ value()

AlgebraicVector CombinedKinematicConstraint::value ( const std::vector< KinematicState > &  states,
const GlobalPoint point 
) const
overridevirtual

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.

4  {
5  AlgebraicVector tmpValue;
6  int size = 0;
7  for (std::vector<MultiTrackKinematicConstraint*>::const_iterator it = constraints.begin(); it != constraints.end();
8  ++it) {
9  tmpValue = (*it)->value(states, point);
10  size += tmpValue.num_row();
11  }
13  int position = 1;
14  for (std::vector<MultiTrackKinematicConstraint*>::const_iterator it = constraints.begin(); it != constraints.end();
15  ++it) {
16  tmpValue = (*it)->value(states, point);
17  values.sub(position, tmpValue);
18  position += tmpValue.num_row();
19  }
20 
21  return values;
22 }

References constraints, point, position, findQualityFiles::size, and contentValuesCheck::values.

Member Data Documentation

◆ constraints

std::vector<MultiTrackKinematicConstraint*> CombinedKinematicConstraint::constraints
private
CombinedKinematicConstraint::CombinedKinematicConstraint
CombinedKinematicConstraint(const std::vector< MultiTrackKinematicConstraint * > &constraintVector)
Definition: CombinedKinematicConstraint.h:22
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
VertexException
Common base class.
Definition: VertexException.h:12
AlgebraicVector
CLHEP::HepVector AlgebraicVector
Definition: AlgebraicObjects.h:13
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
AlgebraicMatrix
CLHEP::HepMatrix AlgebraicMatrix
Definition: AlgebraicObjects.h:14
CombinedKinematicConstraint::constraints
std::vector< MultiTrackKinematicConstraint * > constraints
Definition: CombinedKinematicConstraint.h:59
point
*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
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443