5 if (exPoint.num_row() == 0)
6 throw VertexException(
"PointingKinematicConstraint::value requested for zero Linearization point");
9 int inSize = exPoint.num_row();
10 if ((inSize % 7) != 0)
11 throw VertexException(
"PointingKinematicConstraint::linearization point has a wrong dimension");
12 int nStates = inSize / 7;
14 throw VertexException(
"PointingKinematicConstraint::Current version does not support the multistate refit");
23 return std::pair<AlgebraicVector, AlgebraicVector>(vl, lPar);
27 if (exPoint.num_row() == 0)
28 throw VertexException(
"PointingKinematicConstraint::value requested for zero Linearization point");
31 int inSize = exPoint.num_row();
32 if ((inSize % 7) != 0)
33 throw VertexException(
"PointingKinematicConstraint::linearization point has a wrong dimension");
34 int nStates = inSize / 7;
36 throw VertexException(
"PointingKinematicConstraint::Current version does not support the multistate refit");
43 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr, lPar);
47 const std::vector<RefCountedKinematicParticle>& par)
const {
48 int nStates = par.size();
50 throw VertexException(
"PointingKinematicConstraint::Empty vector of particles passed");
52 throw VertexException(
"PointingKinematicConstraint::Current version does not support the multistate refit");
55 AlgebraicVector lPoint = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
62 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr, lPoint);
66 const std::vector<RefCountedKinematicParticle>& par)
const {
67 int nStates = par.size();
69 throw VertexException(
"PointingKinematicConstraint::Empty vector of particles passed");
71 throw VertexException(
"PointingKinematicConstraint::Current version does not support the multistate refit");
73 AlgebraicVector lPoint = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
79 return std::pair<AlgebraicVector, AlgebraicVector>(vl, lPoint);
98 double cos_phi_p = px /
sqrt(px * px + py * py);
99 double cos_phi_x = dx /
sqrt(dx * dx + dy * dy);
103 double cos_theta_p =
sqrt(px * px + py * py) /
sqrt(px * px + py * py + pz * pz);
104 double cos_theta_x =
sqrt(dx * dx + dy * dy) /
sqrt(dx * dx + dy * dy + dz * dz);
106 float feq =
sqrt((1 - cos_phi_p) * (1 + cos_phi_x)) -
sqrt((1 + cos_phi_p) * (1 - cos_phi_x));
107 float seq =
sqrt((1 - cos_theta_p) * (1 + cos_theta_x)) -
sqrt((1 + cos_theta_p) * (1 - cos_theta_x));
119 return std::pair<AlgebraicVector, AlgebraicVector>(vl,
point);
129 double px =
point(4);
130 double py =
point(5);
131 double pz =
point(6);
151 dr(1, 4) = (-(dx * dy * (1 - px /
sqrt(
pow(px, 2) +
pow(py, 2)))) /
152 (2. *
pow(
pow(dx, 2) +
pow(dy, 2), 1.5) *
154 (dx * dy * (1 + px /
sqrt(
pow(px, 2) +
pow(py, 2)))) /
155 (2. *
pow(
pow(dx, 2) +
pow(dy, 2), 1.5) *
159 dr(1, 5) = (((1 + dx /
sqrt(
pow(dx, 2) +
pow(dy, 2))) * px * py) /
160 (2. *
pow(
pow(px, 2) +
pow(py, 2), 1.5) *
162 ((1 - dx /
sqrt(
pow(dx, 2) +
pow(dy, 2))) * px * py) /
163 (2. *
pow(
pow(px, 2) +
pow(py, 2), 1.5) *
251 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr,
point);
AlgebraicVector deviations(int nStates) const override
CLHEP::HepMatrix AlgebraicMatrix
std::pair< AlgebraicMatrix, AlgebraicVector > derivative(const AlgebraicVector &exPoint) const override
std::pair< AlgebraicVector, AlgebraicVector > makeValue(const AlgebraicVector &exPoint) const
int numberOfEquations() const override
CLHEP::HepVector AlgebraicVector
std::pair< AlgebraicVector, AlgebraicVector > value(const AlgebraicVector &exPoint) const override
Power< A, B >::type pow(const A &a, const B &b)
*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
std::pair< AlgebraicMatrix, AlgebraicVector > makeDerivative(const AlgebraicVector &exPoint) const