10 HelixArbitraryPlaneCrossing2Order::HelixArbitraryPlaneCrossing2Order(
const PositionType&
point,
11 const DirectionType& direction,
23 double px = direction.x();
24 double py = direction.y();
25 double pz = direction.z();
26 double pt2 = px*px+py*py;
27 double p2 = pt2+pz*pz;
28 double pI = 1./
sqrt(p2);
29 double ptI = 1./
sqrt(pt2);
33 theSinThetaI = p2*pI*ptI;
39 std::pair<bool,double>
40 HelixArbitraryPlaneCrossing2Order::pathLength(
const Plane& plane) {
46 double nPx = normalToPlane.
x();
47 double nPy = normalToPlane.
y();
48 double nPz = normalToPlane.
z();
54 double ceq1 = theRho*(nPx*theSinPhi0-nPy*theCosPhi0);
55 double ceq2 = nPx*theCosPhi0 + nPy*theSinPhi0 + nPz*theCosTheta*theSinThetaI;
62 if likely( fabs(ceq1)>FLT_MIN ) {
63 double deq1 = ceq2*ceq2;
64 double deq2 = ceq1*ceq3;
65 if ( fabs(deq1)<FLT_MIN || fabs(deq2/deq1)>1.
e-6 ) {
69 double deq = deq1+2*deq2;
71 double ceq = -0.5*(ceq2+(ceq2>0?1:-1)*
sqrt(deq));
72 dS1 = -2*(ceq/ceq1)*theSinThetaI;
73 dS2 = (ceq3/ceq)*theSinThetaI;
79 double ceq = (ceq2/ceq1)*theSinThetaI;
80 double deq = deq2/deq1;
90 dS1 = dS2 = -(ceq3/ceq2)*theSinThetaI;
95 return solutionByDirection(dS1,dS2);
104 PositionTypeDouble pos = positionInDouble(s);
110 HelixArbitraryPlaneCrossing2Order::PositionTypeDouble
111 HelixArbitraryPlaneCrossing2Order::positionInDouble (
double s)
const {
113 double st = s/theSinThetaI;
114 return PositionTypeDouble(theX0+(theCosPhi0-(st*0.5*theRho)*theSinPhi0)*st,
115 theY0+(theSinPhi0+(st*0.5*theRho)*theCosPhi0)*st,
116 theZ0+st*theCosTheta*theSinThetaI);
122 HelixArbitraryPlaneCrossing2Order::direction (
double s)
const {
124 DirectionTypeDouble
dir = directionInDouble(s);
125 return DirectionType(dir.x(),dir.y(),dir.z());
130 HelixArbitraryPlaneCrossing2Order::DirectionTypeDouble
131 HelixArbitraryPlaneCrossing2Order::directionInDouble (
double s)
const {
133 double dph = s*theRho/theSinThetaI;
134 return DirectionTypeDouble(theCosPhi0-(theSinPhi0+0.5*dph*theCosPhi0)*dph,
135 theSinPhi0+(theCosPhi0-0.5*dph*theSinPhi0)*dph,
136 theCosTheta*theSinThetaI);
141 std::pair<bool,double>
142 HelixArbitraryPlaneCrossing2Order::solutionByDirection(
const double dS1,
143 const double dS2)
const {
148 path = smallestPathLength(dS1,dS2);
153 double s1(propSign*dS1);
154 double s2(propSign*dS2);
162 if ( s1<0 && s2>=0 ) {
173 return std::pair<bool,double>(
valid,
path);
GlobalVector normalVector() const
Global3DPoint GlobalPoint
float localZ(const GlobalPoint &gp) const
static int position[TOTALCHAMBERS][3]
Point3DBase< Scalar, GlobalTag > PositionType
T curvature(T InversePt, const edm::EventSetup &iSetup)
return(e1-e2)*(e1-e2)+dp *dp
volatile std::atomic< bool > shutdown_flag false
*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