CMS 3D CMS Logo

PhotonProducer.cc
Go to the documentation of this file.
1 
44 
45 #include <vector>
46 
47 // PhotonProducer inherits from EDProducer, so it can be a module:
49 public:
51 
52  void produce(edm::Event& evt, const edm::EventSetup& es) override;
53 
54 private:
56  edm::EventSetup const& es,
57  const edm::Handle<reco::PhotonCoreCollection>& photonCoreHandle,
58  const CaloTopology* topology,
59  const HcalPFCuts* hcalCuts,
60  const EcalRecHitCollection* ecalBarrelHits,
61  const EcalRecHitCollection* ecalEndcapHits,
62  ElectronHcalHelper const& hcalHelperCone,
63  ElectronHcalHelper const& hcalHelperBc,
64  reco::VertexCollection& pvVertices,
66  int& iSC);
67 
68  // std::string PhotonCoreCollection_;
77 
78  //AA
79  //Flags and severities to be excluded from calculations
80 
81  std::vector<int> flagsexclEB_;
82  std::vector<int> flagsexclEE_;
83  std::vector<int> severitiesexclEB_;
84  std::vector<int> severitiesexclEE_;
85 
87  double highEt_;
88  double minR9Barrel_;
89  double minR9Endcap_;
92 
94 
96 
98 
101 
102  //MIP
104  //MVA based Halo tagger for the EE photons
105  std::unique_ptr<const PhotonMVABasedHaloTagger> photonMVABasedHaloTagger_ = nullptr;
106 
107  std::vector<double> preselCutValuesBarrel_;
108  std::vector<double> preselCutValuesEndcap_;
109 
112 
113  // additional configuration and helpers
114  std::unique_ptr<ElectronHcalHelper> hcalHelperCone_;
115  std::unique_ptr<ElectronHcalHelper> hcalHelperBc_;
117 
120 };
121 
124 
126  : caloGeomToken_(esConsumes()),
127  topologyToken_(esConsumes()),
128  flagsexclEB_{StringToEnumValue<EcalRecHit::Flags>(
129  config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEB"))},
130  flagsexclEE_{StringToEnumValue<EcalRecHit::Flags>(
131  config.getParameter<std::vector<std::string>>("RecHitFlagToBeExcludedEE"))},
132  severitiesexclEB_{StringToEnumValue<EcalSeverityLevel::SeverityLevel>(
133  config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEB"))},
134  severitiesexclEE_{StringToEnumValue<EcalSeverityLevel::SeverityLevel>(
135  config.getParameter<std::vector<std::string>>("RecHitSeverityToBeExcludedEE"))},
136  photonIsolationCalculator_(config.getParameter<edm::ParameterSet>("isolationSumsCalculatorSet"),
137  flagsexclEB_,
138  flagsexclEE_,
139  severitiesexclEB_,
140  severitiesexclEE_,
141  consumesCollector()),
142  photonMIPHaloTagger_(config.getParameter<edm::ParameterSet>("mipVariableSet"), consumesCollector()),
143  photonEnergyCorrector_(config, consumesCollector()) {
144  // use configuration file to setup input/output collection names
145 
146  photonCoreProducer_ = consumes<reco::PhotonCoreCollection>(config.getParameter<edm::InputTag>("photonCoreProducer"));
147  barrelEcalHits_ = consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("barrelEcalHits"));
148  endcapEcalHits_ = consumes<EcalRecHitCollection>(config.getParameter<edm::InputTag>("endcapEcalHits"));
149  vertexProducer_ = consumes<reco::VertexCollection>(config.getParameter<edm::InputTag>("primaryVertexProducer"));
150  hbheRecHits_ = consumes<HBHERecHitCollection>(config.getParameter<edm::InputTag>("hbheRecHits"));
151  hOverEConeSize_ = config.getParameter<double>("hOverEConeSize");
152  highEt_ = config.getParameter<double>("highEt");
153  // R9 value to decide converted/unconverted
154  minR9Barrel_ = config.getParameter<double>("minR9Barrel");
155  minR9Endcap_ = config.getParameter<double>("minR9Endcap");
156  usePrimaryVertex_ = config.getParameter<bool>("usePrimaryVertex");
157  runMIPTagger_ = config.getParameter<bool>("runMIPTagger");
158  runMVABasedHaloTagger_ = config.getParameter<bool>("runMVABasedHaloTagger");
159 
160  candidateP4type_ = config.getParameter<std::string>("candidateP4type");
161 
162  edm::ParameterSet posCalcParameters = config.getParameter<edm::ParameterSet>("posCalcParameters");
163  posCalculator_ = PositionCalc(posCalcParameters);
164 
165  //Retrieve HCAL PF thresholds - from config or from DB
166  cutsFromDB_ = config.getParameter<bool>("usePFThresholdsFromDB");
167  if (cutsFromDB_) {
168  hcalCutsToken_ = esConsumes<HcalPFCuts, HcalPFCutsRcd>(edm::ESInputTag("", "withTopo"));
169  }
170 
171  ElectronHcalHelper::Configuration cfgCone, cfgBc;
172  cfgCone.hOverEConeSize = hOverEConeSize_;
173  if (cfgCone.hOverEConeSize > 0) {
174  cfgCone.onlyBehindCluster = false;
175  cfgCone.checkHcalStatus = false;
176 
177  cfgCone.hbheRecHits = hbheRecHits_;
178 
179  cfgCone.eThresHB = config.getParameter<EgammaHcalIsolation::arrayHB>("recHitEThresholdHB");
180  cfgCone.maxSeverityHB = config.getParameter<int>("maxHcalRecHitSeverity");
181  cfgCone.eThresHE = config.getParameter<EgammaHcalIsolation::arrayHE>("recHitEThresholdHE");
182  cfgCone.maxSeverityHE = cfgCone.maxSeverityHB;
183  }
184 
185  cfgBc.hOverEConeSize = 0.;
186  cfgBc.onlyBehindCluster = true;
187  cfgBc.checkHcalStatus = false;
188 
189  cfgBc.hbheRecHits = hbheRecHits_;
190 
191  cfgBc.eThresHB = config.getParameter<EgammaHcalIsolation::arrayHB>("recHitEThresholdHB");
192  cfgBc.maxSeverityHB = config.getParameter<int>("maxHcalRecHitSeverity");
193  cfgBc.eThresHE = config.getParameter<EgammaHcalIsolation::arrayHE>("recHitEThresholdHE");
194  cfgBc.maxSeverityHE = cfgBc.maxSeverityHB;
195 
196  hcalHelperCone_ = std::make_unique<ElectronHcalHelper>(cfgCone, consumesCollector());
197  hcalHelperBc_ = std::make_unique<ElectronHcalHelper>(cfgBc, consumesCollector());
198 
199  hcalRun2EffDepth_ = config.getParameter<bool>("hcalRun2EffDepth");
200 
201  //AA
202 
203  //
204 
205  // Parameters for the position calculation:
206  // std::map<std::string,double> providedParameters;
207  // providedParameters.insert(std::make_pair("LogWeighted",config.getParameter<bool>("posCalc_logweight")));
208  //providedParameters.insert(std::make_pair("T0_barl",config.getParameter<double>("posCalc_t0_barl")));
209  //providedParameters.insert(std::make_pair("T0_endc",config.getParameter<double>("posCalc_t0_endc")));
210  //providedParameters.insert(std::make_pair("T0_endcPresh",config.getParameter<double>("posCalc_t0_endcPresh")));
211  //providedParameters.insert(std::make_pair("W0",config.getParameter<double>("posCalc_w0")));
212  //providedParameters.insert(std::make_pair("X0",config.getParameter<double>("posCalc_x0")));
213  //posCalculator_ = PositionCalc(providedParameters);
214  // cut values for pre-selection
215  preselCutValuesBarrel_.push_back(config.getParameter<double>("minSCEtBarrel"));
216  preselCutValuesBarrel_.push_back(config.getParameter<double>("maxHoverEBarrel"));
217  preselCutValuesBarrel_.push_back(config.getParameter<double>("ecalRecHitSumEtOffsetBarrel"));
218  preselCutValuesBarrel_.push_back(config.getParameter<double>("ecalRecHitSumEtSlopeBarrel"));
219  preselCutValuesBarrel_.push_back(config.getParameter<double>("hcalRecHitSumEtOffsetBarrel"));
220  preselCutValuesBarrel_.push_back(config.getParameter<double>("hcalRecHitSumEtSlopeBarrel"));
221  preselCutValuesBarrel_.push_back(config.getParameter<double>("nTrackSolidConeBarrel"));
222  preselCutValuesBarrel_.push_back(config.getParameter<double>("nTrackHollowConeBarrel"));
223  preselCutValuesBarrel_.push_back(config.getParameter<double>("trackPtSumSolidConeBarrel"));
224  preselCutValuesBarrel_.push_back(config.getParameter<double>("trackPtSumHollowConeBarrel"));
225  preselCutValuesBarrel_.push_back(config.getParameter<double>("sigmaIetaIetaCutBarrel"));
226  //
227  preselCutValuesEndcap_.push_back(config.getParameter<double>("minSCEtEndcap"));
228  preselCutValuesEndcap_.push_back(config.getParameter<double>("maxHoverEEndcap"));
229  preselCutValuesEndcap_.push_back(config.getParameter<double>("ecalRecHitSumEtOffsetEndcap"));
230  preselCutValuesEndcap_.push_back(config.getParameter<double>("ecalRecHitSumEtSlopeEndcap"));
231  preselCutValuesEndcap_.push_back(config.getParameter<double>("hcalRecHitSumEtOffsetEndcap"));
232  preselCutValuesEndcap_.push_back(config.getParameter<double>("hcalRecHitSumEtSlopeEndcap"));
233  preselCutValuesEndcap_.push_back(config.getParameter<double>("nTrackSolidConeEndcap"));
234  preselCutValuesEndcap_.push_back(config.getParameter<double>("nTrackHollowConeEndcap"));
235  preselCutValuesEndcap_.push_back(config.getParameter<double>("trackPtSumSolidConeEndcap"));
236  preselCutValuesEndcap_.push_back(config.getParameter<double>("trackPtSumHollowConeEndcap"));
237  preselCutValuesEndcap_.push_back(config.getParameter<double>("sigmaIetaIetaCutEndcap"));
238  //
239 
240  // Register the product
241  produces<reco::PhotonCollection>(PhotonCollection_);
242 }
243 
244 void PhotonProducer::produce(edm::Event& theEvent, const edm::EventSetup& theEventSetup) {
245  HcalPFCuts const* hcalCuts = nullptr;
246  if (cutsFromDB_) {
247  hcalCuts = &theEventSetup.getData(hcalCutsToken_);
248  }
249  using namespace edm;
250  // nEvt_++;
251 
253  auto outputPhotonCollection_p = std::make_unique<reco::PhotonCollection>();
254 
255  // Get the PhotonCore collection
256  bool validPhotonCoreHandle = true;
257  Handle<reco::PhotonCoreCollection> photonCoreHandle;
258  theEvent.getByToken(photonCoreProducer_, photonCoreHandle);
259  if (!photonCoreHandle.isValid()) {
260  edm::LogError("PhotonProducer") << "Error! Can't get the photonCoreProducer";
261  validPhotonCoreHandle = false;
262  }
263 
264  // Get EcalRecHits
265  bool validEcalRecHits = true;
266  Handle<EcalRecHitCollection> barrelHitHandle;
268  theEvent.getByToken(barrelEcalHits_, barrelHitHandle);
269  if (!barrelHitHandle.isValid()) {
270  edm::LogError("PhotonProducer") << "Error! Can't get the barrelEcalHits";
271  validEcalRecHits = false;
272  }
273  if (validEcalRecHits)
274  barrelRecHits = *(barrelHitHandle.product());
275 
276  Handle<EcalRecHitCollection> endcapHitHandle;
277  theEvent.getByToken(endcapEcalHits_, endcapHitHandle);
279  if (!endcapHitHandle.isValid()) {
280  edm::LogError("PhotonProducer") << "Error! Can't get the endcapEcalHits";
281  validEcalRecHits = false;
282  }
283  if (validEcalRecHits)
284  endcapRecHits = *(endcapHitHandle.product());
285 
286  const CaloTopology* topology = &theEventSetup.getData(topologyToken_);
287 
288  // prepare access to hcal data
289  hcalHelperCone_->beginEvent(theEvent, theEventSetup);
290  hcalHelperBc_->beginEvent(theEvent, theEventSetup);
291 
292  // Get the primary event vertex
293  Handle<reco::VertexCollection> vertexHandle;
295  bool validVertex = true;
296  if (usePrimaryVertex_) {
297  theEvent.getByToken(vertexProducer_, vertexHandle);
298  if (!vertexHandle.isValid()) {
299  edm::LogWarning("PhotonProducer") << "Error! Can't get the product primary Vertex Collection "
300  << "\n";
301  validVertex = false;
302  }
303  if (validVertex)
304  vertexCollection = *(vertexHandle.product());
305  }
306 
307  int iSC = 0; // index in photon collection
308  // Loop over barrel and endcap SC collections and fill the photon collection
309  if (validPhotonCoreHandle)
310  fillPhotonCollection(theEvent,
311  theEventSetup,
312  photonCoreHandle,
313  topology,
314  hcalCuts,
315  &barrelRecHits,
316  &endcapRecHits,
318  *hcalHelperBc_,
321  iSC);
322 
323  // put the product in the event
324  edm::LogInfo("PhotonProducer") << " Put in the event " << iSC << " Photon Candidates \n";
325  outputPhotonCollection_p->assign(outputPhotonCollection.begin(), outputPhotonCollection.end());
326 
327  // go back to run2-like 2 effective depths if desired - depth 1 is the normal depth 1, depth 2 is the sum over the rest
328  if (hcalRun2EffDepth_) {
329  for (auto& pho : *outputPhotonCollection_p)
330  pho.hcalToRun2EffDepth();
331  }
332 
333  theEvent.put(std::move(outputPhotonCollection_p), PhotonCollection_);
334 }
335 
337  edm::EventSetup const& es,
338  const edm::Handle<reco::PhotonCoreCollection>& photonCoreHandle,
339  const CaloTopology* topology,
340  const HcalPFCuts* hcalCuts,
341  const EcalRecHitCollection* ecalBarrelHits,
342  const EcalRecHitCollection* ecalEndcapHits,
343  ElectronHcalHelper const& hcalHelperCone,
344  ElectronHcalHelper const& hcalHelperBc,
347  int& iSC) {
348  // get the geometry from the event setup:
350  const CaloSubdetectorGeometry* subDetGeometry = nullptr;
351  const CaloSubdetectorGeometry* geometryES = geometry->getSubdetectorGeometry(DetId::Ecal, EcalPreshower);
352  const EcalRecHitCollection* hits = nullptr;
353  std::vector<double> preselCutValues;
354  float minR9 = 0;
355 
357 
358  std::vector<int> flags_, severitiesexcl_;
359 
360  for (unsigned int lSC = 0; lSC < photonCoreHandle->size(); lSC++) {
361  reco::PhotonCoreRef coreRef(reco::PhotonCoreRef(photonCoreHandle, lSC));
362  reco::SuperClusterRef scRef = coreRef->superCluster();
363  iSC++;
364 
365  int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
366  subDetGeometry = geometry->getSubdetectorGeometry(DetId::Ecal, subdet);
367 
368  if (subdet == EcalBarrel) {
369  preselCutValues = preselCutValuesBarrel_;
371  hits = ecalBarrelHits;
372  flags_ = flagsexclEB_;
373  severitiesexcl_ = severitiesexclEB_;
374  } else if (subdet == EcalEndcap) {
375  preselCutValues = preselCutValuesEndcap_;
377  hits = ecalEndcapHits;
378  flags_ = flagsexclEE_;
379  severitiesexcl_ = severitiesexclEE_;
380  } else {
381  edm::LogWarning("") << "PhotonProducer: do not know if it is a barrel or endcap SuperCluster";
382  }
383  if (hits == nullptr)
384  continue;
385 
386  // SC energy preselection
387  if (scRef->energy() / cosh(scRef->eta()) <= preselCutValues[0])
388  continue;
389 
390  // recalculate position of seed BasicCluster taking shower depth for unconverted photon
391  math::XYZPoint unconvPos =
392  posCalculator_.Calculate_Location(scRef->seed()->hitsAndFractions(), hits, subDetGeometry, geometryES);
393 
394  float maxXtal = EcalClusterTools::eMax(*(scRef->seed()), &(*hits));
395  //AA
396  //Change these to consider severity level of hits
397  float e1x5 = EcalClusterTools::e1x5(*(scRef->seed()), &(*hits), &(*topology));
398  float e2x5 = EcalClusterTools::e2x5Max(*(scRef->seed()), &(*hits), &(*topology));
399  float e3x3 = EcalClusterTools::e3x3(*(scRef->seed()), &(*hits), &(*topology));
400  float e5x5 = EcalClusterTools::e5x5(*(scRef->seed()), &(*hits), &(*topology));
401  const auto& cov = EcalClusterTools::covariances(*(scRef->seed()), &(*hits), &(*topology), geometry);
402  const auto& locCov = EcalClusterTools::localCovariances(*(scRef->seed()), &(*hits), &(*topology));
403 
404  float sigmaEtaEta = sqrt(cov[0]);
405  float sigmaIetaIeta = sqrt(locCov[0]);
406  float r9 = e3x3 / (scRef->rawEnergy());
407 
408  float full5x5_maxXtal = noZS::EcalClusterTools::eMax(*(scRef->seed()), &(*hits));
409  //AA
410  //Change these to consider severity level of hits
411  float full5x5_e1x5 = noZS::EcalClusterTools::e1x5(*(scRef->seed()), &(*hits), &(*topology));
412  float full5x5_e2x5 = noZS::EcalClusterTools::e2x5Max(*(scRef->seed()), &(*hits), &(*topology));
413  float full5x5_e3x3 = noZS::EcalClusterTools::e3x3(*(scRef->seed()), &(*hits), &(*topology));
414  float full5x5_e5x5 = noZS::EcalClusterTools::e5x5(*(scRef->seed()), &(*hits), &(*topology));
415  const auto& full5x5_cov = noZS::EcalClusterTools::covariances(*(scRef->seed()), &(*hits), &(*topology), geometry);
416  const auto& full5x5_locCov = noZS::EcalClusterTools::localCovariances(*(scRef->seed()), &(*hits), &(*topology));
417 
418  float full5x5_sigmaEtaEta = sqrt(full5x5_cov[0]);
419  float full5x5_sigmaIetaIeta = sqrt(full5x5_locCov[0]);
420 
421  // compute position of ECAL shower
422  math::XYZPoint caloPosition;
423  if (r9 > minR9) {
424  caloPosition = unconvPos;
425  } else {
426  caloPosition = scRef->position();
427  }
428 
430  double photonEnergy = 1.;
431  math::XYZPoint vtx(0., 0., 0.);
432  if (!vertexCollection.empty())
433  vtx = vertexCollection.begin()->position();
434  // compute momentum vector of photon from primary vertex and cluster position
435  math::XYZVector direction = caloPosition - vtx;
436  math::XYZVector momentum = direction.unit();
437 
438  // Create dummy candidate with unit momentum and zero energy to allow setting of all variables. The energy is set for last.
439  math::XYZTLorentzVectorD p4(momentum.x(), momentum.y(), momentum.z(), photonEnergy);
440  reco::Photon newCandidate(p4, caloPosition, coreRef, vtx);
441 
442  // Calculate fiducial flags and isolation variable. Blocked are filled from the isolationCalculator
443  reco::Photon::FiducialFlags fiducialFlags;
444  reco::Photon::IsolationVariables isolVarR03, isolVarR04;
445  photonIsolationCalculator_.calculate(&newCandidate, evt, es, fiducialFlags, isolVarR04, isolVarR03, hcalCuts);
446  newCandidate.setFiducialVolumeFlags(fiducialFlags);
447  newCandidate.setIsolationVariables(isolVarR04, isolVarR03);
448 
450  reco::Photon::ShowerShape showerShape;
451  showerShape.e1x5 = e1x5;
452  showerShape.e2x5 = e2x5;
453  showerShape.e3x3 = e3x3;
454  showerShape.e5x5 = e5x5;
455  showerShape.maxEnergyXtal = maxXtal;
456  showerShape.sigmaEtaEta = sigmaEtaEta;
457  showerShape.sigmaIetaIeta = sigmaIetaIeta;
458  for (uint id = 0; id < showerShape.hcalOverEcal.size(); ++id) {
459  showerShape.hcalOverEcal[id] = hcalHelperCone.hcalESum(*scRef, id + 1, hcalCuts) / scRef->energy();
460  showerShape.hcalOverEcalBc[id] = hcalHelperBc.hcalESum(*scRef, id + 1, hcalCuts) / scRef->energy();
461  }
462  showerShape.hcalTowersBehindClusters = hcalHelperBc.hcalTowersBehindClusters(*scRef);
463  showerShape.pre7DepthHcal = false;
464  newCandidate.setShowerShapeVariables(showerShape);
465 
467  reco::Photon::ShowerShape full5x5_showerShape;
468  full5x5_showerShape.e1x5 = full5x5_e1x5;
469  full5x5_showerShape.e2x5 = full5x5_e2x5;
470  full5x5_showerShape.e3x3 = full5x5_e3x3;
471  full5x5_showerShape.e5x5 = full5x5_e5x5;
472  full5x5_showerShape.maxEnergyXtal = full5x5_maxXtal;
473  full5x5_showerShape.sigmaEtaEta = full5x5_sigmaEtaEta;
474  full5x5_showerShape.sigmaIetaIeta = full5x5_sigmaIetaIeta;
475  for (uint id = 0; id < full5x5_showerShape.hcalOverEcal.size(); ++id) {
476  full5x5_showerShape.hcalOverEcal[id] = hcalHelperCone.hcalESum(*scRef, id + 1, hcalCuts) / full5x5_e5x5;
477  full5x5_showerShape.hcalOverEcalBc[id] = hcalHelperBc.hcalESum(*scRef, id + 1, hcalCuts) / full5x5_e5x5;
478  }
479  full5x5_showerShape.hcalTowersBehindClusters = hcalHelperBc.hcalTowersBehindClusters(*scRef);
480  full5x5_showerShape.pre7DepthHcal = false;
481  newCandidate.full5x5_setShowerShapeVariables(full5x5_showerShape);
482 
485  // Photon candidate takes by default (set in photons_cfi.py) a 4-momentum derived from the ecal photon-specific corrections.
486  photonEnergyCorrector_.calculate(evt, newCandidate, subdet, vertexCollection, es);
487  if (candidateP4type_ == "fromEcalEnergy") {
488  newCandidate.setP4(newCandidate.p4(reco::Photon::ecal_photons));
489  newCandidate.setCandidateP4type(reco::Photon::ecal_photons);
490  } else if (candidateP4type_ == "fromRegression") {
491  newCandidate.setP4(newCandidate.p4(reco::Photon::regression1));
492  newCandidate.setCandidateP4type(reco::Photon::regression1);
493  }
494 
495  // fill MIP Vairables for Halo: Block for MIP are filled from PhotonMIPHaloTagger
496  if (subdet == EcalBarrel && runMIPTagger_) {
497  auto mipVar = photonMIPHaloTagger_.mipCalculate(newCandidate, evt, es);
498  newCandidate.setMIPVariables(mipVar);
499  }
500 
502  bool isLooseEM = true;
503  if (newCandidate.pt() < highEt_) {
504  if (newCandidate.hadronicOverEm() >= preselCutValues[1])
505  isLooseEM = false;
506  if (newCandidate.ecalRecHitSumEtConeDR04() > preselCutValues[2] + preselCutValues[3] * newCandidate.pt())
507  isLooseEM = false;
508  if (newCandidate.hcalTowerSumEtConeDR04() > preselCutValues[4] + preselCutValues[5] * newCandidate.pt())
509  isLooseEM = false;
510  if (newCandidate.nTrkSolidConeDR04() > int(preselCutValues[6]))
511  isLooseEM = false;
512  if (newCandidate.nTrkHollowConeDR04() > int(preselCutValues[7]))
513  isLooseEM = false;
514  if (newCandidate.trkSumPtSolidConeDR04() > preselCutValues[8])
515  isLooseEM = false;
516  if (newCandidate.trkSumPtHollowConeDR04() > preselCutValues[9])
517  isLooseEM = false;
518  if (newCandidate.sigmaIetaIeta() > preselCutValues[10])
519  isLooseEM = false;
520  }
521 
522  if (isLooseEM)
523  outputPhotonCollection.push_back(newCandidate);
524  }
525 }
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
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 HcalPFCuts *hcalCuts) const
std::vector< double > preselCutValuesEndcap_
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: Photon.h:159
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
static float eMax(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
T const * product() const
Definition: Handle.h:70
std::unique_ptr< ElectronHcalHelper > hcalHelperCone_
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:526
PositionCalc posCalculator_
const edm::ESGetToken< CaloTopology, CaloTopologyRecord > topologyToken_
Definition: config.py:1
std::array< float, 7 > hcalOverEcalBc
Definition: Photon.h:158
PhotonEnergyCorrector photonEnergyCorrector_
Log< level::Error, false > LogError
edm::EDGetTokenT< HBHERecHitCollection > hbheRecHits
std::unique_ptr< const PhotonMVABasedHaloTagger > photonMVABasedHaloTagger_
bool runMVABasedHaloTagger_
edm::EDGetTokenT< reco::PhotonCoreCollection > photonCoreProducer_
double hOverEConeSize_
static std::array< float, 3 > covariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
PhotonIsolationCalculator photonIsolationCalculator_
const PhotonMIPHaloTagger photonMIPHaloTagger_
static std::array< float, 3 > localCovariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=EgammaLocalCovParamDefaults::kRelEnCut, const EcalPFRecHitThresholds *thresholds=nullptr, float multEB=0.0, float multEE=0.0)
reco::Photon::MIPVariables mipCalculate(const reco::Photon &, const edm::Event &, const edm::EventSetup &es) const
std::unique_ptr< ElectronHcalHelper > hcalHelperBc_
std::vector< int > flagsexclEB_
T sqrt(T t)
Definition: SSEVec.h:23
std::vector< int > flagsexclEE_
std::string candidateP4type_
std::vector< int > severitiesexclEE_
static float e2x5Max(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=nullptr)
Definition: PositionCalc.h:65
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void init(const edm::EventSetup &theEventSetup)
void fillPhotonCollection(edm::Event &evt, edm::EventSetup const &es, const edm::Handle< reco::PhotonCoreCollection > &photonCoreHandle, const CaloTopology *topology, const HcalPFCuts *hcalCuts, const EcalRecHitCollection *ecalBarrelHits, const EcalRecHitCollection *ecalEndcapHits, ElectronHcalHelper const &hcalHelperCone, ElectronHcalHelper const &hcalHelperBc, reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC)
std::vector< int > severitiesexclEB_
std::string PhotonCollection_
Log< level::Info, false > LogInfo
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::array< float, 7 > hcalOverEcal
Definition: Photon.h:156
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
std::vector< double > preselCutValuesBarrel_
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
auto hcalTowersBehindClusters(const reco::SuperCluster &sc) const
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
PhotonProducer(const edm::ParameterSet &ps)
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
EgammaHcalIsolation::arrayHB eThresHB
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
EgammaHcalIsolation::arrayHE eThresHE
Log< level::Warning, false > LogWarning
double hcalESum(const reco::SuperCluster &, int depth, const HcalPFCuts *hcalCuts) const
std::array< double, 4 > arrayHB
void produce(edm::Event &evt, const edm::EventSetup &es) override
static float e1x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
def move(src, dest)
Definition: eostools.py:511
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
std::array< double, 7 > arrayHE