ATLAS Offline Software
Loading...
Searching...
No Matches
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
23
24class 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
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
85 m_pt ( 0.*CLHEP::GeV ),
86 m_eta ( 0. ),
87 m_phi ( 0. ),
88 m_m ( 0.*CLHEP::GeV )
89{}
90
91inline P4PtEtaPhiM::P4PtEtaPhiM(const CLHEP::HepLorentzVector & theHlv)
92{
93 this->set4Mom(theHlv);
94}
95
96inline P4PtEtaPhiM::P4PtEtaPhiM(const I4Momentum & theI4Mom )
97{this->set4Mom(theI4Mom); }
98
99inline P4PtEtaPhiM::P4PtEtaPhiM(const I4Momentum * const theI4Mom )
100{this->set4Mom(*theI4Mom); }
101
102
103inline double P4PtEtaPhiM::pt() const
104{ return m_pt;}
105
106inline double P4PtEtaPhiM::eta() const
107{ return m_eta;}
108
109inline double P4PtEtaPhiM::phi() const
110{ return m_phi;}
111
112inline double P4PtEtaPhiM::m() const
113{ return m_m;}
114
115inline void P4PtEtaPhiM::setPt(double thePt)
116{ m_pt = thePt;}
117
118inline void P4PtEtaPhiM::setEta(double theEta)
119{ m_eta = theEta;}
120
121inline void P4PtEtaPhiM::setPhi(double thePhi)
122{ m_phi = thePhi;}
123
124inline void P4PtEtaPhiM::setM(double theM)
125{ m_m = theM;}
126
127inline 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
135inline void P4PtEtaPhiM::set4Mom(const I4Momentum * const theI4Mom )
136{
137 this->set4Mom(*theI4Mom);
138}
139
140inline 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 is an abstract base class providing 4-momentum behavior.
Definition I4Momentum.h:31
virtual double m() const =0
mass
virtual double phi() const =0
phi in [-pi,pi[
virtual double pt() const =0
transverse momentum
virtual double eta() const =0
pseudo rapidity
P4PtEtaPhiMBase is a base class for classes with 4-momentum behavior, for which pt,...
double m_pt
Definition P4PtEtaPhiM.h:76
virtual const I4MomentumError * errors() const
Access to errors, if available; returns 0 if no errors.
P4PtEtaPhiM(const double pt, const double eta, const double phi, const double m)
constructor with all data members
Definition P4PtEtaPhiM.h:29
virtual double pt() const
get pt data member
double m_eta
Definition P4PtEtaPhiM.h:77
virtual void setEta(double theEta)
set eta data member
virtual void setPt(double thePt)
set pt data member
P4PtEtaPhiM()
default constructor
Definition P4PtEtaPhiM.h:83
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
virtual void setPhi(double thePhi)
set phi data member
double m_phi
Definition P4PtEtaPhiM.h:78
virtual void setM(double theM)
set mass data member
virtual double eta() const
get eta data member
virtual double m() const
get mass data member
virtual double phi() const
get phi data member