CMS 3D CMS Logo

GEDPhotonProducer.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <vector>
3 #include <memory>
4 
8 
10 
15 
23 
26 
29 
32 
35 
36 namespace {
37  inline double ptFast(const double energy, const math::XYZPoint& position, const math::XYZPoint& origin) {
38  const auto v = position - origin;
39  return energy * std::sqrt(v.perp2() / v.mag2());
40  }
41 } // namespace
42 
44  if (step == "final")
45  flags_ = kFinal;
46  else if (step == "oot")
47  flags_ = kOOT;
48  else if (step == "ootfinal")
49  flags_ = (kOOT | kFinal);
50  else if (step == "tmp")
51  flags_ = 0;
52  else {
53  throw cms::Exception("InvalidConfig")
54  << " reconstructStep " << step << " is invalid, the options are: tmp, final,oot or ootfinal" << std::endl;
55  }
56 }
57 
59  : ecalClusterESGetTokens_{consumesCollector()},
60  recoStep_(config.getParameter<std::string>("reconstructionStep")),
61  conf_(config) {
62  // use configuration file to setup input/output collection names
63  //
64  photonProducer_ = conf_.getParameter<edm::InputTag>("photonProducer");
65 
66  if (recoStep_.isFinal()) {
67  photonProducerT_ = consumes<reco::PhotonCollection>(photonProducer_);
68  pfCandidates_ = consumes<reco::PFCandidateCollection>(conf_.getParameter<edm::InputTag>("pfCandidates"));
69 
70  const edm::ParameterSet& pfIsolCfg = conf_.getParameter<edm::ParameterSet>("pfIsolCfg");
71  auto getVMToken = [&pfIsolCfg, this](const std::string& name) {
72  return consumes<edm::ValueMap<float>>(pfIsolCfg.getParameter<edm::InputTag>(name));
73  };
74  phoChargedIsolationToken_ = getVMToken("chargedHadronIso");
75  phoNeutralHadronIsolationToken_ = getVMToken("neutralHadronIso");
76  phoPhotonIsolationToken_ = getVMToken("photonIso");
77  phoChargedWorstVtxIsoToken_ = getVMToken("chargedHadronWorstVtxIso");
78  phoChargedWorstVtxGeomVetoIsoToken_ = getVMToken("chargedHadronWorstVtxGeomVetoIso");
79  phoChargedPFPVIsoToken_ = getVMToken("chargedHadronPFPVIso");
80 
81  //OOT photons in legacy 80X re-miniAOD do not have PF cluster embeded into the reco object
82  //to preserve 80X behaviour
83  if (conf_.exists("pfECALClusIsolation")) {
84  phoPFECALClusIsolationToken_ =
85  consumes<edm::ValueMap<float>>(conf_.getParameter<edm::InputTag>("pfECALClusIsolation"));
86  }
87  if (conf_.exists("pfHCALClusIsolation")) {
88  phoPFHCALClusIsolationToken_ =
89  consumes<edm::ValueMap<float>>(conf_.getParameter<edm::InputTag>("pfHCALClusIsolation"));
90  }
91  } else {
92  photonCoreProducerT_ = consumes<reco::PhotonCoreCollection>(photonProducer_);
93  }
94 
95  auto pfEg = conf_.getParameter<edm::InputTag>("pfEgammaCandidates");
96  if (not pfEg.label().empty())
97  pfEgammaCandidates_ = consumes<reco::PFCandidateCollection>(pfEg);
98  barrelEcalHits_ = consumes<EcalRecHitCollection>(conf_.getParameter<edm::InputTag>("barrelEcalHits"));
99  endcapEcalHits_ = consumes<EcalRecHitCollection>(conf_.getParameter<edm::InputTag>("endcapEcalHits"));
100  preshowerHits_ = consumes<EcalRecHitCollection>(conf_.getParameter<edm::InputTag>("preshowerHits"));
101  vertexProducer_ = consumes<reco::VertexCollection>(conf_.getParameter<edm::InputTag>("primaryVertexProducer"));
102 
103  auto hcTow = conf_.getParameter<edm::InputTag>("hcalTowers");
104  if (not hcTow.label().empty())
105  hcalTowers_ = consumes<CaloTowerCollection>(hcTow);
106  //
107  photonCollection_ = conf_.getParameter<std::string>("outputPhotonCollection");
108  hOverEConeSize_ = conf_.getParameter<double>("hOverEConeSize");
109  highEt_ = conf_.getParameter<double>("highEt");
110  // R9 value to decide converted/unconverted
111  minR9Barrel_ = conf_.getParameter<double>("minR9Barrel");
112  minR9Endcap_ = conf_.getParameter<double>("minR9Endcap");
113  usePrimaryVertex_ = conf_.getParameter<bool>("usePrimaryVertex");
114  runMIPTagger_ = conf_.getParameter<bool>("runMIPTagger");
115 
116  candidateP4type_ = config.getParameter<std::string>("candidateP4type");
117  valueMapPFCandPhoton_ = config.getParameter<std::string>("valueMapPhotons");
118 
119  edm::ParameterSet posCalcParameters = config.getParameter<edm::ParameterSet>("posCalcParameters");
120  posCalculator_ = PositionCalc(posCalcParameters);
121 
122  //AA
123  //Flags and Severities to be excluded from photon calculations
124  const std::vector<std::string> flagnamesEB =
125  config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEB");
126 
127  const std::vector<std::string> flagnamesEE =
128  config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEE");
129 
130  flagsexclEB_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
131 
132  flagsexclEE_ = StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
133 
134  const std::vector<std::string> severitynamesEB =
135  config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEB");
136 
137  severitiesexclEB_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
138 
139  const std::vector<std::string> severitynamesEE =
140  config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEE");
141 
142  severitiesexclEE_ = StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
143 
144  thePhotonEnergyCorrector_ = new PhotonEnergyCorrector(conf_, consumesCollector());
145 
146  //AA
147 
148  //
149 
150  // Parameters for the position calculation:
151  // std::map<std::string,double> providedParameters;
152  // providedParameters.insert(std::make_pair("LogWeighted",conf_.getParameter<bool>("posCalc_logweight")));
153  //providedParameters.insert(std::make_pair("T0_barl",conf_.getParameter<double>("posCalc_t0_barl")));
154  //providedParameters.insert(std::make_pair("T0_endc",conf_.getParameter<double>("posCalc_t0_endc")));
155  //providedParameters.insert(std::make_pair("T0_endcPresh",conf_.getParameter<double>("posCalc_t0_endcPresh")));
156  //providedParameters.insert(std::make_pair("W0",conf_.getParameter<double>("posCalc_w0")));
157  //providedParameters.insert(std::make_pair("X0",conf_.getParameter<double>("posCalc_x0")));
158  //posCalculator_ = PositionCalc(providedParameters);
159  // cut values for pre-selection
160  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("minSCEtBarrel"));
161  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("maxHoverEBarrel"));
162  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("ecalRecHitSumEtOffsetBarrel"));
163  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("ecalRecHitSumEtSlopeBarrel"));
164  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("hcalTowerSumEtOffsetBarrel"));
165  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("hcalTowerSumEtSlopeBarrel"));
166  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("nTrackSolidConeBarrel"));
167  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("nTrackHollowConeBarrel"));
168  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("trackPtSumSolidConeBarrel"));
169  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("trackPtSumHollowConeBarrel"));
170  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("sigmaIetaIetaCutBarrel"));
171  //
172  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("minSCEtEndcap"));
173  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("maxHoverEEndcap"));
174  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("ecalRecHitSumEtOffsetEndcap"));
175  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("ecalRecHitSumEtSlopeEndcap"));
176  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("hcalTowerSumEtOffsetEndcap"));
177  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("hcalTowerSumEtSlopeEndcap"));
178  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("nTrackSolidConeEndcap"));
179  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("nTrackHollowConeEndcap"));
180  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("trackPtSumSolidConeEndcap"));
181  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("trackPtSumHollowConeEndcap"));
182  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("sigmaIetaIetaCutEndcap"));
183  //
184 
185  //moved from beginRun to here, I dont see how this could cause harm as its just reading in the exactly same parameters each run
186  if (!recoStep_.isFinal()) {
187  thePhotonIsolationCalculator_ = new PhotonIsolationCalculator();
188  edm::ParameterSet isolationSumsCalculatorSet = conf_.getParameter<edm::ParameterSet>("isolationSumsCalculatorSet");
189  thePhotonIsolationCalculator_->setup(isolationSumsCalculatorSet,
190  flagsexclEB_,
191  flagsexclEE_,
192  severitiesexclEB_,
193  severitiesexclEE_,
194  consumesCollector());
195  thePhotonMIPHaloTagger_ = new PhotonMIPHaloTagger();
196  edm::ParameterSet mipVariableSet = conf_.getParameter<edm::ParameterSet>("mipVariableSet");
197  thePhotonMIPHaloTagger_->setup(mipVariableSet, consumesCollector());
198 
199  } else {
200  thePhotonIsolationCalculator_ = nullptr;
201  thePhotonMIPHaloTagger_ = nullptr;
202  }
203 
204  checkHcalStatus_ = conf_.getParameter<bool>("checkHcalStatus");
205 
206  // Register the product
207  produces<reco::PhotonCollection>(photonCollection_);
208  if (not pfEgammaCandidates_.isUninitialized())
209  produces<edm::ValueMap<reco::PhotonRef>>(valueMapPFCandPhoton_);
210 }
211 
216  //delete energyCorrectionF;
217 }
218 
219 void GEDPhotonProducer::beginRun(edm::Run const& r, edm::EventSetup const& theEventSetup) {
220  if (!recoStep_.isFinal()) {
221  thePhotonEnergyCorrector_->init(theEventSetup);
222  }
223 }
224 
225 void GEDPhotonProducer::endRun(edm::Run const& r, edm::EventSetup const& theEventSetup) {}
226 
227 void GEDPhotonProducer::produce(edm::Event& theEvent, const edm::EventSetup& theEventSetup) {
228  using namespace edm;
229  // nEvt_++;
230 
232  auto outputPhotonCollection_p = std::make_unique<reco::PhotonCollection>();
233  edm::ValueMap<reco::PhotonRef> pfEGCandToPhotonMap;
234 
235  // Get the PhotonCore collection
236  bool validPhotonCoreHandle = false;
237  Handle<reco::PhotonCoreCollection> photonCoreHandle;
238  bool validPhotonHandle = false;
239  Handle<reco::PhotonCollection> photonHandle;
240  //value maps for isolation
241  edm::Handle<edm::ValueMap<float>> phoChargedIsolationMap;
242  edm::Handle<edm::ValueMap<float>> phoNeutralHadronIsolationMap;
243  edm::Handle<edm::ValueMap<float>> phoPhotonIsolationMap;
244  edm::Handle<edm::ValueMap<float>> phoChargedWorstVtxIsoMap;
245  edm::Handle<edm::ValueMap<float>> phoChargedWorstVtxGeomVetoIsoMap;
246  edm::Handle<edm::ValueMap<float>> phoChargedPFPVIsoMap;
247 
248  edm::Handle<edm::ValueMap<float>> phoPFECALClusIsolationMap;
249  edm::Handle<edm::ValueMap<float>> phoPFHCALClusIsolationMap;
250 
251  if (recoStep_.isFinal()) {
252  theEvent.getByToken(photonProducerT_, photonHandle);
253  //get isolation objects
254  theEvent.getByToken(phoChargedIsolationToken_, phoChargedIsolationMap);
255  theEvent.getByToken(phoNeutralHadronIsolationToken_, phoNeutralHadronIsolationMap);
256  theEvent.getByToken(phoPhotonIsolationToken_, phoPhotonIsolationMap);
257  theEvent.getByToken(phoChargedWorstVtxIsoToken_, phoChargedWorstVtxIsoMap);
258  theEvent.getByToken(phoChargedWorstVtxGeomVetoIsoToken_, phoChargedWorstVtxGeomVetoIsoMap);
259  theEvent.getByToken(phoChargedPFPVIsoToken_, phoChargedPFPVIsoMap);
260 
261  //OOT photons in legacy 80X re-miniAOD workflow dont have cluster isolation embed in them
263  theEvent.getByToken(phoPFECALClusIsolationToken_, phoPFECALClusIsolationMap);
264  }
266  theEvent.getByToken(phoPFHCALClusIsolationToken_, phoPFHCALClusIsolationMap);
267  }
268 
269  if (photonHandle.isValid()) {
270  validPhotonHandle = true;
271  } else {
272  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the product " << photonProducer_.label() << "\n";
273  }
274  } else {
275  theEvent.getByToken(photonCoreProducerT_, photonCoreHandle);
276  if (photonCoreHandle.isValid()) {
277  validPhotonCoreHandle = true;
278  } else {
279  throw cms::Exception("GEDPhotonProducer")
280  << "Error! Can't get the photonCoreProducer " << photonProducer_.label() << "\n";
281  }
282  }
283 
284  // Get EcalRecHits
285  bool validEcalRecHits = true;
286  Handle<EcalRecHitCollection> barrelHitHandle;
287  const EcalRecHitCollection dummyEB;
288  theEvent.getByToken(barrelEcalHits_, barrelHitHandle);
289  if (!barrelHitHandle.isValid()) {
290  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the barrelEcalHits";
291  }
292  const EcalRecHitCollection& barrelRecHits(validEcalRecHits ? *(barrelHitHandle.product()) : dummyEB);
293 
294  Handle<EcalRecHitCollection> endcapHitHandle;
295  theEvent.getByToken(endcapEcalHits_, endcapHitHandle);
296  const EcalRecHitCollection dummyEE;
297  if (!endcapHitHandle.isValid()) {
298  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the endcapEcalHits";
299  }
300  const EcalRecHitCollection& endcapRecHits(validEcalRecHits ? *(endcapHitHandle.product()) : dummyEE);
301 
302  bool validPreshowerRecHits = true;
303  Handle<EcalRecHitCollection> preshowerHitHandle;
304  theEvent.getByToken(preshowerHits_, preshowerHitHandle);
305  EcalRecHitCollection preshowerRecHits;
306  if (!preshowerHitHandle.isValid()) {
307  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the preshowerEcalHits";
308  }
309  if (validPreshowerRecHits)
310  preshowerRecHits = *(preshowerHitHandle.product());
311 
312  Handle<reco::PFCandidateCollection> pfEGCandidateHandle;
313  // Get the PF refined cluster collection
315  theEvent.getByToken(pfEgammaCandidates_, pfEGCandidateHandle);
316  if (!pfEGCandidateHandle.isValid()) {
317  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the pfEgammaCandidates";
318  }
319  }
320 
321  Handle<reco::PFCandidateCollection> pfCandidateHandle;
322 
323  if (recoStep_.isFinal()) {
324  // Get the PF candidates collection
325  theEvent.getByToken(pfCandidates_, pfCandidateHandle);
326  //OOT photons have no PF candidates so its not an error in this case
327  if (!pfCandidateHandle.isValid() && !recoStep_.isOOT()) {
328  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the pfCandidates";
329  }
330  }
331 
332  //AA
333  //Get the severity level object
335  theEventSetup.get<EcalSeverityLevelAlgoRcd>().get(sevLv);
336  //
337 
338  // get Hcal towers collection
339  CaloTowerCollection const* hcalTowers = nullptr;
340  if (not hcalTowers_.isUninitialized()) {
341  Handle<CaloTowerCollection> hcalTowersHandle;
342  theEvent.getByToken(hcalTowers_, hcalTowersHandle);
343  hcalTowers = &(*hcalTowersHandle);
344  }
345 
346  // get the geometry from the event setup:
347  theEventSetup.get<CaloGeometryRecord>().get(theCaloGeom_);
348 
349  //
350  // update energy correction function
351  // energyCorrectionF->init(theEventSetup);
352 
353  edm::ESHandle<CaloTopology> pTopology;
354  theEventSetup.get<CaloTopologyRecord>().get(theCaloTopo_);
356 
357  // Get the primary event vertex
358  Handle<reco::VertexCollection> vertexHandle;
359  const reco::VertexCollection dummyVC;
360  bool validVertex = true;
361  if (usePrimaryVertex_) {
362  theEvent.getByToken(vertexProducer_, vertexHandle);
363  if (!vertexHandle.isValid()) {
364  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the product primary Vertex Collection";
365  }
366  }
367  const reco::VertexCollection& vertexCollection(usePrimaryVertex_ && validVertex ? *(vertexHandle.product())
368  : dummyVC);
369 
370  // math::XYZPoint vtx(0.,0.,0.);
371  //if (vertexCollection.size()>0) vtx = vertexCollection.begin()->position();
372 
373  // get the regression calculator ready
374  thePhotonEnergyCorrector_->init(theEventSetup);
376  thePhotonEnergyCorrector_->gedRegression()->setEvent(theEvent);
377  thePhotonEnergyCorrector_->gedRegression()->setEventContent(theEventSetup);
378  }
379 
380  int iSC = 0; // index in photon collection
381  // Loop over barrel and endcap SC collections and fill the photon collection
382  if (validPhotonCoreHandle)
383  fillPhotonCollection(theEvent,
384  theEventSetup,
385  photonCoreHandle,
386  topology,
387  &barrelRecHits,
388  &endcapRecHits,
389  &preshowerRecHits,
390  hcalTowers,
391  //vtx,
394  iSC);
395 
396  iSC = 0;
397  if (validPhotonHandle && recoStep_.isFinal())
398  fillPhotonCollection(theEvent,
399  theEventSetup,
400  photonHandle,
401  pfCandidateHandle,
402  pfEGCandidateHandle,
403  pfEGCandToPhotonMap,
404  vertexHandle,
406  iSC,
407  phoChargedIsolationMap,
408  phoNeutralHadronIsolationMap,
409  phoPhotonIsolationMap,
410  phoChargedWorstVtxIsoMap,
411  phoChargedWorstVtxGeomVetoIsoMap,
412  phoChargedPFPVIsoMap,
413  phoPFECALClusIsolationMap,
414  phoPFHCALClusIsolationMap);
415 
416  // put the product in the event
417  edm::LogInfo("GEDPhotonProducer") << " Put in the event " << iSC << " Photon Candidates \n";
418  outputPhotonCollection_p->assign(outputPhotonCollection.begin(), outputPhotonCollection.end());
419  const edm::OrphanHandle<reco::PhotonCollection> photonOrphHandle =
420  theEvent.put(std::move(outputPhotonCollection_p), photonCollection_);
421 
424  auto pfEGCandToPhotonMap_p = std::make_unique<edm::ValueMap<reco::PhotonRef>>();
425  edm::ValueMap<reco::PhotonRef>::Filler filler(*pfEGCandToPhotonMap_p);
426  unsigned nObj = pfEGCandidateHandle->size();
427  std::vector<reco::PhotonRef> values(nObj);
429  for (unsigned int lCand = 0; lCand < nObj; lCand++) {
430  reco::PFCandidateRef pfCandRef(reco::PFCandidateRef(pfEGCandidateHandle, lCand));
431  reco::SuperClusterRef pfScRef = pfCandRef->superClusterRef();
432 
433  for (unsigned int lSC = 0; lSC < photonOrphHandle->size(); lSC++) {
434  reco::PhotonRef photonRef(reco::PhotonRef(photonOrphHandle, lSC));
435  reco::SuperClusterRef scRef = photonRef->superCluster();
436  if (pfScRef != scRef)
437  continue;
438  values[lCand] = photonRef;
439  }
440  }
441 
442  filler.insert(pfEGCandidateHandle, values.begin(), values.end());
443  filler.fill();
444  theEvent.put(std::move(pfEGCandToPhotonMap_p), valueMapPFCandPhoton_);
445  }
446 }
447 
449  edm::EventSetup const& es,
450  const edm::Handle<reco::PhotonCoreCollection>& photonCoreHandle,
451  const CaloTopology* topology,
452  const EcalRecHitCollection* ecalBarrelHits,
453  const EcalRecHitCollection* ecalEndcapHits,
458  int& iSC) {
460  const EcalRecHitCollection* hits = nullptr;
461  std::vector<double> preselCutValues;
462  std::vector<int> flags_, severitiesexcl_;
463 
464  for (unsigned int lSC = 0; lSC < photonCoreHandle->size(); lSC++) {
465  reco::PhotonCoreRef coreRef(reco::PhotonCoreRef(photonCoreHandle, lSC));
466  reco::SuperClusterRef parentSCRef = coreRef->parentSuperCluster();
467  reco::SuperClusterRef scRef = coreRef->superCluster();
468 
469  // const reco::SuperCluster* pClus=&(*scRef);
470  iSC++;
471 
472  DetId::Detector thedet = scRef->seed()->hitsAndFractions()[0].first.det();
473  int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
474  if (subdet == EcalBarrel) {
475  preselCutValues = preselCutValuesBarrel_;
476  hits = ecalBarrelHits;
477  flags_ = flagsexclEB_;
478  severitiesexcl_ = severitiesexclEB_;
479  } else if (subdet == EcalEndcap) {
480  preselCutValues = preselCutValuesEndcap_;
481  hits = ecalEndcapHits;
482  flags_ = flagsexclEE_;
483  severitiesexcl_ = severitiesexclEE_;
484  } else if (EcalTools::isHGCalDet(thedet)) {
485  preselCutValues = preselCutValuesEndcap_;
486  hits = nullptr;
487  flags_ = flagsexclEE_;
488  severitiesexcl_ = severitiesexclEE_;
489  } else {
490  edm::LogWarning("") << "GEDPhotonProducer: do not know if it is a barrel or endcap SuperCluster: " << thedet
491  << ' ' << subdet;
492  }
493 
494  // SC energy preselection
495  if (parentSCRef.isNonnull() &&
496  ptFast(parentSCRef->energy(), parentSCRef->position(), math::XYZPoint(0, 0, 0)) <= preselCutValues[0])
497  continue;
498  // calculate HoE
499 
500  double HoE1, HoE2;
501  HoE1 = HoE2 = 0.;
502 
503  std::vector<CaloTowerDetId> TowersBehindClus;
504  float hcalDepth1OverEcalBc, hcalDepth2OverEcalBc;
505  hcalDepth1OverEcalBc = hcalDepth2OverEcalBc = 0.f;
506  bool invalidHcal = false;
507 
508  if (not hcalTowers_.isUninitialized()) {
509  EgammaTowerIsolation towerIso1(hOverEConeSize_, 0., 0., 1, hcalTowers);
510  EgammaTowerIsolation towerIso2(hOverEConeSize_, 0., 0., 2, hcalTowers);
511  HoE1 = towerIso1.getTowerESum(&(*scRef)) / scRef->energy();
512  HoE2 = towerIso2.getTowerESum(&(*scRef)) / scRef->energy();
513 
515  es.get<CaloGeometryRecord>().get(ctmaph);
516 
518  es.get<HcalChannelQualityRcd>().get("withTopo", hcalQuality);
519 
520  edm::ESHandle<HcalTopology> hcalTopology;
521  es.get<HcalRecNumberingRecord>().get(hcalTopology);
522 
523  TowersBehindClus = egamma::towersOf(*scRef, *ctmaph);
524  hcalDepth1OverEcalBc = egamma::depth1HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy();
525  hcalDepth2OverEcalBc = egamma::depth2HcalESum(TowersBehindClus, *hcalTowers) / scRef->energy();
526 
527  if (checkHcalStatus_ && hcalDepth1OverEcalBc == 0 && hcalDepth2OverEcalBc == 0) {
528  invalidHcal = !egamma::hasActiveHcal(TowersBehindClus, *ctmaph, *hcalQuality, *hcalTopology);
529  }
530  }
531 
532  // std::cout << " GEDPhotonProducer calculation of HoE with towers in a cone " << HoE1 << " " << HoE2 << std::endl;
533  //std::cout << " GEDPhotonProducer calcualtion of HoE with towers behind the BCs " << hcalDepth1OverEcalBc << " " << hcalDepth2OverEcalBc << std::endl;
534 
535  float maxXtal = (hits != nullptr ? EcalClusterTools::eMax(*(scRef->seed()), &(*hits)) : 0.f);
536  //AA
537  //Change these to consider severity level of hits
538  float e1x5 = (hits != nullptr ? EcalClusterTools::e1x5(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
539  float e2x5 = (hits != nullptr ? EcalClusterTools::e2x5Max(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
540  float e3x3 = (hits != nullptr ? EcalClusterTools::e3x3(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
541  float e5x5 = (hits != nullptr ? EcalClusterTools::e5x5(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
542  std::vector<float> cov =
543  (hits != nullptr ? EcalClusterTools::covariances(*(scRef->seed()), &(*hits), &(*topology), geometry)
544  : std::vector<float>({0.f, 0.f, 0.f}));
545  std::vector<float> locCov =
546  (hits != nullptr ? EcalClusterTools::localCovariances(*(scRef->seed()), &(*hits), &(*topology))
547  : std::vector<float>({0.f, 0.f, 0.f}));
548 
549  float sigmaEtaEta = sqrt(cov[0]);
550  float sigmaIetaIeta = sqrt(locCov[0]);
551 
552  float full5x5_maxXtal = (hits != nullptr ? noZS::EcalClusterTools::eMax(*(scRef->seed()), &(*hits)) : 0.f);
553  //AA
554  //Change these to consider severity level of hits
555  float full5x5_e1x5 =
556  (hits != nullptr ? noZS::EcalClusterTools::e1x5(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
557  float full5x5_e2x5 =
558  (hits != nullptr ? noZS::EcalClusterTools::e2x5Max(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
559  float full5x5_e3x3 =
560  (hits != nullptr ? noZS::EcalClusterTools::e3x3(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
561  float full5x5_e5x5 =
562  (hits != nullptr ? noZS::EcalClusterTools::e5x5(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
563  std::vector<float> full5x5_cov =
564  (hits != nullptr ? noZS::EcalClusterTools::covariances(*(scRef->seed()), &(*hits), &(*topology), geometry)
565  : std::vector<float>({0.f, 0.f, 0.f}));
566  std::vector<float> full5x5_locCov =
567  (hits != nullptr ? noZS::EcalClusterTools::localCovariances(*(scRef->seed()), &(*hits), &(*topology))
568  : std::vector<float>({0.f, 0.f, 0.f}));
569 
570  float full5x5_sigmaEtaEta = sqrt(full5x5_cov[0]);
571  float full5x5_sigmaIetaIeta = sqrt(full5x5_locCov[0]);
572 
573  // compute position of ECAL shower
574  math::XYZPoint caloPosition = scRef->position();
575 
577  double photonEnergy = 1.;
578  math::XYZPoint vtx(0., 0., 0.);
579  if (!vertexCollection.empty())
580  vtx = vertexCollection.begin()->position();
581  // compute momentum vector of photon from primary vertex and cluster position
582  math::XYZVector direction = caloPosition - vtx;
583  //math::XYZVector momentum = direction.unit() * photonEnergy ;
584  math::XYZVector momentum = direction.unit();
585 
586  // Create dummy candidate with unit momentum and zero energy to allow setting of all variables. The energy is set for last.
587  math::XYZTLorentzVectorD p4(momentum.x(), momentum.y(), momentum.z(), photonEnergy);
588  reco::Photon newCandidate(p4, caloPosition, coreRef, vtx);
589 
590  //std::cout << " standard p4 before " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
591  //std::cout << " type " <<newCandidate.getCandidateP4type() << " standard p4 after " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
592 
593  // Calculate fiducial flags and isolation variable. Blocked are filled from the isolationCalculator
594  reco::Photon::FiducialFlags fiducialFlags;
595  reco::Photon::IsolationVariables isolVarR03, isolVarR04;
596  if (!EcalTools::isHGCalDet(thedet)) {
597  thePhotonIsolationCalculator_->calculate(&newCandidate, evt, es, fiducialFlags, isolVarR04, isolVarR03);
598  }
599  newCandidate.setFiducialVolumeFlags(fiducialFlags);
600  newCandidate.setIsolationVariables(isolVarR04, isolVarR03);
601 
603  reco::Photon::ShowerShape showerShape;
604  showerShape.e1x5 = e1x5;
605  showerShape.e2x5 = e2x5;
606  showerShape.e3x3 = e3x3;
607  showerShape.e5x5 = e5x5;
608  showerShape.maxEnergyXtal = maxXtal;
609  showerShape.sigmaEtaEta = sigmaEtaEta;
610  showerShape.sigmaIetaIeta = sigmaIetaIeta;
611  showerShape.hcalDepth1OverEcal = HoE1;
612  showerShape.hcalDepth2OverEcal = HoE2;
613  showerShape.hcalDepth1OverEcalBc = hcalDepth1OverEcalBc;
614  showerShape.hcalDepth2OverEcalBc = hcalDepth2OverEcalBc;
615  showerShape.hcalTowersBehindClusters = TowersBehindClus;
616  showerShape.invalidHcal = invalidHcal;
618  const float spp = (!edm::isFinite(locCov[2]) ? 0. : sqrt(locCov[2]));
619  const float sep = locCov[1];
620  showerShape.sigmaIetaIphi = sep;
621  showerShape.sigmaIphiIphi = spp;
622  showerShape.e2nd = (hits != nullptr ? EcalClusterTools::e2nd(*(scRef->seed()), &(*hits)) : 0.f);
623  showerShape.eTop = (hits != nullptr ? EcalClusterTools::eTop(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
624  showerShape.eLeft = (hits != nullptr ? EcalClusterTools::eLeft(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
625  showerShape.eRight = (hits != nullptr ? EcalClusterTools::eRight(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
626  showerShape.eBottom = (hits != nullptr ? EcalClusterTools::eBottom(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
627  showerShape.e1x3 = (hits != nullptr ? EcalClusterTools::e1x3(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
628  showerShape.e2x2 = (hits != nullptr ? EcalClusterTools::e2x2(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
629  showerShape.e2x5Max = (hits != nullptr ? EcalClusterTools::e2x5Max(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
630  showerShape.e2x5Left =
631  (hits != nullptr ? EcalClusterTools::e2x5Left(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
632  showerShape.e2x5Right =
633  (hits != nullptr ? EcalClusterTools::e2x5Right(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
634  showerShape.e2x5Top = (hits != nullptr ? EcalClusterTools::e2x5Top(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
635  showerShape.e2x5Bottom =
636  (hits != nullptr ? EcalClusterTools::e2x5Bottom(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
637  if (hits) {
638  Cluster2ndMoments clus2ndMoments = EcalClusterTools::cluster2ndMoments(*(scRef->seed()), *hits);
639  showerShape.smMajor = clus2ndMoments.sMaj;
640  showerShape.smMinor = clus2ndMoments.sMin;
641  showerShape.smAlpha = clus2ndMoments.alpha;
642  } else {
643  showerShape.smMajor = 0.f;
644  showerShape.smMinor = 0.f;
645  showerShape.smAlpha = 0.f;
646  }
647 
648  // fill preshower shapes
649  EcalClusterLazyTools toolsforES(
651  const float sigmaRR = toolsforES.eseffsirir(*scRef);
652  showerShape.effSigmaRR = sigmaRR;
653  newCandidate.setShowerShapeVariables(showerShape);
654 
655  reco::Photon::SaturationInfo saturationInfo;
656  const reco::CaloCluster& seedCluster = *(scRef->seed());
657  DetId seedXtalId = seedCluster.seed();
658  int nSaturatedXtals = 0;
659  bool isSeedSaturated = false;
660  if (hits != nullptr) {
661  const auto hitsAndFractions = scRef->hitsAndFractions();
662  for (auto&& hitFractionPair : hitsAndFractions) {
663  auto&& ecalRecHit = hits->find(hitFractionPair.first);
664  if (ecalRecHit == hits->end())
665  continue;
666  if (ecalRecHit->checkFlag(EcalRecHit::Flags::kSaturated)) {
667  nSaturatedXtals++;
668  if (seedXtalId == ecalRecHit->detid())
669  isSeedSaturated = true;
670  }
671  }
672  }
673  saturationInfo.nSaturatedXtals = nSaturatedXtals;
674  saturationInfo.isSeedSaturated = isSeedSaturated;
675  newCandidate.setSaturationInfo(saturationInfo);
676 
678  reco::Photon::ShowerShape full5x5_showerShape;
679  full5x5_showerShape.e1x5 = full5x5_e1x5;
680  full5x5_showerShape.e2x5 = full5x5_e2x5;
681  full5x5_showerShape.e3x3 = full5x5_e3x3;
682  full5x5_showerShape.e5x5 = full5x5_e5x5;
683  full5x5_showerShape.maxEnergyXtal = full5x5_maxXtal;
684  full5x5_showerShape.sigmaEtaEta = full5x5_sigmaEtaEta;
685  full5x5_showerShape.sigmaIetaIeta = full5x5_sigmaIetaIeta;
687  const float full5x5_spp = (!edm::isFinite(full5x5_locCov[2]) ? 0. : sqrt(full5x5_locCov[2]));
688  const float full5x5_sep = full5x5_locCov[1];
689  full5x5_showerShape.sigmaIetaIphi = full5x5_sep;
690  full5x5_showerShape.sigmaIphiIphi = full5x5_spp;
691  full5x5_showerShape.e2nd = (hits != nullptr ? noZS::EcalClusterTools::e2nd(*(scRef->seed()), &(*hits)) : 0.f);
692  full5x5_showerShape.eTop =
693  (hits != nullptr ? noZS::EcalClusterTools::eTop(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
694  full5x5_showerShape.eLeft =
695  (hits != nullptr ? noZS::EcalClusterTools::eLeft(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
696  full5x5_showerShape.eRight =
697  (hits != nullptr ? noZS::EcalClusterTools::eRight(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
698  full5x5_showerShape.eBottom =
699  (hits != nullptr ? noZS::EcalClusterTools::eBottom(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
700  full5x5_showerShape.e1x3 =
701  (hits != nullptr ? noZS::EcalClusterTools::e1x3(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
702  full5x5_showerShape.e2x2 =
703  (hits != nullptr ? noZS::EcalClusterTools::e2x2(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
704  full5x5_showerShape.e2x5Max =
705  (hits != nullptr ? noZS::EcalClusterTools::e2x5Max(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
706  full5x5_showerShape.e2x5Left =
707  (hits != nullptr ? noZS::EcalClusterTools::e2x5Left(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
708  full5x5_showerShape.e2x5Right =
709  (hits != nullptr ? noZS::EcalClusterTools::e2x5Right(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
710  full5x5_showerShape.e2x5Top =
711  (hits != nullptr ? noZS::EcalClusterTools::e2x5Top(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
712  full5x5_showerShape.e2x5Bottom =
713  (hits != nullptr ? noZS::EcalClusterTools::e2x5Bottom(*(scRef->seed()), &(*hits), &(*topology)) : 0.f);
714  if (hits) {
715  Cluster2ndMoments clus2ndMoments = noZS::EcalClusterTools::cluster2ndMoments(*(scRef->seed()), *hits);
716  full5x5_showerShape.smMajor = clus2ndMoments.sMaj;
717  full5x5_showerShape.smMinor = clus2ndMoments.sMin;
718  full5x5_showerShape.smAlpha = clus2ndMoments.alpha;
719  } else {
720  full5x5_showerShape.smMajor = 0.f;
721  full5x5_showerShape.smMinor = 0.f;
722  full5x5_showerShape.smAlpha = 0.f;
723  }
724  // fill preshower shapes
725  full5x5_showerShape.effSigmaRR = sigmaRR;
726  newCandidate.full5x5_setShowerShapeVariables(full5x5_showerShape);
727 
730  // Photon candidate takes by default (set in photons_cfi.py)
731  // a 4-momentum derived from the ecal photon-specific corrections.
732  if (!EcalTools::isHGCalDet(thedet)) {
733  thePhotonEnergyCorrector_->calculate(evt, newCandidate, subdet, vertexCollection, es);
734  if (candidateP4type_ == "fromEcalEnergy") {
735  newCandidate.setP4(newCandidate.p4(reco::Photon::ecal_photons));
736  newCandidate.setCandidateP4type(reco::Photon::ecal_photons);
737  } else if (candidateP4type_ == "fromRegression1") {
738  newCandidate.setP4(newCandidate.p4(reco::Photon::regression1));
739  newCandidate.setCandidateP4type(reco::Photon::regression1);
740  } else if (candidateP4type_ == "fromRegression2") {
741  newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
742  newCandidate.setCandidateP4type(reco::Photon::regression2);
743  } else if (candidateP4type_ == "fromRefinedSCRegression") {
744  newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
745  newCandidate.setCandidateP4type(reco::Photon::regression2);
746  }
747  } else {
748  math::XYZVector gamma_momentum = direction.unit() * scRef->energy();
749  math::XYZTLorentzVectorD p4(gamma_momentum.x(), gamma_momentum.y(), gamma_momentum.z(), scRef->energy());
750  newCandidate.setP4(p4);
751  newCandidate.setCandidateP4type(reco::Photon::ecal_photons);
752  // Make it an EE photon
753  reco::Photon::FiducialFlags fiducialFlags;
754  fiducialFlags.isEE = true;
755  newCandidate.setFiducialVolumeFlags(fiducialFlags);
756  }
757 
758  // std::cout << " final p4 " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
759 
760  // std::cout << " GEDPhotonProducer from candidate HoE with towers in a cone " << newCandidate.hadronicOverEm() << " " << newCandidate.hadronicDepth1OverEm() << " " << newCandidate.hadronicDepth2OverEm() << std::endl;
761  // std::cout << " GEDPhotonProducer from candidate of HoE with towers behind the BCs " << newCandidate.hadTowOverEm() << " " << newCandidate.hadTowDepth1OverEm() << " " << newCandidate.hadTowDepth2OverEm() << std::endl;
762 
763  // fill MIP Vairables for Halo: Block for MIP are filled from PhotonMIPHaloTagger
765  if (subdet == EcalBarrel && runMIPTagger_) {
766  thePhotonMIPHaloTagger_->MIPcalculate(&newCandidate, evt, es, mipVar);
767  newCandidate.setMIPVariables(mipVar);
768  }
769 
771  bool isLooseEM = true;
772  if (newCandidate.pt() < highEt_) {
773  if (newCandidate.hadronicOverEm() >= preselCutValues[1])
774  isLooseEM = false;
775  if (newCandidate.ecalRecHitSumEtConeDR04() > preselCutValues[2] + preselCutValues[3] * newCandidate.pt())
776  isLooseEM = false;
777  if (newCandidate.hcalTowerSumEtConeDR04() > preselCutValues[4] + preselCutValues[5] * newCandidate.pt())
778  isLooseEM = false;
779  if (newCandidate.nTrkSolidConeDR04() > int(preselCutValues[6]))
780  isLooseEM = false;
781  if (newCandidate.nTrkHollowConeDR04() > int(preselCutValues[7]))
782  isLooseEM = false;
783  if (newCandidate.trkSumPtSolidConeDR04() > preselCutValues[8])
784  isLooseEM = false;
785  if (newCandidate.trkSumPtHollowConeDR04() > preselCutValues[9])
786  isLooseEM = false;
787  if (newCandidate.sigmaIetaIeta() > preselCutValues[10])
788  isLooseEM = false;
789  }
790 
791  if (isLooseEM)
792  outputPhotonCollection.push_back(newCandidate);
793  }
794 }
795 
797  edm::EventSetup const& es,
798  const edm::Handle<reco::PhotonCollection>& photonHandle,
799  const edm::Handle<reco::PFCandidateCollection> pfCandidateHandle,
800  const edm::Handle<reco::PFCandidateCollection> pfEGCandidateHandle,
801  edm::ValueMap<reco::PhotonRef> pfEGCandToPhotonMap,
804  int& iSC,
805  const edm::Handle<edm::ValueMap<float>>& chargedHadrons,
806  const edm::Handle<edm::ValueMap<float>>& neutralHadrons,
808  const edm::Handle<edm::ValueMap<float>>& chargedHadronsWorstVtx,
809  const edm::Handle<edm::ValueMap<float>>& chargedHadronsWorstVtxGeomVeto,
810  const edm::Handle<edm::ValueMap<float>>& chargedHadronsPFPV,
811  const edm::Handle<edm::ValueMap<float>>& pfEcalClusters,
812  const edm::Handle<edm::ValueMap<float>>& pfHcalClusters) {
813  std::vector<double> preselCutValues;
814 
815  for (unsigned int lSC = 0; lSC < photonHandle->size(); lSC++) {
816  reco::PhotonRef phoRef(reco::PhotonRef(photonHandle, lSC));
817  reco::SuperClusterRef parentSCRef = phoRef->parentSuperCluster();
818  reco::SuperClusterRef scRef = phoRef->superCluster();
819  DetId::Detector thedet = scRef->seed()->hitsAndFractions()[0].first.det();
820  int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
821  if (subdet == EcalBarrel) {
822  preselCutValues = preselCutValuesBarrel_;
823  } else if (subdet == EcalEndcap) {
824  preselCutValues = preselCutValuesEndcap_;
825  } else if (EcalTools::isHGCalDet(thedet)) {
826  preselCutValues = preselCutValuesEndcap_;
827  } else {
828  edm::LogWarning("") << "GEDPhotonProducer: do not know if it is a barrel or endcap SuperCluster" << thedet << ' '
829  << subdet;
830  }
831 
832  // SC energy preselection
833  if (parentSCRef.isNonnull() &&
834  ptFast(parentSCRef->energy(), parentSCRef->position(), math::XYZPoint(0, 0, 0)) <= preselCutValues[0])
835  continue;
836  reco::Photon newCandidate(*phoRef);
837  iSC++;
838 
839  // Calculate the PF isolation and ID - for the time being there is no calculation. Only the setting
842 
843  //get the pointer for the photon object
844  edm::Ptr<reco::Photon> photonPtr(photonHandle, lSC);
845 
846  if (!recoStep_.isOOT()) { //out of time photons do not have PF info so skip in this case
847  pfIso.chargedHadronIso = (*chargedHadrons)[photonPtr];
848  pfIso.neutralHadronIso = (*neutralHadrons)[photonPtr];
849  pfIso.photonIso = (*photons)[photonPtr];
850  pfIso.chargedHadronWorstVtxIso = (*chargedHadronsWorstVtx)[photonPtr];
851  pfIso.chargedHadronWorstVtxGeomVetoIso = (*chargedHadronsWorstVtxGeomVeto)[photonPtr];
852  pfIso.chargedHadronPFPVIso = (*chargedHadronsPFPV)[photonPtr];
853  }
854 
855  //OOT photons in legacy 80X reminiAOD workflow dont have pf cluster isolation embeded into them at this stage
857  pfIso.sumEcalClusterEt = (*pfEcalClusters)[photonPtr];
858  } else
859  pfIso.sumEcalClusterEt = 0.;
860 
862  pfIso.sumHcalClusterEt = (*pfHcalClusters)[photonPtr];
863  } else
864  pfIso.sumHcalClusterEt = 0.;
865 
866  newCandidate.setPflowIsolationVariables(pfIso);
867  newCandidate.setPflowIDVariables(pfID);
868 
869  // do the regression
870  thePhotonEnergyCorrector_->calculate(evt, newCandidate, subdet, *vertexHandle, es);
871  if (candidateP4type_ == "fromEcalEnergy") {
872  newCandidate.setP4(newCandidate.p4(reco::Photon::ecal_photons));
874  } else if (candidateP4type_ == "fromRegression1") {
875  newCandidate.setP4(newCandidate.p4(reco::Photon::regression1));
877  } else if (candidateP4type_ == "fromRegression2") {
878  newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
880  } else if (candidateP4type_ == "fromRefinedSCRegression") {
881  newCandidate.setP4(newCandidate.p4(reco::Photon::regression2));
883  }
884 
885  // std::cout << " GEDPhotonProducer pf based isolation chargedHadron " << newCandidate.chargedHadronIso() << " neutralHadron " << newCandidate.neutralHadronIso() << " Photon " << newCandidate.photonIso() << std::endl;
886  //std::cout << " GEDPhotonProducer from candidate HoE with towers in a cone " << newCandidate.hadronicOverEm() << " " << newCandidate.hadronicDepth1OverEm() << " " << newCandidate.hadronicDepth2OverEm() << std::endl;
887  //std::cout << " GEDPhotonProducer from candidate of HoE with towers behind the BCs " << newCandidate.hadTowOverEm() << " " << newCandidate.hadTowDepth1OverEm() << " " << newCandidate.hadTowDepth2OverEm() << std::endl;
888  //std::cout << " standard p4 before " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
889  //std::cout << " type " <<newCandidate.getCandidateP4type() << " standard p4 after " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
890  //std::cout << " final p4 " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
891 
892  outputPhotonCollection.push_back(newCandidate);
893  }
894 }
EgHLTOffHistBins_cfi.e1x5
e1x5
Definition: EgHLTOffHistBins_cfi.py:22
reco::Photon::ShowerShape::eTop
float eTop
Definition: Photon.h:155
reco::Photon::ShowerShape::sigmaIphiIphi
float sigmaIphiIphi
Definition: Photon.h:153
reco::Photon::ShowerShape::maxEnergyXtal
float maxEnergyXtal
Definition: Photon.h:144
GEDPhotonProducer::preshowerHits_
edm::EDGetTokenT< EcalRecHitCollection > preshowerHits_
Definition: GEDPhotonProducer.h:99
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
reco::Photon::ShowerShape::hcalDepth2OverEcalBc
float hcalDepth2OverEcalBc
Definition: Photon.h:148
reco::Photon::ShowerShape::eRight
float eRight
Definition: Photon.h:157
GEDPhotonProducer::thePhotonMIPHaloTagger_
PhotonMIPHaloTagger * thePhotonMIPHaloTagger_
Definition: GEDPhotonProducer.h:154
geometry
ESHandle< TrackerGeometry > geometry
Definition: TkLasBeamFitter.cc:200
GEDPhotonProducer::valueMapPFCandPhoton_
std::string valueMapPFCandPhoton_
Definition: GEDPhotonProducer.h:121
reco::Photon::ShowerShape::e2x5Left
float e2x5Left
Definition: Photon.h:162
reco::Photon::ShowerShape::sigmaEtaEta
float sigmaEtaEta
Definition: Photon.h:138
MessageLogger.h
edm::Handle::product
T const * product() const
Definition: Handle.h:70
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
reco::Photon::SaturationInfo::nSaturatedXtals
int nSaturatedXtals
Definition: Photon.h:259
reco::Photon::ShowerShape::e1x5
float e1x5
Definition: Photon.h:140
EcalTools::isHGCalDet
static bool isHGCalDet(DetId::Detector thedet)
identify HGCal cells
Definition: EcalTools.h:49
step
step
Definition: StallMonitor.cc:94
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PFCandidate.h
GEDPhotonProducer::~GEDPhotonProducer
~GEDPhotonProducer() override
Definition: GEDPhotonProducer.cc:212
GEDPhotonProducer::produce
void produce(edm::Event &evt, const edm::EventSetup &es) override
Definition: GEDPhotonProducer.cc:227
HcalChannelQualityRcd
Definition: HcalChannelQualityRcd.h:8
EcalSeverityLevelAlgoRcd.h
reco::Photon::ShowerShape::e1x3
float e1x3
Definition: Photon.h:159
edm::Run
Definition: Run.h:45
GEDPhotonProducer::thePhotonIsolationCalculator_
PhotonIsolationCalculator * thePhotonIsolationCalculator_
Definition: GEDPhotonProducer.h:123
reco::Photon::FiducialFlags::isEE
bool isEE
Definition: Photon.h:96
HLT_FULL_cff.endcapRecHits
endcapRecHits
Definition: HLT_FULL_cff.py:14984
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
EcalClusterToolsT::e2x5Bottom
static float e2x5Bottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:593
reco::Photon::ShowerShape::e2nd
float e2nd
Definition: Photon.h:154
edm
HLT enums.
Definition: AlignableModifier.h:19
GEDPhotonProducer::beginRun
void beginRun(edm::Run const &r, edm::EventSetup const &es) final
Definition: GEDPhotonProducer.cc:219
gedPhotons_cfi.mipVariableSet
mipVariableSet
Definition: gedPhotons_cfi.py:36
math::XYZTLorentzVectorD
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
EcalClusterToolsT::covariances
static std::vector< float > covariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
Definition: EcalClusterTools.h:957
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
geometry
Definition: geometry.py:1
GEDPhotonProducer::thePhotonEnergyCorrector_
PhotonEnergyCorrector * thePhotonEnergyCorrector_
Definition: GEDPhotonProducer.h:160
reco::Photon::p4
const LorentzVector & p4(P4type type) const
HLT_FULL_cff.barrelRecHits
barrelRecHits
Definition: HLT_FULL_cff.py:14987
reco::Photon::ShowerShape::e2x2
float e2x2
Definition: Photon.h:160
reco::Photon::ShowerShape::invalidHcal
bool invalidHcal
Definition: Photon.h:150
reco::Photon::SaturationInfo
Definition: Photon.h:258
reco::Photon::PflowIsolationVariables::chargedHadronPFPVIso
float chargedHadronPFPVIso
Definition: Photon.h:463
EcalClusterToolsT::eMax
static float eMax(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
Definition: EcalClusterTools.h:550
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
edm::SortedCollection< EcalRecHit >
GEDPhotonProducer::phoChargedPFPVIsoToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedPFPVIsoToken_
Definition: GEDPhotonProducer.h:112
GEDPhotonProducer::theCaloTopo_
edm::ESHandle< CaloTopology > theCaloTopo_
Definition: GEDPhotonProducer.h:149
reco::Photon::PflowIsolationVariables::chargedHadronIso
float chargedHadronIso
Definition: Photon.h:460
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
PhotonCore.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
reco::Photon::ShowerShape::eBottom
float eBottom
Definition: Photon.h:158
findQualityFiles.v
v
Definition: findQualityFiles.py:179
MonitorAlCaEcalPi0_cfi.posCalcParameters
posCalcParameters
Definition: MonitorAlCaEcalPi0_cfi.py:72
egamma::depth2HcalESum
double depth2HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
Definition: EgammaHadTower.cc:83
edm::Handle
Definition: AssociativeIterator.h:50
GEDPhotonProducer::photonCollection_
std::string photonCollection_
Definition: GEDPhotonProducer.h:92
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
GEDPhotonProducer::flagsexclEB_
std::vector< int > flagsexclEB_
Definition: GEDPhotonProducer.h:128
CaloTopology
Definition: CaloTopology.h:19
reco::Photon::PflowIsolationVariables::neutralHadronIso
float neutralHadronIso
Definition: Photon.h:464
EcalBarrel
Definition: EcalSubdetector.h:10
EgammaHadTower.h
PhotonIsolationCalculator
Definition: PhotonIsolationCalculator.h:17
edm::Ref< PFCandidateCollection >
reco::Photon::ShowerShape::e2x5Bottom
float e2x5Bottom
Definition: Photon.h:165
PhotonMIPHaloTagger::MIPcalculate
void MIPcalculate(const reco::Photon *, const edm::Event &, const edm::EventSetup &es, reco::Photon::MIPVariables &mipId)
Definition: PhotonMIPHaloTagger.cc:57
reco::Photon::PflowIsolationVariables::chargedHadronWorstVtxGeomVetoIso
float chargedHadronWorstVtxGeomVetoIso
Definition: Photon.h:462
config
Definition: config.py:1
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
DetId
Definition: DetId.h:17
Photon.h
GEDPhotonProducer::photonCoreProducerT_
edm::EDGetTokenT< reco::PhotonCoreCollection > photonCoreProducerT_
Definition: GEDPhotonProducer.h:95
reco::Photon::PflowIsolationVariables
Definition: Photon.h:459
CaloGeometry
Definition: CaloGeometry.h:21
reco::Photon::ShowerShape::sigmaIetaIphi
float sigmaIetaIphi
Definition: Photon.h:152
GEDPhotonProducer::flagsexclEE_
std::vector< int > flagsexclEE_
Definition: GEDPhotonProducer.h:129
EgammaTowerIsolation::getTowerESum
double getTowerESum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=nullptr) const
Definition: EgammaTowerIsolation.h:209
reco::Photon::ecal_photons
Definition: Photon.h:273
GEDPhotonProducer::recoStep_
RecoStepInfo recoStep_
Definition: GEDPhotonProducer.h:142
EcalClusterToolsT::e2x5Max
static float e2x5Max(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:603
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
reco::Photon::ShowerShape::eLeft
float eLeft
Definition: Photon.h:156
EcalClusterToolsT::e2x5Top
static float e2x5Top(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:585
reco::Photon::setPflowIsolationVariables
void setPflowIsolationVariables(const PflowIsolationVariables &pfisol)
Set Particle Flow Isolation variables.
Definition: Photon.h:497
ecaldqm::topology
const CaloTopology * topology(nullptr)
GEDPhotonProducer::endcapEcalHits_
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
Definition: GEDPhotonProducer.h:98
EcalClusterToolsT::e2x2
static float e2x2(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:489
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
reco::Photon::ShowerShape::smAlpha
float smAlpha
Definition: Photon.h:168
GEDPhotonProducer::pfEgammaCandidates_
edm::EDGetTokenT< reco::PFCandidateCollection > pfEgammaCandidates_
Definition: GEDPhotonProducer.h:100
reco::CaloCluster
Definition: CaloCluster.h:31
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
edm::ESHandle< EcalSeverityLevelAlgo >
EcalSeverityLevelAlgoRcd
Definition: EcalSeverityLevelAlgoRcd.h:12
reco::Photon::ShowerShape::smMajor
float smMajor
Definition: Photon.h:166
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
GEDPhotonProducer::severitiesexclEE_
std::vector< int > severitiesexclEE_
Definition: GEDPhotonProducer.h:131
StringToEnumValue.h
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
Cluster2ndMoments::alpha
float alpha
Definition: EcalClusterTools.h:68
EgammaTowerIsolation.h
reco::Photon::ShowerShape::hcalDepth1OverEcalBc
float hcalDepth1OverEcalBc
Definition: Photon.h:147
EcalClusterLazyTools
EcalClusterToolsT::cluster2ndMoments
static Cluster2ndMoments cluster2ndMoments(const reco::BasicCluster &basicCluster, const EcalRecHitCollection &recHits, double phiCorrectionFactor=0.8, double w0=4.7, bool useLogWeights=true)
Definition: EcalClusterTools.h:1446
EcalSeverityLevelAlgo.h
reco::Photon::ShowerShape::e2x5Right
float e2x5Right
Definition: Photon.h:163
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
EcalClusterToolsT::eTop
static float eTop(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:668
CaloGeometryRecord.h
GEDPhotonProducer::phoChargedWorstVtxGeomVetoIsoToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedWorstVtxGeomVetoIsoToken_
Definition: GEDPhotonProducer.h:111
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
GEDPhotonProducer::phoChargedIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedIsolationToken_
Definition: GEDPhotonProducer.h:107
EcalEndcap
Definition: EcalSubdetector.h:10
reco::Photon::ShowerShape::effSigmaRR
float effSigmaRR
Definition: Photon.h:151
GEDPhotonProducer::phoPFHCALClusIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoPFHCALClusIsolationToken_
Definition: GEDPhotonProducer.h:115
ClusterShape.h
GEDPhotonProducer::GEDPhotonProducer
GEDPhotonProducer(const edm::ParameterSet &ps)
Definition: GEDPhotonProducer.cc:58
egamma::towersOf
std::vector< CaloTowerDetId > towersOf(reco::SuperCluster const &sc, CaloTowerConstituentsMap const &towerMap, HoeMode mode=HoeMode::SingleTower)
Definition: EgammaHadTower.cc:25
IOMC_cff.ecalRecHit
ecalRecHit
Definition: IOMC_cff.py:103
CaloSubdetectorGeometry.h
GEDPhotonProducer::photonProducerT_
edm::EDGetTokenT< reco::PhotonCollection > photonProducerT_
Definition: GEDPhotonProducer.h:96
reco::Photon::PflowIsolationVariables::chargedHadronWorstVtxIso
float chargedHadronWorstVtxIso
Definition: Photon.h:461
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Cluster2ndMoments::sMaj
float sMaj
Definition: EcalClusterTools.h:65
reco::Photon::ShowerShape::e2x5Max
float e2x5Max
Definition: Photon.h:161
reco::Photon::ShowerShape::hcalDepth2OverEcal
float hcalDepth2OverEcal
Definition: Photon.h:146
GEDPhotonProducer::barrelEcalHits_
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
Definition: GEDPhotonProducer.h:97
reco::Photon::ShowerShape::e2x5Top
float e2x5Top
Definition: Photon.h:164
PhotonMIPHaloTagger
Definition: PhotonMIPHaloTagger.h:17
GEDPhotonProducer::RecoStepInfo::isOOT
bool isOOT() const
Definition: GEDPhotonProducer.h:54
reco::Photon::ShowerShape::sigmaIetaIeta
float sigmaIetaIeta
Definition: Photon.h:139
cosmicPhotonAnalyzer_cfi.eMax
eMax
Definition: cosmicPhotonAnalyzer_cfi.py:10
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
GEDPhotonProducer::RecoStepInfo::flags_
unsigned int flags_
Definition: GEDPhotonProducer.h:58
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
GEDPhotonProducer::RecoStepInfo::RecoStepInfo
RecoStepInfo(const std::string &recoStep)
Definition: GEDPhotonProducer.cc:43
GEDPhotonProducer::candidateP4type_
std::string candidateP4type_
Definition: GEDPhotonProducer.h:161
EcalClusterToolsT::eBottom
static float eBottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:676
reco::Photon::ShowerShape::e2x5
float e2x5
Definition: Photon.h:141
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
CaloTopologyRecord.h
reco::Photon::ShowerShape::smMinor
float smMinor
Definition: Photon.h:167
reco::Photon::FiducialFlags
Definition: Photon.h:93
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
GEDPhotonProducer::RecoStepInfo::kOOT
Definition: GEDPhotonProducer.h:51
EgammaTowerIsolation
Definition: EgammaTowerIsolation.h:197
PositionCalc
Definition: PositionCalc.h:29
GEDPhotonProducer::severitiesexclEB_
std::vector< int > severitiesexclEB_
Definition: GEDPhotonProducer.h:130
GEDPhotonProducer::hOverEConeSize_
double hOverEConeSize_
Definition: GEDPhotonProducer.h:133
createfilelist.int
int
Definition: createfilelist.py:10
p4
double p4[4]
Definition: TauolaWrapper.h:92
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
GEDPhotonProducer::RecoStepInfo::kFinal
Definition: GEDPhotonProducer.h:51
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
DetId::Detector
Detector
Definition: DetId.h:24
EcalClusterToolsT::e2nd
static float e2nd(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
Definition: EcalClusterTools.h:555
edm::EventSetup
Definition: EventSetup.h:57
gedPhotons_cfi.isolationSumsCalculatorSet
isolationSumsCalculatorSet
Definition: gedPhotons_cfi.py:34
GEDPhotonProducer::ecalClusterESGetTokens_
const EcalClusterLazyTools::ESGetTokens ecalClusterESGetTokens_
Definition: GEDPhotonProducer.h:117
get
#define get
reco::Photon::IsolationVariables
Definition: Photon.h:358
EcalTools.h
GEDPhotonProducer::fillPhotonCollection
void fillPhotonCollection(edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::PhotonCoreCollection > &photonCoreHandle, const CaloTopology *topology, const EcalRecHitCollection *ecalBarrelHits, const EcalRecHitCollection *ecalEndcapHits, const EcalRecHitCollection *preshowerHits, CaloTowerCollection const *hcalTowers, const reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC)
Definition: GEDPhotonProducer.cc:448
reco::CaloCluster::seed
DetId seed() const
return DetId of seed
Definition: CaloCluster.h:219
EcalClusterToolsT::eRight
static float eRight(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:660
HcalChannelQualityRcd.h
GEDPhotonProducer::phoPFECALClusIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoPFECALClusIsolationToken_
Definition: GEDPhotonProducer.h:114
GEDPhotonProducer::phoNeutralHadronIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoNeutralHadronIsolationToken_
Definition: GEDPhotonProducer.h:108
EcalClusterLazyToolsBase::ESGetTokens::get
ESData get(edm::EventSetup const &eventSetup) const
Definition: EcalClusterLazyTools.h:62
EcalClusterToolsT::e2x5Right
static float e2x5Right(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:569
conversions_cfi.hcalTowers
hcalTowers
Definition: conversions_cfi.py:21
GEDPhotonProducer.h
edm::Ptr
Definition: AssociationVector.h:31
alignCSCRings.r
r
Definition: alignCSCRings.py:93
CaloTopology.h
ValueMap.h
EcalClusterToolsT::e3x3
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:514
PhotonEnergyCorrector::gedRegression
std::unique_ptr< ModifyObjectValueBase > & gedRegression()
Definition: PhotonEnergyCorrector.h:29
gedPhotonSequence_cff.pfIsolCfg
pfIsolCfg
Definition: gedPhotonSequence_cff.py:29
reco::Photon::setPflowIDVariables
void setPflowIDVariables(const PflowIDVariables &pfid)
Definition: Photon.h:519
reco::Photon
Definition: Photon.h:21
PhotonEnergyCorrector::init
void init(const edm::EventSetup &theEventSetup)
Definition: PhotonEnergyCorrector.cc:60
reco::Photon::ShowerShape::hcalTowersBehindClusters
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: Photon.h:149
GEDPhotonProducer::phoChargedWorstVtxIsoToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedWorstVtxIsoToken_
Definition: GEDPhotonProducer.h:110
reco::Photon::ShowerShape
Definition: Photon.h:137
PhotonEnergyCorrector
Definition: PhotonEnergyCorrector.h:25
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::OrphanHandle
Definition: EDProductfwd.h:39
GEDPhotonProducer::checkHcalStatus_
bool checkHcalStatus_
Definition: GEDPhotonProducer.h:163
reco::Photon::PflowIDVariables
Definition: Photon.h:499
isFinite.h
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
gedPhotons_cfi.outputPhotonCollection
outputPhotonCollection
Definition: gedPhotons_cfi.py:30
PhotonEnergyCorrector::calculate
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
Definition: PhotonEnergyCorrector.cc:80
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
EcalClusterToolsT::e2x5Left
static float e2x5Left(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:577
PFCandidateEGammaExtra.h
edm::ValueMap
Definition: ValueMap.h:107
Exception
Definition: hltDiff.cc:246
EcalClusterToolsT::e1x5
static float e1x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:620
egamma::depth1HcalESum
double depth1HcalESum(std::vector< CaloTowerDetId > const &towers, CaloTowerCollection const &)
Definition: EgammaHadTower.cc:73
GEDPhotonProducer::usePrimaryVertex_
bool usePrimaryVertex_
Definition: GEDPhotonProducer.h:144
HLT_FULL_cff.full5x5_sigmaIetaIeta
full5x5_sigmaIetaIeta
Definition: HLT_FULL_cff.py:13771
reco::Photon::ShowerShape::hcalDepth1OverEcal
float hcalDepth1OverEcal
Definition: Photon.h:145
ptFast
double ptFast(const double energy, const math::XYZPoint &position, const math::XYZPoint &origin)
Definition: SuperClusterImporter.cc:13
reco::Photon::regression1
Definition: Photon.h:273
reco::Photon::setCandidateP4type
void setCandidateP4type(const P4type type)
Definition: Photon.h:312
reco::Photon::SaturationInfo::isSeedSaturated
bool isSeedSaturated
Definition: Photon.h:260
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
EcalClusterToolsT::e5x5
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:534
GEDPhotonProducer::RecoStepInfo::isFinal
bool isFinal() const
Definition: GEDPhotonProducer.h:55
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
reco::Photon::PflowIsolationVariables::photonIso
float photonIso
Definition: Photon.h:465
Exception.h
reco::Photon::MIPVariables
Definition: Photon.h:324
Cluster2ndMoments::sMin
float sMin
Definition: EcalClusterTools.h:66
reco::Photon::ShowerShape::e3x3
float e3x3
Definition: Photon.h:142
GEDPhotonProducer::preselCutValuesEndcap_
std::vector< double > preselCutValuesEndcap_
Definition: GEDPhotonProducer.h:157
reco::Photon::PflowIsolationVariables::sumEcalClusterEt
float sumEcalClusterEt
Definition: Photon.h:466
GEDPhotonProducer::preselCutValuesBarrel_
std::vector< double > preselCutValuesBarrel_
Definition: GEDPhotonProducer.h:156
egamma::hasActiveHcal
bool hasActiveHcal(std::vector< CaloTowerDetId > const &towers, CaloTowerConstituentsMap const &towerMap, HcalChannelQuality const &hcalQuality, HcalTopology const &hcalTopology)
Definition: EgammaHadTower.cc:93
electronIdCutBasedExt_cfi.sigmaEtaEta
sigmaEtaEta
Definition: electronIdCutBasedExt_cfi.py:123
reco::Photon::PflowIsolationVariables::sumHcalClusterEt
float sumHcalClusterEt
Definition: Photon.h:467
PhotonIsolationCalculator::calculate
void calculate(const reco::Photon *, const edm::Event &, const edm::EventSetup &es, reco::Photon::FiducialFlags &phofid, reco::Photon::IsolationVariables &phoisolR03, reco::Photon::IsolationVariables &phoisolR04) const
Definition: PhotonIsolationCalculator.cc:179
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
GEDPhotonProducer::highEt_
double highEt_
Definition: GEDPhotonProducer.h:136
MaterialEffects_cfi.photonEnergy
photonEnergy
Definition: MaterialEffects_cfi.py:26
edm::helper::Filler
Definition: ValueMap.h:22
EcalClusterToolsT::eLeft
static float eLeft(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:652
edm::isFinite
constexpr bool isFinite(T x)
EgHLTOffHistBins_cfi.e2x5
e2x5
Definition: EgHLTOffHistBins_cfi.py:21
reco::Photon::regression2
Definition: Photon.h:273
GEDPhotonProducer::pfCandidates_
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidates_
Definition: GEDPhotonProducer.h:101
GEDPhotonProducer::endRun
void endRun(edm::Run const &, edm::EventSetup const &) final
Definition: GEDPhotonProducer.cc:225
GEDPhotonProducer::theCaloGeom_
edm::ESHandle< CaloGeometry > theCaloGeom_
Definition: GEDPhotonProducer.h:148
reco::Photon::setP4
void setP4(P4type type, const LorentzVector &p4, float p4Error, bool setToRecoCandidate)
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
EcalClusterToolsT::e1x3
static float e1x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: EcalClusterTools.h:636
gedPhotons_cfi.preshowerHits
preshowerHits
Definition: gedPhotons_cfi.py:47
GEDPhotonProducer::hcalTowers_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
Definition: GEDPhotonProducer.h:102
Cluster2ndMoments
Definition: EcalClusterTools.h:63
GEDPhotonProducer::phoPhotonIsolationToken_
edm::EDGetTokenT< edm::ValueMap< float > > phoPhotonIsolationToken_
Definition: GEDPhotonProducer.h:109
edm::InputTag
Definition: InputTag.h:15
GEDPhotonProducer::vertexProducer_
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
Definition: GEDPhotonProducer.h:103
GEDPhotonProducer::runMIPTagger_
bool runMIPTagger_
Definition: GEDPhotonProducer.h:139
GEDPhotonProducer::photonProducer_
edm::InputTag photonProducer_
Definition: GEDPhotonProducer.h:93
EcalClusterToolsT::localCovariances
static std::vector< float > localCovariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=4.7)
Definition: EcalClusterTools.h:1034
reco::Photon::ShowerShape::e5x5
float e5x5
Definition: Photon.h:143