7 _cotTheta(0.0),_curvature(0.0),_z0(0.0),_d0(0.0),_phi0(0.0),
9 _sinPhi0(2),_cosPhi0(2),_sinTheta(2),_cosTheta(2),
19 double q,
double BFieldTesla)
21 double CotTheta = 0.0 ;
27 if (BFieldTesla != 0.0 && q != 0.0) {
28 double CurvatureConstant=0.0029979;
29 double Helicity = -1.0 * fabs(BFieldTesla) * fabs(q) / (BFieldTesla*
q);
30 double Radius = fabs(MomentumGev.perp()/(CurvatureConstant*BFieldTesla*
q));
32 if(Radius==0.0) W = HUGE_VAL;
else W = Helicity/Radius;
33 double phi1 = MomentumGev.phi();
34 double x = PositionCm.x(),
y = PositionCm.y(),
z = PositionCm.z();
35 double sinPhi1 =
sin(phi1), cosPhi1 =
cos(phi1);
36 double gamma = atan((x*cosPhi1 +
y*sinPhi1)/(x*sinPhi1-
y*cosPhi1 -1/W));
38 if(Phi0 >
M_PI) Phi0 = Phi0 - 2.0*
M_PI;
39 if(Phi0 < -
M_PI) Phi0 = Phi0 + 2.0*
M_PI;
40 D0 = ((1/W +
y*cosPhi1 - x*sinPhi1) /
cos(gamma) - 1/W);
41 CotTheta = MomentumGev.z()/MomentumGev.perp();
42 Z0 =
z + gamma*CotTheta/W;
45 CLHEP::Hep3Vector direction = MomentumGev.unit();
46 CLHEP::Hep3Vector projectedDirection = CLHEP::Hep3Vector(direction.x(),direction.y(),0.0).unit();
47 double s = projectedDirection.dot(PositionCm);
48 double sprime = s/
sin(direction.theta());
49 Z0 = (PositionCm - sprime*direction).
z();
50 Phi0 = MomentumGev.phi();
51 CotTheta = MomentumGev.z()/MomentumGev.perp();
53 D0 = (PositionCm.y()*
cos(Phi0) - PositionCm.x()*
sin(Phi0));
144 return HepGeom::Vector3D<double> (xtan,ytan,ztan);
200 double rad = (rho*rho-d*d)/(1.0+2.0*c*d);
206 rprime =
sqrt( rad );
208 if (c*rprime > 1.0 || c*rprime < -1.0) {
212 L2D = asin(c*rprime)/
c;
214 double rad = rho*rho-d*d;
216 if (rad<0.0) rprime = 0.0;
217 else rprime =
sqrt( rad );
234 if (theta<0.0) theta+=
M_PI;
double getL2DAtR(double r) const
double getPathLengthAtZ(double z) const
void _refreshCache() const
double getCosPhi0() const
void setPathLength(double pathLength)
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
void setCurvature(double curvature)
double getSinPhi0() const
void setPhi0(double phi0)
HepGeom::Point3D< double > getPosition(double s=0.0) const
double getCotTheta() const
T curvature(T InversePt, const edm::EventSetup &iSetup)
Cos< T >::type cos(const T &t)
double getSinTheta() const
double getCosTheta() const
void getGflashTrajectoryPoint(GflashTrajectoryPoint &point, double s) const
double getZAtR(double r) const
void _cacheSinesAndCosines(double s) const
HepGeom::Vector3D< double > getDirection(double s=0.0) const
Gflash3Vector & getPosition()
double getCurvature() const
Gflash3Vector & getMomentum()
*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
void setCotTheta(double cotTheta)
double getPathLengthAtRhoEquals(double rho) const
void initializeTrajectory(const HepGeom::Vector3D< double > &, const HepGeom::Point3D< double > &, double q, double Field)