CMS 3D CMS Logo

CombinedKinematicConstraint.cc
Go to the documentation of this file.
2 
3 AlgebraicVector CombinedKinematicConstraint::value(const std::vector<KinematicState>& states,
4  const GlobalPoint& point) const {
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 }
23 
24 AlgebraicMatrix CombinedKinematicConstraint::parametersDerivative(const std::vector<KinematicState>& states,
25  const GlobalPoint& point) const {
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 }
44 
45 AlgebraicMatrix CombinedKinematicConstraint::positionDerivative(const std::vector<KinematicState>& states,
46  const GlobalPoint& point) const {
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 }
65 
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 }
size
Write out results.
AlgebraicVector value(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
AlgebraicMatrix parametersDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
CLHEP::HepMatrix AlgebraicMatrix
AlgebraicMatrix positionDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
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