CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
photonIsolationHIProducer Class Reference
Inheritance diagram for photonIsolationHIProducer:
edm::stream::EDProducer<>

Public Member Functions

 photonIsolationHIProducer (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void produce (edm::Event &evt, const edm::EventSetup &es) override
 

Private Attributes

edm::EDGetTokenT< reco::BasicClusterCollectionbarrelClusters_
 
edm::EDGetTokenT< EcalRecHitCollectionbarrelEcalHits_
 
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_
 
edm::EDGetTokenT< reco::BasicClusterCollectionendcapClusters_
 
edm::EDGetTokenT< EcalRecHitCollectionendcapEcalHits_
 
const edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeometryToken_
 
edm::EDGetTokenT< HBHERecHitCollectionhbhe_
 
edm::EDGetTokenT< HFRecHitCollectionhf_
 
edm::EDGetTokenT< HORecHitCollectionho_
 
edm::EDGetTokenT< reco::PhotonCollectionphotonProducer_
 
std::string trackQuality_
 
edm::EDGetTokenT< reco::TrackCollectiontracks_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 23 of file photonIsolationHIProducer.cc.

Constructor & Destructor Documentation

◆ photonIsolationHIProducer()

photonIsolationHIProducer::photonIsolationHIProducer ( const edm::ParameterSet ps)
explicit

Definition at line 48 of file photonIsolationHIProducer.cc.

49  : photonProducer_(consumes(config.getParameter<edm::InputTag>("photonProducer"))),
50  barrelEcalHits_(consumes(config.getParameter<edm::InputTag>("ebRecHitCollection"))),
51  endcapEcalHits_(consumes(config.getParameter<edm::InputTag>("eeRecHitCollection"))),
52  hbhe_(consumes(config.getParameter<edm::InputTag>("hbhe"))),
53  hf_(consumes(config.getParameter<edm::InputTag>("hf"))),
54  ho_(consumes(config.getParameter<edm::InputTag>("ho"))),
55  barrelClusters_(consumes(config.getParameter<edm::InputTag>("basicClusterBarrel"))),
56  endcapClusters_(consumes(config.getParameter<edm::InputTag>("basicClusterEndcap"))),
57  tracks_(consumes(config.getParameter<edm::InputTag>("trackCollection"))),
58  ecalClusterToolsESGetTokens_{consumesCollector()},
60  trackQuality_(config.getParameter<std::string>("trackQuality")) {
61  produces<reco::HIPhotonIsolationMap>();
62 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::EDGetTokenT< HORecHitCollection > ho_
edm::EDGetTokenT< HBHERecHitCollection > hbhe_
edm::EDGetTokenT< reco::BasicClusterCollection > endcapClusters_
Definition: config.py:1
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
edm::EDGetTokenT< HFRecHitCollection > hf_
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
edm::EDGetTokenT< reco::BasicClusterCollection > barrelClusters_
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
edm::EDGetTokenT< reco::PhotonCollection > photonProducer_
edm::EDGetTokenT< reco::TrackCollection > tracks_
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_

Member Function Documentation

◆ fillDescriptions()

void photonIsolationHIProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 145 of file photonIsolationHIProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

145  {
147 
148  desc.add<edm::InputTag>("photonProducer", edm::InputTag("photons"));
149  desc.add<edm::InputTag>("ebRecHitCollection", edm::InputTag("ecalRecHit:EcalRecHitsEB"));
150  desc.add<edm::InputTag>("eeRecHitCollection", edm::InputTag("ecalRecHit:EcalRecHitsEE"));
151  desc.add<edm::InputTag>("hbhe", edm::InputTag("hbhereco"));
152  desc.add<edm::InputTag>("hf", edm::InputTag("hfreco"));
153  desc.add<edm::InputTag>("ho", edm::InputTag("horeco"));
154  desc.add<edm::InputTag>("basicClusterBarrel", edm::InputTag("islandBasicClusters:islandBarrelBasicClusters"));
155  desc.add<edm::InputTag>("basicClusterEndcap", edm::InputTag("islandBasicClusters:islandEndcapBasicClusters"));
156  desc.add<edm::InputTag>("trackCollection", edm::InputTag("hiGeneralTracks"));
157  desc.add<std::string>("trackQuality", "highPurity");
158 
159  descriptions.add("photonIsolationHIProducer", desc);
160 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void photonIsolationHIProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
overrideprivate

Definition at line 64 of file photonIsolationHIProducer.cc.

References HLT_2024v14_cff::barrelClusters, barrelClusters_, piZeroAnalyzer_cfi::barrelEcalHits, barrelEcalHits_, electrons_cff::eBottom, ecalClusterToolsESGetTokens_, electrons_cff::eLeft, cosmicPhotonAnalyzer_cfi::eMax, HLT_2024v14_cff::endcapClusters, endcapClusters_, piZeroAnalyzer_cfi::endcapEcalHits, endcapEcalHits_, electrons_cff::eRight, electrons_cff::eTop, trigObjTnPSource_cfi::filler, geometryToken_, EcalClusterLazyToolsBase::ESGetTokens::get(), EcalClusterIsoCalculator::getBkgSubEcalClusterIso(), HcalRechitIsoCalculator::getBkgSubHcalRechitIso(), TrackIsoCalculator::getBkgSubTrackIso(), edm::Event::getByToken(), edm::EventSetup::getHandle(), photonIsolationHIProducer_cfi::hbhe, hbhe_, Hcal_Conditions_forGlobalTag_cff::hf, hf_, Hcal_Conditions_forGlobalTag_cff::ho, ho_, genparticles_cff::iso, edm::ESHandleBase::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, eostools::move(), photonProducer_, BPHMonitor_cfi::photons, edm::ESHandle< T >::product(), edm::Event::put(), fileCollector::seed, hcalRecHitTable_cff::time, JetHT_cfg::trackCollection, trackQuality_, and tracks_.

64  {
72  evt.getByToken(hbhe_, hbhe);
74  evt.getByToken(hf_, hf);
76  evt.getByToken(ho_, ho);
83 
84  auto outputMap = std::make_unique<reco::HIPhotonIsolationMap>();
86  std::vector<reco::HIPhotonIsolation> isoVector;
87 
90  const CaloGeometry* geometry = nullptr;
91  if (geometryHandle.isValid()) {
92  geometry = geometryHandle.product();
93  }
97 
98  for (reco::PhotonCollection::const_iterator phoItr = photons->begin(); phoItr != photons->end(); ++phoItr) {
100  // HI-style isolation info
101  iso.ecalClusterIsoR1(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 1, 0));
102  iso.ecalClusterIsoR2(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 2, 0));
103  iso.ecalClusterIsoR3(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 3, 0));
104  iso.ecalClusterIsoR4(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 4, 0));
105  iso.ecalClusterIsoR5(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 5, 0));
106 
107  iso.hcalRechitIsoR1(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 1, 0));
108  iso.hcalRechitIsoR2(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 2, 0));
109  iso.hcalRechitIsoR3(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 3, 0));
110  iso.hcalRechitIsoR4(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 4, 0));
111  iso.hcalRechitIsoR5(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 5, 0));
112 
113  iso.trackIsoR1PtCut20(TxC.getBkgSubTrackIso(*phoItr, 1, 2));
114  iso.trackIsoR2PtCut20(TxC.getBkgSubTrackIso(*phoItr, 2, 2));
115  iso.trackIsoR3PtCut20(TxC.getBkgSubTrackIso(*phoItr, 3, 2));
116  iso.trackIsoR4PtCut20(TxC.getBkgSubTrackIso(*phoItr, 4, 2));
117  iso.trackIsoR5PtCut20(TxC.getBkgSubTrackIso(*phoItr, 5, 2));
118 
119  // ecal spike rejection info (seed timing)
120  const reco::CaloClusterPtr seed = phoItr->superCluster()->seed();
121  const DetId& id = lazyTool.getMaximum(*seed).first;
122  float time = -999.;
123  const EcalRecHitCollection& rechits = (phoItr->isEB() ? *barrelEcalHits : *endcapEcalHits);
124  EcalRecHitCollection::const_iterator it = rechits.find(id);
125  if (it != rechits.end()) {
126  time = it->time();
127  }
128  iso.seedTime(time);
129 
130  // ecal spike rejectino info (swiss cross)
131  float eMax = lazyTool.eMax(*seed);
132  float eRight = lazyTool.eRight(*seed);
133  float eLeft = lazyTool.eLeft(*seed);
134  float eTop = lazyTool.eTop(*seed);
135  float eBottom = lazyTool.eBottom(*seed);
136  iso.swissCrx(1 - (eRight + eLeft + eTop + eBottom) / eMax);
137 
138  isoVector.push_back(iso);
139  }
140  filler.insert(photons, isoVector.begin(), isoVector.end());
141  filler.fill();
142  evt.put(std::move(outputMap));
143 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::EDGetTokenT< HORecHitCollection > ho_
edm::EDGetTokenT< HBHERecHitCollection > hbhe_
std::vector< EcalRecHit >::const_iterator const_iterator
edm::EDGetTokenT< reco::BasicClusterCollection > endcapClusters_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:526
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometryToken_
ESData get(edm::EventSetup const &eventSetup) const
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< HFRecHitCollection > hf_
trackCollection
Definition: JetHT_cfg.py:51
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
bool isValid() const
Definition: ESHandle.h:44
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
Definition: DetId.h:17
edm::EDGetTokenT< reco::BasicClusterCollection > barrelClusters_
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
edm::EDGetTokenT< reco::PhotonCollection > photonProducer_
edm::EDGetTokenT< reco::TrackCollection > tracks_
def move(src, dest)
Definition: eostools.py:511
const EcalClusterLazyTools::ESGetTokens ecalClusterToolsESGetTokens_

Member Data Documentation

◆ barrelClusters_

edm::EDGetTokenT<reco::BasicClusterCollection> photonIsolationHIProducer::barrelClusters_
private

Definition at line 38 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ barrelEcalHits_

edm::EDGetTokenT<EcalRecHitCollection> photonIsolationHIProducer::barrelEcalHits_
private

Definition at line 33 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ ecalClusterToolsESGetTokens_

const EcalClusterLazyTools::ESGetTokens photonIsolationHIProducer::ecalClusterToolsESGetTokens_
private

Definition at line 42 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ endcapClusters_

edm::EDGetTokenT<reco::BasicClusterCollection> photonIsolationHIProducer::endcapClusters_
private

Definition at line 39 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ endcapEcalHits_

edm::EDGetTokenT<EcalRecHitCollection> photonIsolationHIProducer::endcapEcalHits_
private

Definition at line 34 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ geometryToken_

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> photonIsolationHIProducer::geometryToken_
private

Definition at line 43 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ hbhe_

edm::EDGetTokenT<HBHERecHitCollection> photonIsolationHIProducer::hbhe_
private

Definition at line 35 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ hf_

edm::EDGetTokenT<HFRecHitCollection> photonIsolationHIProducer::hf_
private

Definition at line 36 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ ho_

edm::EDGetTokenT<HORecHitCollection> photonIsolationHIProducer::ho_
private

Definition at line 37 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ photonProducer_

edm::EDGetTokenT<reco::PhotonCollection> photonIsolationHIProducer::photonProducer_
private

Definition at line 32 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ trackQuality_

std::string photonIsolationHIProducer::trackQuality_
private

Definition at line 45 of file photonIsolationHIProducer.cc.

Referenced by produce().

◆ tracks_

edm::EDGetTokenT<reco::TrackCollection> photonIsolationHIProducer::tracks_
private

Definition at line 40 of file photonIsolationHIProducer.cc.

Referenced by produce().