14 if(states.size()<2)
throw VertexException(
"ColinearityKinematicConstraint::<2 states passed");
17 double a_1 = -states[0].particleCharge()*states[0].magneticField()->inInverseGeV(states[0].globalPosition()).z();
18 double a_2 = -states[1].particleCharge()*states[1].magneticField()->inInverseGeV(states[1].globalPosition()).z();
23 double p1vx =
p1(3) - a_1*(point.
y() -
p1(1));
24 double p1vy =
p1(4) + a_1*(point.
x() -
p1(0));
27 double p2vx =
p2(3) - a_2*(point.
y() -
p2(1));
28 double p2vy =
p2(4) + a_2*(point.
x() -
p2(0));
32 res(1) = atan2(p1vy,p1vx) - atan2(p2vy,p2vx);
33 if ( res(1) >
M_PI ) res(1) -= 2.0*
M_PI;
34 if ( res(1) <= -
M_PI ) res(1) += 2.0*
M_PI;
37 res(2) = atan2(pt1,
p1(5)) - atan2(pt2,
p2(5));
38 if ( res(2) >
M_PI ) res(2) -= 2.0*
M_PI;
39 if ( res(2) <= -
M_PI ) res(2) += 2.0*
M_PI;
50 int n_st = states.size();
51 if(n_st<2)
throw VertexException(
"ColinearityKinematicConstraint::<2 states passed");
54 double a_1 = -states[0].particleCharge()*states[0].magneticField()->inInverseGeV(states[0].globalPosition()).z();
55 double a_2 = -states[1].particleCharge()*states[1].magneticField()->inInverseGeV(states[1].globalPosition()).z();
60 double p1vx =
p1(3) - a_1*(point.
y() -
p1(1));
61 double p1vy =
p1(4) + a_1*(point.
x() -
p1(0));
62 double k1 = 1.0/(p1vx*p1vx + p1vy*p1vy);
66 double p2vx =
p2(3) - a_2*(point.
y() -
p2(1));
67 double p2vy =
p2(4) + a_2*(point.
x() -
p2(0));
68 double k2 = 1.0/(p2vx*p2vx + p2vy*p2vy);
75 res(1,1) = -k1*a_1*p1vx;
76 res(1,8) = k2*a_2*p2vx;
79 res(1,2) = -k1*a_1*p1vy;
80 res(1,9) = k2*a_2*p2vy;
83 res(1,3) = 0.; res(1,10) = 0.;
95 res(1,6) = 0.; res(1,13) = 0.;
97 res(1,7) = 0.; res(1,14) = 0.;
102 res(2,1) = 0.; res(2,8) = 0.;
105 res(2,2) = 0.; res(2,9) = 0.;
108 res(2,3) = 0.; res(2,10) = 0.;
110 res(2,4) =
p1(5)*
p1(3) / (pTot1*pTot1*
pt1);
111 res(2,11) = -
p2(5)*
p2(3) / (pTot2*pTot2*
pt2);
114 res(2,5) =
p1(5)*
p1(4) / (pTot1*pTot1*
pt1);
115 res(2,12) = -
p2(5)*
p2(4) / (pTot2*pTot2*
pt2);
118 res(2,6) = - pt1/(pTot1*pTot1);
119 res(2,13) = pt2/(pTot2*pTot2);
121 res(2,7) = 0.; res(2,14) = 0.;
131 if(states.size()<2)
throw VertexException(
"ColinearityKinematicConstraint::<2 states passed");
133 double a_1 = -states[0].particleCharge() * states[0].magneticField()->inInverseGeV(states[0].globalPosition()).z();
134 double a_2 = -states[1].particleCharge() * states[1].magneticField()->inInverseGeV(states[1].globalPosition()).z();
139 double p1vx =
p1(3) - a_1*(point.
y() -
p1(1));
140 double p1vy =
p1(4) + a_1*(point.
x() -
p1(0));
141 double k1 = 1.0/(p1vx*p1vx + p1vy*p1vy);
144 double p2vx =
p2(3) - a_2*(point.
y() -
p2(1));
145 double p2vy =
p2(4) + a_2*(point.
x() -
p2(0));
146 double k2 = 1.0/(p2vx*p2vx + p2vy*p2vy);
152 res(1,1) = k1*a_1*p1vx - k2*a_2*p2vx;
155 res(1,2) = k1*a_1*p1vy - k2*a_2*p2vy;
ROOT::Math::SVector< double, 7 > AlgebraicVector7
CLHEP::HepMatrix AlgebraicMatrix
AlgebraicMatrix positionDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
AlgebraicVector value(const std::vector< KinematicState > &states, const GlobalPoint &point) const override
CLHEP::HepVector AlgebraicVector
AlgebraicMatrix parametersDerivative(const std::vector< KinematicState > &states, const GlobalPoint &point) 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
ColinearityKinematicConstraint(ConstraintDim dim=Phi)