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.

References constraints.

Referenced by clone().

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

Member Function Documentation

◆ clone()

CombinedKinematicConstraint* CombinedKinematicConstraint::clone ( void  ) const
inlineoverridevirtual

Implements MultiTrackKinematicConstraint.

Definition at line 56 of file CombinedKinematicConstraint.h.

References CombinedKinematicConstraint().

56 { return new CombinedKinematicConstraint(*this); }
CombinedKinematicConstraint(const std::vector< MultiTrackKinematicConstraint *> &constraintVector)

◆ 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.

References constraints, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

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 }
std::vector< MultiTrackKinematicConstraint * > 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.

References constraints, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, makeMuonMisalignmentScenario::matrix, and point.

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 }
CLHEP::HepMatrix AlgebraicMatrix
std::vector< MultiTrackKinematicConstraint * > constraints
*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

◆ 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.

References constraints, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, makeMuonMisalignmentScenario::matrix, and point.

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 }
CLHEP::HepMatrix AlgebraicMatrix
std::vector< MultiTrackKinematicConstraint * > constraints
*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

◆ 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.

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

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 }
size
Write out results.
CLHEP::HepVector AlgebraicVector
static int position[264][3]
Definition: ReadPGInfo.cc:289
std::vector< MultiTrackKinematicConstraint * > constraints
*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

Member Data Documentation

◆ constraints

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