00001 // 00002 // $Id: fourvec.h,v 1.1 2011/05/26 09:46:53 mseidel Exp $ 00003 // 00004 // File: hitfit/fourvec.h 00005 // Purpose: Define 3- and 4-vector types for the hitfit package, and 00006 // supply a few additional operations. 00007 // Created: Jul, 2000, sss, based on run 1 mass analysis code. 00008 // 00009 // This file defines the types `Threevec' and `Fourvec' to be used 00010 // in hitfit code. These are based on the corresponding CLHEP classes. 00011 // We also provide a handful of operations in addition to those that 00012 // CLHEP has. 00013 // 00014 // CMSSW File : interface/fourvec.h 00015 // Original Author : Scott Stuart Snyder <snyder@bnl.gov> for D0 00016 // Imported to CMSSW by Haryo Sumowidagdo <Suharyo.Sumowidagdo@cern.ch> 00017 // 00018 00045 #ifndef HITFIT_FOURVEC_H 00046 #define HITFIT_FOURVEC_H 00047 00048 #include "CLHEP/Vector/LorentzVector.h" 00049 00050 00051 namespace hitfit { 00052 00053 00054 // Define the types that we want to use. 00058 typedef CLHEP::HepLorentzVector Fourvec; 00059 00063 typedef CLHEP::Hep3Vector Threevec; 00064 00065 // Adjust the 3-vector part of V (leaving the energy unchanged) so that 00066 // it has mass MASS. 00079 void adjust_p_for_mass (Fourvec& v, double mass); 00080 00081 // Adjust the energy component of V (leaving the 3-vector part unchanged) 00082 // so that it has mass MASS. 00095 void adjust_e_for_mass (Fourvec& v, double mass); 00096 00097 // Rotate V through polar angle THETA. 00108 void rottheta (Fourvec& v, double theta); 00109 00110 // Rotate V through a polar angle such that its pseudorapidity changes by ETA. 00122 void roteta (Fourvec& v, double eta); 00123 00124 // Conversions between pseudorapidity and polar angle. 00130 double eta_to_theta (double eta); 00136 double theta_to_eta (double theta); 00137 00138 // Get the detector eta (D0-specific). Needs a Z-vertex. 00147 double deteta (const Fourvec& v, double zvert); // XXX 00148 00149 // Handle wraparound for a difference in azimuthal angles. 00156 double phidiff (double phi); 00157 00158 // Find the distance in R between two four-vectors. 00163 double delta_r (const Fourvec& a, const Fourvec& b); 00164 00165 00166 } // namespace hitfit 00167 00168 00169 #endif // not HITFIT_FOURVEC_H 00170