CMS 3D CMS Logo

PhotonProducer.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <vector>
3 #include <memory>
4 
5 // Framework
8 
10 
15 
16 
24 
27 
30 
37 
39 
40  conf_(config)
41 {
42 
43  // use onfiguration file to setup input/output collection names
44 
46  consumes<reco::PhotonCoreCollection>(conf_.getParameter<edm::InputTag>("photonCoreProducer"));
48  consumes<EcalRecHitCollection>(conf_.getParameter<edm::InputTag>("barrelEcalHits"));
50  consumes<EcalRecHitCollection>(conf_.getParameter<edm::InputTag>("endcapEcalHits"));
52  consumes<reco::VertexCollection>(conf_.getParameter<edm::InputTag>("primaryVertexProducer"));
53  hcalTowers_ =
54  consumes<CaloTowerCollection>(conf_.getParameter<edm::InputTag>("hcalTowers"));
55  hOverEConeSize_ = conf_.getParameter<double>("hOverEConeSize");
56  highEt_ = conf_.getParameter<double>("highEt");
57  // R9 value to decide converted/unconverted
58  minR9Barrel_ = conf_.getParameter<double>("minR9Barrel");
59  minR9Endcap_ = conf_.getParameter<double>("minR9Endcap");
60  usePrimaryVertex_ = conf_.getParameter<bool>("usePrimaryVertex");
61  runMIPTagger_ = conf_.getParameter<bool>("runMIPTagger");
62 
63  candidateP4type_ = config.getParameter<std::string>("candidateP4type") ;
64 
66  config.getParameter<edm::ParameterSet>("posCalcParameters");
67  posCalculator_ = PositionCalc(posCalcParameters);
68 
69 
70  //AA
71  //Flags and Severities to be excluded from photon calculations
72  const std::vector<std::string> flagnamesEB =
73  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEB");
74 
75  const std::vector<std::string> flagnamesEE =
76  config.getParameter<std::vector<std::string> >("RecHitFlagToBeExcludedEE");
77 
79  StringToEnumValue<EcalRecHit::Flags>(flagnamesEB);
80 
82  StringToEnumValue<EcalRecHit::Flags>(flagnamesEE);
83 
84  const std::vector<std::string> severitynamesEB =
85  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEB");
86 
88  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEB);
89 
90  const std::vector<std::string> severitynamesEE =
91  config.getParameter<std::vector<std::string> >("RecHitSeverityToBeExcludedEE");
92 
94  StringToEnumValue<EcalSeverityLevel::SeverityLevel>(severitynamesEE);
95 
96  //AA
97 
98  //
99 
100  // Parameters for the position calculation:
101  // std::map<std::string,double> providedParameters;
102  // providedParameters.insert(std::make_pair("LogWeighted",conf_.getParameter<bool>("posCalc_logweight")));
103  //providedParameters.insert(std::make_pair("T0_barl",conf_.getParameter<double>("posCalc_t0_barl")));
104  //providedParameters.insert(std::make_pair("T0_endc",conf_.getParameter<double>("posCalc_t0_endc")));
105  //providedParameters.insert(std::make_pair("T0_endcPresh",conf_.getParameter<double>("posCalc_t0_endcPresh")));
106  //providedParameters.insert(std::make_pair("W0",conf_.getParameter<double>("posCalc_w0")));
107  //providedParameters.insert(std::make_pair("X0",conf_.getParameter<double>("posCalc_x0")));
108  //posCalculator_ = PositionCalc(providedParameters);
109  // cut values for pre-selection
110  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("minSCEtBarrel"));
111  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("maxHoverEBarrel"));
112  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("ecalRecHitSumEtOffsetBarrel"));
113  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("ecalRecHitSumEtSlopeBarrel"));
114  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("hcalTowerSumEtOffsetBarrel"));
115  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("hcalTowerSumEtSlopeBarrel"));
116  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("nTrackSolidConeBarrel"));
117  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("nTrackHollowConeBarrel"));
118  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("trackPtSumSolidConeBarrel"));
119  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("trackPtSumHollowConeBarrel"));
120  preselCutValuesBarrel_.push_back(conf_.getParameter<double>("sigmaIetaIetaCutBarrel"));
121  //
122  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("minSCEtEndcap"));
123  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("maxHoverEEndcap"));
124  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("ecalRecHitSumEtOffsetEndcap"));
125  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("ecalRecHitSumEtSlopeEndcap"));
126  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("hcalTowerSumEtOffsetEndcap"));
127  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("hcalTowerSumEtSlopeEndcap"));
128  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("nTrackSolidConeEndcap"));
129  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("nTrackHollowConeEndcap"));
130  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("trackPtSumSolidConeEndcap"));
131  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("trackPtSumHollowConeEndcap"));
132  preselCutValuesEndcap_.push_back(conf_.getParameter<double>("sigmaIetaIetaCutEndcap"));
133  //
134 
135  thePhotonEnergyCorrector_ = new PhotonEnergyCorrector(conf_, consumesCollector());
138  thePhotonIsolationCalculator_->setup(isolationSumsCalculatorSet, flagsexclEB_, flagsexclEE_, severitiesexclEB_, severitiesexclEE_,consumesCollector());
139 
140 
143  thePhotonMIPHaloTagger_->setup(mipVariableSet,consumesCollector());
144 
145  // Register the product
146  produces< reco::PhotonCollection >(PhotonCollection_);
147 
148 }
149 
151 {
155  //delete energyCorrectionF;
156 }
157 
158 
159 
160 void PhotonProducer::beginRun (edm::Run const& r, edm::EventSetup const & theEventSetup) {
161 
162 
163 
164  thePhotonEnergyCorrector_ -> init(theEventSetup);
165 }
166 
167 void PhotonProducer::endRun (edm::Run const& r, edm::EventSetup const & theEventSetup) {
168 }
169 
170 
171 void PhotonProducer::produce(edm::Event& theEvent, const edm::EventSetup& theEventSetup) {
172 
173  using namespace edm;
174  // nEvt_++;
175 
177  auto outputPhotonCollection_p = std::make_unique<reco::PhotonCollection>();
178 
179 
180  // Get the PhotonCore collection
181  bool validPhotonCoreHandle=true;
182  Handle<reco::PhotonCoreCollection> photonCoreHandle;
183  theEvent.getByToken(photonCoreProducer_,photonCoreHandle);
184  if (!photonCoreHandle.isValid()) {
185  edm::LogError("PhotonProducer")
186  << "Error! Can't get the photonCoreProducer";
187  validPhotonCoreHandle=false;
188  }
189 
190  // Get EcalRecHits
191  bool validEcalRecHits=true;
192  Handle<EcalRecHitCollection> barrelHitHandle;
194  theEvent.getByToken(barrelEcalHits_, barrelHitHandle);
195  if (!barrelHitHandle.isValid()) {
196  edm::LogError("PhotonProducer")
197  << "Error! Can't get the barrelEcalHits";
198  validEcalRecHits=false;
199  }
200  if ( validEcalRecHits) barrelRecHits = *(barrelHitHandle.product());
201 
202 
203  Handle<EcalRecHitCollection> endcapHitHandle;
204  theEvent.getByToken(endcapEcalHits_, endcapHitHandle);
206  if (!endcapHitHandle.isValid()) {
207  edm::LogError("PhotonProducer")
208  << "Error! Can't get the endcapEcalHits";
209  validEcalRecHits=false;
210  }
211  if( validEcalRecHits) endcapRecHits = *(endcapHitHandle.product());
212 
213  //AA
214  //Get the severity level object
216  theEventSetup.get<EcalSeverityLevelAlgoRcd>().get(sevLv);
217  //
218 
219 
220 // get Hcal towers collection
221  Handle<CaloTowerCollection> hcalTowersHandle;
222  theEvent.getByToken(hcalTowers_, hcalTowersHandle);
223 
224 
225  // get the geometry from the event setup:
226  theEventSetup.get<CaloGeometryRecord>().get(theCaloGeom_);
227 
228  //
229  // update energy correction function
230  // energyCorrectionF->init(theEventSetup);
231 
232  edm::ESHandle<CaloTopology> pTopology;
233  theEventSetup.get<CaloTopologyRecord>().get(theCaloTopo_);
235 
236  // Get the primary event vertex
237  Handle<reco::VertexCollection> vertexHandle;
239  bool validVertex=true;
240  if ( usePrimaryVertex_ ) {
241  theEvent.getByToken(vertexProducer_, vertexHandle);
242  if (!vertexHandle.isValid()) {
243  edm::LogWarning("PhotonProducer") << "Error! Can't get the product primary Vertex Collection "<< "\n";
244  validVertex=false;
245  }
246  if (validVertex) vertexCollection = *(vertexHandle.product());
247  }
248  // math::XYZPoint vtx(0.,0.,0.);
249  //if (vertexCollection.size()>0) vtx = vertexCollection.begin()->position();
250 
251 
252  int iSC=0; // index in photon collection
253  // Loop over barrel and endcap SC collections and fill the photon collection
254  if ( validPhotonCoreHandle)
255  fillPhotonCollection(theEvent,
256  theEventSetup,
257  photonCoreHandle,
258  topology,
259  &barrelRecHits,
260  &endcapRecHits,
261  hcalTowersHandle,
262  //vtx,
263  vertexCollection,
264  outputPhotonCollection,
265  iSC,
266  sevLv.product());
267 
268 
269  // put the product in the event
270  edm::LogInfo("PhotonProducer") << " Put in the event " << iSC << " Photon Candidates \n";
271  outputPhotonCollection_p->assign(outputPhotonCollection.begin(),outputPhotonCollection.end());
272  theEvent.put(std::move(outputPhotonCollection_p), PhotonCollection_);
273 
274 }
275 
277  edm::EventSetup const & es,
278  const edm::Handle<reco::PhotonCoreCollection> & photonCoreHandle,
279  const CaloTopology* topology,
280  const EcalRecHitCollection* ecalBarrelHits,
281  const EcalRecHitCollection* ecalEndcapHits,
282  const edm::Handle<CaloTowerCollection> & hcalTowersHandle,
283  // math::XYZPoint & vtx,
286  const EcalSeverityLevelAlgo * sevLv) {
287 
289  const CaloSubdetectorGeometry* subDetGeometry =nullptr ;
292  std::vector<double> preselCutValues;
293  float minR9=0;
294 
295 
296  std::vector<int> flags_, severitiesexcl_;
297 
298  for(unsigned int lSC=0; lSC < photonCoreHandle->size(); lSC++) {
299 
300  reco::PhotonCoreRef coreRef(reco::PhotonCoreRef(photonCoreHandle, lSC));
301  reco::SuperClusterRef scRef=coreRef->superCluster();
302  // const reco::SuperCluster* pClus=&(*scRef);
303  iSC++;
304 
305  int subdet = scRef->seed()->hitsAndFractions()[0].first.subdetId();
306  subDetGeometry = theCaloGeom_->getSubdetectorGeometry(DetId::Ecal, subdet);
307 
308  if (subdet==EcalBarrel) {
309  preselCutValues = preselCutValuesBarrel_;
310  minR9 = minR9Barrel_;
311  hits = ecalBarrelHits;
312  flags_ = flagsexclEB_;
313  severitiesexcl_ = severitiesexclEB_;
314  } else if (subdet==EcalEndcap) {
315  preselCutValues = preselCutValuesEndcap_;
316  minR9 = minR9Endcap_;
317  hits = ecalEndcapHits;
318  flags_ = flagsexclEE_;
319  severitiesexcl_ = severitiesexclEE_;
320  } else {
321  edm::LogWarning("")<<"PhotonProducer: do not know if it is a barrel or endcap SuperCluster";
322  }
323  if(hits == nullptr) continue;
324 
325  // SC energy preselection
326  if (scRef->energy()/cosh(scRef->eta()) <= preselCutValues[0] ) continue;
327  // calculate HoE
328 
329  const CaloTowerCollection* hcalTowersColl = hcalTowersHandle.product();
330  EgammaTowerIsolation towerIso1(hOverEConeSize_,0.,0.,1,hcalTowersColl) ;
331  EgammaTowerIsolation towerIso2(hOverEConeSize_,0.,0.,2,hcalTowersColl) ;
332  double HoE1=towerIso1.getTowerESum(&(*scRef))/scRef->energy();
333  double HoE2=towerIso2.getTowerESum(&(*scRef))/scRef->energy();
334 
335  EgammaHadTower towerIsoBehindClus(es);
336  towerIsoBehindClus.setTowerCollection(hcalTowersHandle.product());
337  std::vector<CaloTowerDetId> TowersBehindClus = towerIsoBehindClus.towersOf(*scRef);
338  float hcalDepth1OverEcalBc = towerIsoBehindClus.getDepth1HcalESum(TowersBehindClus)/scRef->energy();
339  float hcalDepth2OverEcalBc = towerIsoBehindClus.getDepth2HcalESum(TowersBehindClus)/scRef->energy();
340  // std::cout << " PhotonProducer calculation of HoE with towers in a cone " << HoE1 << " " << HoE2 << std::endl;
341  //std::cout << " PhotonProducer calcualtion of HoE with towers behind the BCs " << hcalDepth1OverEcalBc << " " << hcalDepth2OverEcalBc << std::endl;
342 
343 
344  // recalculate position of seed BasicCluster taking shower depth for unconverted photon
345  math::XYZPoint unconvPos = posCalculator_.Calculate_Location(scRef->seed()->hitsAndFractions(),hits,subDetGeometry,geometryES);
346 
347 
348  float maxXtal = EcalClusterTools::eMax( *(scRef->seed()), &(*hits) );
349  //AA
350  //Change these to consider severity level of hits
351  float e1x5 = EcalClusterTools::e1x5( *(scRef->seed()), &(*hits), &(*topology));
352  float e2x5 = EcalClusterTools::e2x5Max( *(scRef->seed()), &(*hits), &(*topology));
353  float e3x3 = EcalClusterTools::e3x3( *(scRef->seed()), &(*hits), &(*topology));
354  float e5x5 = EcalClusterTools::e5x5( *(scRef->seed()), &(*hits), &(*topology));
355  std::vector<float> cov = EcalClusterTools::covariances( *(scRef->seed()), &(*hits), &(*topology), geometry);
356  std::vector<float> locCov = EcalClusterTools::localCovariances( *(scRef->seed()), &(*hits), &(*topology));
357 
358  float sigmaEtaEta = sqrt(cov[0]);
359  float sigmaIetaIeta = sqrt(locCov[0]);
360  float r9 =e3x3/(scRef->rawEnergy());
361 
362  float full5x5_maxXtal = noZS::EcalClusterTools::eMax( *(scRef->seed()), &(*hits) );
363  //AA
364  //Change these to consider severity level of hits
365  float full5x5_e1x5 = noZS::EcalClusterTools::e1x5( *(scRef->seed()), &(*hits), &(*topology));
366  float full5x5_e2x5 = noZS::EcalClusterTools::e2x5Max( *(scRef->seed()), &(*hits), &(*topology));
367  float full5x5_e3x3 = noZS::EcalClusterTools::e3x3( *(scRef->seed()), &(*hits), &(*topology));
368  float full5x5_e5x5 = noZS::EcalClusterTools::e5x5( *(scRef->seed()), &(*hits), &(*topology));
369  std::vector<float> full5x5_cov = noZS::EcalClusterTools::covariances( *(scRef->seed()), &(*hits), &(*topology), geometry);
370  std::vector<float> full5x5_locCov = noZS::EcalClusterTools::localCovariances( *(scRef->seed()), &(*hits), &(*topology));
371 
372  float full5x5_sigmaEtaEta = sqrt(full5x5_cov[0]);
373  float full5x5_sigmaIetaIeta = sqrt(full5x5_locCov[0]);
374 
375  // compute position of ECAL shower
376  math::XYZPoint caloPosition;
377  if (r9>minR9) {
378  caloPosition = unconvPos;
379  } else {
380  caloPosition = scRef->position();
381  }
382 
384  double photonEnergy=1.;
385  math::XYZPoint vtx(0.,0.,0.);
386  if (!vertexCollection.empty()) vtx = vertexCollection.begin()->position();
387  // compute momentum vector of photon from primary vertex and cluster position
388  math::XYZVector direction = caloPosition - vtx;
389  //math::XYZVector momentum = direction.unit() * photonEnergy ;
390  math::XYZVector momentum = direction.unit() ;
391 
392  // Create dummy candidate with unit momentum and zero energy to allow setting of all variables. The energy is set for last.
393  math::XYZTLorentzVectorD p4(momentum.x(), momentum.y(), momentum.z(), photonEnergy );
394  reco::Photon newCandidate(p4, caloPosition, coreRef, vtx);
395  //std::cout << " standard p4 before " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
396  //std::cout << " type " <<newCandidate.getCandidateP4type() << " standard p4 after " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
397 
398  // Calculate fiducial flags and isolation variable. Blocked are filled from the isolationCalculator
399  reco::Photon::FiducialFlags fiducialFlags;
400  reco::Photon::IsolationVariables isolVarR03, isolVarR04;
401  thePhotonIsolationCalculator_-> calculate ( &newCandidate,evt,es,fiducialFlags,isolVarR04, isolVarR03);
402  newCandidate.setFiducialVolumeFlags( fiducialFlags );
403  newCandidate.setIsolationVariables(isolVarR04, isolVarR03 );
404 
405 
407  reco::Photon::ShowerShape showerShape;
408  showerShape.e1x5= e1x5;
409  showerShape.e2x5= e2x5;
410  showerShape.e3x3= e3x3;
411  showerShape.e5x5= e5x5;
412  showerShape.maxEnergyXtal = maxXtal;
413  showerShape.sigmaEtaEta = sigmaEtaEta;
414  showerShape.sigmaIetaIeta = sigmaIetaIeta;
415  showerShape.hcalDepth1OverEcal = HoE1;
416  showerShape.hcalDepth2OverEcal = HoE2;
417  showerShape.hcalDepth1OverEcalBc = hcalDepth1OverEcalBc;
418  showerShape.hcalDepth2OverEcalBc = hcalDepth2OverEcalBc;
419  showerShape.hcalTowersBehindClusters = TowersBehindClus;
420  newCandidate.setShowerShapeVariables ( showerShape );
421 
423  reco::Photon::ShowerShape full5x5_showerShape;
424  full5x5_showerShape.e1x5= full5x5_e1x5;
425  full5x5_showerShape.e2x5= full5x5_e2x5;
426  full5x5_showerShape.e3x3= full5x5_e3x3;
427  full5x5_showerShape.e5x5= full5x5_e5x5;
428  full5x5_showerShape.maxEnergyXtal = full5x5_maxXtal;
429  full5x5_showerShape.sigmaEtaEta = full5x5_sigmaEtaEta;
430  full5x5_showerShape.sigmaIetaIeta = full5x5_sigmaIetaIeta;
431  newCandidate.full5x5_setShowerShapeVariables ( full5x5_showerShape );
432 
435  // Photon candidate takes by default (set in photons_cfi.py) a 4-momentum derived from the ecal photon-specific corrections.
436  thePhotonEnergyCorrector_->calculate(evt, newCandidate, subdet, vertexCollection,es);
437  if ( candidateP4type_ == "fromEcalEnergy") {
438  newCandidate.setP4( newCandidate.p4(reco::Photon::ecal_photons) );
439  newCandidate.setCandidateP4type(reco::Photon::ecal_photons);
440  } else if ( candidateP4type_ == "fromRegression") {
441  newCandidate.setP4( newCandidate.p4(reco::Photon::regression1) );
442  newCandidate.setCandidateP4type(reco::Photon::regression1);
443  }
444 
445  // std::cout << " final p4 " << newCandidate.p4() << " energy " << newCandidate.energy() << std::endl;
446 
447 
448  // std::cout << " PhotonProducer from candidate HoE with towers in a cone " << newCandidate.hadronicOverEm() << " " << newCandidate.hadronicDepth1OverEm() << " " << newCandidate.hadronicDepth2OverEm() << std::endl;
449  // std::cout << " PhotonProducer from candidate of HoE with towers behind the BCs " << newCandidate.hadTowOverEm() << " " << newCandidate.hadTowDepth1OverEm() << " " << newCandidate.hadTowDepth2OverEm() << std::endl;
450 
451 
452  // fill MIP Vairables for Halo: Block for MIP are filled from PhotonMIPHaloTagger
454  if(subdet==EcalBarrel && runMIPTagger_ )
455  {
456 
457  thePhotonMIPHaloTagger_-> MIPcalculate( &newCandidate,evt,es,mipVar);
458  newCandidate.setMIPVariables(mipVar);
459  }
460 
461 
462 
464  bool isLooseEM=true;
465  if ( newCandidate.pt() < highEt_) {
466  if ( newCandidate.hadronicOverEm() >= preselCutValues[1] ) isLooseEM=false;
467  if ( newCandidate.ecalRecHitSumEtConeDR04() > preselCutValues[2]+ preselCutValues[3]*newCandidate.pt() ) isLooseEM=false;
468  if ( newCandidate.hcalTowerSumEtConeDR04() > preselCutValues[4]+ preselCutValues[5]*newCandidate.pt() ) isLooseEM=false;
469  if ( newCandidate.nTrkSolidConeDR04() > int(preselCutValues[6]) ) isLooseEM=false;
470  if ( newCandidate.nTrkHollowConeDR04() > int(preselCutValues[7]) ) isLooseEM=false;
471  if ( newCandidate.trkSumPtSolidConeDR04() > preselCutValues[8] ) isLooseEM=false;
472  if ( newCandidate.trkSumPtHollowConeDR04() > preselCutValues[9] ) isLooseEM=false;
473  if ( newCandidate.sigmaIetaIeta() > preselCutValues[10] ) isLooseEM=false;
474  }
475 
476 
477 
478  if ( isLooseEM)
479  outputPhotonCollection.push_back(newCandidate);
480 
481 
482  }
483 }
T getParameter(std::string const &) const
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:49
edm::EDGetTokenT< reco::VertexCollection > vertexProducer_
edm::EDGetTokenT< CaloTowerCollection > hcalTowers_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
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 edm::Handle< CaloTowerCollection > &hcalTowersHandle, reco::VertexCollection &pvVertices, reco::PhotonCollection &outputCollection, int &iSC, const EcalSeverityLevelAlgo *sevLv)
std::vector< double > preselCutValuesEndcap_
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
static std::vector< float > covariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
void beginRun(edm::Run const &r, edm::EventSetup const &es) final
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
static float eMax(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
edm::ParameterSet conf_
int init
Definition: HydjetWrapper.h:67
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
PositionCalc posCalculator_
void endRun(edm::Run const &, edm::EventSetup const &) final
Definition: config.py:1
#define nullptr
~PhotonProducer() override
edm::EDGetTokenT< reco::PhotonCoreCollection > photonCoreProducer_
double hOverEConeSize_
void setTowerCollection(const CaloTowerCollection *towercollection)
edm::EDGetTokenT< EcalRecHitCollection > endcapEcalHits_
std::vector< int > flagsexclEB_
double getDepth1HcalESum(const reco::SuperCluster &sc) const
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)
edm::ESHandle< CaloTopology > theCaloTopo_
std::vector< int > flagsexclEE_
std::string candidateP4type_
std::vector< int > severitiesexclEE_
static float e2x5Max(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
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
PhotonIsolationCalculator * thePhotonIsolationCalculator_
std::vector< int > severitiesexclEB_
std::string PhotonCollection_
edm::ESHandle< CaloGeometry > theCaloGeom_
PhotonEnergyCorrector * thePhotonEnergyCorrector_
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
T const * product() const
Definition: Handle.h:81
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
std::vector< double > preselCutValuesBarrel_
std::vector< CaloTowerDetId > towersOf(const reco::SuperCluster &sc) const
double getDepth2HcalESum(const reco::SuperCluster &sc) const
ESHandle< TrackerGeometry > geometry
HLT enums.
PhotonProducer(const edm::ParameterSet &ps)
edm::EDGetTokenT< EcalRecHitCollection > barrelEcalHits_
math::XYZPoint Calculate_Location(const HitsAndFractions &iDetIds, const edm::SortedCollection< HitType > *iRecHits, const CaloSubdetectorGeometry *iSubGeom, const CaloSubdetectorGeometry *iESGeom=0)
Definition: PositionCalc.h:68
T get() const
Definition: EventSetup.h:68
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
PhotonMIPHaloTagger * thePhotonMIPHaloTagger_
void produce(edm::Event &evt, const edm::EventSetup &es) override
T const * product() const
Definition: ESHandle.h:84
static std::vector< float > localCovariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=4.7)
static float e1x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:44
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)