53 double cal_th (
double theta,
double z)
66 const double R_CC = 91.6;
67 const double Z_EC = 178.9;
68 const double BIGG = 1e8;
71 if (fabs (
cos (theta)) < 1/BIGG)
72 tanth = BIGG *
sin (theta);
76 double z_cc = R_CC / tanth +
z;
78 if (fabs (z_cc) < Z_EC)
79 theta = atan2 (R_CC, z_cc);
83 if (tanth < 0) zz = - zz;
84 double r_ec = (zz-
z) * tanth;
85 theta = atan2 (r_ec, zz);
88 if (theta < 0) theta += 2 *
M_PI;
112 CLHEP::Hep3Vector vect = v.vect();
113 double old_p2 = vect.mag2();
116 double new_p2 = v.e()*v.e() - mass*mass;
119 vect *=
sqrt (new_p2 / old_p2);
137 v.setE (
sqrt (v.vect().mag2() + mass*mass));
153 double s =
sin (theta),
c =
cos (theta);
154 double old_pt = v.perp();
155 double new_pt = old_pt*
c - v.z()*
s;
156 v.setZ (old_pt*s + v.z()*
c);
158 v.setX (v.x() * new_pt / old_pt);
159 v.setY (v.y() * new_pt / old_pt);
176 double theta1 = v.theta ();
178 double eta2 = eta1 +
eta;
196 return 2 * atan (
exp (-eta));
211 return -
log (
tan (theta / 2));
262 double deta = a.pseudoRapidity() - b.pseudoRapidity();
263 double dphi =
phidiff (a.phi() - b.phi());
264 return sqrt (deta*deta + dphi*dphi);
Define three-vector and four-vector classes for the HitFit package, and supply a few additional opera...
void adjust_e_for_mass(Fourvec &v, double mass)
Adjust the energy component of four-vector v (leaving the three-vector part unchanged) so that the fo...
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
double phidiff(double phi)
Normalized difference in azimuthal angles to a range between .
double theta_to_eta(double theta)
Convert polar angle to pseudorapidity.
void roteta(Fourvec &v, double eta)
Rotate four-vector v through a polar angle such that the four-vector pseudorapidity changes by a desi...
double eta_to_theta(double eta)
Convert pseudorapidity to polar angle.
Cos< T >::type cos(const T &t)
double delta_r(const Fourvec &a, const Fourvec &b)
Find the distance between two four-vectors in the two-dimensional space .
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Tan< T >::type tan(const T &t)
double deteta(const Fourvec &v, double zvert)
NOT USED ANYMORE: Get the detector (D0-specific), requires z-vertex.
void adjust_p_for_mass(Fourvec &v, double mass)
Adjust the three-vector part of v, leaving the energy unchanged,.
void rottheta(Fourvec &v, double theta)
Rotate four-vector v through a polar angle.