5 if(newConst ==
nullptr)
throw VertexException(
"MultipleKinematicConstraint::zero constraint pointer passed");
6 cts.push_back(newConst);
12 if(
cts.empty())
throw VertexException(
"MultipleKinematicConstraint::value requested for empty constraint");
13 if(exPoint.num_row() ==0 )
throw VertexException(
"MultipleKinematicConstraint::value requested for zero Linearization point");
19 int inSize = exPoint.num_row();
20 if((inSize%7) !=0)
throw VertexException(
"MultipleKinematicConstraint::linearization point has a wrong dimension");
23 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
24 {total += (*i)->numberOfEquations();}
28 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
31 int sz = vlc.num_row();
32 for(
int j = 1; j < sz+1; j++)
33 {vl(cr_size+j) = vlc(j);}
36 return std::pair<AlgebraicVector, AlgebraicVector>(vl,expansion);
41 if(
cts.empty())
throw VertexException(
"MultipleKinematicConstraint::derivative requested for empty constraint");
42 if(exPoint.num_row() ==0 )
throw VertexException(
"MultipleKinematicConstraint::value requested for zero Linearization point");
45 int inSize = exPoint.num_row();
46 if((inSize%7) !=0)
throw VertexException(
"MultipleKinematicConstraint::linearization point has a wrong dimension");
51 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
52 {total += (*i)->numberOfEquations();}
58 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
62 dr.sub(cr_size+1,1,lConst);
63 cr_size += (*i)->numberOfEquations();
65 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr,par);
71 if(
cts.empty())
throw VertexException(
"MultipleKinematicConstraint::number of equations requested for empty constraint");
72 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
73 {ne += (*i)->numberOfEquations();}
79 if(
cts.empty())
throw VertexException(
"MultipleKinematicConstraint::derivative requested for empty constraint");
80 int nStates = par.size();
83 for(std::vector<RefCountedKinematicParticle>::const_iterator
i = par.begin();
i!=par.end();
i++)
85 for(
int j = 1; j<8; j++){param((count -1)*7+j) = (*i)->currentState().kinematicParameters().vector()(j-1);}
91 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
92 {total += (*i)->numberOfEquations();}
96 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
99 int sz = vlc.num_row();
100 for(
int j = 1; j <= sz; j++)
101 {vl(cr_size+j) = vlc(j);}
104 return std::pair<AlgebraicVector, AlgebraicVector>(vl,param);
109 if(
cts.empty())
throw VertexException(
"MultipleKinematicConstraint::derivative requested for empty constraint");
110 int nStates = par.size();
114 for(std::vector<RefCountedKinematicParticle>::const_iterator
i = par.begin();
i!=par.end();
i++)
116 for(
int j = 1; j<8; j++){param((count -1)*7+j) = (*i)->currentState().kinematicParameters().vector()(j-1);}
120 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
121 {total += (*i)->numberOfEquations();}
125 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
133 dr.sub(cr_size+1,1,lConst);
134 cr_size += (*i)->numberOfEquations();
136 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr,param);
142 if(
cts.empty())
throw VertexException(
"MultipleKinematicConstraint::deviations requested for empty constraint");
143 for(std::vector<KinematicConstraint *>::const_iterator
i =
cts.begin();
i !=
cts.end();
i++)
146 for(
int j = 1; j < nStates*7+1; j++){dev(j) = dev(j) + dev_loc(j);}
void addConstraint(KinematicConstraint *newConst) const
std::pair< AlgebraicVector, AlgebraicVector > value(const AlgebraicVector &exPoint) const override
std::vector< KinematicConstraint * > cts
CLHEP::HepMatrix AlgebraicMatrix
CLHEP::HepVector AlgebraicVector
AlgebraicVector deviations(int nStates) const override
std::pair< AlgebraicMatrix, AlgebraicVector > derivative(const AlgebraicVector &exPoint) const override
int numberOfEquations() const override