CMS 3D CMS Logo

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