4 #include <vdt/vdtMath.h>
7 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 theSinTheta = pt2*ptI*pI;
45 if ( s!=theCachedS ) {
47 theCachedDPhi = theCachedS*theRho*theSinTheta;
48 vdt::fast_sincos(theCachedDPhi,theCachedSDPhi,theCachedCDPhi);
57 return PositionTypeDouble(theX0+(-theSinPhi0*(1.-theCachedCDPhi)+theCosPhi0*theCachedSDPhi)*o,
58 theY0+( theCosPhi0*(1.-theCachedCDPhi)+theSinPhi0*theCachedSDPhi)*o,
59 theZ0+theCachedS*theCosTheta);
63 double st = theCachedS*theSinTheta;
64 return PositionType(theX0+(theCosPhi0-st*0.5*theRho*theSinPhi0)*st,
65 theY0+(theSinPhi0+st*0.5*theRho*theCosPhi0)*st,
66 theZ0+st*theCosTheta/theSinTheta);
73 HelixForwardPlaneCrossing::direction (
double s)
const {
77 if ( s!=theCachedS ) {
79 theCachedDPhi = theCachedS*theRho*theSinTheta;
80 vdt::fast_sincos(theCachedDPhi,theCachedSDPhi,theCachedCDPhi);
83 if ( fabs(theCachedDPhi)>1.
e-4 ) {
85 return DirectionType(theCosPhi0*theCachedCDPhi-theSinPhi0*theCachedSDPhi,
86 theSinPhi0*theCachedCDPhi+theCosPhi0*theCachedSDPhi,
87 theCosTheta/theSinTheta);
91 double dph = theCachedS*theRho*theSinTheta;
92 return DirectionType(theCosPhi0-(theSinPhi0+0.5*theCosPhi0*dph)*dph,
93 theSinPhi0+(theCosPhi0-0.5*theSinPhi0*dph)*dph,
94 theCosTheta/theSinTheta);
98 const float HelixForwardPlaneCrossing::theNumericalPrecision = 5.e-7;
static int position[TOTALCHAMBERS][3]
Point3DBase< Scalar, GlobalTag > PositionType
T curvature(T InversePt, const edm::EventSetup &iSetup)
Abs< T >::type abs(const T &t)
*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