28 const HepGeom::Point3D<double> &PositionCm,
31 double CotTheta = 0.0;
37 if (BFieldTesla != 0.0 && q != 0.0) {
38 double CurvatureConstant = 0.0029979;
39 double Helicity = -1.0 * fabs(BFieldTesla) * fabs(q) / (BFieldTesla *
q);
40 double Radius = fabs(MomentumGev.perp() / (CurvatureConstant * BFieldTesla *
q));
45 W = Helicity / Radius;
46 double phi1 = MomentumGev.phi();
47 double x = PositionCm.x(),
y = PositionCm.y(),
z = PositionCm.z();
48 double sinPhi1 =
sin(phi1), cosPhi1 =
cos(phi1);
49 double gamma = atan((x * cosPhi1 +
y * sinPhi1) / (x * sinPhi1 -
y * cosPhi1 - 1 / W));
52 Phi0 = Phi0 - 2.0 *
M_PI;
54 Phi0 = Phi0 + 2.0 *
M_PI;
55 D0 = ((1 / W +
y * cosPhi1 - x * sinPhi1) /
cos(gamma) - 1 / W);
56 CotTheta = MomentumGev.z() / MomentumGev.perp();
57 Z0 =
z + gamma * CotTheta / W;
59 CLHEP::Hep3Vector direction = MomentumGev.unit();
60 CLHEP::Hep3Vector projectedDirection = CLHEP::Hep3Vector(direction.x(), direction.y(), 0.0).unit();
61 double s = projectedDirection.dot(PositionCm);
62 double sprime = s /
sin(direction.theta());
63 Z0 = (PositionCm - sprime * direction).
z();
64 Phi0 = MomentumGev.phi();
65 CotTheta = MomentumGev.z() / MomentumGev.perp();
67 D0 = (PositionCm.y() *
cos(Phi0) - PositionCm.x() *
sin(Phi0));
134 return HepGeom::Point3D<double>(
137 return HepGeom::Point3D<double>(
152 return HepGeom::Vector3D<double>(xtan, ytan, ztan);
192 double rad = (rho * rho - d *
d) / (1.0 + 2.0 * c * d);
199 if (c * rprime > 1.0 || c * rprime < -1.0) {
200 L2D = c * rprime > 0. ?
M_PI / c : -
M_PI /
c;
202 L2D = asin(c * rprime) /
c;
204 double rad = rho * rho - d *
d;
double getL2DAtR(double r) const
const edm::EventSetup & c
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
T curvature(T InversePt, const MagneticField &field)
void setPhi0(double phi0)
HepGeom::Point3D< double > getPosition(double s=0.0) const
double getCotTheta() const
Cos< T >::type cos(const T &t)
double getSinTheta() const
double getCosTheta() const
void getGflashTrajectoryPoint(GflashTrajectoryPoint &point, double s) const
static constexpr float d0
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)