CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
ElectronHcalHelper Class Reference

#include <ElectronHcalHelper.h>

Classes

struct  Configuration
 

Public Member Functions

void checkSetup (const edm::EventSetup &)
 
 ElectronHcalHelper (const Configuration &)
 
bool hasActiveHcal (const reco::SuperCluster &sc) const
 
double hcalESum (const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=nullptr) const
 
double hcalESumDepth1 (const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=nullptr) const
 
double hcalESumDepth1BehindClusters (const std::vector< CaloTowerDetId > &towers) const
 
double hcalESumDepth2 (const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=nullptr) const
 
double hcalESumDepth2BehindClusters (const std::vector< CaloTowerDetId > &towers) const
 
std::vector< CaloTowerDetIdhcalTowersBehindClusters (const reco::SuperCluster &sc) const
 
double hOverEConeSize () const
 
void readEvent (const edm::Event &)
 
 ~ElectronHcalHelper ()
 

Private Attributes

edm::ESHandle< CaloGeometrycaloGeom_
 
unsigned long long caloGeomCacheId_
 
const Configuration cfg_
 
EgammaHadTowerhadTower_
 
EgammaHcalIsolationhcalIso_
 
EgammaTowerIsolationtowerIso1_
 
EgammaTowerIsolationtowerIso2_
 
const CaloTowerCollectiontowersFromCollection_ = nullptr
 

Detailed Description

Definition at line 21 of file ElectronHcalHelper.h.

Constructor & Destructor Documentation

◆ ElectronHcalHelper()

ElectronHcalHelper::ElectronHcalHelper ( const Configuration cfg)

Definition at line 11 of file ElectronHcalHelper.cc.

12  : cfg_(cfg), caloGeomCacheId_(0), hcalIso_(nullptr), towerIso1_(nullptr), towerIso2_(nullptr), hadTower_(nullptr) {}

◆ ~ElectronHcalHelper()

ElectronHcalHelper::~ElectronHcalHelper ( )

Definition at line 114 of file ElectronHcalHelper.cc.

114  {
115  if (cfg_.hOverEConeSize == 0) {
116  return;
117  }
118  if (cfg_.useTowers) {
119  delete towerIso1_;
120  delete towerIso2_;
121  delete hadTower_;
122  } else {
123  delete hcalIso_;
124  }
125 }

References cfg_, hadTower_, hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, towerIso1_, towerIso2_, and ElectronHcalHelper::Configuration::useTowers.

Member Function Documentation

◆ checkSetup()

void ElectronHcalHelper::checkSetup ( const edm::EventSetup es)

Definition at line 14 of file ElectronHcalHelper.cc.

14  {
15  if (cfg_.hOverEConeSize == 0) {
16  return;
17  }
18 
19  if (cfg_.useTowers) {
20  delete hadTower_;
21  hadTower_ = new EgammaHadTower(es);
22  } else {
23  unsigned long long newCaloGeomCacheId_ = es.get<CaloGeometryRecord>().cacheIdentifier();
24  if (caloGeomCacheId_ != newCaloGeomCacheId_) {
25  caloGeomCacheId_ = newCaloGeomCacheId_;
27  }
28  }
29 }

References caloGeom_, caloGeomCacheId_, cfg_, edm::EventSetup::get(), get, hadTower_, ElectronHcalHelper::Configuration::hOverEConeSize, and ElectronHcalHelper::Configuration::useTowers.

Referenced by GsfElectronAlgo::checkSetup().

◆ hasActiveHcal()

bool ElectronHcalHelper::hasActiveHcal ( const reco::SuperCluster sc) const

◆ hcalESum()

double ElectronHcalHelper::hcalESum ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = nullptr 
) const

Definition at line 71 of file ElectronHcalHelper.cc.

71  {
72  if (cfg_.hOverEConeSize == 0) {
73  return 0;
74  }
75  if (cfg_.useTowers) {
76  return (hcalESumDepth1(sc, excludeTowers) + hcalESumDepth2(sc, excludeTowers));
77  } else {
78  return hcalIso_->getHcalESum(&sc);
79  }
80 }

References cfg_, EgammaHcalIsolation::getHcalESum(), hcalESumDepth1(), hcalESumDepth2(), hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, and ElectronHcalHelper::Configuration::useTowers.

◆ hcalESumDepth1()

double ElectronHcalHelper::hcalESumDepth1 ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = nullptr 
) const

Definition at line 82 of file ElectronHcalHelper.cc.

83  {
84  if (cfg_.hOverEConeSize == 0) {
85  return 0;
86  }
87  if (cfg_.useTowers) {
88  return towerIso1_->getTowerESum(&sc, excludeTowers);
89  } else {
90  return hcalIso_->getHcalESumDepth1(&sc);
91  }
92 }

References cfg_, EgammaHcalIsolation::getHcalESumDepth1(), EgammaTowerIsolation::getTowerESum(), hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, towerIso1_, and ElectronHcalHelper::Configuration::useTowers.

Referenced by GsfElectronAlgo::calculateShowerShape(), and hcalESum().

◆ hcalESumDepth1BehindClusters()

double ElectronHcalHelper::hcalESumDepth1BehindClusters ( const std::vector< CaloTowerDetId > &  towers) const

◆ hcalESumDepth2()

double ElectronHcalHelper::hcalESumDepth2 ( const reco::SuperCluster sc,
const std::vector< CaloTowerDetId > *  excludeTowers = nullptr 
) const

Definition at line 94 of file ElectronHcalHelper.cc.

95  {
96  if (cfg_.hOverEConeSize == 0) {
97  return 0;
98  }
99  if (cfg_.useTowers) {
100  return towerIso2_->getTowerESum(&sc, excludeTowers);
101  } else {
102  return hcalIso_->getHcalESumDepth2(&sc);
103  }
104 }

References cfg_, EgammaHcalIsolation::getHcalESumDepth2(), EgammaTowerIsolation::getTowerESum(), hcalIso_, ElectronHcalHelper::Configuration::hOverEConeSize, towerIso2_, and ElectronHcalHelper::Configuration::useTowers.

Referenced by GsfElectronAlgo::calculateShowerShape(), and hcalESum().

◆ hcalESumDepth2BehindClusters()

double ElectronHcalHelper::hcalESumDepth2BehindClusters ( const std::vector< CaloTowerDetId > &  towers) const

◆ hcalTowersBehindClusters()

std::vector< CaloTowerDetId > ElectronHcalHelper::hcalTowersBehindClusters ( const reco::SuperCluster sc) const

Definition at line 59 of file ElectronHcalHelper.cc.

59  {
60  return hadTower_->towersOf(sc);
61 }

References hadTower_, and EgammaHadTower::towersOf().

Referenced by GsfElectronAlgo::calculateShowerShape().

◆ hOverEConeSize()

double ElectronHcalHelper::hOverEConeSize ( ) const
inline

Definition at line 48 of file ElectronHcalHelper.h.

48 { return cfg_.hOverEConeSize; }

References cfg_, and ElectronHcalHelper::Configuration::hOverEConeSize.

◆ readEvent()

void ElectronHcalHelper::readEvent ( const edm::Event evt)

Member Data Documentation

◆ caloGeom_

edm::ESHandle<CaloGeometry> ElectronHcalHelper::caloGeom_
private

Definition at line 64 of file ElectronHcalHelper.h.

Referenced by checkSetup(), and readEvent().

◆ caloGeomCacheId_

unsigned long long ElectronHcalHelper::caloGeomCacheId_
private

Definition at line 63 of file ElectronHcalHelper.h.

Referenced by checkSetup().

◆ cfg_

const Configuration ElectronHcalHelper::cfg_
private

◆ hadTower_

EgammaHadTower* ElectronHcalHelper::hadTower_
private

◆ hcalIso_

EgammaHcalIsolation* ElectronHcalHelper::hcalIso_
private

◆ towerIso1_

EgammaTowerIsolation* ElectronHcalHelper::towerIso1_
private

Definition at line 70 of file ElectronHcalHelper.h.

Referenced by hcalESumDepth1(), readEvent(), and ~ElectronHcalHelper().

◆ towerIso2_

EgammaTowerIsolation* ElectronHcalHelper::towerIso2_
private

Definition at line 71 of file ElectronHcalHelper.h.

Referenced by hcalESumDepth2(), readEvent(), and ~ElectronHcalHelper().

◆ towersFromCollection_

const CaloTowerCollection* ElectronHcalHelper::towersFromCollection_ = nullptr
private
ElectronHcalHelper::cfg_
const Configuration cfg_
Definition: ElectronHcalHelper.h:60
EgammaHcalIsolation::getHcalESumDepth2
double getHcalESumDepth2(const reco::Candidate *c) const
Definition: EgammaHcalIsolation.h:76
ElectronHcalHelper::hcalESumDepth1
double hcalESumDepth1(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=nullptr) const
Definition: ElectronHcalHelper.cc:82
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm::Handle
Definition: AssociativeIterator.h:50
EgammaHcalIsolation::getHcalESum
double getHcalESum(const reco::Candidate *c) const
Definition: EgammaHcalIsolation.h:48
ElectronHcalHelper::Configuration::hOverEHFMinE
double hOverEHFMinE
Definition: ElectronHcalHelper.h:37
EgammaHcalIsolation
Definition: EgammaHcalIsolation.h:30
ElectronHcalHelper::hcalIso_
EgammaHcalIsolation * hcalIso_
Definition: ElectronHcalHelper.h:67
EgammaHadTower::hasActiveHcal
bool hasActiveHcal(const std::vector< CaloTowerDetId > &towers) const
Definition: EgammaHadTower.cc:116
ElectronHcalHelper::caloGeomCacheId_
unsigned long long caloGeomCacheId_
Definition: ElectronHcalHelper.h:63
EgammaTowerIsolation::getTowerESum
double getTowerESum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
Definition: EgammaTowerIsolation.h:208
ElectronHcalHelper::towersFromCollection_
const CaloTowerCollection * towersFromCollection_
Definition: ElectronHcalHelper.h:73
EgammaHadTower::getDepth2HcalESum
double getDepth2HcalESum(const std::vector< CaloTowerDetId > &towers, CaloTowerCollection const &) const
Definition: EgammaHadTower.cc:105
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ElectronHcalHelper::Configuration::hcalTowers
edm::EDGetTokenT< CaloTowerCollection > hcalTowers
Definition: ElectronHcalHelper.h:31
ElectronHcalHelper::Configuration::hOverEConeSize
double hOverEConeSize
Definition: ElectronHcalHelper.h:25
ElectronHcalHelper::towerIso1_
EgammaTowerIsolation * towerIso1_
Definition: ElectronHcalHelper.h:70
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
ElectronHcalHelper::Configuration::hcalRecHits
edm::EDGetTokenT< HBHERecHitCollection > hcalRecHits
Definition: ElectronHcalHelper.h:35
ElectronHcalHelper::towerIso2_
EgammaTowerIsolation * towerIso2_
Definition: ElectronHcalHelper.h:71
edm::LogError
Definition: MessageLogger.h:183
ElectronHcalHelper::Configuration::hOverEHBMinE
double hOverEHBMinE
Definition: ElectronHcalHelper.h:36
EgammaTowerIsolation
Definition: EgammaTowerIsolation.h:196
ElectronHcalHelper::caloGeom_
edm::ESHandle< CaloGeometry > caloGeom_
Definition: ElectronHcalHelper.h:64
get
#define get
looper.cfg
cfg
Definition: looper.py:297
EgammaHadTower::towersOf
std::vector< CaloTowerDetId > towersOf(const reco::SuperCluster &sc) const
Definition: EgammaHadTower.cc:50
EgammaHcalIsolation::getHcalESumDepth1
double getHcalESumDepth1(const reco::Candidate *c) const
Definition: EgammaHcalIsolation.h:58
HLT_2018_cff.towers
towers
Definition: HLT_2018_cff.py:35030
ElectronHcalHelper::hadTower_
EgammaHadTower * hadTower_
Definition: ElectronHcalHelper.h:72
ElectronHcalHelper::Configuration::hOverEPtMin
double hOverEPtMin
Definition: ElectronHcalHelper.h:32
ElectronHcalHelper::Configuration::checkHcalStatus
bool checkHcalStatus
Definition: ElectronHcalHelper.h:28
EgammaHadTower::getDepth1HcalESum
double getDepth1HcalESum(const std::vector< CaloTowerDetId > &towers, CaloTowerCollection const &) const
Definition: EgammaHadTower.cc:94
ElectronHcalHelper::Configuration::useTowers
bool useTowers
Definition: ElectronHcalHelper.h:28
EgammaHadTower
Definition: EgammaHadTower.h:17
edm::Event::get
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:337
ElectronHcalHelper::hcalESumDepth2
double hcalESumDepth2(const reco::SuperCluster &, const std::vector< CaloTowerDetId > *excludeTowers=nullptr) const
Definition: ElectronHcalHelper.cc:94