00001 #include "tmb_tree/TMBLorentzVector.hpp" 00002 #include "TLorentzRotation.h" 00003 00004 Double_t TMBLorentzVector::operator () (int i) const { 00005 // return i'th component of 4 vector 00006 switch (i) 00007 { 00008 case kX: 00009 case kY: 00010 case kZ: 00011 return Vect ()(i); 00012 case kE:return E (); 00013 default:Error ("operator()()", "bad index (%d) returning 0", i); 00014 } 00015 return 0.; 00016 } 00017 00018 void TMBLorentzVector::Boost(const TVector3 & b) { 00019 // apply Lorentz boost by vector b 00020 Double_t b2 = b.Mag2 (); 00021 Double_t gamma = 1.0 / TMath::Sqrt (1.0 - b2); 00022 Double_t bp = b.Dot (Vect ()); 00023 Double_t gamma2 = b2 > 0 ? (gamma - 1.0) / b2 : 0.0; 00024 Vect () += (gamma2 * bp + gamma * E ()) * b; 00025 // SetE (gamma * (E () + bp)); 00026 } 00027 00028 TMBLorentzVector & TMBLorentzVector::operator *= (const TLorentzRotation & m) { 00029 // apply lorentz rotation, see TLorentzRotation::VectorMultiplication() 00030 return *this = m.VectorMultiplication((TLorentzVector)*this); 00031 } 00032 00033 TMBLorentzVector & TMBLorentzVector::Transform (const TLorentzRotation & m){ 00034 // apply lorentz transformation, see TLorentzRotation::VectorMultiplication() 00035 return *this = m.VectorMultiplication((TLorentzVector)*this); 00036 } 00037 00040 Bool_t TMBLorentzVector::is_equal (const TMBLorentzVector &lv) const 00041 { 00042 return TMBVector3::is_equal (lv.E(), E()) && Vect().is_equal (lv.Vect()); 00043 } 00044 00045 ClassImp(TMBLorentzVector)
1.3.4