CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
fourvec.h
Go to the documentation of this file.
1 //
2 //
3 // File: hitfit/fourvec.h
4 // Purpose: Define 3- and 4-vector types for the hitfit package, and
5 // supply a few additional operations.
6 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
7 //
8 // This file defines the types `Threevec' and `Fourvec' to be used
9 // in hitfit code. These are based on the corresponding CLHEP classes.
10 // We also provide a handful of operations in addition to those that
11 // CLHEP has.
12 //
13 // CMSSW File : interface/fourvec.h
14 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
15 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
16 //
17 
44 #ifndef HITFIT_FOURVEC_H
45 #define HITFIT_FOURVEC_H
46 
47 #include "CLHEP/Vector/LorentzVector.h"
48 
49 
50 namespace hitfit {
51 
52 
53 // Define the types that we want to use.
57 typedef CLHEP::HepLorentzVector Fourvec;
58 
62 typedef CLHEP::Hep3Vector Threevec;
63 
64 // Adjust the 3-vector part of V (leaving the energy unchanged) so that
65 // it has mass MASS.
78 void adjust_p_for_mass (Fourvec& v, double mass);
79 
80 // Adjust the energy component of V (leaving the 3-vector part unchanged)
81 // so that it has mass MASS.
94 void adjust_e_for_mass (Fourvec& v, double mass);
95 
96 // Rotate V through polar angle THETA.
107 void rottheta (Fourvec& v, double theta);
108 
109 // Rotate V through a polar angle such that its pseudorapidity changes by ETA.
121 void roteta (Fourvec& v, double eta);
122 
123 // Conversions between pseudorapidity and polar angle.
129 double eta_to_theta (double eta);
135 double theta_to_eta (double theta);
136 
137 // Get the detector eta (D0-specific). Needs a Z-vertex.
146 double deteta (const Fourvec& v, double zvert); // XXX
147 
148 // Handle wraparound for a difference in azimuthal angles.
155 double phidiff (double phi);
156 
157 // Find the distance in R between two four-vectors.
162 double delta_r (const Fourvec& a, const Fourvec& b);
163 
164 
165 } // namespace hitfit
166 
167 
168 #endif // not HITFIT_FOURVEC_H
169 
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...
Definition: fourvec.cc:123
Geom::Theta< T > theta() const
double phidiff(double phi)
Normalized difference in azimuthal angles to a range between .
Definition: fourvec.cc:230
double theta_to_eta(double theta)
Convert polar angle to pseudorapidity.
Definition: fourvec.cc:199
void roteta(Fourvec &v, double eta)
Rotate four-vector v through a polar angle such that the four-vector pseudorapidity changes by a desi...
Definition: fourvec.cc:162
T eta() const
double eta_to_theta(double eta)
Convert pseudorapidity to polar angle.
Definition: fourvec.cc:184
double delta_r(const Fourvec &a, const Fourvec &b)
Find the distance between two four-vectors in the two-dimensional space .
Definition: fourvec.cc:249
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:57
double deteta(const Fourvec &v, double zvert)
NOT USED ANYMORE: Get the detector (D0-specific), requires z-vertex.
Definition: fourvec.cc:214
void adjust_p_for_mass(Fourvec &v, double mass)
Adjust the three-vector part of v, leaving the energy unchanged,.
Definition: fourvec.cc:98
CLHEP::Hep3Vector Threevec
Typedef for a Hep3Vector.
Definition: fourvec.h:62
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void rottheta(Fourvec &v, double theta)
Rotate four-vector v through a polar angle.
Definition: fourvec.cc:140
Definition: DDAxes.h:10