File indexing completed on 2024-04-06 12:24:46
0001 #ifndef ElectronHcalHelper_h
0002 #define ElectronHcalHelper_h
0003
0004 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0005 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "FWCore/Framework/interface/ESHandle.h"
0009 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
0010 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0011 #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHcalIsolation.h"
0012 #include "RecoEgamma/EgammaIsolationAlgos/interface/EgammaHadTower.h"
0013 #include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h"
0014 #include "Geometry/CaloTopology/interface/CaloTowerConstituentsMap.h"
0015 #include "CondFormats/DataRecord/interface/HcalPFCutsRcd.h"
0016 #include "CondTools/Hcal/interface/HcalPFCutsHandler.h"
0017
0018 class ConsumesCollector;
0019 class EgammaHadTower;
0020 class HcalTopology;
0021 class HcalChannelQuality;
0022 class HcalHcalSeverityLevelComputer;
0023 class CaloTowerConstituentsMap;
0024
0025 class ElectronHcalHelper {
0026 public:
0027 struct Configuration {
0028
0029 double hOverEConeSize;
0030
0031
0032 bool onlyBehindCluster, checkHcalStatus;
0033
0034
0035 edm::EDGetTokenT<HBHERecHitCollection> hbheRecHits;
0036
0037 EgammaHcalIsolation::arrayHB eThresHB;
0038 int maxSeverityHB;
0039 EgammaHcalIsolation::arrayHE eThresHE;
0040 int maxSeverityHE;
0041 };
0042
0043 ElectronHcalHelper(const Configuration &cfg, edm::ConsumesCollector &&cc);
0044
0045 void beginEvent(const edm::Event &evt, const edm::EventSetup &eventSetup);
0046
0047 inline auto hcalTowersBehindClusters(const reco::SuperCluster &sc) const { return egamma::towersOf(sc, *towerMap_); }
0048 double hcalESum(const reco::SuperCluster &, int depth, const HcalPFCuts *hcalCuts) const;
0049 double hOverEConeSize() const { return cfg_.hOverEConeSize; }
0050 int maxSeverityHB() const { return cfg_.maxSeverityHB; }
0051 int maxSeverityHE() const { return cfg_.maxSeverityHE; }
0052 EgammaHcalIsolation::arrayHB eThresHB() const { return cfg_.eThresHB; }
0053 EgammaHcalIsolation::arrayHE eThresHE() const { return cfg_.eThresHE; }
0054
0055
0056 bool hasActiveHcal(const reco::SuperCluster &sc) const;
0057
0058
0059 const auto hcalTopology() const { return hcalTopology_; }
0060 const auto hcalChannelQuality() const { return hcalChannelQuality_; }
0061 const auto hcalSevLvlComputer() const { return hcalSevLvlComputer_; }
0062 const auto towerMap() const { return towerMap_; }
0063
0064 private:
0065 const Configuration cfg_;
0066
0067 edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeometryToken_;
0068 edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> hcalTopologyToken_;
0069 edm::ESGetToken<HcalChannelQuality, HcalChannelQualityRcd> hcalChannelQualityToken_;
0070 edm::ESGetToken<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd> hcalSevLvlComputerToken_;
0071 edm::ESGetToken<CaloTowerConstituentsMap, CaloGeometryRecord> towerMapToken_;
0072
0073
0074 std::unique_ptr<EgammaHcalIsolation> hcalIso_;
0075 HcalTopology const *hcalTopology_ = nullptr;
0076 HcalChannelQuality const *hcalChannelQuality_ = nullptr;
0077 HcalSeverityLevelComputer const *hcalSevLvlComputer_ = nullptr;
0078 CaloTowerConstituentsMap const *towerMap_ = nullptr;
0079 };
0080
0081 #endif