CMS 3D CMS Logo

HGCalTower.cc
Go to the documentation of this file.
3 
4 using l1t::HGCalTower;
5 using l1t::L1Candidate;
6 
7 HGCalTower::HGCalTower(double etEm,
8  double etHad,
9  double eta,
10  double phi,
11  uint32_t id,
12  int hwpt,
13  int hweta,
14  int hwphi,
15  int qual,
16  int hwEtEm,
17  int hwEtHad,
18  int hwEtRatio)
19  : L1Candidate(PolarLorentzVector(etEm + etHad, eta, phi, 0.), hwpt, hweta, hwphi, qual),
20  etEm_(etEm),
21  etHad_(etHad),
22  id_(id),
23  hwEtEm_(hwEtEm),
24  hwEtHad_(hwEtHad),
25  hwEtRatio_(hwEtRatio) {}
26 
28 
29 void HGCalTower::addEtEm(double et) {
30  etEm_ += et;
31  addEt(et);
32 }
33 
34 void HGCalTower::addEtHad(double et) {
35  etHad_ += et;
36  addEt(et);
37 }
38 
39 void HGCalTower::addEt(double et) { this->setP4(PolarLorentzVector(this->pt() + et, this->eta(), this->phi(), 0.)); }
40 
42  // NOTE: assume same eta and phi -> need an explicit check on the ID
43  if (id().rawId() != tower.id().rawId()) {
44  throw edm::Exception(edm::errors::StdException, "StdException")
45  << "HGCalTower: adding to this tower with ID: " << id().rawId()
46  << " one with different ID: " << tower.id().rawId() << std::endl;
47  }
48  addEt(tower.pt());
49  etEm_ += tower.etEm();
50  etHad_ += tower.etHad();
51 
52  return *this;
53 }
l1t::HGCalTower::addEtHad
void addEtHad(double et)
Definition: HGCalTower.cc:34
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
l1t::HGCalTower::addEtEm
void addEtEm(double et)
Definition: HGCalTower.cc:29
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
l1t::HGCalTower
Definition: HGCalTower.h:13
EDMException.h
l1t::HGCalTower::addEt
void addEt(double et)
Definition: HGCalTower.cc:39
l1t::L1Candidate
Definition: L1Candidate.h:15
PVValHelper::eta
Definition: PVValidationHelpers.h:70
reco::LeafCandidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: LeafCandidate.h:25
l1t::HGCalTower::~HGCalTower
~HGCalTower() override
Definition: HGCalTower.cc:27
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
PVValHelper::phi
Definition: PVValidationHelpers.h:69
l1t::HGCalTower::etEm_
double etEm_
Definition: HGCalTower.h:55
HGCalTower.h
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::errors::StdException
Definition: EDMException.h:28
l1t::HGCalTower::etHad_
double etHad_
Definition: HGCalTower.h:56
reco::LeafCandidate::et
double et() const final
transverse energy
Definition: LeafCandidate.h:127
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Exception
Definition: hltDiff.cc:245
l1t::HGCalTower::id
HGCalTowerID id() const
Definition: HGCalTower.h:40
l1t::HGCalTowerID::rawId
unsigned short rawId() const
Definition: HGCalTowerID.h:29
l1t::HGCalTower::operator+=
const HGCalTower & operator+=(const HGCalTower &tower)
Definition: HGCalTower.cc:41