52 double cal_th (
double theta,
double z)
65 const double R_CC = 91.6;
66 const double Z_EC = 178.9;
67 const double BIGG = 1e8;
70 if (fabs (
cos (theta)) < 1/BIGG)
71 tanth = BIGG *
sin (theta);
75 double z_cc = R_CC / tanth +
z;
77 if (fabs (z_cc) < Z_EC)
78 theta = atan2 (R_CC, z_cc);
82 if (tanth < 0) zz = - zz;
83 double r_ec = (zz-
z) * tanth;
84 theta = atan2 (r_ec, zz);
87 if (theta < 0) theta += 2 *
M_PI;
111 CLHEP::Hep3Vector vect = v.vect();
112 double old_p2 = vect.mag2();
115 double new_p2 = v.e()*v.e() - mass*
mass;
118 vect *=
sqrt (new_p2 / old_p2);
136 v.setE (
sqrt (v.vect().mag2() + mass*
mass));
152 double s =
sin (theta),
c =
cos (theta);
153 double old_pt = v.perp();
154 double new_pt = old_pt*
c - v.z()*
s;
155 v.setZ (old_pt*s + v.z()*
c);
157 v.setX (v.x() * new_pt / old_pt);
158 v.setY (v.y() * new_pt / old_pt);
175 double theta1 = v.theta ();
177 double eta2 = eta1 +
eta;
195 return 2 * atan (
exp (-eta));
210 return -
log (
tan (theta / 2));
261 double deta = a.pseudoRapidity() - b.pseudoRapidity();
262 double dphi =
phidiff (a.phi() - b.phi());
263 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.