CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GEDPhotonProducer.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <vector>
3 #include <memory>
4 
5 // Framework
9 
11 
16 
17 
29 
31 
34 
37 
40 
45 
46 namespace {
47  inline double ptFast( const double energy,
48  const math::XYZPoint& position,
49  const math::XYZPoint& origin ) {
50  const auto v = position - origin;
51  return energy*std::sqrt(v.perp2()/v.mag2());
52  }
53 }
54 
56 
57  conf_(config)
58 {
59 
60  // use configuration file to setup input/output collection names
61  //
62  photonProducer_ = conf_.getParameter<edm::InputTag>("photonProducer");
63  reconstructionStep_ = conf_.getParameter<std::string>("reconstructionStep");
64 
65  if ( reconstructionStep_ == "final" ) {
67  consumes<reco::PhotonCollection>(photonProducer_);
68  pfCandidates_ =
69  consumes<reco::PFCandidateCollection>(conf_.getParameter<edm::InputTag>("pfCandidates"));
70 
72  consumes<edm::ValueMap<float>>(conf_.getParameter<edm::InputTag>("chargedHadronIsolation"));
74  consumes<edm::ValueMap<float>>(conf_.getParameter<edm::InputTag>("neutralHadronIsolation"));
76  consumes<edm::ValueMap<float>>(conf_.getParameter<edm::InputTag>("photonIsolation"));
77 
78  } else {
79 
81  consumes<reco::PhotonCoreCollection>(photonProducer_);
82 
83  }
84 
86  consumes<reco::PFCandidateCollection>(conf_.getParameter<edm::InputTag>("pfEgammaCandidates"));
88  consumes<EcalRecHitCollection>(conf_.getParameter<edm::InputTag>("barrelEcalHits"));
90  consumes<EcalRecHitCollection>(conf_.getParameter<edm::InputTag>("endcapEcalHits"));
92  consumes<EcalRecHitCollection>(conf_.getParameter<edm::InputTag>("preshowerHits"));
94  consumes<reco::VertexCollection>(conf_.getParameter<edm::InputTag>("primaryVertexProducer"));
95 
96  hcalTowers_ =
97  consumes<CaloTowerCollection>(conf_.getParameter<edm::InputTag>("hcalTowers"));
98  //
99  photonCollection_ = conf_.getParameter<std::string>("outputPhotonCollection");
100  hOverEConeSize_ = conf_.getParameter<double>("hOverEConeSize");
101  highEt_ = conf_.getParameter<double>("highEt");
102  // R9 value to decide converted/unconverted
103  minR9Barrel_ = conf_.getParameter<double>("minR9Barrel");
104  minR9Endcap_ = conf_.getParameter<double>("minR9Endcap");
105  usePrimaryVertex_ = conf_.getParameter<bool>("usePrimaryVertex");
106  runMIPTagger_ = conf_.getParameter<bool>("runMIPTagger");
107 
108  candidateP4type_ = config.getParameter<std::string>("candidateP4type") ;
109  valueMapPFCandPhoton_ = config.getParameter<std::string>("valueMapPhotons");
110 
111 
113  config.getParameter<edm::ParameterSet>("posCalcParameters");
114  posCalculator_ = PositionCalc(posCalcParameters);
115 
116 
117  //AA
118  //Flags and Severities to be excluded from photon calculations
119  const std::vector<std::string> flagnamesEB =
120  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEB");
121 
122  const std::vector<std::string> flagnamesEE =
123  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEE");
124 
125  flagsexclEB_=
126  StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
127 
128  flagsexclEE_=
129  StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
130 
131  const std::vector<std::string> severitynamesEB =
132  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEB");
133 
135  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
136 
137  const std::vector<std::string> severitynamesEE =
138  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEE");
139 
141  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
142 
145  if( conf_.existsAs<edm::ParameterSet>("regressionConfig") ) {
146  auto sumes = consumesCollector();
147  thePhotonEnergyCorrector_->gedRegression()->setConsumes(sumes);
148  }
149 
150  //AA
151 
152  //
153 
154  // Parameters for the position calculation:
155  // std::map<std::string,double> providedParameters;
156  // providedParameters.insert(std::make_pair("LogWeighted",conf_.getParameter<bool>("posCalc_logweight")));
157  //providedParameters.insert(std::make_pair("T0_barl",conf_.getParameter<double>("posCalc_t0_barl")));
158  //providedParameters.insert(std::make_pair("T0_endc",conf_.getParameter<double>("posCalc_t0_endc")));
159  //providedParameters.insert(std::make_pair("T0_endcPresh",conf_.getParameter<double>("posCalc_t0_endcPresh")));
160  //providedParameters.insert(std::make_pair("W0",conf_.getParameter<double>("posCalc_w0")));
161  //providedParameters.insert(std::make_pair("X0",conf_.getParameter<double>("posCalc_x0")));
162  //posCalculator_ = PositionCalc(providedParameters);
163  // cut values for pre-selection
164  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("minSCEtBarrel"));
165  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("maxHoverEBarrel"));
166  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("ecalRecHitSumEtOffsetBarrel"));
167  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("ecalRecHitSumEtSlopeBarrel"));
168  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("hcalTowerSumEtOffsetBarrel"));
169  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("hcalTowerSumEtSlopeBarrel"));
170  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("nTrackSolidConeBarrel"));
171  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("nTrackHollowConeBarrel"));
172  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("trackPtSumSolidConeBarrel"));
173  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("trackPtSumHollowConeBarrel"));
174  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("sigmaIetaIetaCutBarrel"));
175  //
176  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("minSCEtEndcap"));
177  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("maxHoverEEndcap"));
178  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("ecalRecHitSumEtOffsetEndcap"));
179  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("ecalRecHitSumEtSlopeEndcap"));
180  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("hcalTowerSumEtOffsetEndcap"));
181  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("hcalTowerSumEtSlopeEndcap"));
182  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("nTrackSolidConeEndcap"));
183  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("nTrackHollowConeEndcap"));
184  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("trackPtSumSolidConeEndcap"));
185  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("trackPtSumHollowConeEndcap"));
186  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("sigmaIetaIetaCutEndcap"));
187  //
188 
189  //moved from beginRun to here, I dont see how this could cause harm as its just reading in the exactly same parameters each run
190  if ( reconstructionStep_ != "final"){
192  edm::ParameterSet isolationSumsCalculatorSet = conf_.getParameter<edm::ParameterSet>("isolationSumsCalculatorSet");
193  thePhotonIsolationCalculator_->setup(isolationSumsCalculatorSet, flagsexclEB_, flagsexclEE_, severitiesexclEB_, severitiesexclEE_,consumesCollector());
195  edm::ParameterSet mipVariableSet = conf_.getParameter<edm::ParameterSet>("mipVariableSet");
197 
198  }else{
201  }
202  // Register the product
203  produces< reco::PhotonCollection >(photonCollection_);
204  produces< edm::ValueMap<reco::PhotonRef> > (valueMapPFCandPhoton_);
205 
206 
207 }
208 
210 {
214  //delete energyCorrectionF;
215 }
216 
217 
218 
219 void GEDPhotonProducer::beginRun (edm::Run const& r, edm::EventSetup const & theEventSetup) {
220 
221  if ( reconstructionStep_ != "final" ) {
222  thePhotonEnergyCorrector_ -> init(theEventSetup);
223  }
224 
225 }
226 
227 void GEDPhotonProducer::endRun (edm::Run const& r, edm::EventSetup const & theEventSetup) {
228 }
229 
230 
231 void GEDPhotonProducer::produce(edm::Event& theEvent, const edm::EventSetup& theEventSetup) {
232 
233  using namespace edm;
234  // nEvt_++;
235 
236  reco::PhotonCollection outputPhotonCollection;
237  auto outputPhotonCollection_p = std::make_unique<reco::PhotonCollection>();
238  edm::ValueMap<reco::PhotonRef> pfEGCandToPhotonMap;
239 
240 
241  // Get the PhotonCore collection
242  bool validPhotonCoreHandle=false;
243  Handle<reco::PhotonCoreCollection> photonCoreHandle;
244  bool validPhotonHandle= false;
245  Handle<reco::PhotonCollection> photonHandle;
246  //value maps for isolation
247  edm::Handle<edm::ValueMap<float> > phoChargedIsolationMap_CITK;
248  edm::Handle<edm::ValueMap<float> > phoNeutralHadronIsolationMap_CITK;
249  edm::Handle<edm::ValueMap<float> > phoPhotonIsolationMap_CITK;
250 
251  if ( reconstructionStep_ == "final" ) {
252  theEvent.getByToken(photonProducerT_,photonHandle);
253  //get isolation objects
254  theEvent.getByToken(phoChargedIsolationToken_CITK,phoChargedIsolationMap_CITK);
255  theEvent.getByToken(phoNeutralHadronIsolationToken_CITK,phoNeutralHadronIsolationMap_CITK);
256  theEvent.getByToken(phoPhotonIsolationToken_CITK,phoPhotonIsolationMap_CITK);
257  if ( photonHandle.isValid()) {
258  validPhotonHandle=true;
259  } else {
260  throw cms::Exception("GEDPhotonProducer") << "Error! Can't get the product " << photonProducer_.label() << "\n";
261  }
262  } else {
263 
264  theEvent.getByToken(photonCoreProducerT_,photonCoreHandle);
265  if (photonCoreHandle.isValid()) {
266  validPhotonCoreHandle=true;
267  } else {
268  throw cms::Exception("GEDPhotonProducer")
269  << "Error! Can't get the photonCoreProducer" << photonProducer_.label() << "\n";
270  }
271  }
272 
273  // Get EcalRecHits
274  bool validEcalRecHits=true;
275  Handle<EcalRecHitCollection> barrelHitHandle;
276  const EcalRecHitCollection dummyEB;
277  theEvent.getByToken(barrelEcalHits_, barrelHitHandle);
278  if (!barrelHitHandle.isValid()) {
279  throw cms::Exception("GEDPhotonProducer")
280  << "Error! Can't get the barrelEcalHits";
281  }
282  const EcalRecHitCollection& barrelRecHits(validEcalRecHits ? *(barrelHitHandle.product()) : dummyEB);
283 
284  Handle<EcalRecHitCollection> endcapHitHandle;
285  theEvent.getByToken(endcapEcalHits_, endcapHitHandle);
286  const EcalRecHitCollection dummyEE;
287  if (!endcapHitHandle.isValid()) {
288  throw cms::Exception("GEDPhotonProducer")
289  << "Error! Can't get the endcapEcalHits";
290  }
291  const EcalRecHitCollection& endcapRecHits(validEcalRecHits ? *(endcapHitHandle.product()) : dummyEE);
292 
293  bool validPreshowerRecHits=true;
294  Handle<EcalRecHitCollection> preshowerHitHandle;
295  theEvent.getByToken(preshowerHits_, preshowerHitHandle);
296  EcalRecHitCollection preshowerRecHits;
297  if (!preshowerHitHandle.isValid()) {
298  throw cms::Exception("GEDPhotonProducer")
299  << "Error! Can't get the preshowerEcalHits";
300  }
301  if( validPreshowerRecHits ) preshowerRecHits = *(preshowerHitHandle.product());
302 
303 
304 
305  Handle<reco::PFCandidateCollection> pfEGCandidateHandle;
306  // Get the PF refined cluster collection
307  theEvent.getByToken(pfEgammaCandidates_,pfEGCandidateHandle);
308  if (!pfEGCandidateHandle.isValid()) {
309  throw cms::Exception("GEDPhotonProducer")
310  << "Error! Can't get the pfEgammaCandidates";
311  }
312 
313  Handle<reco::PFCandidateCollection> pfCandidateHandle;
314 
315  if ( reconstructionStep_ == "final" ) {
316  // Get the PF candidates collection
317  theEvent.getByToken(pfCandidates_,pfCandidateHandle);
318  if (!pfCandidateHandle.isValid()) {
319  throw cms::Exception("GEDPhotonProducer")
320  << "Error! Can't get the pfCandidates";
321  }
322  }
323 
324  //AA
325  //Get the severity level object
327  theEventSetup.get<EcalSeverityLevelAlgoRcd>().get(sevLv);
328  //
329 
330 
331 // get Hcal towers collection
332  Handle<CaloTowerCollection> hcalTowersHandle;
333  theEvent.getByToken(hcalTowers_, hcalTowersHandle);
334 
335 
336  // get the geometry from the event setup:
337  theEventSetup.get<CaloGeometryRecord>().get(theCaloGeom_);
338 
339  //
340  // update energy correction function
341  // energyCorrectionF->init(theEventSetup);
342 
343  edm::ESHandle<CaloTopology> pTopology;
344  theEventSetup.get<CaloTopologyRecord>().get(theCaloTopo_);
346 
347  // Get the primary event vertex
348  Handle<reco::VertexCollection> vertexHandle;
349  const reco::VertexCollection dummyVC;
350  bool validVertex=true;
351  if ( usePrimaryVertex_ ) {
352  theEvent.getByToken(vertexProducer_, vertexHandle);
353  if (!vertexHandle.isValid()) {
354  throw cms::Exception("GEDPhotonProducer")
355  << "Error! Can't get the product primary Vertex Collection";
356  }
357  }
358  const reco::VertexCollection& vertexCollection(usePrimaryVertex_ && validVertex ? *(vertexHandle.product()) : dummyVC);
359 
360  // math::XYZPoint vtx(0.,0.,0.);
361  //if (vertexCollection.size()>0) vtx = vertexCollection.begin()->position();
362 
363  // get the regression calculator ready
364  thePhotonEnergyCorrector_->init(theEventSetup);
366  thePhotonEnergyCorrector_->gedRegression()->setEvent(theEvent);
367  thePhotonEnergyCorrector_->gedRegression()->setEventContent(theEventSetup);
368  }
369 
370 
371  int iSC=0; // index in photon collection
372  // Loop over barrel and endcap SC collections and fill the photon collection
373  if ( validPhotonCoreHandle)
374  fillPhotonCollection(theEvent,
375  theEventSetup,
376  photonCoreHandle,
377  topology,
378  &barrelRecHits,
379  &endcapRecHits,
380  &preshowerRecHits,
381  hcalTowersHandle,
382  //vtx,
383  vertexCollection,
384  outputPhotonCollection,
385  iSC);
386 
387  iSC=0;
388  if ( validPhotonHandle && reconstructionStep_ == "final" )
389  fillPhotonCollection(theEvent,
390  theEventSetup,
391  photonHandle,
392  pfCandidateHandle,
393  pfEGCandidateHandle,
394  pfEGCandToPhotonMap,
395  vertexHandle,
396  outputPhotonCollection,
397  iSC,
398  phoChargedIsolationMap_CITK,
399  phoNeutralHadronIsolationMap_CITK,
400  phoPhotonIsolationMap_CITK);
401 
402 
403 
404  // put the product in the event
405  edm::LogInfo("GEDPhotonProducer") << " Put in the event " << iSC << " Photon Candidates \n";
406  outputPhotonCollection_p->assign(outputPhotonCollection.begin(),outputPhotonCollection.end());
407  const edm::OrphanHandle<reco::PhotonCollection> photonOrphHandle = theEvent.put(std::move(outputPhotonCollection_p), photonCollection_);
408 
409 
410  if ( reconstructionStep_ != "final" ) {
412  auto pfEGCandToPhotonMap_p = std::make_unique<edm::ValueMap<reco::PhotonRef>>();
413  edm::ValueMap<reco::PhotonRef>::Filler filler(*pfEGCandToPhotonMap_p);
414  unsigned nObj = pfEGCandidateHandle->size();
415  std::vector<reco::PhotonRef> values(nObj);
417  for(unsigned int lCand=0; lCand < nObj; lCand++) {
418  reco::PFCandidateRef pfCandRef (reco::PFCandidateRef(pfEGCandidateHandle,lCand));
419  reco::SuperClusterRef pfScRef = pfCandRef -> superClusterRef();
420 
421  for(unsigned int lSC=0; lSC < photonOrphHandle->size(); lSC++) {
422  reco::PhotonRef photonRef(reco::PhotonRef(photonOrphHandle, lSC));
423  reco::SuperClusterRef scRef=photonRef->superCluster();
424  if ( pfScRef != scRef ) continue;
425  values[lCand] = photonRef;
426  }
427  }
428 
429 
430  filler.insert(pfEGCandidateHandle,values.begin(),values.end());
431  filler.fill();
432  theEvent.put(std::move(pfEGCandToPhotonMap_p),valueMapPFCandPhoton_);
433 
434 
435  }
436 
437 
438 
439 
440 
441 
442 }
443 
445  edm::EventSetup const & es,
446  const edm::Handle<reco::PhotonCoreCollection> & photonCoreHandle,
447  const CaloTopology* topology,
448  const EcalRecHitCollection* ecalBarrelHits,
449  const EcalRecHitCollection* ecalEndcapHits,
450  const EcalRecHitCollection* preshowerHits,
451  const edm::Handle<CaloTowerCollection> & hcalTowersHandle,
453  reco::PhotonCollection & outputPhotonCollection, int& iSC) {
454 
455 
457  const EcalRecHitCollection* hits = nullptr ;
458  std::vector<double> preselCutValues;
459  std::vector<int> flags_, severitiesexcl_;
460 
461  for(unsigned int lSC=0; lSC < photonCoreHandle->size(); lSC++) {
462 
463  reco::PhotonCoreRef coreRef(reco::PhotonCoreRef(photonCoreHandle, lSC));
464  reco::SuperClusterRef parentSCRef = coreRef->parentSuperCluster();
465  reco::SuperClusterRef scRef=coreRef->superCluster();
466 
467 
468 
469  // const reco::SuperCluster* pClus=&(*scRef);
470  iSC++;
471 
472  int 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 ( thedet == DetId::Forward ) {
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 << ' ' << subdet;
491  }
492 
493 
494 
495 
496  // SC energy preselection
497  if (parentSCRef.isNonnull() &&
498  ptFast(parentSCRef->energy(),parentSCRef->position(),math::XYZPoint(0,0,0)) <= preselCutValues[0] ) continue;
499  // calculate HoE
500 
501  const CaloTowerCollection* hcalTowersColl = hcalTowersHandle.product();
502  EgammaTowerIsolation towerIso1(hOverEConeSize_,0.,0.,1,hcalTowersColl) ;
503  EgammaTowerIsolation towerIso2(hOverEConeSize_,0.,0.,2,hcalTowersColl) ;
504  double HoE1=towerIso1.getTowerESum(&(*scRef))/scRef->energy();
505  double HoE2=towerIso2.getTowerESum(&(*scRef))/scRef->energy();
506 
507  EgammaHadTower towerIsoBehindClus(es);
508  towerIsoBehindClus.setTowerCollection(hcalTowersHandle.product());
509  std::vector<CaloTowerDetId> TowersBehindClus = towerIsoBehindClus.towersOf(*scRef);
510  float hcalDepth1OverEcalBc = towerIsoBehindClus.getDepth1HcalESum(TowersBehindClus)/scRef->energy();
511  float hcalDepth2OverEcalBc = towerIsoBehindClus.getDepth2HcalESum(TowersBehindClus)/scRef->energy();
512  // std::cout << " GEDPhotonProducer calculation of HoE with towers in a cone " << HoE1 << " " << HoE2 << std::endl;
513  //std::cout << " GEDPhotonProducer calcualtion of HoE with towers behind the BCs " << hcalDepth1OverEcalBc << " " << hcalDepth2OverEcalBc << std::endl;
514 
515  float maxXtal = ( hits != nullptr ? EcalClusterTools::eMax( *(scRef->seed()), &(*hits) ) : 0.f );
516  //AA
517  //Change these to consider severity level of hits
518  float e1x5 = ( hits != nullptr ? EcalClusterTools::e1x5( *(scRef->seed()), &(*hits), &(*topology)) : 0.f );
519  float e2x5 = ( hits != nullptr ? EcalClusterTools::e2x5Max( *(scRef->seed()), &(*hits), &(*topology)) : 0.f );
520  float e3x3 = ( hits != nullptr ? EcalClusterTools::e3x3( *(scRef->seed()), &(*hits), &(*topology)) : 0.f );
521  float e5x5 = ( hits != nullptr ? EcalClusterTools::e5x5( *(scRef->seed()), &(*hits), &(*topology)) : 0.f );
522  std::vector<float> cov = ( hits != nullptr ? EcalClusterTools::covariances( *(scRef->seed()), &(*hits), &(*topology), geometry) : std::vector<float>( {0.f,0.f,0.f} ) );
523  std::vector<float> locCov = ( hits != nullptr ? EcalClusterTools::localCovariances( *(scRef->seed()), &(*hits), &(*topology)) : std::vector<float>( {0.f,0.f,0.f} ) );
524 
525  float sigmaEtaEta = sqrt(cov[0]);
526  float sigmaIetaIeta = sqrt(locCov[0]);
527 
528  float full5x5_maxXtal = ( hits != nullptr ? noZS::EcalClusterTools::eMax( *(scRef->seed()), &(*hits) ) : 0.f );
529  //AA
530  //Change these to consider severity level of hits
531  float full5x5_e1x5 = ( hits != nullptr ? noZS::EcalClusterTools::e1x5( *(scRef->seed()), &(*hits), &(*topology)) : 0.f );
532  float full5x5_e2x5 = ( hits != nullptr ? noZS::EcalClusterTools::e2x5Max( *(scRef->seed()), &(*hits), &(*topology)) : 0.f );
533  float full5x5_e3x3 = ( hits != nullptr ? noZS::EcalClusterTools::e3x3( *(scRef->seed()), &(*hits), &(*topology)) : 0.f );
534  float full5x5_e5x5 = ( hits != nullptr ? noZS::EcalClusterTools::e5x5( *(scRef->seed()), &(*hits), &(*topology)) : 0.f );
535  std::vector<float> full5x5_cov = ( hits != nullptr ? noZS::EcalClusterTools::covariances( *(scRef->seed()), &(*hits), &(*topology), geometry) : std::vector<float>( {0.f,0.f,0.f} ) );
536  std::vector<float> full5x5_locCov = ( hits != nullptr ? noZS::EcalClusterTools::localCovariances( *(scRef->seed()), &(*hits), &(*topology)) : std::vector<float>( {0.f,0.f,0.f} ) );
537 
538  float full5x5_sigmaEtaEta = sqrt(full5x5_cov[0]);
539  float full5x5_sigmaIetaIeta = sqrt(full5x5_locCov[0]);
540 
541  // compute position of ECAL shower
542  math::XYZPoint caloPosition = scRef->position();
543 
544 
546  double photonEnergy=1.;
547  math::XYZPoint vtx(0.,0.,0.);
548  if (vertexCollection.size()>0) vtx = vertexCollection.begin()->position();
549  // compute momentum vector of photon from primary vertex and cluster position
550  math::XYZVector direction = caloPosition - vtx;
551  //math::XYZVector momentum = direction.unit() * photonEnergy ;
552  math::XYZVector momentum = direction.unit() ;
553 
554  // Create dummy candidate with unit momentum and zero energy to allow setting of all variables. The energy is set for last.
555  math::XYZTLorentzVectorD p4(momentum.x(), momentum.y(), momentum.z(), photonEnergy );
556  reco::Photon newCandidate(p4, caloPosition, coreRef, vtx);
557 
558  //std::cout << " standard p4 before " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
559  //std::cout << " type " <<newCandidate.getCandidateP4type() << " standard p4 after " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
560 
561  // Calculate fiducial flags and isolation variable. Blocked are filled from the isolationCalculator
562  reco::Photon::FiducialFlags fiducialFlags;
563  reco::Photon::IsolationVariables isolVarR03, isolVarR04;
564  if( thedet != DetId::Forward && thedet != DetId::Hcal) {
565  thePhotonIsolationCalculator_->calculate( &newCandidate,evt,es,fiducialFlags,isolVarR04, isolVarR03);
566  }
567  newCandidate.setFiducialVolumeFlags( fiducialFlags );
568  newCandidate.setIsolationVariables(isolVarR04, isolVarR03 );
569 
570 
572  reco::Photon::ShowerShape showerShape;
573  showerShape.e1x5= e1x5;
574  showerShape.e2x5= e2x5;
575  showerShape.e3x3= e3x3;
576  showerShape.e5x5= e5x5;
577  showerShape.maxEnergyXtal = maxXtal;
578  showerShape.sigmaEtaEta = sigmaEtaEta;
579  showerShape.sigmaIetaIeta = sigmaIetaIeta;
580  showerShape.hcalDepth1OverEcal = HoE1;
581  showerShape.hcalDepth2OverEcal = HoE2;
582  showerShape.hcalDepth1OverEcalBc = hcalDepth1OverEcalBc;
583  showerShape.hcalDepth2OverEcalBc = hcalDepth2OverEcalBc;
584  showerShape.hcalTowersBehindClusters = TowersBehindClus;
586  const float spp = (!edm::isFinite(locCov[2]) ? 0. : sqrt(locCov[2]));
587  const float sep = locCov[1];
588  showerShape.sigmaIetaIphi = sep;
589  showerShape.sigmaIphiIphi = spp;
590  showerShape.e2nd = ( hits != nullptr ? EcalClusterTools::e2nd(*(scRef->seed()),&(*hits)) : 0.f );
591  showerShape.eTop = ( hits != nullptr ? EcalClusterTools::eTop(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
592  showerShape.eLeft = ( hits != nullptr ? EcalClusterTools::eLeft(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
593  showerShape.eRight = ( hits != nullptr ? EcalClusterTools::eRight(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
594  showerShape.eBottom = ( hits != nullptr ? EcalClusterTools::eBottom(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
595  showerShape.e1x3 = ( hits != nullptr ? EcalClusterTools::e1x3(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
596  showerShape.e2x2 = ( hits != nullptr ? EcalClusterTools::e2x2(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
597  showerShape.e2x5Max = ( hits != nullptr ? EcalClusterTools::e2x5Max(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
598  showerShape.e2x5Left = ( hits != nullptr ? EcalClusterTools::e2x5Left(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
599  showerShape.e2x5Right = ( hits != nullptr ? EcalClusterTools::e2x5Right(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
600  showerShape.e2x5Top = ( hits != nullptr ? EcalClusterTools::e2x5Top(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
601  showerShape.e2x5Bottom = ( hits != nullptr ? EcalClusterTools::e2x5Bottom(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
602  // fill preshower shapes
604  const float sigmaRR = toolsforES.eseffsirir( *scRef );
605  showerShape.effSigmaRR = sigmaRR;
606  newCandidate.setShowerShapeVariables ( showerShape );
607 
609  reco::Photon::ShowerShape full5x5_showerShape;
610  full5x5_showerShape.e1x5= full5x5_e1x5;
611  full5x5_showerShape.e2x5= full5x5_e2x5;
612  full5x5_showerShape.e3x3= full5x5_e3x3;
613  full5x5_showerShape.e5x5= full5x5_e5x5;
614  full5x5_showerShape.maxEnergyXtal = full5x5_maxXtal;
615  full5x5_showerShape.sigmaEtaEta = full5x5_sigmaEtaEta;
616  full5x5_showerShape.sigmaIetaIeta = full5x5_sigmaIetaIeta;
618  const float full5x5_spp = (!edm::isFinite(full5x5_locCov[2]) ? 0. : sqrt(full5x5_locCov[2]));
619  const float full5x5_sep = full5x5_locCov[1];
620  full5x5_showerShape.sigmaIetaIphi = full5x5_sep;
621  full5x5_showerShape.sigmaIphiIphi = full5x5_spp;
622  full5x5_showerShape.e2nd = ( hits != nullptr ? noZS::EcalClusterTools::e2nd(*(scRef->seed()),&(*hits)) : 0.f );
623  full5x5_showerShape.eTop = ( hits != nullptr ? noZS::EcalClusterTools::eTop(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
624  full5x5_showerShape.eLeft = ( hits != nullptr ? noZS::EcalClusterTools::eLeft(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
625  full5x5_showerShape.eRight = ( hits != nullptr ? noZS::EcalClusterTools::eRight(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
626  full5x5_showerShape.eBottom = ( hits != nullptr ? noZS::EcalClusterTools::eBottom(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
627  full5x5_showerShape.e1x3 = ( hits != nullptr ? noZS::EcalClusterTools::e1x3(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
628  full5x5_showerShape.e2x2 = ( hits != nullptr ? noZS::EcalClusterTools::e2x2(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
629  full5x5_showerShape.e2x5Max = ( hits != nullptr ? noZS::EcalClusterTools::e2x5Max(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
630  full5x5_showerShape.e2x5Left = ( hits != nullptr ? noZS::EcalClusterTools::e2x5Left(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
631  full5x5_showerShape.e2x5Right = ( hits != nullptr ? noZS::EcalClusterTools::e2x5Right(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
632  full5x5_showerShape.e2x5Top = ( hits != nullptr ? noZS::EcalClusterTools::e2x5Top(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
633  full5x5_showerShape.e2x5Bottom = ( hits != nullptr ? noZS::EcalClusterTools::e2x5Bottom(*(scRef->seed()), &(*hits), &(*topology)) : 0.f );
634  // fill preshower shapes
635  full5x5_showerShape.effSigmaRR = sigmaRR;
636  newCandidate.full5x5_setShowerShapeVariables ( full5x5_showerShape );
637 
638 
639 
642  // Photon candidate takes by default (set in photons_cfi.py)
643  // a 4-momentum derived from the ecal photon-specific corrections.
644  if( thedet != DetId::Forward && thedet != DetId::Hcal) {
645  thePhotonEnergyCorrector_->calculate(evt, newCandidate, subdet, vertexCollection, es);
646  if ( candidateP4type_ == "fromEcalEnergy") {
647  newCandidate.setP4( newCandidate.p4(reco::Photon::ecal_photons) );
648  newCandidate.setCandidateP4type(reco::Photon::ecal_photons);
649  } else if ( candidateP4type_ == "fromRegression1") {
650  newCandidate.setP4( newCandidate.p4(reco::Photon::regression1) );
651  newCandidate.setCandidateP4type(reco::Photon::regression1);
652  } else if ( candidateP4type_ == "fromRegression2") {
653  newCandidate.setP4( newCandidate.p4(reco::Photon::regression2) );
654  newCandidate.setCandidateP4type(reco::Photon::regression2);
655  } else if ( candidateP4type_ == "fromRefinedSCRegression" ) {
656  newCandidate.setP4( newCandidate.p4(reco::Photon::regression2) );
657  newCandidate.setCandidateP4type(reco::Photon::regression2);
658  }
659  }
660 
661  // std::cout << " final p4 " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
662 
663 
664  // std::cout << " GEDPhotonProducer from candidate HoE with towers in a cone " << newCandidate.hadronicOverEm() << " " << newCandidate.hadronicDepth1OverEm() << " " << newCandidate.hadronicDepth2OverEm() << std::endl;
665  // std::cout << " GEDPhotonProducer from candidate of HoE with towers behind the BCs " << newCandidate.hadTowOverEm() << " " << newCandidate.hadTowDepth1OverEm() << " " << newCandidate.hadTowDepth2OverEm() << std::endl;
666 
667 
668  // fill MIP Vairables for Halo: Block for MIP are filled from PhotonMIPHaloTagger
670  if(subdet==EcalBarrel && runMIPTagger_ )
671  {
672 
673  thePhotonMIPHaloTagger_-> MIPcalculate( &newCandidate,evt,es,mipVar);
674  newCandidate.setMIPVariables(mipVar);
675  }
676 
677 
678 
680  bool isLooseEM=true;
681  if ( newCandidate.pt() < highEt_) {
682  if ( newCandidate.hadronicOverEm() >= preselCutValues[1] ) isLooseEM=false;
683  if ( newCandidate.ecalRecHitSumEtConeDR04() > preselCutValues[2]+ preselCutValues[3]*newCandidate.pt() ) isLooseEM=false;
684  if ( newCandidate.hcalTowerSumEtConeDR04() > preselCutValues[4]+ preselCutValues[5]*newCandidate.pt() ) isLooseEM=false;
685  if ( newCandidate.nTrkSolidConeDR04() > int(preselCutValues[6]) ) isLooseEM=false;
686  if ( newCandidate.nTrkHollowConeDR04() > int(preselCutValues[7]) ) isLooseEM=false;
687  if ( newCandidate.trkSumPtSolidConeDR04() > preselCutValues[8] ) isLooseEM=false;
688  if ( newCandidate.trkSumPtHollowConeDR04() > preselCutValues[9] ) isLooseEM=false;
689  if ( newCandidate.sigmaIetaIeta() > preselCutValues[10] ) isLooseEM=false;
690  }
691 
692 
693 
694  if ( isLooseEM)
695  outputPhotonCollection.push_back(newCandidate);
696 
697 
698  }
699 }
700 
701 
702 
703 
705  edm::EventSetup const & es,
706  const edm::Handle<reco::PhotonCollection> & photonHandle,
707  const edm::Handle<reco::PFCandidateCollection> pfCandidateHandle,
708  const edm::Handle<reco::PFCandidateCollection> pfEGCandidateHandle,
709  edm::ValueMap<reco::PhotonRef> pfEGCandToPhotonMap,
711  reco::PhotonCollection & outputPhotonCollection, int& iSC, const edm::Handle<edm::ValueMap<float>>& chargedHadrons_, const edm::Handle<edm::ValueMap<float>>& neutralHadrons_, const edm::Handle<edm::ValueMap<float>>& photons_) {
712 
713 
714 
715  std::vector<double> preselCutValues;
716 
717 
718  for(unsigned int lSC=0; lSC < photonHandle->size(); lSC++) {
719  reco::PhotonRef phoRef(reco::PhotonRef(photonHandle, lSC));
720  reco::SuperClusterRef parentSCRef = phoRef->parentSuperCluster();
721  reco::SuperClusterRef scRef=phoRef->superCluster();
722  int thedet = scRef->seed()->hitsAndFractions()[0].first.det();
723  int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
724  if (subdet==EcalBarrel) {
725  preselCutValues = preselCutValuesBarrel_;
726  } else if (subdet==EcalEndcap) {
727  preselCutValues = preselCutValuesEndcap_;
728  } else if ( thedet == DetId::Forward || thedet == DetId::Hcal) {
729  preselCutValues = preselCutValuesEndcap_;
730  } else {
731  edm::LogWarning("")<<"GEDPhotonProducer: do not know if it is a barrel or endcap SuperCluster" << thedet << ' ' << subdet;
732  }
733 
734 
735 
736  // SC energy preselection
737  if (parentSCRef.isNonnull() &&
738  ptFast(parentSCRef->energy(),parentSCRef->position(),math::XYZPoint(0,0,0)) <= preselCutValues[0] ) continue;
739  reco::Photon newCandidate(*phoRef);
740  iSC++;
741 
742 
743  // Calculate the PF isolation and ID - for the time being there is no calculation. Only the setting
746 
747  //get the pointer for the photon object
748  edm::Ptr<reco::Photon> photonPtr(photonHandle, lSC);
749 
750  pfIso.chargedHadronIso = (*chargedHadrons_)[photonPtr] ;
751  pfIso.neutralHadronIso = (*neutralHadrons_)[photonPtr];
752  pfIso.photonIso = (*photons_)[photonPtr];
753  newCandidate.setPflowIsolationVariables(pfIso);
754  newCandidate.setPflowIDVariables(pfID);
755 
756 
757  // do the regression
758  thePhotonEnergyCorrector_->calculate(evt, newCandidate, subdet, *vertexHandle, es);
759  if ( candidateP4type_ == "fromEcalEnergy") {
760  newCandidate.setP4( newCandidate.p4(reco::Photon::ecal_photons) );
762  } else if ( candidateP4type_ == "fromRegression1") {
763  newCandidate.setP4( newCandidate.p4(reco::Photon::regression1) );
765  } else if ( candidateP4type_ == "fromRegression2") {
766  newCandidate.setP4( newCandidate.p4(reco::Photon::regression2) );
768  } else if ( candidateP4type_ == "fromRefinedSCRegression" ) {
769  newCandidate.setP4( newCandidate.p4(reco::Photon::regression2) );
771  }
772 
773  // std::cout << " GEDPhotonProducer pf based isolation chargedHadron " << newCandidate.chargedHadronIso() << " neutralHadron " << newCandidate.neutralHadronIso() << " Photon " << newCandidate.photonIso() << std::endl;
774  //std::cout << " GEDPhotonProducer from candidate HoE with towers in a cone " << newCandidate.hadronicOverEm() << " " << newCandidate.hadronicDepth1OverEm() << " " << newCandidate.hadronicDepth2OverEm() << std::endl;
775  //std::cout << " GEDPhotonProducer from candidate of HoE with towers behind the BCs " << newCandidate.hadTowOverEm() << " " << newCandidate.hadTowDepth1OverEm() << " " << newCandidate.hadTowDepth2OverEm() << std::endl;
776  //std::cout << " standard p4 before " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
777  //std::cout << " type " <<newCandidate.getCandidateP4type() << " standard p4 after " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
778  //std::cout << " final p4 " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
779 
780  outputPhotonCollection.push_back(newCandidate);
781 
782  }
783 
784 }
edm::InputTag photonProducer_
void setPflowIsolationVariables(const PflowIsolationVariables &pfisol)
Set Particle Flow Isolation variables.
Definition: Photon.h:479
T getParameter(std::string const &) const
PhotonEnergyCorrector * thePhotonEnergyCorrector_
PhotonMIPHaloTagger * thePhotonMIPHaloTagger_
virtual void endRun(edm::Run const &, edm::EventSetup const &) overridefinal
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
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
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandidates_
edm::ESHandle< CaloGeometry > theCaloGeom_
static float e2x5Bottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
std::vector< CaloTowerDetId > hcalTowersBehindClusters
Definition: Photon.h:151
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
void setCandidateP4type(const P4type type)
Definition: Photon.h:284
static std::vector< float > covariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
static float eMax(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
virtual void produce(edm::Event &evt, const edm::EventSetup &es) override
edm::EDGetTokenT< edm::ValueMap< float > > phoPhotonIsolationToken_CITK
std::vector< int > flagsexclEB_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
#define nullptr
std::string reconstructionStep_
PhotonIsolationCalculator * thePhotonIsolationCalculator_
std::vector< int > severitiesexclEE_
tuple vertexCollection
std::unique_ptr< ModifyObjectValueBase > & gedRegression()
double ptFast(const double energy, const math::XYZPoint &position, const math::XYZPoint &origin)
std::string photonCollection_
static float e2x5Top(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
bool isFinite(T x)
edm::ESHandle< CaloTopology > theCaloTopo_
void setTowerCollection(const CaloTowerCollection *towercollection)
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
PositionCalc posCalculator_
double getDepth1HcalESum(const reco::SuperCluster &sc) const
static float e2x2(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T sqrt(T t)
Definition: SSEVec.h:18
double p4[4]
Definition: TauolaWrapper.h:92
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)
void setPflowIDVariables(const PflowIDVariables &pfid)
Definition: Photon.h:502
def move
Definition: eostools.py:510
static float e2nd(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
std::vector< int > flagsexclEE_
edm::EDGetTokenT< reco::PhotonCoreCollection > photonCoreProducerT_
static float e2x5Max(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
edm::EDGetTokenT< edm::ValueMap< float > > phoChargedIsolationToken_CITK
double f[11][100]
static float eBottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static float e2x5Right(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
void init(const edm::EventSetup &theEventSetup)
tuple posCalcParameters
void setup(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
double getTowerESum(const reco::Candidate *cand, const std::vector< CaloTowerDetId > *detIdToExclude=0) const
edm::EDGetTokenT< reco::PFCandidateCollection > pfEgammaCandidates_
std::vector< int > severitiesexclEB_
static float eTop(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
GEDPhotonProducer(const edm::ParameterSet &ps)
T const * product() const
Definition: Handle.h:81
std::vector< double > preselCutValuesBarrel_
edm::EDGetTokenT< reco::PhotonCollection > photonProducerT_
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
const T & get() const
Definition: EventSetup.h:56
std::vector< double > preselCutValuesEndcap_
T const * product() const
Definition: ESHandle.h:86
static float e2x5Left(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
const LorentzVector & p4(P4type type) const
std::string candidateP4type_
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, const edm::Handle< CaloTowerCollection > &hcalTowersHandle, const reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC)
virtual void beginRun(edm::Run const &r, edm::EventSetup const &es) overridefinal
std::string const & label() const
Definition: InputTag.h:36
std::vector< CaloTowerDetId > towersOf(const reco::SuperCluster &sc) const
edm::EDGetTokenT< edm::ValueMap< float > > phoNeutralHadronIsolationToken_CITK
double getDepth2HcalESum(const reco::SuperCluster &sc) const
ESHandle< TrackerGeometry > geometry
static int position[264][3]
Definition: ReadPGInfo.cc:509
edm::ParameterSet conf_
static float eRight(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static float e1x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
static float eLeft(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static std::vector< float > localCovariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=4.7)
edm::EDGetTokenT< EcalRecHitCollection > preshowerHits_
static float e1x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
Definition: Run.h:42
void setP4(P4type type, const LorentzVector &p4, float p4Error, bool setToRecoCandidate)
std::string valueMapPFCandPhoton_
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)