test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CombinedKinematicConstraint.cc
Go to the documentation of this file.
2 
3 AlgebraicVector CombinedKinematicConstraint::value(const std::vector<KinematicState> &states, const GlobalPoint& point) const
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 }
21 
22 AlgebraicMatrix CombinedKinematicConstraint::parametersDerivative(const std::vector<KinematicState> &states, const GlobalPoint& point) const
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 }
40 
41 AlgebraicMatrix CombinedKinematicConstraint::positionDerivative(const std::vector<KinematicState> &states, const GlobalPoint& point) const
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 }
59 
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 }
virtual AlgebraicVector value(const std::vector< KinematicState > &states, const GlobalPoint &point) const
CLHEP::HepMatrix AlgebraicMatrix
std::vector< MultiTrackKinematicConstraint * > constraints
CLHEP::HepVector AlgebraicVector
static int position[264][3]
Definition: ReadPGInfo.cc:509
virtual AlgebraicMatrix positionDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const
virtual AlgebraicMatrix parametersDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const
tuple size
Write out results.
*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