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)
 
 ~photonIsolationHIProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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_
 
edm::EDGetTokenT< reco::BasicClusterCollectionendcapClusters_
 
edm::EDGetTokenT< EcalRecHitCollectionendcapEcalHits_
 
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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 22 of file photonIsolationHIProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 45 of file photonIsolationHIProducer.cc.

46  : photonProducer_(consumes<reco::PhotonCollection>(config.getParameter<edm::InputTag>("photonProducer"))),
47  barrelEcalHits_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("ebRecHitCollection"))),
48  endcapEcalHits_(consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("eeRecHitCollection"))),
49  hbhe_(consumes<HBHERecHitCollection>(config.getParameter<edm::InputTag>("hbhe"))),
50  hf_(consumes<HFRecHitCollection>(config.getParameter<edm::InputTag>("hf"))),
51  ho_(consumes<HORecHitCollection>(config.getParameter<edm::InputTag>("ho"))),
52  barrelClusters_(consumes<reco::BasicClusterCollection>(config.getParameter<edm::InputTag>("basicClusterBarrel"))),
53  endcapClusters_(consumes<reco::BasicClusterCollection>(config.getParameter<edm::InputTag>("basicClusterEndcap"))),
54  tracks_(consumes<reco::TrackCollection>(config.getParameter<edm::InputTag>("trackCollection"))),
55  trackQuality_(config.getParameter<std::string>("trackQuality")) {
56  produces<reco::HIPhotonIsolationMap>();
57 }
edm::EDGetTokenT< HORecHitCollection > ho_
edm::EDGetTokenT< HBHERecHitCollection > hbhe_
edm::EDGetTokenT< reco::BasicClusterCollection > endcapClusters_
Definition: config.py:1
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_
photonIsolationHIProducer::~photonIsolationHIProducer ( )
override

Definition at line 59 of file photonIsolationHIProducer.cc.

59 {}

Member Function Documentation

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

Definition at line 137 of file photonIsolationHIProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, HLT_2018_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

137  {
139 
140  desc.add<edm::InputTag>("photonProducer", edm::InputTag("photons"));
141  desc.add<edm::InputTag>("ebRecHitCollection", edm::InputTag("ecalRecHit:EcalRecHitsEB"));
142  desc.add<edm::InputTag>("eeRecHitCollection", edm::InputTag("ecalRecHit:EcalRecHitsEE"));
143  desc.add<edm::InputTag>("hbhe", edm::InputTag("hbhereco"));
144  desc.add<edm::InputTag>("hf", edm::InputTag("hfreco"));
145  desc.add<edm::InputTag>("ho", edm::InputTag("horeco"));
146  desc.add<edm::InputTag>("basicClusterBarrel", edm::InputTag("islandBasicClusters:islandBarrelBasicClusters"));
147  desc.add<edm::InputTag>("basicClusterEndcap", edm::InputTag("islandBasicClusters:islandEndcapBasicClusters"));
148  desc.add<edm::InputTag>("trackCollection", edm::InputTag("hiGeneralTracks"));
149  desc.add<std::string>("trackQuality", "highPurity");
150 
151  descriptions.add("photonIsolationHIProducer", desc);
152 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void photonIsolationHIProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
overrideprivate

Definition at line 61 of file photonIsolationHIProducer.cc.

References HLT_2018_cff::barrelClusters, barrelClusters_, piZeroAnalyzer_cfi::barrelEcalHits, barrelEcalHits_, reco::HIPhotonIsolation::ecalClusterIsoR1(), reco::HIPhotonIsolation::ecalClusterIsoR2(), reco::HIPhotonIsolation::ecalClusterIsoR3(), reco::HIPhotonIsolation::ecalClusterIsoR4(), reco::HIPhotonIsolation::ecalClusterIsoR5(), cosmicPhotonAnalyzer_cfi::eMax, HLT_2018_cff::endcapClusters, endcapClusters_, piZeroAnalyzer_cfi::endcapEcalHits, endcapEcalHits_, trigObjTnPSource_cfi::filler, EcalClusterIsoCalculator::getBkgSubEcalClusterIso(), HcalRechitIsoCalculator::getBkgSubHcalRechitIso(), TrackIsoCalculator::getBkgSubTrackIso(), edm::Event::getByToken(), photonIsolationHIProducer_cfi::hbhe, hbhe_, reco::HIPhotonIsolation::hcalRechitIsoR1(), reco::HIPhotonIsolation::hcalRechitIsoR2(), reco::HIPhotonIsolation::hcalRechitIsoR3(), reco::HIPhotonIsolation::hcalRechitIsoR4(), reco::HIPhotonIsolation::hcalRechitIsoR5(), photonIsolationHIProducer_cfi::hf, hf_, photonIsolationHIProducer_cfi::ho, ho_, eostools::move(), photonProducer_, BPHMonitor_cfi::photons, edm::Event::put(), TrackInfoProducer_cfi::rechits, SurveyInfoScenario_cff::seed, reco::HIPhotonIsolation::seedTime(), reco::HIPhotonIsolation::swissCrx(), ntuplemaker::time, duplicaterechits_cfi::trackCollection, reco::HIPhotonIsolation::trackIsoR1PtCut20(), reco::HIPhotonIsolation::trackIsoR2PtCut20(), reco::HIPhotonIsolation::trackIsoR3PtCut20(), reco::HIPhotonIsolation::trackIsoR4PtCut20(), reco::HIPhotonIsolation::trackIsoR5PtCut20(), trackQuality_, and tracks_.

61  {
63  evt.getByToken(photonProducer_, photons);
65  evt.getByToken(barrelEcalHits_, barrelEcalHits);
67  evt.getByToken(endcapEcalHits_, endcapEcalHits);
69  evt.getByToken(hbhe_, hbhe);
71  evt.getByToken(hf_, hf);
73  evt.getByToken(ho_, ho);
75  evt.getByToken(barrelClusters_, barrelClusters);
77  evt.getByToken(endcapClusters_, endcapClusters);
79  evt.getByToken(tracks_, trackCollection);
80 
81  auto outputMap = std::make_unique<reco::HIPhotonIsolationMap>();
83  std::vector<reco::HIPhotonIsolation> isoVector;
84 
85  EcalClusterIsoCalculator CxC(evt, es, barrelClusters, endcapClusters);
86  HcalRechitIsoCalculator RxC(evt, es, hbhe, hf, ho);
87  TrackIsoCalculator TxC(evt, es, trackCollection, trackQuality_);
89 
90  for (reco::PhotonCollection::const_iterator phoItr = photons->begin(); phoItr != photons->end(); ++phoItr) {
92  // HI-style isolation info
93  iso.ecalClusterIsoR1(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 1, 0));
94  iso.ecalClusterIsoR2(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 2, 0));
95  iso.ecalClusterIsoR3(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 3, 0));
96  iso.ecalClusterIsoR4(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 4, 0));
97  iso.ecalClusterIsoR5(CxC.getBkgSubEcalClusterIso(phoItr->superCluster(), 5, 0));
98 
99  iso.hcalRechitIsoR1(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 1, 0));
100  iso.hcalRechitIsoR2(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 2, 0));
101  iso.hcalRechitIsoR3(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 3, 0));
102  iso.hcalRechitIsoR4(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 4, 0));
103  iso.hcalRechitIsoR5(RxC.getBkgSubHcalRechitIso(phoItr->superCluster(), 5, 0));
104 
105  iso.trackIsoR1PtCut20(TxC.getBkgSubTrackIso(*phoItr, 1, 2));
106  iso.trackIsoR2PtCut20(TxC.getBkgSubTrackIso(*phoItr, 2, 2));
107  iso.trackIsoR3PtCut20(TxC.getBkgSubTrackIso(*phoItr, 3, 2));
108  iso.trackIsoR4PtCut20(TxC.getBkgSubTrackIso(*phoItr, 4, 2));
109  iso.trackIsoR5PtCut20(TxC.getBkgSubTrackIso(*phoItr, 5, 2));
110 
111  // ecal spike rejection info (seed timing)
112  const reco::CaloClusterPtr seed = phoItr->superCluster()->seed();
113  const DetId& id = lazyTool.getMaximum(*seed).first;
114  float time = -999.;
115  const EcalRecHitCollection& rechits = (phoItr->isEB() ? *barrelEcalHits : *endcapEcalHits);
117  if (it != rechits.end()) {
118  time = it->time();
119  }
120  iso.seedTime(time);
121 
122  // ecal spike rejectino info (swiss cross)
123  float eMax = lazyTool.eMax(*seed);
124  float eRight = lazyTool.eRight(*seed);
125  float eLeft = lazyTool.eLeft(*seed);
126  float eTop = lazyTool.eTop(*seed);
127  float eBottom = lazyTool.eBottom(*seed);
128  iso.swissCrx(1 - (eRight + eLeft + eTop + eBottom) / eMax);
129 
130  isoVector.push_back(iso);
131  }
132  filler.insert(photons, isoVector.begin(), isoVector.end());
133  filler.fill();
134  evt.put(std::move(outputMap));
135 }
float hcalRechitIsoR1() const
Rechit-based isolation (HCAL) R = 0.1.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
edm::EDGetTokenT< HORecHitCollection > ho_
edm::EDGetTokenT< HBHERecHitCollection > hbhe_
float ecalClusterIsoR1() const
Cluster-based isolation (ECAL) R = 0.1.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
std::vector< EcalRecHit >::const_iterator const_iterator
edm::EDGetTokenT< reco::BasicClusterCollection > endcapClusters_
float seedTime() const
Ecal rechit seed time.
float hcalRechitIsoR3() const
Rechit-based isolation (HCAL) R = 0.3.
float ecalClusterIsoR4() const
Cluster-based isolation (ECAL) R = 0.4.
float hcalRechitIsoR4() const
Rechit-based isolation (HCAL) R = 0.4.
edm::EDGetTokenT< HFRecHitCollection > hf_
float trackIsoR5PtCut20() const
Track-based isolation, pt>2.0GeV, R = 0.5.
float ecalClusterIsoR5() const
Cluster-based isolation (ECAL) R = 0.5.
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
Definition: DetId.h:17
float ecalClusterIsoR2() const
Cluster-based isolation (ECAL) R = 0.2.
edm::EDGetTokenT< reco::BasicClusterCollection > barrelClusters_
float hcalRechitIsoR5() const
Rechit-based isolation (HCAL) R = 0.5.
float hcalRechitIsoR2() const
Rechit-based isolation (HCAL) R = 0.2.
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
float trackIsoR1PtCut20() const
Track-based isolation, pt>2.0GeV, R = 0.1.
float swissCrx() const
SwissCross crystal ratio.
float trackIsoR4PtCut20() const
Track-based isolation, pt>2.0GeV, R = 0.4.
edm::EDGetTokenT< reco::PhotonCollection > photonProducer_
float trackIsoR2PtCut20() const
Track-based isolation, pt>2.0GeV, R = 0.2.
float trackIsoR3PtCut20() const
Track-based isolation, pt>2.0GeV, R = 0.3.
float ecalClusterIsoR3() const
Cluster-based isolation (ECAL) R = 0.3.
edm::EDGetTokenT< reco::TrackCollection > tracks_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 38 of file photonIsolationHIProducer.cc.

Referenced by produce().

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

Definition at line 33 of file photonIsolationHIProducer.cc.

Referenced by produce().

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

Definition at line 39 of file photonIsolationHIProducer.cc.

Referenced by produce().

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

Definition at line 34 of file photonIsolationHIProducer.cc.

Referenced by produce().

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

Definition at line 35 of file photonIsolationHIProducer.cc.

Referenced by produce().

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

Definition at line 36 of file photonIsolationHIProducer.cc.

Referenced by produce().

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

Definition at line 37 of file photonIsolationHIProducer.cc.

Referenced by produce().

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

Definition at line 32 of file photonIsolationHIProducer.cc.

Referenced by produce().

std::string photonIsolationHIProducer::trackQuality_
private

Definition at line 42 of file photonIsolationHIProducer.cc.

Referenced by produce().

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

Definition at line 40 of file photonIsolationHIProducer.cc.

Referenced by produce().