SRLorentzVector.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file SRLorentzVector.h
3 // \author Christopher Backhouse - bckhouse@caltech.edu
4 // \date $Date: 2012-11-19 17:32:23 $
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef SRLORENTZVECTOR_H
8 #define SRLORENTZVECTOR_H
9 
10 #ifndef __GCCXML__
11 #include "TLorentzVector.h"
12 #include "TVector3.h"
13 #endif
14 
15 namespace caf
16 {
17  /// 4-vector with more efficient storage than TLorentzVector
19  {
20  public:
22  virtual ~SRLorentzVector();
23 
24 #ifndef __GCCXML__
25  SRLorentzVector(const TLorentzVector& v);
26 
27  /// Recommend users convert back to TLorentzVector for boosts etc
28  operator TLorentzVector() const;
29 
30  // For access as a position vector. For momentum use the member variables
31  // directly.
32  float T() const {return E;}
33  float X() const {return px;}
34  float Y() const {return py;}
35  float Z() const {return pz;}
36  float Mag() const {return TMath::Sqrt(px*px + py*py + pz*pz);}
37  float Beta() const {return Mag()/E;}
38  float Gamma() const {return 1.0/TMath::Sqrt(1-Beta()*Beta());}
39 
40  TVector3 Vect() const {return TVector3(px, py, pz);}
41 #endif
42 
43  float E;
44  float px;
45  float py;
46  float pz;
47  };
48 
49 } // end namespace
50 
51 #endif // SRLORENTZVECTOR_H
52 //////////////////////////////////////////////////////////////////////////////
TVector3 Vect() const
float Gamma() const
float Mag() const
4-vector with more efficient storage than TLorentzVector
Var Sqrt(const Var &v)
Use to take sqrt of a var.
Definition: Var.cxx:326
This module creates Common Analysis Files.
Definition: FileReducer.h:10
float Beta() const