CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PhotonIsolationCalculator.cc
Go to the documentation of this file.
1 
8 
23 
30 //#include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h"
31 
38 
40 
41 
42 #include <string>
43 #include <TMath.h>
44 
45 
47 
48 
49  trackInputTag_ = conf.getParameter<edm::InputTag>("trackProducer");
50  beamSpotProducerTag_ = conf.getParameter<edm::InputTag>("beamSpotProducer");
51  barrelecalCollection_ = conf.getParameter<std::string>("barrelEcalRecHitCollection");
52  barrelecalProducer_ = conf.getParameter<std::string>("barrelEcalRecHitProducer");
53  endcapecalCollection_ = conf.getParameter<std::string>("endcapEcalRecHitCollection");
54  endcapecalProducer_ = conf.getParameter<std::string>("endcapEcalRecHitProducer");
55  hcalCollection_ = conf.getParameter<std::string>("HcalRecHitCollection");
56  hcalProducer_ = conf.getParameter<std::string>("HcalRecHitProducer");
57 
58  // gsfRecoInputTag_ = conf.getParameter<edm::InputTag>("GsfRecoCollection");
59  modulePhiBoundary_ = conf.getParameter<double>("modulePhiBoundary");
60  moduleEtaBoundary_ = conf.getParameter<std::vector<double> >("moduleEtaBoundary");
61  //
62  vetoClusteredEcalHits_ = conf.getParameter<bool>("vetoClustered");
63  useNumCrystals_ = conf.getParameter<bool>("useNumCrystals");
65  trkIsoBarrelRadiusA_.push_back( conf.getParameter<double>("TrackConeOuterRadiusA_Barrel") );
66  trkIsoBarrelRadiusA_.push_back( conf.getParameter<double>("TrackConeInnerRadiusA_Barrel") ) ;
67  trkIsoBarrelRadiusA_.push_back( conf.getParameter<double>("isolationtrackThresholdA_Barrel") );
68  trkIsoBarrelRadiusA_.push_back( conf.getParameter<double>("longImpactParameterA_Barrel") );
69  trkIsoBarrelRadiusA_.push_back( conf.getParameter<double>("transImpactParameterA_Barrel") );
70  trkIsoBarrelRadiusA_.push_back( conf.getParameter<double>("isolationtrackEtaSliceA_Barrel") );
71 
72  ecalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("EcalRecHitInnerRadiusA_Barrel") );
73  ecalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("EcalRecHitOuterRadiusA_Barrel") );
74  ecalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("EcalRecHitEtaSliceA_Barrel") );
75  ecalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("EcalRecHitThreshEA_Barrel") );
76  ecalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("EcalRecHitThreshEtA_Barrel") );
77 
78  hcalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("HcalTowerInnerRadiusA_Barrel") );
79  hcalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("HcalTowerOuterRadiusA_Barrel") );
80  hcalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("HcalTowerThreshEA_Barrel") );
81  hcalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("HcalDepth1TowerInnerRadiusA_Barrel") );
82  hcalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("HcalDepth1TowerOuterRadiusA_Barrel") );
83  hcalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("HcalDepth1TowerThreshEA_Barrel") );
84  hcalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("HcalDepth2TowerInnerRadiusA_Barrel") );
85  hcalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("HcalDepth2TowerOuterRadiusA_Barrel") );
86  hcalIsoBarrelRadiusA_.push_back( conf.getParameter<double>("HcalDepth2TowerThreshEA_Barrel") );
87 
88 
89  trkIsoBarrelRadiusB_.push_back( conf.getParameter<double>("TrackConeOuterRadiusB_Barrel") );
90  trkIsoBarrelRadiusB_.push_back( conf.getParameter<double>("TrackConeInnerRadiusB_Barrel") ) ;
91  trkIsoBarrelRadiusB_.push_back( conf.getParameter<double>("isolationtrackThresholdB_Barrel") );
92  trkIsoBarrelRadiusB_.push_back( conf.getParameter<double>("longImpactParameterB_Barrel") );
93  trkIsoBarrelRadiusB_.push_back( conf.getParameter<double>("transImpactParameterB_Barrel") );
94  trkIsoBarrelRadiusB_.push_back( conf.getParameter<double>("isolationtrackEtaSliceB_Barrel") );
95 
96  ecalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("EcalRecHitInnerRadiusB_Barrel") );
97  ecalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("EcalRecHitOuterRadiusB_Barrel") );
98  ecalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("EcalRecHitEtaSliceB_Barrel") );
99  ecalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("EcalRecHitThreshEB_Barrel") );
100  ecalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("EcalRecHitThreshEtB_Barrel") );
101 
102  hcalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("HcalTowerInnerRadiusB_Barrel") );
103  hcalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("HcalTowerOuterRadiusB_Barrel") );
104  hcalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("HcalTowerThreshEB_Barrel") );
105  hcalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("HcalDepth1TowerInnerRadiusB_Barrel") );
106  hcalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("HcalDepth1TowerOuterRadiusB_Barrel") );
107  hcalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("HcalDepth1TowerThreshEB_Barrel") );
108  hcalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("HcalDepth2TowerInnerRadiusB_Barrel") );
109  hcalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("HcalDepth2TowerOuterRadiusB_Barrel") );
110  hcalIsoBarrelRadiusB_.push_back( conf.getParameter<double>("HcalDepth2TowerThreshEB_Barrel") );
111 
113  trkIsoEndcapRadiusA_.push_back( conf.getParameter<double>("TrackConeOuterRadiusA_Endcap") );
114  trkIsoEndcapRadiusA_.push_back( conf.getParameter<double>("TrackConeInnerRadiusA_Endcap") ) ;
115  trkIsoEndcapRadiusA_.push_back( conf.getParameter<double>("isolationtrackThresholdA_Endcap") );
116  trkIsoEndcapRadiusA_.push_back( conf.getParameter<double>("longImpactParameterA_Endcap") );
117  trkIsoEndcapRadiusA_.push_back( conf.getParameter<double>("transImpactParameterA_Endcap") );
118  trkIsoEndcapRadiusA_.push_back( conf.getParameter<double>("isolationtrackEtaSliceA_Endcap") );
119 
120 
121  ecalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("EcalRecHitInnerRadiusA_Endcap") );
122  ecalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("EcalRecHitOuterRadiusA_Endcap") );
123  ecalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("EcalRecHitEtaSliceA_Endcap") );
124  ecalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("EcalRecHitThreshEA_Endcap") );
125  ecalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("EcalRecHitThreshEtA_Endcap") );
126 
127 
128  hcalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("HcalTowerInnerRadiusA_Endcap") );
129  hcalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("HcalTowerOuterRadiusA_Endcap") );
130  hcalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("HcalTowerThreshEA_Endcap") );
131  hcalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("HcalDepth1TowerInnerRadiusA_Endcap") );
132  hcalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("HcalDepth1TowerOuterRadiusA_Endcap") );
133  hcalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("HcalDepth1TowerThreshEA_Endcap") );
134  hcalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("HcalDepth2TowerInnerRadiusA_Endcap") );
135  hcalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("HcalDepth2TowerOuterRadiusA_Endcap") );
136  hcalIsoEndcapRadiusA_.push_back( conf.getParameter<double>("HcalDepth2TowerThreshEA_Endcap") );
137 
138 
139  trkIsoEndcapRadiusB_.push_back( conf.getParameter<double>("TrackConeOuterRadiusB_Endcap") );
140  trkIsoEndcapRadiusB_.push_back( conf.getParameter<double>("TrackConeInnerRadiusB_Endcap") ) ;
141  trkIsoEndcapRadiusB_.push_back( conf.getParameter<double>("isolationtrackThresholdB_Endcap") );
142  trkIsoEndcapRadiusB_.push_back( conf.getParameter<double>("longImpactParameterB_Endcap") );
143  trkIsoEndcapRadiusB_.push_back( conf.getParameter<double>("transImpactParameterB_Endcap") );
144  trkIsoEndcapRadiusB_.push_back( conf.getParameter<double>("isolationtrackEtaSliceB_Endcap") );
145 
146  ecalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("EcalRecHitInnerRadiusB_Endcap") );
147  ecalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("EcalRecHitOuterRadiusB_Endcap") );
148  ecalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("EcalRecHitEtaSliceB_Endcap") );
149  ecalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("EcalRecHitThreshEB_Endcap") );
150  ecalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("EcalRecHitThreshEtB_Endcap") );
151 
152  hcalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("HcalTowerInnerRadiusB_Endcap") );
153  hcalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("HcalTowerOuterRadiusB_Endcap") );
154  hcalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("HcalTowerThreshEB_Endcap") );
155  hcalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("HcalDepth1TowerInnerRadiusB_Endcap") );
156  hcalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("HcalDepth1TowerOuterRadiusB_Endcap") );
157  hcalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("HcalDepth1TowerThreshEB_Endcap") );
158  hcalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("HcalDepth2TowerInnerRadiusB_Endcap") );
159  hcalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("HcalDepth2TowerOuterRadiusB_Endcap") );
160  hcalIsoEndcapRadiusB_.push_back( conf.getParameter<double>("HcalDepth2TowerThreshEB_Endcap") );
161 
162  //Pick up the variables for the spike removal
163  severityLevelCut_ = conf.getParameter<int>("severityLevelCut");
164  severityRecHitThreshold_ = conf.getParameter<double>("severityRecHitThreshold");
165  spikeIdThreshold_ = conf.getParameter<double>("spikeIdThreshold");
166 
167  const std::vector<int> &tempV(conf.getParameter<std::vector<int> >("recHitFlagsToBeExcluded"));
168  v_chstatus_.clear();
169  v_chstatus_.insert(v_chstatus_.begin(),tempV.begin(),tempV.end());
170  std::sort( v_chstatus_.begin(), v_chstatus_.end() );
171 
172 
173  //Need to figure out which algo to use
174  if(!conf.getParameter<std::string>("spikeIdString").compare("kE1OverE9") ) {
176  } else if(!conf.getParameter<std::string>("spikeIdString").compare("kSwissCross") ) {
178  } else if(!conf.getParameter<std::string>("spikeIdString").compare("kSwissCrossBordersIncluded") ) {
180  } else {
182  edm::LogWarning("PhotonIsolationCalculator|SpikeRemovalForIsolation")
183  << "Cannot find the requested method. kSwissCross set instead.";
184  }
185 }
186 
187 
189  const edm::Event& e,
190  const edm::EventSetup& es,
194 
195 
196  //Get fiducial flags. This does not really belong here
197  bool isEBPho = false;
198  bool isEEPho = false;
199  bool isEBEtaGap = false;
200  bool isEBPhiGap = false;
201  bool isEERingGap = false;
202  bool isEEDeeGap = false;
203  bool isEBEEGap = false;
204  classify(pho, isEBPho, isEEPho, isEBEtaGap, isEBPhiGap, isEERingGap, isEEDeeGap, isEBEEGap);
205  phofid.isEB = isEBPho;
206  phofid.isEE = isEEPho;
207  phofid.isEBEtaGap = isEBEtaGap;
208  phofid.isEBPhiGap = isEBPhiGap;
209  phofid.isEERingGap = isEERingGap;
210  phofid.isEEDeeGap = isEEDeeGap;
211  phofid.isEBEEGap = isEBEEGap;
212 
213  // Calculate isolation variables. cone sizes and thresholds
214  // are set for Barrel and endcap separately
215 
216  reco::SuperClusterRef scRef=pho->superCluster();
217  const reco::BasicCluster & seedCluster = *(scRef->seed()) ;
218  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
219  int detector = seedXtalId.subdetId() ;
220 
221  if (detector==EcalBarrel) {
222 
229 
235 
245 
246 
253 
259 
269 
270 
271 
272 
273  } else if
274  (detector==EcalEndcap) {
275 
282 
288 
298 
299 
306 
307 
313 
323 
324  }
325 
326 
327  //Calculate hollow cone track isolation, CONE A
328  int ntrkA=0;
329  double trkisoA=0;
330  calculateTrackIso(pho, e, trkisoA, ntrkA, isolationtrackThresholdA_,
332 
333  //Calculate solid cone track isolation, CONE A
334  int sntrkA=0;
335  double strkisoA=0;
336  calculateTrackIso(pho, e, strkisoA, sntrkA, isolationtrackThresholdA_,
338 
339  phoisolR1.nTrkHollowCone = ntrkA;
340  phoisolR1.trkSumPtHollowCone = trkisoA;
341  phoisolR1.nTrkSolidCone = sntrkA;
342  phoisolR1.trkSumPtSolidCone = strkisoA;
343 
344  //Calculate hollow cone track isolation, CONE B
345  int ntrkB=0;
346  double trkisoB=0;
347  calculateTrackIso(pho, e, trkisoB, ntrkB, isolationtrackThresholdB_,
349 
350  //Calculate solid cone track isolation, CONE B
351  int sntrkB=0;
352  double strkisoB=0;
353  calculateTrackIso(pho, e, strkisoB, sntrkB, isolationtrackThresholdB_,
355 
356  phoisolR2.nTrkHollowCone = ntrkB;
357  phoisolR2.trkSumPtHollowCone = trkisoB;
358  phoisolR2.nTrkSolidCone = sntrkB;
359  phoisolR2.trkSumPtSolidCone = strkisoB;
360 
361 // std::cout << "Output from solid cone track isolation: ";
362 // std::cout << " Sum pT: " << strkiso << " ntrk: " << sntrk << std::endl;
363 
364  double EcalRecHitIsoA = calculateEcalRecHitIso(pho, e, es,
372  phoisolR1.ecalRecHitSumEt = EcalRecHitIsoA;
373 
374  double EcalRecHitIsoB = calculateEcalRecHitIso(pho, e, es,
382  phoisolR2.ecalRecHitSumEt = EcalRecHitIsoB;
383 
384  double HcalTowerIsoA = calculateHcalTowerIso(pho, e, es, photonHcalTowerConeOuterRadiusA_,
387  phoisolR1.hcalTowerSumEt = HcalTowerIsoA;
388 
389 
390  double HcalTowerIsoB = calculateHcalTowerIso(pho, e, es, photonHcalTowerConeOuterRadiusB_,
393  phoisolR2.hcalTowerSumEt = HcalTowerIsoB;
394 
396 
397  double HcalDepth1TowerIsoA = calculateHcalTowerIso(pho, e, es, photonHcalDepth1TowerConeOuterRadiusA_,
400  phoisolR1.hcalDepth1TowerSumEt = HcalDepth1TowerIsoA;
401 
402 
403  double HcalDepth1TowerIsoB = calculateHcalTowerIso(pho, e, es, photonHcalDepth1TowerConeOuterRadiusB_,
406  phoisolR2.hcalDepth1TowerSumEt = HcalDepth1TowerIsoB;
407 
408 
409 
411 
412  double HcalDepth2TowerIsoA = calculateHcalTowerIso(pho, e, es, photonHcalDepth2TowerConeOuterRadiusA_,
415  phoisolR1.hcalDepth2TowerSumEt = HcalDepth2TowerIsoA;
416 
417 
418  double HcalDepth2TowerIsoB = calculateHcalTowerIso(pho, e, es, photonHcalDepth2TowerConeOuterRadiusB_,
421  phoisolR2.hcalDepth2TowerSumEt = HcalDepth2TowerIsoB;
422 
423 
424 
425 
426 
427 
428 }
429 
430 
432  bool &isEBPho,
433  bool &isEEPho,
434  bool &isEBEtaGap,
435  bool &isEBPhiGap,
436  bool &isEERingGap,
437  bool &isEEDeeGap,
438  bool &isEBEEGap){
439 
440 
441  const reco::CaloCluster & seedCluster = *(photon->superCluster()->seed()) ;
442  // following line is temporary until the D. Evans or F. Ferri submit the new tag for ClusterAlgos
443  // DEfinitive will be
444  // DetId seedXtalId = scRef->seed()->seed();
445  DetId seedXtalId = seedCluster.hitsAndFractions()[0].first ;
446  int detector = seedXtalId.subdetId() ;
447 
448  //Set fiducial flags for this photon.
449  double eta = photon->superCluster()->position().eta();
450  double feta = fabs(eta);
451 
452  if (detector==EcalBarrel) {
453 
454 
455  isEBPho = true;
456  if (EBDetId::isNextToEtaBoundary(EBDetId(seedXtalId))) {
457  if (fabs(feta-1.479)<.1) isEBEEGap = true ;
458  else
459  isEBEtaGap = true ;
460  }
461 
462  if (EBDetId::isNextToPhiBoundary(EBDetId(seedXtalId)))
463  isEBPhiGap = true ;
464 
465 
466 
467  } else if (detector==EcalEndcap) {
468 
469  isEEPho = true;
470  if (EEDetId::isNextToRingBoundary(EEDetId(seedXtalId))) {
471  if (fabs(feta-1.479)<.1) isEBEEGap = true ;
472  else
473  isEERingGap = true ;
474  }
475 
476  if (EEDetId::isNextToDBoundary(EEDetId(seedXtalId)))
477  isEEDeeGap = true ;
478  }
479 
480 
481 }
482 
484  const edm::Event& e,
485  double &trkCone,
486  int &ntrkCone,
487  double pTThresh,
488  double RCone,
489  double RinnerCone,
490  double etaSlice,
491  double lip,
492  double d0){
493  int counter =0;
494  double ptSum =0.;
495 
496 
497  //get the tracks
499  e.getByLabel(trackInputTag_,tracks);
500  if(!tracks.isValid()) {
501  return;
502  }
504  //Photon Eta and Phi. Hope these are correct.
505  reco::BeamSpot vertexBeamSpot;
506  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
507  e.getByLabel(beamSpotProducerTag_,recoBeamSpotHandle);
508  vertexBeamSpot = *recoBeamSpotHandle;
509 
510  PhotonTkIsolation phoIso(RCone,
511  RinnerCone,
512  etaSlice,
513  pTThresh,
514  lip ,
515  d0,
516  trackCollection,
517  math::XYZPoint(vertexBeamSpot.x0(),vertexBeamSpot.y0(),vertexBeamSpot.z0()));
518 
519  counter = phoIso.getNumberTracks(photon);
520  ptSum = phoIso.getPtTracks(photon);
521  ntrkCone = counter;
522  trkCone = ptSum;
523 }
524 
525 
526 
528  const edm::Event& iEvent,
529  const edm::EventSetup& iSetup,
530  double RCone,
531  double RConeInner,
532  double etaSlice,
533  double eMin,
534  double etMin,
535  bool vetoClusteredHits,
536  bool useNumXtals)
537 {
538 
539  edm::Handle<EcalRecHitCollection> ecalhitsCollEB;
540  edm::Handle<EcalRecHitCollection> ecalhitsCollEE;
541 
542  iEvent.getByLabel(endcapecalProducer_,endcapecalCollection_, ecalhitsCollEE);
543 
544  iEvent.getByLabel(barrelecalProducer_,barrelecalCollection_, ecalhitsCollEB);
545 
546  const EcalRecHitCollection* rechitsCollectionEE_ = ecalhitsCollEE.product();
547  const EcalRecHitCollection* rechitsCollectionEB_ = ecalhitsCollEB.product();
548 
549  //Get the channel status from the db
551  iSetup.get<EcalChannelStatusRcd>().get(chStatus);
552 
553  std::auto_ptr<CaloRecHitMetaCollectionV> RecHitsEE(0);
554  RecHitsEE = std::auto_ptr<CaloRecHitMetaCollectionV>(new EcalRecHitMetaCollection(*rechitsCollectionEE_));
555 
556  std::auto_ptr<CaloRecHitMetaCollectionV> RecHitsEB(0);
557  RecHitsEB = std::auto_ptr<CaloRecHitMetaCollectionV>(new EcalRecHitMetaCollection(*rechitsCollectionEB_));
558 
559  edm::ESHandle<CaloGeometry> geoHandle;
560  iSetup.get<CaloGeometryRecord>().get(geoHandle);
561 
562  EgammaRecHitIsolation phoIsoEB(RCone,
563  RConeInner,
564  etaSlice,
565  etMin,
566  eMin,
567  geoHandle,
568  &(*RecHitsEB),
569  DetId::Ecal);
570 
571  phoIsoEB.setVetoClustered(vetoClusteredHits);
572  phoIsoEB.setUseNumCrystals(useNumXtals);
574 
575  double ecalIsolEB = phoIsoEB.getEtSum(photon);
576 
577  EgammaRecHitIsolation phoIsoEE(RCone,
578  RConeInner,
579  etaSlice,
580  etMin,
581  eMin,
582  geoHandle,
583  &(*RecHitsEE),
584  DetId::Ecal);
585 
586  phoIsoEE.setVetoClustered(vetoClusteredHits);
587  phoIsoEE.setUseNumCrystals(useNumXtals);
588 
589  double ecalIsolEE = phoIsoEE.getEtSum(photon);
590  // delete phoIso;
591  double ecalIsol = ecalIsolEB + ecalIsolEE;
592 
593  return ecalIsol;
594 
595 
596 }
597 
599  const edm::Event& iEvent,
600  const edm::EventSetup& iSetup,
601  double RCone,
602  double RConeInner,
603  double eMin,
604  signed int depth )
605 {
606 
607  edm::Handle<CaloTowerCollection> hcalhitsCollH;
608 
609  iEvent.getByLabel(hcalProducer_,hcalCollection_, hcalhitsCollH);
610 
611  const CaloTowerCollection *toww = hcalhitsCollH.product();
612 
613  double ecalIsol=0.;
614 
615  //std::cout << "before iso call" << std::endl;
616  EgammaTowerIsolation phoIso(RCone,
617  RConeInner,
618  eMin,depth,
619  toww);
620  ecalIsol = phoIso.getTowerEtSum(photon);
621  // delete phoIso;
622  //std::cout << "after call" << std::endl;
623  return ecalIsol;
624 
625 
626 }
627 
628 
629 
630 
T getParameter(std::string const &) const
double z0() const
z coordinate
Definition: BeamSpot.h:69
static bool isNextToEtaBoundary(EBDetId id)
Definition: EBDetId.cc:175
std::vector< double > ecalIsoBarrelRadiusA_
reco::SuperClusterRef superCluster() const
Retrieve photonCore attributes.
Definition: Photon.h:54
tuple d0
Definition: debug_cff.py:3
std::vector< double > hcalIsoBarrelRadiusB_
double getEtSum(const reco::Candidate *emObject) const
void calculate(const reco::Photon *, const edm::Event &, const edm::EventSetup &es, reco::Photon::FiducialFlags &phofid, reco::Photon::IsolationVariables &phoisolR03, reco::Photon::IsolationVariables &phoisolR04)
std::vector< double > ecalIsoEndcapRadiusB_
std::vector< double > trkIsoEndcapRadiusB_
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
void calculateTrackIso(const reco::Photon *photon, const edm::Event &e, double &trkCone, int &ntrkCone, double pTThresh=0, double RCone=.4, double RinnerCone=.1, double etaSlice=0.015, double lip=0.2, double d0=0.1)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
Definition: CaloCluster.h:178
T eta() const
double calculateHcalTowerIso(const reco::Photon *photon, const edm::Event &iEvent, const edm::EventSetup &iSetup, double RCone, double RConeInner, double eMin, signed int depth)
std::vector< double > hcalIsoEndcapRadiusA_
void setUseNumCrystals(bool b=true)
std::vector< double > trkIsoBarrelRadiusB_
int iEvent
Definition: GenABIO.cc:243
std::vector< double > hcalIsoBarrelRadiusA_
void setup(const edm::ParameterSet &conf)
static bool isNextToPhiBoundary(EBDetId id)
Definition: EBDetId.cc:180
EcalSeverityLevelAlgo::SpikeId spId_
static bool isNextToRingBoundary(EEDetId id)
Definition: EEDetId.cc:391
static bool isNextToDBoundary(EEDetId id)
Definition: EEDetId.cc:383
bool isValid() const
Definition: HandleBase.h:76
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
double getPtTracks(const reco::Candidate *) const
tuple conf
Definition: dbtoconf.py:185
Definition: DetId.h:20
tuple tracks
Definition: testEve_cfg.py:39
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
const T & get() const
Definition: EventSetup.h:55
std::vector< double > trkIsoEndcapRadiusA_
T const * product() const
Definition: ESHandle.h:62
T const * product() const
Definition: Handle.h:74
std::vector< double > moduleEtaBoundary_
void setVetoClustered(bool b=true)
SimpleCaloRecHitMetaCollection< EcalRecHitCollection > EcalRecHitMetaCollection
std::vector< double > hcalIsoEndcapRadiusB_
double y0() const
y coordinate
Definition: BeamSpot.h:67
std::vector< double > ecalIsoEndcapRadiusA_
std::vector< double > ecalIsoBarrelRadiusB_
double calculateEcalRecHitIso(const reco::Photon *photon, const edm::Event &iEvent, const edm::EventSetup &iSetup, double RCone, double RConeInner, double etaSlice, double eMin, double etMin, bool vetoClusteredHits, bool useNumCrystals)
double getTowerEtSum(const reco::Candidate *) const
void classify(const reco::Photon *photon, bool &isEBPho, bool &isEEPho, bool &isEBEtaGap, bool &isEBPhiGap, bool &isEERingGap, bool &isEEDeeGap, bool &isEBEEGap)
std::vector< double > trkIsoBarrelRadiusA_
void doSpikeRemoval(const EcalRecHitCollection *const recHits, const EcalChannelStatus *const chStatus, const int &severityLevelCut=3, const float &sevRecHitThresh=5.0, const EcalSeverityLevelAlgo::SpikeId &id=EcalSeverityLevelAlgo::kSwissCross, const float &spIdThresh=0.95)
int getNumberTracks(const reco::Candidate *) const
double x0() const
x coordinate
Definition: BeamSpot.h:65