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 // $Id: fourvec.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $
3 //
4 // File: hitfit/fourvec.h
5 // Purpose: Define 3- and 4-vector types for the hitfit package, and
6 // supply a few additional operations.
7 // Created: Jul, 2000, sss, based on run 1 mass analysis code.
8 //
9 // This file defines the types `Threevec' and `Fourvec' to be used
10 // in hitfit code. These are based on the corresponding CLHEP classes.
11 // We also provide a handful of operations in addition to those that
12 // CLHEP has.
13 //
14 // CMSSW File : interface/fourvec.h
15 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0
16 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch>
17 //
18 
45 #ifndef HITFIT_FOURVEC_H
46 #define HITFIT_FOURVEC_H
47 
48 #include "CLHEP/Vector/LorentzVector.h"
49 
50 
51 namespace hitfit {
52 
53 
54 // Define the types that we want to use.
58 typedef CLHEP::HepLorentzVector Fourvec;
59 
63 typedef CLHEP::Hep3Vector Threevec;
64 
65 // Adjust the 3-vector part of V (leaving the energy unchanged) so that
66 // it has mass MASS.
79 void adjust_p_for_mass (Fourvec& v, double mass);
80 
81 // Adjust the energy component of V (leaving the 3-vector part unchanged)
82 // so that it has mass MASS.
95 void adjust_e_for_mass (Fourvec& v, double mass);
96 
97 // Rotate V through polar angle THETA.
108 void rottheta (Fourvec& v, double theta);
109 
110 // Rotate V through a polar angle such that its pseudorapidity changes by ETA.
122 void roteta (Fourvec& v, double eta);
123 
124 // Conversions between pseudorapidity and polar angle.
130 double eta_to_theta (double eta);
136 double theta_to_eta (double theta);
137 
138 // Get the detector eta (D0-specific). Needs a Z-vertex.
147 double deteta (const Fourvec& v, double zvert); // XXX
148 
149 // Handle wraparound for a difference in azimuthal angles.
156 double phidiff (double phi);
157 
158 // Find the distance in R between two four-vectors.
163 double delta_r (const Fourvec& a, const Fourvec& b);
164 
165 
166 } // namespace hitfit
167 
168 
169 #endif // not HITFIT_FOURVEC_H
170 
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:124
Geom::Theta< T > theta() const
double phidiff(double phi)
Normalized difference in azimuthal angles to a range between .
Definition: fourvec.cc:231
double theta_to_eta(double theta)
Convert polar angle to pseudorapidity.
Definition: fourvec.cc:200
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:163
T eta() const
double eta_to_theta(double eta)
Convert pseudorapidity to polar angle.
Definition: fourvec.cc:185
double delta_r(const Fourvec &a, const Fourvec &b)
Find the distance between two four-vectors in the two-dimensional space .
Definition: fourvec.cc:250
CLHEP::HepLorentzVector Fourvec
Typedef for a HepLorentzVector.
Definition: fourvec.h:58
double deteta(const Fourvec &v, double zvert)
NOT USED ANYMORE: Get the detector (D0-specific), requires z-vertex.
Definition: fourvec.cc:215
void adjust_p_for_mass(Fourvec &v, double mass)
Adjust the three-vector part of v, leaving the energy unchanged,.
Definition: fourvec.cc:99
CLHEP::Hep3Vector Threevec
Typedef for a Hep3Vector.
Definition: fourvec.h:63
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:141
Definition: DDAxes.h:10