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);
28 if (exPoint.num_row() == 0)
29 throw VertexException(
"PointingKinematicConstraint::value requested for zero Linearization point");
32 int inSize = exPoint.num_row();
33 if ((inSize % 7) != 0)
34 throw VertexException(
"PointingKinematicConstraint::linearization point has a wrong dimension");
35 int nStates = inSize / 7;
37 throw VertexException(
"PointingKinematicConstraint::Current version does not support the multistate refit");
44 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr, lPar);
48 const std::vector<RefCountedKinematicParticle>& par)
const {
49 int nStates = par.size();
51 throw VertexException(
"PointingKinematicConstraint::Empty vector of particles passed");
53 throw VertexException(
"PointingKinematicConstraint::Current version does not support the multistate refit");
56 AlgebraicVector lPoint = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
61 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr, lPoint);
65 const std::vector<RefCountedKinematicParticle>& par)
const {
66 int nStates = par.size();
68 throw VertexException(
"PointingKinematicConstraint::Empty vector of particles passed");
70 throw VertexException(
"PointingKinematicConstraint::Current version does not support the multistate refit");
72 AlgebraicVector lPoint = asHepVector<7>(par.front()->currentState().kinematicParameters().vector());
75 return std::pair<AlgebraicVector, AlgebraicVector>(vl, lPoint);
94 double sin_p = py /
sqrt(px * px + py * py);
95 double cos_p = px /
sqrt(px * px + py * py);
96 double sin_x = dy /
sqrt(dx * dx + dy * dy);
97 double cos_x = dx /
sqrt(dx * dx + dy * dy);
99 double sin_pt = pz /
sqrt(px * px + py * py + pz * pz);
100 double cos_pt =
sqrt(px * px + py * py) /
sqrt(px * px + py * py + pz * pz);
101 double sin_xt = dz /
sqrt(dx * dx + dy * dy + dz * dz);
102 double cos_xt =
sqrt(dx * dx + dy * dy) /
sqrt(dx * dx + dy * dy + dz * dz);
104 vl(1) = (1 - cos_x) / sin_x - (1 - cos_p) / sin_p;
105 vl(2) = (1 - cos_xt) / sin_xt - (1 - cos_pt) / sin_pt;
110 return std::pair<AlgebraicVector, AlgebraicVector>(vl,
point);
122 double pz =
point(6);
160 dr(1, 1) = dx / (dy *
sqrt(dx * dx + dy * dy)) - 1 / dy;
161 dr(1, 2) = 1 /
sqrt(dx * dx + dy * dy) -
sqrt(dx * dx + dy * dy) / (dy *
dy) + dx / (dy * dy);
163 dr(1, 4) = -(px / (py *
sqrt(px * px + py * py)) - 1 / py);
164 dr(1, 5) = -(1 /
sqrt(px * px + py * py) -
sqrt(px * px + py * py) / (py *
py) + px / (py * py));
169 dr(2, 1) = (dx /
dz) * (1 /
sqrt(dx * dx + dy * dy + dz * dz) - 1 /
sqrt(dx * dx + dy * dy));
170 dr(2, 2) = (dy /
dz) * (1 /
sqrt(dx * dx + dy * dy + dz * dz) - 1 /
sqrt(dx * dx + dy * dy));
171 dr(2, 3) = (1 / (dz *
dz)) * (
sqrt(dx * dx + dy * dy) -
sqrt(dx * dx + dy * dy + dz * dz)) +
172 1 /
sqrt(dx * dx + dy * dy + dz * dz);
173 dr(2, 4) = -(px / pz) * (1 /
sqrt(px * px + py * py + pz * pz) - 1 /
sqrt(px * px + py * py));
174 dr(2, 5) = -(py / pz) * (1 /
sqrt(px * px + py * py + pz * pz) - 1 /
sqrt(px * px + py * py));
175 dr(2, 6) = -((1 / (pz * pz)) * (
sqrt(px * px + py * py) -
sqrt(px * px + py * py + pz * pz)) +
176 1 /
sqrt(px * px + py * py + pz * pz));
179 return std::pair<AlgebraicMatrix, AlgebraicVector>(
dr,
point);
int numberOfEquations() const override
CLHEP::HepMatrix AlgebraicMatrix
std::pair< AlgebraicVector, AlgebraicVector > makeValue(const AlgebraicVector &exPoint) const
AlgebraicVector deviations(int nStates) const override
CLHEP::HepVector AlgebraicVector
std::pair< AlgebraicVector, AlgebraicVector > value(const AlgebraicVector &exPoint) const override
std::pair< AlgebraicMatrix, AlgebraicVector > makeDerivative(const AlgebraicVector &exPoint) const
std::pair< AlgebraicMatrix, AlgebraicVector > derivative(const AlgebraicVector &exPoint) const override
*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