CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PtEtaPhiMass.h
Go to the documentation of this file.
1 #ifndef DataFormats_Math_PtEtaPhiMass_h
2 #define DataFormats_Math_PtEtaPhiMass_h
3 
4 #include<cmath>
5 inline float __attribute__((always_inline)) __attribute__ ((pure))
6 etaFromXYZ(float x, float y, float z) { float t(z/std::sqrt(x*x+y*y)); return ::asinhf(t);}
7 inline float __attribute__((always_inline)) __attribute__ ((pure))
8 etaFromRZ(float r, float z) { float t(z/r); return ::asinhf(t);}
9 
10 
11 
14 class PtEtaPhiMass {
15 private:
16  float pt_, eta_, phi_, mass_;
17 public:
18  // default constructor (unitialized)
20 
21  //positional constructor (still compatible with Root, c++03)
22  PtEtaPhiMass(float ipt, float ieta, float iphi, float imass):
23  pt_(ipt), eta_(ieta), phi_(iphi), mass_(imass){}
24 
26  float pt() const { return pt_;}
28  float eta() const { return eta_; }
30  float phi() const { return phi_; }
32  float mass() const { return mass_; }
33 
34 };
35 
36 
37 
38 #endif
float phi() const
momentum azimuthal angle
Definition: PtEtaPhiMass.h:30
float eta() const
momentum pseudorapidity
Definition: PtEtaPhiMass.h:28
float pt() const
transverse momentum
Definition: PtEtaPhiMass.h:26
float float float z
T x() const
Cartesian x coordinate.
T sqrt(T t)
Definition: SSEVec.h:48
float __attribute__((vector_size(8))) float32x2_t
Definition: ExtVec.h:12
float mass() const
mass
Definition: PtEtaPhiMass.h:32
PtEtaPhiMass(float ipt, float ieta, float iphi, float imass)
Definition: PtEtaPhiMass.h:22