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_
 
HcalChannelQuality const * hcalChannelQuality_ = nullptr
 
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcdhcalChannelQualityToken_
 
std::unique_ptr< EgammaHcalIsolationhcalIso_
 
HcalSeverityLevelComputer const * hcalSevLvlComputer_ = nullptr
 
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcdhcalSevLvlComputerToken_
 
HcalTopology const * hcalTopology_ = nullptr
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordhcalTopologyToken_
 
CaloTowerConstituentsMap const * towerMap_ = 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 
)

Definition at line 8 of file ElectronHcalHelper.cc.

References caloGeometryToken_, gpuPixelDoublets::cc, cfg_, hcalChannelQualityToken_, hcalSevLvlComputerToken_, hcalTopologyToken_, ElectronHcalHelper::Configuration::hOverEConeSize, ElectronHcalHelper::Configuration::onlyBehindCluster, and towerMapToken_.

8  : cfg_(cfg) {
9  if (cfg_.hOverEConeSize == 0. and !cfg_.onlyBehindCluster) {
10  return;
11  }
12 
13  caloGeometryToken_ = cc.esConsumes();
14  hcalTopologyToken_ = cc.esConsumes();
15  hcalChannelQualityToken_ = cc.esConsumes(edm::ESInputTag("", "withTopo"));
16  hcalSevLvlComputerToken_ = cc.esConsumes();
17  towerMapToken_ = cc.esConsumes();
18 }
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcalTopologyToken_
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > hcalSevLvlComputerToken_
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
const Configuration cfg_
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > towerMapToken_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > hcalChannelQualityToken_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_

Member Function Documentation

◆ beginEvent()

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

Definition at line 20 of file ElectronHcalHelper.cc.

References caloGeometryToken_, cfg_, ElectronHcalHelper::Configuration::eThresHB, ElectronHcalHelper::Configuration::eThresHE, options_cfi::eventSetup, edm::Event::get(), 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().

20  {
21  if (cfg_.hOverEConeSize == 0. and !cfg_.onlyBehindCluster) {
22  return;
23  }
24 
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 }
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > hcalTopologyToken_
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:344
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > hcalSevLvlComputerToken_
HcalChannelQuality const * hcalChannelQuality_
const Configuration cfg_
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits
std::unique_ptr< EgammaHcalIsolation > hcalIso_
HcalSeverityLevelComputer const * hcalSevLvlComputer_
edm::ESGetToken< CaloTowerConstituentsMap, CaloGeometryRecord > towerMapToken_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > hcalChannelQualityToken_
HcalTopology const * hcalTopology_
EgammaHcalIsolation::arrayHB eThresHB
EgammaHcalIsolation::arrayHE eThresHE
std::array< double, 4 > arrayHB
CaloTowerConstituentsMap const * towerMap_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeometryToken_
std::array< double, 7 > arrayHE

◆ hasActiveHcal()

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

Definition at line 67 of file ElectronHcalHelper.cc.

References cfg_, ElectronHcalHelper::Configuration::checkHcalStatus, egamma::hasActiveHcal(), hcalChannelQuality_, hcalTopology_, hcalTowersBehindClusters(), and towerMap_.

Referenced by GsfElectronAlgo::calculateShowerShape(), and GEDPhotonProducer::fillPhotonCollection().

67  {
68  return (cfg_.checkHcalStatus)
70  : true;
71 }
HcalChannelQuality const * hcalChannelQuality_
const Configuration cfg_
bool hasActiveHcal(std::vector< CaloTowerDetId > const &towers, CaloTowerConstituentsMap const &towerMap, HcalChannelQuality const &hcalQuality, HcalTopology const &hcalTopology)
auto hcalTowersBehindClusters(const reco::SuperCluster &sc) const
HcalTopology const * hcalTopology_
CaloTowerConstituentsMap const * towerMap_

◆ hcalChannelQuality()

const auto ElectronHcalHelper::hcalChannelQuality ( ) const
inline

Definition at line 56 of file ElectronHcalHelper.h.

References hcalChannelQuality_.

Referenced by GsfElectronAlgo::beginEvent().

56 { return hcalChannelQuality_; }
HcalChannelQuality const * hcalChannelQuality_

◆ 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.

References hcalSevLvlComputer_.

Referenced by GsfElectronAlgo::beginEvent().

57 { return hcalSevLvlComputer_; }
HcalSeverityLevelComputer const * hcalSevLvlComputer_

◆ hcalTopology()

const auto ElectronHcalHelper::hcalTopology ( ) const
inline

Definition at line 55 of file ElectronHcalHelper.h.

References hcalTopology_.

Referenced by GsfElectronAlgo::beginEvent().

55 { return hcalTopology_; }
HcalTopology const * hcalTopology_

◆ hcalTowersBehindClusters()

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

Definition at line 45 of file ElectronHcalHelper.h.

References towerMap_, and egamma::towersOf().

Referenced by GsfElectronAlgo::calculateShowerShape(), PhotonProducer::fillPhotonCollection(), GEDPhotonProducer::fillPhotonCollection(), and hasActiveHcal().

45 { return egamma::towersOf(sc, *towerMap_); }
CaloTowerConstituentsMap const * towerMap_
std::vector< CaloTowerDetId > towersOf(reco::SuperCluster const &sc, CaloTowerConstituentsMap const &towerMap, HoeMode mode=HoeMode::SingleTower)

◆ hOverEConeSize()

double ElectronHcalHelper::hOverEConeSize ( ) const
inline

◆ maxSeverityHB()

int ElectronHcalHelper::maxSeverityHB ( ) const
inline

◆ maxSeverityHE()

int ElectronHcalHelper::maxSeverityHE ( ) const
inline

◆ towerMap()

const auto ElectronHcalHelper::towerMap ( ) const
inline

Definition at line 58 of file ElectronHcalHelper.h.

References towerMap_.

Referenced by GsfElectronAlgo::beginEvent().

58 { return towerMap_; }
CaloTowerConstituentsMap const * towerMap_

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_

HcalChannelQuality const* 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_

HcalSeverityLevelComputer const* 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_

HcalTopology const* 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_

CaloTowerConstituentsMap const* 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().