CMS 3D CMS Logo

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