CMS 3D CMS Logo

ElectronHcalHelper.cc
Go to the documentation of this file.
5 
6 using namespace reco;
7 
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 }
19 
20 void ElectronHcalHelper::beginEvent(const edm::Event& evt, const edm::EventSetup& eventSetup) {
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,
49  cfg_.hOverEConeSize,
51  0.,
52  cfg_.eThresHB,
53  EgammaHcalIsolation::arrayHB{{0., 0., 0., 0.}},
54  cfg_.maxSeverityHB,
55  cfg_.eThresHE,
56  EgammaHcalIsolation::arrayHE{{0., 0., 0., 0., 0., 0., 0.}},
57  cfg_.maxSeverityHE,
58  evt.get(cfg_.hbheRecHits),
59  eventSetup.getHandle(caloGeometryToken_),
60  eventSetup.getHandle(hcalTopologyToken_),
61  eventSetup.getHandle(hcalChannelQualityToken_),
62  eventSetup.getHandle(hcalSevLvlComputerToken_),
63  towerMap_);
64  }
65 }
66 
68  return (cfg_.checkHcalStatus)
70  : true;
71 }
72 
73 double ElectronHcalHelper::hcalESum(const SuperCluster& sc, int depth) const {
74  return (cfg_.onlyBehindCluster) ? hcalIso_->getHcalESumBc(&sc, depth)
75  : (cfg_.hOverEConeSize > 0.) ? hcalIso_->getHcalESum(&sc, depth)
76  : 0.;
77 }
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
MessageLogger.h
ElectronHcalHelper::beginEvent
void beginEvent(const edm::Event &evt, const edm::EventSetup &eventSetup)
Definition: ElectronHcalHelper.cc:20
EgammaHcalIsolation::InclusionRule::withinConeAroundCluster
reco::SuperCluster
Definition: SuperCluster.h:18
EgammaHcalIsolation::arrayHB
std::array< double, 4 > arrayHB
Definition: EgammaHcalIsolation.h:41
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
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::hasActiveHcal
bool hasActiveHcal(const reco::SuperCluster &sc) const
Definition: ElectronHcalHelper.cc:67
ElectronHcalHelper::hcalChannelQuality_
const HcalChannelQuality * hcalChannelQuality_
Definition: ElectronHcalHelper.h:72
ElectronHcalHelper::ElectronHcalHelper
ElectronHcalHelper(const Configuration &cfg, edm::ConsumesCollector &&cc)
Definition: ElectronHcalHelper.cc:8
ElectronHcalHelper::hcalESum
double hcalESum(const reco::SuperCluster &, int depth) const
Definition: ElectronHcalHelper.cc:73
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
ElectronHcalHelper::Configuration
Definition: ElectronHcalHelper.h:25
CaloGeometryRecord.h
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
edm::EventSetup
Definition: EventSetup.h:58
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.h
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
ConsumesCollector.h
edm::Event
Definition: Event.h:73
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
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
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