ATLAS Offline Software
Loading...
Searching...
No Matches
P4EEtaPhiM.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_P4EETAPHIM_H
6#define FOURMOM_P4EETAPHIM_H
7
9//#include "SealBase/DebugAids.h"
10#include <cmath>
11
12// CLHEP includes
13#include "CLHEP/Units/SystemOfUnits.h"
14
23
24class P4EEtaPhiM : public virtual P4EEtaPhiMBase
25{
26 public:
27
29 P4EEtaPhiM(const double e, const double eta, const double phi, const double m);
30
32 P4EEtaPhiM();
33
35 P4EEtaPhiM(const CLHEP::HepLorentzVector & theHlv);
36
38 P4EEtaPhiM(const I4Momentum & theI4M );
39
41 P4EEtaPhiM(const I4Momentum * const pI4M );
42
43
45 virtual double e() const;
47 virtual double eta() const;
49 virtual double phi() const;
51 virtual double m() const;
52
54 virtual void setE (double theE);
56 virtual void setEta (double theEta);
58 virtual void setPhi (double thePhi);
60 virtual void setM (double theM);
61
63 virtual void set4Mom (const I4Momentum & theI4Mom );
65 virtual void set4Mom (const I4Momentum * const theI4Mom );
67 virtual void set4Mom (const CLHEP::HepLorentzVector & theHlv );
68
69 virtual const I4MomentumError* errors() const;
70
71 protected:
72
73
74
75 double m_e;
76 double m_eta;
77 double m_phi;
78 double m_m;
79
80};
81
84 m_e ( 0.*CLHEP::GeV ),
85 m_eta ( 0. ),
86 m_phi ( 0. ),
87 m_m ( 0.*CLHEP::GeV )
88{}
89
90inline P4EEtaPhiM::P4EEtaPhiM(const CLHEP::HepLorentzVector & theHlv)
91{
92 this->set4Mom(theHlv);
93}
94
95inline P4EEtaPhiM::P4EEtaPhiM(const I4Momentum & theI4Mom )
96{this->set4Mom(theI4Mom); }
97
98inline P4EEtaPhiM::P4EEtaPhiM(const I4Momentum * const theI4Mom )
99{this->set4Mom(*theI4Mom); }
100
101
102inline double P4EEtaPhiM::e() const
103{ return m_e;}
104
105inline double P4EEtaPhiM::eta() const
106{ return m_eta;}
107
108inline double P4EEtaPhiM::phi() const
109{ return m_phi;}
110
111inline double P4EEtaPhiM::m() const
112{ return m_m;}
113
114inline void P4EEtaPhiM::setE(double theE)
115{ m_e = theE;}
116
117inline void P4EEtaPhiM::setEta(double theEta)
118{ m_eta = theEta;}
119
120inline void P4EEtaPhiM::setPhi(double thePhi)
121{ m_phi = thePhi;}
122
123inline void P4EEtaPhiM::setM(double theM)
124{ m_m = theM;}
125
126inline void P4EEtaPhiM::set4Mom(const I4Momentum & theI4Mom )
127{
128 m_e=theI4Mom.e();
129 m_eta=theI4Mom.eta();
130 m_phi=theI4Mom.phi();
131 m_m=theI4Mom.m();
132}
133
134inline void P4EEtaPhiM::set4Mom(const I4Momentum * const theI4Mom )
135{
136 this->set4Mom(*theI4Mom);
137}
138
139inline void P4EEtaPhiM::set4Mom(const CLHEP::HepLorentzVector & theHlv)
140{
141 m_e=theHlv.e();
142 m_eta=theHlv.eta();
143 //FIXME protect against negative energy
144 //assert(m_e >= 0,"P4EEtaPhiM::set4Mom cannot have negative energy");
145 //assert(m_e >= 0);
146 // FIXME of the FIXME in fact it is not necessary to prtoect against negative energy
147 // and besides Seal assert does not work
148 // ASSERT( m_e >= 0 );
149 m_phi=theHlv.phi();
150 m_m=theHlv.m();
151
152
153}
154
155
156#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 eta() const =0
pseudo rapidity
virtual double e() const =0
energy
P4EEtaPhiMBase is a base class for classes with 4-momentum behavior, for which E, eta,...
double m_m
Definition P4EEtaPhiM.h:78
virtual void setM(double theM)
set mass data member
Definition P4EEtaPhiM.h:123
P4EEtaPhiM()
default constructor
Definition P4EEtaPhiM.h:82
virtual double e() const
get energy data member
Definition P4EEtaPhiM.h:102
double m_eta
Definition P4EEtaPhiM.h:76
virtual double phi() const
get phi data member
Definition P4EEtaPhiM.h:108
virtual void set4Mom(const I4Momentum &theI4Mom)
set all 4-mom from another I4Momentum reference
Definition P4EEtaPhiM.h:126
double m_phi
Definition P4EEtaPhiM.h:77
virtual void setEta(double theEta)
set eta data member
Definition P4EEtaPhiM.h:117
virtual const I4MomentumError * errors() const
Access to errors, if available; returns 0 if no errors.
P4EEtaPhiM(const double e, const double eta, const double phi, const double m)
constructor with all data members
Definition P4EEtaPhiM.cxx:7
virtual void setE(double theE)
set energy data member
Definition P4EEtaPhiM.h:114
virtual double eta() const
get eta data member
Definition P4EEtaPhiM.h:105
virtual void setPhi(double thePhi)
set phi data member
Definition P4EEtaPhiM.h:120
double m_e
Definition P4EEtaPhiM.h:75
virtual double m() const
get mass data member
Definition P4EEtaPhiM.h:111