All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SRLorentzVector.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file SRLorentzVector.h
3 // \author Christopher Backhouse - bckhouse@caltech.edu
4 ////////////////////////////////////////////////////////////////////////
5 
6 #ifndef SRLORENTZVECTOR_H
7 #define SRLORENTZVECTOR_H
8 
9 #ifndef __castxml__
10 #include "TLorentzVector.h"
11 #include "TVector3.h"
12 #endif
13 
14 namespace caf
15 {
16  /// 4-vector with more efficient storage than TLorentzVector
18  {
19  public:
21  virtual ~SRLorentzVector();
22 
23 #ifndef __castxml__
24  SRLorentzVector(const TLorentzVector& v);
25 
26  /// Recommend users convert back to TLorentzVector for boosts etc
27  operator TLorentzVector() const;
28 
29  // For access as a position vector. For momentum use the member variables
30  // directly.
31  float T() const {return E;}
32  float X() const {return px;}
33  float Y() const {return py;}
34  float Z() const {return pz;}
35  float Mag() const {return TMath::Sqrt(px*px + py*py + pz*pz);}
36  float Beta() const {return Mag()/E;}
37  float Gamma() const {return 1.0/TMath::Sqrt(1-Beta()*Beta());}
38 
39  TVector3 Vect() const {return TVector3(px, py, pz);}
40  #endif
41 
42  float E;
43  float px;
44  float py;
45  float pz;
46  };
47 
48  } // end namespace
49 
50 #endif // SRLORENTZVECTOR_H
51 //////////////////////////////////////////////////////////////////////////////
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:172
float Beta() const