ATLAS Offline Software
P4PtEtaPhiM.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef FOURMOM_P4PTETAPHIM_H
6 #define FOURMOM_P4PTETAPHIM_H
7 
9 //#include "SealBase/DebugAids.h"
10 #include <cmath>
11 
12 // CLHEP includes
13 #include "CLHEP/Units/SystemOfUnits.h"
14 
24 class P4PtEtaPhiM : public virtual P4PtEtaPhiMBase
25 {
26  public:
27 
29  P4PtEtaPhiM(const double pt, const double eta, const double phi, const double m)
30  : m_pt(pt), m_eta(eta), m_phi(phi), m_m(m) {};
31 
33  P4PtEtaPhiM();
34 
36  P4PtEtaPhiM(const CLHEP::HepLorentzVector & theHlv);
37 
39  P4PtEtaPhiM(const I4Momentum & theI4M );
40 
42  P4PtEtaPhiM(const I4Momentum * const pI4M );
43 
44 
46  virtual double pt() const;
48  virtual double eta() const;
50  virtual double phi() const;
52  virtual double m() const;
53 
55  virtual void setPt (double thePt);
57  virtual void setEta (double theEta);
59  virtual void setPhi (double thePhi);
61  virtual void setM (double theM);
62 
64  virtual void set4Mom (const I4Momentum & theI4Mom );
66  virtual void set4Mom (const I4Momentum * const theI4Mom );
68  virtual void set4Mom (const CLHEP::HepLorentzVector & theHlv );
69 
70  virtual const I4MomentumError* errors() const;
71 
72  protected:
73 
74 
75 
76  double m_pt;
77  double m_eta;
78  double m_phi;
79  double m_m;
80 
81 };
82 
84  P4PtEtaPhiMBase( ),
85  m_pt ( 0.*CLHEP::GeV ),
86  m_eta ( 0. ),
87  m_phi ( 0. ),
88  m_m ( 0.*CLHEP::GeV )
89 {}
90 
91 inline P4PtEtaPhiM::P4PtEtaPhiM(const CLHEP::HepLorentzVector & theHlv)
92 {
93  this->set4Mom(theHlv);
94 }
95 
96 inline P4PtEtaPhiM::P4PtEtaPhiM(const I4Momentum & theI4Mom )
97 {this->set4Mom(theI4Mom); }
98 
99 inline P4PtEtaPhiM::P4PtEtaPhiM(const I4Momentum * const theI4Mom )
100 {this->set4Mom(*theI4Mom); }
101 
102 
103 inline double P4PtEtaPhiM::pt() const
104 { return m_pt;}
105 
106 inline double P4PtEtaPhiM::eta() const
107 { return m_eta;}
108 
109 inline double P4PtEtaPhiM::phi() const
110 { return m_phi;}
111 
112 inline double P4PtEtaPhiM::m() const
113 { return m_m;}
114 
115 inline void P4PtEtaPhiM::setPt(double thePt)
116 { m_pt = thePt;}
117 
118 inline void P4PtEtaPhiM::setEta(double theEta)
119 { m_eta = theEta;}
120 
121 inline void P4PtEtaPhiM::setPhi(double thePhi)
122 { m_phi = thePhi;}
123 
124 inline void P4PtEtaPhiM::setM(double theM)
125 { m_m = theM;}
126 
127 inline void P4PtEtaPhiM::set4Mom(const I4Momentum & theI4Mom )
128 {
129  m_pt=theI4Mom.pt();
130  m_eta=theI4Mom.eta();
131  m_phi=theI4Mom.phi();
132  m_m=theI4Mom.m();
133 }
134 
135 inline void P4PtEtaPhiM::set4Mom(const I4Momentum * const theI4Mom )
136 {
137  this->set4Mom(*theI4Mom);
138 }
139 
140 inline void P4PtEtaPhiM::set4Mom(const CLHEP::HepLorentzVector & theHlv)
141 {
142  m_pt=theHlv.perp();
143  m_eta=theHlv.eta();
144  //FIXME protect against negative energy
145  //assert(m_e >= 0,"P4PtEtaPhiM::set4Mom cannot have negative energy");
146  //assert(m_e >= 0);
147  // FIXME of the FIXME in fact it is not necessary to prtoect against negative energy
148  // and besides Seal assert does not work
149  // ASSERT( m_e >= 0 );
150  m_phi=theHlv.phi();
151  m_m=theHlv.m();
152 
153 
154 }
155 
156 
157 #endif
I4Momentum
Definition: I4Momentum.h:31
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
P4PtEtaPhiMBase.h
P4PtEtaPhiM::m_eta
double m_eta
Definition: P4PtEtaPhiM.h:77
P4PtEtaPhiM::setM
virtual void setM(double theM)
set mass data member
Definition: P4PtEtaPhiM.h:124
I4Momentum::pt
virtual double pt() const =0
transverse momentum
P4PtEtaPhiM::m_m
double m_m
Definition: P4PtEtaPhiM.h:79
P4PtEtaPhiM::m_phi
double m_phi
Definition: P4PtEtaPhiM.h:78
P4PtEtaPhiM::phi
virtual double phi() const
get phi data member
Definition: P4PtEtaPhiM.h:109
P4PtEtaPhiM::setPt
virtual void setPt(double thePt)
set pt data member
Definition: P4PtEtaPhiM.h:115
P4PtEtaPhiM::setPhi
virtual void setPhi(double thePhi)
set phi data member
Definition: P4PtEtaPhiM.h:121
P4PtEtaPhiM::set4Mom
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
Definition: P4PtEtaPhiM.h:127
I4MomentumError
Definition: I4MomentumError.h:28
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
I4Momentum::eta
virtual double eta() const =0
pseudo rapidity
P4PtEtaPhiM::errors
virtual const I4MomentumError * errors() const
Access to errors, if available; returns 0 if no errors.
Definition: P4PtEtaPhiM.cxx:7
P4PtEtaPhiM::m
virtual double m() const
get mass data member
Definition: P4PtEtaPhiM.h:112
P4PtEtaPhiM::setEta
virtual void setEta(double theEta)
set eta data member
Definition: P4PtEtaPhiM.h:118
P4PtEtaPhiM::pt
virtual double pt() const
get pt data member
Definition: P4PtEtaPhiM.h:103
I4Momentum::phi
virtual double phi() const =0
phi in [-pi,pi[
P4PtEtaPhiMBase
Definition: P4PtEtaPhiMBase.h:26
P4PtEtaPhiM::eta
virtual double eta() const
get eta data member
Definition: P4PtEtaPhiM.h:106
I4Momentum::m
virtual double m() const =0
mass
P4PtEtaPhiM::P4PtEtaPhiM
P4PtEtaPhiM()
default constructor
Definition: P4PtEtaPhiM.h:83
P4PtEtaPhiM
Definition: P4PtEtaPhiM.h:25
P4PtEtaPhiM::m_pt
double m_pt
Definition: P4PtEtaPhiM.h:76
P4PtEtaPhiM::P4PtEtaPhiM
P4PtEtaPhiM(const double pt, const double eta, const double phi, const double m)
constructor with all data members
Definition: P4PtEtaPhiM.h:29