CMS 3D CMS Logo

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