00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifdef GNUPRAGMA
00014 #pragma implementation
00015 #endif
00016
00017 #include "CLHEP/Vector/LorentzVector.h"
00018
00019 namespace CLHEP {
00020
00021
00022
00023
00024
00025
00026
00027 HepLorentzVector rotationXOf
00028 (const HepLorentzVector & vec, double phi){
00029 HepLorentzVector vv (vec);
00030 return vv.rotateX (phi);
00031 }
00032
00033 HepLorentzVector rotationYOf
00034 (const HepLorentzVector & vec, double phi){
00035 HepLorentzVector vv (vec);
00036 return vv.rotateY (phi);
00037 }
00038
00039 HepLorentzVector rotationZOf
00040 (const HepLorentzVector & vec, double phi){
00041 HepLorentzVector vv (vec);
00042 return vv.rotateZ (phi);
00043 }
00044
00045
00046
00047
00048
00049 HepLorentzVector & HepLorentzVector::boost
00050 ( const Hep3Vector & aaxis, double bbeta ) {
00051 if (bbeta==0) {
00052 return *this;
00053 }
00054 double r2 = aaxis.mag2();
00055 if ( r2 == 0 ) {
00056 std::cerr << "HepLorentzVector::boost() - "
00057 << "A zero vector used as axis defining a boost -- no boost done"
00058 << std::endl;
00059 return *this;
00060 }
00061 double b2 = bbeta*bbeta;
00062 if (b2 >= 1) {
00063 std::cerr << "HepLorentzVector::boost() - "
00064 << "LorentzVector boosted with beta >= 1 (speed of light) -- \n"
00065 << "no boost done" << std::endl;
00066 } else {
00067 Hep3Vector u = aaxis.unit();
00068 register double ggamma = std::sqrt(1./(1.-b2));
00069 register double betaDotV = u.dot(pp)*bbeta;
00070 register double tt = ee;
00071
00072 ee = ggamma * (tt + betaDotV);
00073 pp += ( ((ggamma-1)/b2)*betaDotV*bbeta + ggamma*bbeta*tt ) * u;
00074
00075
00076
00077
00078 }
00079 return *this;
00080 }
00081
00082 }