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 beginEvent (const edm::Event &evt, const edm::EventSetup &eventSetup)
 
 ElectronHcalHelper (const Configuration &cfg, edm::ConsumesCollector &&cc)
 
bool hasActiveHcal (const reco::SuperCluster &sc) const
 
const auto hcalChannelQuality () const
 
double hcalESum (const reco::SuperCluster &, int depth) const
 
const auto hcalSevLvlComputer () const
 
const auto hcalTopology () const
 
auto hcalTowersBehindClusters (const reco::SuperCluster &sc) const
 
double hOverEConeSize () const
 
int maxSeverityHB () const
 
int maxSeverityHE () const
 
const auto towerMap () const
 

Private Attributes

edm::ESGetToken< CaloGeometry, CaloGeometryRecordcaloGeometryToken_
 
const Configuration cfg_
 
const HcalChannelQualityhcalChannelQuality_ = nullptr
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdhcalChannelQualityToken_
 
std::unique_ptr< EgammaHcalIsolationhcalIso_
 
const HcalSeverityLevelComputerhcalSevLvlComputer_ = nullptr
 
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcdhcalSevLvlComputerToken_
 
const HcalTopologyhcalTopology_ = nullptr
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordhcalTopologyToken_
 
const CaloTowerConstituentsMaptowerMap_ = nullptr
 
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecordtowerMapToken_
 

Detailed Description

Definition at line 23 of file ElectronHcalHelper.h.

Constructor & Destructor Documentation

◆ ElectronHcalHelper()

ElectronHcalHelper::ElectronHcalHelper ( const Configuration cfg,
edm::ConsumesCollector &&  cc 
)

Member Function Documentation

◆ beginEvent()

void ElectronHcalHelper::beginEvent ( const edm::Event evt,
const edm::EventSetup eventSetup 
)

Definition at line 20 of file ElectronHcalHelper.cc.

20  {
21  if (cfg_.hOverEConeSize == 0. and !cfg_.onlyBehindCluster) {
22  return;
23  }
24 
28  towerMap_ = &eventSetup.getData(towerMapToken_);
29 
30  if (cfg_.onlyBehindCluster) {
31  hcalIso_ = std::make_unique<EgammaHcalIsolation>(EgammaHcalIsolation::InclusionRule::isBehindClusterSeed,
32  0.,
34  0.,
35  cfg_.eThresHB,
36  EgammaHcalIsolation::arrayHB{{0., 0., 0., 0.}},
38  cfg_.eThresHE,
39  EgammaHcalIsolation::arrayHE{{0., 0., 0., 0., 0., 0., 0.}},
41  evt.get(cfg_.hbheRecHits),
42  eventSetup.getHandle(caloGeometryToken_),
43  eventSetup.getHandle(hcalTopologyToken_),
46  towerMap_);
47  } else {
48  hcalIso_ = std::make_unique<EgammaHcalIsolation>(EgammaHcalIsolation::InclusionRule::withinConeAroundCluster,
51  0.,
52  cfg_.eThresHB,
53  EgammaHcalIsolation::arrayHB{{0., 0., 0., 0.}},
55  cfg_.eThresHE,
56  EgammaHcalIsolation::arrayHE{{0., 0., 0., 0., 0., 0., 0.}},
58  evt.get(cfg_.hbheRecHits),
59  eventSetup.getHandle(caloGeometryToken_),
60  eventSetup.getHandle(hcalTopologyToken_),
63  towerMap_);
64  }
65 }

References caloGeometryToken_, cfg_, ElectronHcalHelper::Configuration::eThresHB, ElectronHcalHelper::Configuration::eThresHE, edm::Event::get(), edm::EventSetup::getData(), edm::EventSetup::getHandle(), ElectronHcalHelper::Configuration::hbheRecHits, hcalChannelQuality_, hcalChannelQualityToken_, hcalIso_, hcalSevLvlComputer_, hcalSevLvlComputerToken_, hcalTopology_, hcalTopologyToken_, ElectronHcalHelper::Configuration::hOverEConeSize, EgammaHcalIsolation::isBehindClusterSeed, ElectronHcalHelper::Configuration::maxSeverityHB, ElectronHcalHelper::Configuration::maxSeverityHE, ElectronHcalHelper::Configuration::onlyBehindCluster, towerMap_, towerMapToken_, and EgammaHcalIsolation::withinConeAroundCluster.

Referenced by GsfElectronAlgo::completeElectrons().

◆ hasActiveHcal()

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

◆ hcalChannelQuality()

const auto ElectronHcalHelper::hcalChannelQuality ( ) const
inline

Definition at line 56 of file ElectronHcalHelper.h.

56 { return hcalChannelQuality_; }

References hcalChannelQuality_.

Referenced by GsfElectronAlgo::beginEvent().

◆ hcalESum()

double ElectronHcalHelper::hcalESum ( const reco::SuperCluster sc,
int  depth 
) const

◆ hcalSevLvlComputer()

const auto ElectronHcalHelper::hcalSevLvlComputer ( ) const
inline

Definition at line 57 of file ElectronHcalHelper.h.

57 { return hcalSevLvlComputer_; }

References hcalSevLvlComputer_.

Referenced by GsfElectronAlgo::beginEvent().

◆ hcalTopology()

const auto ElectronHcalHelper::hcalTopology ( ) const
inline

Definition at line 55 of file ElectronHcalHelper.h.

55 { return hcalTopology_; }

References hcalTopology_.

Referenced by GsfElectronAlgo::beginEvent().

◆ hcalTowersBehindClusters()

auto ElectronHcalHelper::hcalTowersBehindClusters ( const reco::SuperCluster sc) const
inline

◆ hOverEConeSize()

double ElectronHcalHelper::hOverEConeSize ( ) const
inline

Definition at line 47 of file ElectronHcalHelper.h.

47 { return cfg_.hOverEConeSize; }

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

◆ maxSeverityHB()

int ElectronHcalHelper::maxSeverityHB ( ) const
inline

Definition at line 48 of file ElectronHcalHelper.h.

48 { return cfg_.maxSeverityHB; }

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

Referenced by GsfElectronAlgo::beginEvent().

◆ maxSeverityHE()

int ElectronHcalHelper::maxSeverityHE ( ) const
inline

Definition at line 49 of file ElectronHcalHelper.h.

49 { return cfg_.maxSeverityHE; }

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

Referenced by GsfElectronAlgo::beginEvent().

◆ towerMap()

const auto ElectronHcalHelper::towerMap ( ) const
inline

Definition at line 58 of file ElectronHcalHelper.h.

58 { return towerMap_; }

References towerMap_.

Referenced by GsfElectronAlgo::beginEvent().

Member Data Documentation

◆ caloGeometryToken_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> ElectronHcalHelper::caloGeometryToken_
private

Definition at line 63 of file ElectronHcalHelper.h.

Referenced by beginEvent(), and ElectronHcalHelper().

◆ cfg_

const Configuration ElectronHcalHelper::cfg_
private

◆ hcalChannelQuality_

const HcalChannelQuality* ElectronHcalHelper::hcalChannelQuality_ = nullptr
private

Definition at line 72 of file ElectronHcalHelper.h.

Referenced by beginEvent(), hasActiveHcal(), and hcalChannelQuality().

◆ hcalChannelQualityToken_

edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> ElectronHcalHelper::hcalChannelQualityToken_
private

Definition at line 65 of file ElectronHcalHelper.h.

Referenced by beginEvent(), and ElectronHcalHelper().

◆ hcalIso_

std::unique_ptr<EgammaHcalIsolation> ElectronHcalHelper::hcalIso_
private

Definition at line 70 of file ElectronHcalHelper.h.

Referenced by beginEvent(), and hcalESum().

◆ hcalSevLvlComputer_

const HcalSeverityLevelComputer* ElectronHcalHelper::hcalSevLvlComputer_ = nullptr
private

Definition at line 73 of file ElectronHcalHelper.h.

Referenced by beginEvent(), and hcalSevLvlComputer().

◆ hcalSevLvlComputerToken_

edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> ElectronHcalHelper::hcalSevLvlComputerToken_
private

Definition at line 66 of file ElectronHcalHelper.h.

Referenced by beginEvent(), and ElectronHcalHelper().

◆ hcalTopology_

const HcalTopology* ElectronHcalHelper::hcalTopology_ = nullptr
private

Definition at line 71 of file ElectronHcalHelper.h.

Referenced by beginEvent(), hasActiveHcal(), and hcalTopology().

◆ hcalTopologyToken_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> ElectronHcalHelper::hcalTopologyToken_
private

Definition at line 64 of file ElectronHcalHelper.h.

Referenced by beginEvent(), and ElectronHcalHelper().

◆ towerMap_

const CaloTowerConstituentsMap* ElectronHcalHelper::towerMap_ = nullptr
private

Definition at line 74 of file ElectronHcalHelper.h.

Referenced by beginEvent(), hasActiveHcal(), hcalTowersBehindClusters(), and towerMap().

◆ towerMapToken_

edm::ESGetToken<CaloTowerConstituentsMap, CaloGeometryRecord> ElectronHcalHelper::towerMapToken_
private

Definition at line 67 of file ElectronHcalHelper.h.

Referenced by beginEvent(), and ElectronHcalHelper().

ElectronHcalHelper::Configuration::hbheRecHits
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits
Definition: ElectronHcalHelper.h:33
ElectronHcalHelper::hcalTowersBehindClusters
auto hcalTowersBehindClusters(const reco::SuperCluster &sc) const
Definition: ElectronHcalHelper.h:45
ElectronHcalHelper::caloGeometryToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
Definition: ElectronHcalHelper.h:63
ElectronHcalHelper::cfg_
const Configuration cfg_
Definition: ElectronHcalHelper.h:61
edm::ESInputTag
Definition: ESInputTag.h:87
ElectronHcalHelper::hcalSevLvlComputerToken_
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > hcalSevLvlComputerToken_
Definition: ElectronHcalHelper.h:66
EgammaHcalIsolation::InclusionRule::withinConeAroundCluster
EgammaHcalIsolation::arrayHB
std::array< double, 4 > arrayHB
Definition: EgammaHcalIsolation.h:41
cc
ElectronHcalHelper::hcalTopology_
const HcalTopology * hcalTopology_
Definition: ElectronHcalHelper.h:71
ElectronHcalHelper::hcalIso_
std::unique_ptr< EgammaHcalIsolation > hcalIso_
Definition: ElectronHcalHelper.h:70
ElectronHcalHelper::Configuration::maxSeverityHB
int maxSeverityHB
Definition: ElectronHcalHelper.h:36
ElectronHcalHelper::Configuration::onlyBehindCluster
bool onlyBehindCluster
Definition: ElectronHcalHelper.h:30
ElectronHcalHelper::hcalSevLvlComputer_
const HcalSeverityLevelComputer * hcalSevLvlComputer_
Definition: ElectronHcalHelper.h:73
ElectronHcalHelper::Configuration::hOverEConeSize
double hOverEConeSize
Definition: ElectronHcalHelper.h:27
ElectronHcalHelper::hcalChannelQuality_
const HcalChannelQuality * hcalChannelQuality_
Definition: ElectronHcalHelper.h:72
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
funct::true
true
Definition: Factorize.h:173
egamma::towersOf
std::vector< CaloTowerDetId > towersOf(reco::SuperCluster const &sc, CaloTowerConstituentsMap const &towerMap, HoeMode mode=HoeMode::SingleTower)
Definition: EgammaHadTower.cc:25
EgammaHcalIsolation::InclusionRule::isBehindClusterSeed
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
ElectronHcalHelper::Configuration::maxSeverityHE
int maxSeverityHE
Definition: ElectronHcalHelper.h:38
ElectronHcalHelper::hcalTopologyToken_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcalTopologyToken_
Definition: ElectronHcalHelper.h:64
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
looper.cfg
cfg
Definition: looper.py:296
ElectronHcalHelper::Configuration::eThresHB
EgammaHcalIsolation::arrayHB eThresHB
Definition: ElectronHcalHelper.h:35
ElectronHcalHelper::Configuration::checkHcalStatus
bool checkHcalStatus
Definition: ElectronHcalHelper.h:30
ElectronHcalHelper::towerMap_
const CaloTowerConstituentsMap * towerMap_
Definition: ElectronHcalHelper.h:74
egamma::hasActiveHcal
bool hasActiveHcal(std::vector< CaloTowerDetId > const &towers, CaloTowerConstituentsMap const &towerMap, HcalChannelQuality const &hcalQuality, HcalTopology const &hcalTopology)
Definition: EgammaHadTower.cc:93
edm::Event::get
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
ElectronHcalHelper::Configuration::eThresHE
EgammaHcalIsolation::arrayHE eThresHE
Definition: ElectronHcalHelper.h:37
EgammaHcalIsolation::arrayHE
std::array< double, 7 > arrayHE
Definition: EgammaHcalIsolation.h:42
ElectronHcalHelper::towerMapToken_
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > towerMapToken_
Definition: ElectronHcalHelper.h:67
ElectronHcalHelper::hcalChannelQualityToken_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > hcalChannelQualityToken_
Definition: ElectronHcalHelper.h:65