Main Page
Namespaces
Classes
Package Documentation
DataFormats
L1THGCal
src
HGCalTower.cc
Go to the documentation of this file.
1
#include "
DataFormats/L1THGCal/interface/HGCalTower.h
"
2
#include "
FWCore/Utilities/interface/EDMException.h
"
3
4
using
l1t::L1Candidate
;
5
using
l1t::HGCalTower
;
6
7
HGCalTower::HGCalTower(
double
etEm,
8
double
etHad,
9
double
eta
,
10
double
phi
,
11
unsigned
short
id
,
12
int
hwpt,
13
int
hweta,
14
int
hwphi,
15
int
qual,
16
int
hwEtEm,
17
int
hwEtHad,
18
int
hwEtRatio) :
L1Candidate
(
PolarLorentzVector
(etEm+etHad, eta, phi, 0.), hwpt, hweta, hwphi, qual),
19
etEm_(etEm),
20
etHad_(etHad),
21
id_(id),
22
hwEtEm_(hwEtEm),
23
hwEtHad_(hwEtHad),
24
hwEtRatio_(hwEtRatio) {}
25
26
27
HGCalTower::~HGCalTower
() {}
28
29
30
void
HGCalTower::addEtEm
(
double
et
) {
31
etEm_
+=
et
;
32
addEt
(et);
33
}
34
35
void
HGCalTower::addEtHad
(
double
et
) {
36
etHad_
+=
et
;
37
addEt
(et);
38
}
39
40
void
HGCalTower::addEt
(
double
et
) {
41
this->
setP4
(
PolarLorentzVector
(this->
pt
()+et, this->
eta
(), this->
phi
(), 0.));
42
}
43
44
45
const
HGCalTower
&
HGCalTower::operator+=
(
const
HGCalTower
& tower){
46
// NOTE: assume same eta and phi -> need an explicit check on the ID
47
if
(
id
().rawId() != tower.
id
().
rawId
()) {
48
throw
edm::Exception
(
edm::errors::StdException
,
"StdException"
)
49
<<
"HGCalTower: adding to this tower with ID: "
<<
id
().
rawId
()
50
<<
" one with different ID: "
<< tower.
id
().
rawId
() << std::endl;
51
}
52
addEt
(tower.
pt
());
53
etEm_
+=tower.
etEm
();
54
etHad_
+=tower.
etHad
();
55
56
return
*
this
;
57
58
}
l1t::HGCalTower
Definition:
HGCalTower.h:14
l1t::HGCalTower::etHad
double etHad() const
Definition:
HGCalTower.h:46
edm::errors::StdException
Definition:
EDMException.h:28
l1t::HGCalTower::operator+=
const HGCalTower & operator+=(const HGCalTower &tower)
Definition:
HGCalTower.cc:45
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition:
LeafCandidate.h:137
Exception
Definition:
hltDiff.cc:292
PVValHelper::phi
Definition:
PVValidationHelpers.h:64
reco::LeafCandidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition:
LeafCandidate.h:25
l1t::HGCalTower::addEt
void addEt(double et)
Definition:
HGCalTower.cc:40
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition:
LeafCandidate.h:131
PVValHelper::eta
Definition:
PVValidationHelpers.h:65
l1t::HGCalTower::addEtEm
void addEtEm(double et)
Definition:
HGCalTower.cc:30
EDMException.h
HGCalTower.h
reco::LeafCandidate::et
double et() const final
transverse energy
Definition:
LeafCandidate.h:112
l1t::L1Candidate
Definition:
L1Candidate.h:16
l1t::HGCalTower::~HGCalTower
~HGCalTower() override
Definition:
HGCalTower.cc:27
l1t::HGCalTowerID::rawId
unsigned short rawId() const
Definition:
HGCalTowerID.h:24
l1t::HGCalTower::id
HGCalTowerID id() const
Definition:
HGCalTower.h:50
l1t::HGCalTower::etEm
double etEm() const
Definition:
HGCalTower.h:45
l1t::HGCalTower::etEm_
double etEm_
Definition:
HGCalTower.h:66
l1t::HGCalTower::etHad_
double etHad_
Definition:
HGCalTower.h:67
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition:
LeafCandidate.h:133
l1t::HGCalTower::addEtHad
void addEtHad(double et)
Definition:
HGCalTower.cc:35
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition:
LeafCandidate.h:143
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition:
Candidate.h:39
Generated for CMSSW Reference Manual by
1.8.11