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  unsigned short 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 }
double etHad() const
Definition: HGCalTower.h:36
const HGCalTower & operator+=(const HGCalTower &tower)
Definition: HGCalTower.cc:41
double eta() const final
momentum pseudorapidity
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: LeafCandidate.h:25
void addEt(double et)
Definition: HGCalTower.cc:39
double pt() const final
transverse momentum
void addEtEm(double et)
Definition: HGCalTower.cc:29
double et() const final
transverse energy
~HGCalTower() override
Definition: HGCalTower.cc:27
unsigned short rawId() const
Definition: HGCalTowerID.h:25
HGCalTowerID id() const
Definition: HGCalTower.h:40
double etEm() const
Definition: HGCalTower.h:35
double phi() const final
momentum azimuthal angle
void addEtHad(double et)
Definition: HGCalTower.cc:34
void setP4(const LorentzVector &p4) final
set 4-momentum
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39