ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/LJMet/MultivariateAnalysis/src/TMBLorentzVector.cc
Revision: 1.1
Committed: Tue Nov 11 23:01:22 2008 UTC (16 years, 5 months ago) by kukartse
Content type: text/plain
Branch: MAIN
CVS Tags: V00-03-01, ZMorph_BASE_20100408, gak040610_morphing, V00-02-02, gak011410, gak010310, ejterm2010_25nov2009, V00-02-01, V00-02-00, gak112409, CMSSW_22X_branch_base, segala101609, V00-01-15, V00-01-14, V00-01-13, V00-01-12, V00-01-11, V00-01-10, gak031009, gak030509, gak022309, gak021209, gak040209, gak012809, V00-01-09, V00-01-08, V00-01-07, V00-01-06, V00-01-05, V00-01-04, V00-00-07, V00-00-06, V00-00-05, V00-00-04, V00-01-03, V00-00-02, V00-00-01, HEAD
Branch point for: ZMorph-V00-03-01, CMSSW_22X_branch
Log Message:
initial creation of a package for LJMET multivariate analysis

File Contents

# User Rev Content
1 kukartse 1.1 #include "LJMet/MultivariateAnalysis/interface/TMBLorentzVector.h"
2     #include "TLorentzRotation.h"
3    
4     Double_t TMBLorentzVector::operator () (int i) const {
5     // return i'th component of 4 vector
6     switch (i)
7     {
8     case kX:
9     case kY:
10     case kZ:
11     return Vect ()(i);
12     case kE:return E ();
13     default:Error ("operator()()", "bad index (%d) returning 0", i);
14     }
15     return 0.;
16     }
17    
18     void TMBLorentzVector::Boost(const TVector3 & b) {
19     // apply Lorentz boost by vector b
20     Double_t b2 = b.Mag2 ();
21     Double_t gamma = 1.0 / TMath::Sqrt (1.0 - b2);
22     Double_t bp = b.Dot (Vect ());
23     Double_t gamma2 = b2 > 0 ? (gamma - 1.0) / b2 : 0.0;
24     Vect () += (gamma2 * bp + gamma * E ()) * b;
25     // SetE (gamma * (E () + bp));
26     }
27    
28     TMBLorentzVector & TMBLorentzVector::operator *= (const TLorentzRotation & m) {
29     // apply lorentz rotation, see TLorentzRotation::VectorMultiplication()
30     return *this = m.VectorMultiplication((TLorentzVector)*this);
31     }
32    
33     TMBLorentzVector & TMBLorentzVector::Transform (const TLorentzRotation & m){
34     // apply lorentz transformation, see TLorentzRotation::VectorMultiplication()
35     return *this = m.VectorMultiplication((TLorentzVector)*this);
36     }
37    
38     /// Equivalence operator. True if all components are
39     /// equivalent within machine precision.
40     Bool_t TMBLorentzVector::is_equal (const TMBLorentzVector &lv) const
41     {
42     return TMBVector3::is_equal (lv.E(), E()) && Vect().is_equal (lv.Vect());
43     }
44    
45     //ClassImp(TMBLorentzVector)