CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RegressionEnergyPatElectronProducer.cc
Go to the documentation of this file.
2 
14 
15 #include <iostream>
16 
19  mayConsume<reco::GsfElectronCollection>(cfg.getParameter<edm::InputTag>("inputElectronsTag"));
20  inputPatElectronsToken_ = mayConsume<pat::ElectronCollection>(cfg.getParameter<edm::InputTag>("inputElectronsTag"));
21  inputCollectionType_ = cfg.getParameter<uint32_t>("inputCollectionType");
22  rhoInputToken_ = consumes<double>(cfg.getParameter<edm::InputTag>("rhoCollection"));
23  verticesInputToken_ = consumes<reco::VertexCollection>(cfg.getParameter<edm::InputTag>("vertexCollection"));
24  energyRegressionType_ = cfg.getParameter<uint32_t>("energyRegressionType");
25  regressionInputFile_ = cfg.getParameter<std::string>("regressionInputFile");
26  recHitCollectionEBToken_ = mayConsume<EcalRecHitCollection>(cfg.getParameter<edm::InputTag>("recHitCollectionEB"));
27  recHitCollectionEEToken_ = mayConsume<EcalRecHitCollection>(cfg.getParameter<edm::InputTag>("recHitCollectionEE"));
30  nameEnergyReg_ = cfg.getParameter<std::string>("nameEnergyReg");
31  nameEnergyErrorReg_ = cfg.getParameter<std::string>("nameEnergyErrorReg");
32  debug_ = cfg.getUntrackedParameter<bool>("debug");
33  useReducedRecHits_ = cfg.getParameter<bool>("useRecHitCollections");
34  produceValueMaps_ = cfg.getParameter<bool>("produceValueMaps");
35 
36  // if Gsf Electrons; useReducedRecHits should be used)
37  if (inputCollectionType_ == 0 && !useReducedRecHits_) {
38  throw cms::Exception("InconsistentParameters")
39  << " *** Inconsistent configuration : if you read GsfElectrons, you should set useRecHitCollections to true "
40  "and provide the correcte values to recHitCollectionEB and recHitCollectionEE (most probably "
41  "reducedEcalRecHitsEB and reducedEcalRecHitsEE )"
42  << std::endl;
43  }
44 
45  if (inputCollectionType_ == 0 && !produceValueMaps_) {
46  edm::LogPrint("RegressionEnergyPatElectronProducer")
47  << " You are running on GsfElectrons and the producer is not configured to produce ValueMaps with the results. "
48  "In that case, it does not nothing !! ";
49  }
50 
51  if (inputCollectionType_ == 0) {
52  // do nothing
53  } else if (inputCollectionType_ == 1) {
54  produces<pat::ElectronCollection>();
55  } else {
56  throw cms::Exception("InconsistentParameters")
57  << " inputCollectionType should be either 0 (GsfElectrons) or 1 (pat::Electrons) ";
58  }
59 
60  //set regression type
62  if (energyRegressionType_ == 1)
64  else if (energyRegressionType_ == 2)
66  else if (energyRegressionType_ == 3)
68 
69  //load weights and initialize
71  regressionEvaluator_->initialize(regressionInputFile_, type);
72 
73  if (produceValueMaps_) {
74  produces<edm::ValueMap<double> >(nameEnergyReg_);
75  produces<edm::ValueMap<double> >(nameEnergyErrorReg_);
76  }
77 
78  //****************************************************************************************
79  //set up regression calculator
80  //****************************************************************************************
81 
82  geomInitialized_ = false;
83 
84  edm::LogPrint("RegressionEnergyPatElectronProducer") << " Finished initialization ";
85 }
86 
88 
91  if (!geomInitialized_) {
94  geomInitialized_ = true;
95  }
96 
97  //**************************************************************************
98  //Get Number of Vertices
99  //**************************************************************************
101  event.getByToken(verticesInputToken_, hVertexProduct);
102  const reco::VertexCollection inVertices = *(hVertexProduct.product());
103 
104  // loop through all vertices
105  Int_t nvertices = 0;
106  for (reco::VertexCollection::const_iterator inV = inVertices.begin(); inV != inVertices.end(); ++inV) {
107  //pass these vertex cuts
108  if (inV->ndof() >= 4 && inV->position().Rho() <= 2.0 && fabs(inV->z()) <= 24.0) {
109  nvertices++;
110  }
111  }
112 
113  //**************************************************************************
114  //Get Rho
115  //**************************************************************************
116  double rho = 0;
117  edm::Handle<double> hRhoKt6PFJets;
118  event.getByToken(rhoInputToken_, hRhoKt6PFJets);
119  rho = (*hRhoKt6PFJets);
120 
121  //*************************************************************************
122  // Get the RecHits
123  //************************************************************************
124 
127  if (useReducedRecHits_) {
128  event.getByToken(recHitCollectionEBToken_, pEBRecHits);
129  event.getByToken(recHitCollectionEEToken_, pEERecHits);
130  }
131 
134  if (inputCollectionType_ == 0) {
135  event.getByToken(inputGsfElectronsToken_, gsfCollectionH);
136  nElectrons_ = gsfCollectionH->size();
137  }
138  if (inputCollectionType_ == 1) {
139  event.getByToken(inputPatElectronsToken_, patCollectionH);
140  nElectrons_ = patCollectionH->size();
141  }
142 
143  // prepare the two even if only one is used
144  std::unique_ptr<pat::ElectronCollection> patElectrons(new pat::ElectronCollection);
145 
146  // Fillers for ValueMaps:
147  std::unique_ptr<edm::ValueMap<double> > regrEnergyMap(new edm::ValueMap<double>());
148  edm::ValueMap<double>::Filler energyFiller(*regrEnergyMap);
149 
150  std::unique_ptr<edm::ValueMap<double> > regrEnergyErrorMap(new edm::ValueMap<double>());
151  edm::ValueMap<double>::Filler energyErrorFiller(*regrEnergyErrorMap);
152 
153  // Reserve the vectors with outputs
154  std::vector<double> energyValues;
155  std::vector<double> energyErrorValues;
156  energyValues.reserve(nElectrons_);
157  energyErrorValues.reserve(nElectrons_);
158 
159  for (unsigned iele = 0; iele < nElectrons_; ++iele) {
160  const reco::GsfElectron* ele = (inputCollectionType_ == 0) ? &(*gsfCollectionH)[iele] : &(*patCollectionH)[iele];
161  if (debug_) {
162  edm::LogPrint("RegressionEnergyPatElectronProducer")
163  << "***********************************************************************\n";
164  edm::LogPrint("RegressionEnergyPatElectronProducer")
165  << "Run Lumi Event: " << event.id().run() << " " << event.luminosityBlock() << " " << event.id().event()
166  << "\n";
167  edm::LogPrint("RegressionEnergyPatElectronProducer")
168  << "Pat Electron : " << ele->pt() << " " << ele->eta() << " " << ele->phi() << "\n";
169  }
170 
171  pat::Electron* myPatElectron = (inputCollectionType_ == 0) ? nullptr : new pat::Electron((*patCollectionH)[iele]);
172  // Get RecHit Collection
173  const EcalRecHitCollection* recHits = nullptr;
174  if (useReducedRecHits_) {
175  if (ele->isEB()) {
176  recHits = pEBRecHits.product();
177  } else
178  recHits = pEERecHits.product();
179  } else {
180  recHits = (*patCollectionH)[iele].recHits();
181  }
182 
183  SuperClusterHelper* mySCHelper = nullptr;
184  if (inputCollectionType_ == 0) {
185  mySCHelper = new SuperClusterHelper(&(*ele), recHits, ecalTopology_, caloGeometry_);
186  } else if (inputCollectionType_ == 1) {
187  mySCHelper = new SuperClusterHelper(&(*patCollectionH)[iele], recHits, ecalTopology_, caloGeometry_);
188  }
189 
190  // apply regression energy
191  Double_t FinalMomentum = 0;
192  Double_t FinalMomentumError = 0;
193  Double_t RegressionMomentum = 0;
194  Double_t RegressionMomentumError = 0;
195 
196  if (energyRegressionType_ == 1) {
197  RegressionMomentum = regressionEvaluator_->regressionValueNoTrkVar(mySCHelper->rawEnergy(),
198  mySCHelper->eta(),
199  mySCHelper->phi(),
200  mySCHelper->r9(),
201  mySCHelper->etaWidth(),
202  mySCHelper->phiWidth(),
203  mySCHelper->clustersSize(),
204  mySCHelper->hadronicOverEm(),
205  rho,
206  nvertices,
207  mySCHelper->seedEta(),
208  mySCHelper->seedPhi(),
209  mySCHelper->seedEnergy(),
210  mySCHelper->e3x3(),
211  mySCHelper->e5x5(),
212  mySCHelper->sigmaIetaIeta(),
213  mySCHelper->spp(),
214  mySCHelper->sep(),
215  mySCHelper->eMax(),
216  mySCHelper->e2nd(),
217  mySCHelper->eTop(),
218  mySCHelper->eBottom(),
219  mySCHelper->eLeft(),
220  mySCHelper->eRight(),
221  mySCHelper->e2x5Max(),
222  mySCHelper->e2x5Top(),
223  mySCHelper->e2x5Bottom(),
224  mySCHelper->e2x5Left(),
225  mySCHelper->e2x5Right(),
226  mySCHelper->ietaSeed(),
227  mySCHelper->iphiSeed(),
228  mySCHelper->etaCrySeed(),
229  mySCHelper->phiCrySeed(),
230  mySCHelper->preshowerEnergyOverRaw(),
231  debug_);
232  RegressionMomentumError =
234  mySCHelper->eta(),
235  mySCHelper->phi(),
236  mySCHelper->r9(),
237  mySCHelper->etaWidth(),
238  mySCHelper->phiWidth(),
239  mySCHelper->clustersSize(),
240  mySCHelper->hadronicOverEm(),
241  rho,
242  nvertices,
243  mySCHelper->seedEta(),
244  mySCHelper->seedPhi(),
245  mySCHelper->seedEnergy(),
246  mySCHelper->e3x3(),
247  mySCHelper->e5x5(),
248  mySCHelper->sigmaIetaIeta(),
249  mySCHelper->spp(),
250  mySCHelper->sep(),
251  mySCHelper->eMax(),
252  mySCHelper->e2nd(),
253  mySCHelper->eTop(),
254  mySCHelper->eBottom(),
255  mySCHelper->eLeft(),
256  mySCHelper->eRight(),
257  mySCHelper->e2x5Max(),
258  mySCHelper->e2x5Top(),
259  mySCHelper->e2x5Bottom(),
260  mySCHelper->e2x5Left(),
261  mySCHelper->e2x5Right(),
262  mySCHelper->ietaSeed(),
263  mySCHelper->iphiSeed(),
264  mySCHelper->etaCrySeed(),
265  mySCHelper->phiCrySeed(),
266  mySCHelper->preshowerEnergyOverRaw(),
267  debug_);
268 
269  // PAT method
270  if (inputCollectionType_ == 1) {
271  myPatElectron->setEcalRegressionEnergy(RegressionMomentum, RegressionMomentumError);
272  }
273  energyValues.push_back(RegressionMomentum);
274  energyErrorValues.push_back(RegressionMomentumError);
275 
276  } else if (energyRegressionType_ == 2) { // ECAL regression with subcluster information
277  RegressionMomentum = regressionEvaluator_->regressionValueWithSubClusters(mySCHelper->rawEnergy(),
278  mySCHelper->eta(),
279  mySCHelper->phi(),
280  mySCHelper->r9(),
281  mySCHelper->etaWidth(),
282  mySCHelper->phiWidth(),
283  mySCHelper->clustersSize(),
284  mySCHelper->hadronicOverEm(),
285  rho,
286  nvertices,
287  mySCHelper->seedEta(),
288  mySCHelper->seedPhi(),
289  mySCHelper->seedEnergy(),
290  mySCHelper->e3x3(),
291  mySCHelper->e5x5(),
292  mySCHelper->sigmaIetaIeta(),
293  mySCHelper->spp(),
294  mySCHelper->sep(),
295  mySCHelper->eMax(),
296  mySCHelper->e2nd(),
297  mySCHelper->eTop(),
298  mySCHelper->eBottom(),
299  mySCHelper->eLeft(),
300  mySCHelper->eRight(),
301  mySCHelper->e2x5Max(),
302  mySCHelper->e2x5Top(),
303  mySCHelper->e2x5Bottom(),
304  mySCHelper->e2x5Left(),
305  mySCHelper->e2x5Right(),
306  mySCHelper->ietaSeed(),
307  mySCHelper->iphiSeed(),
308  mySCHelper->etaCrySeed(),
309  mySCHelper->phiCrySeed(),
310  mySCHelper->preshowerEnergyOverRaw(),
311  ele->ecalDrivenSeed(),
312  ele->isEBEtaGap(),
313  ele->isEBPhiGap(),
314  ele->isEEDeeGap(),
315  mySCHelper->eSubClusters(),
316  mySCHelper->subClusterEnergy(1),
317  mySCHelper->subClusterEta(1),
318  mySCHelper->subClusterPhi(1),
319  mySCHelper->subClusterEmax(1),
320  mySCHelper->subClusterE3x3(1),
321  mySCHelper->subClusterEnergy(2),
322  mySCHelper->subClusterEta(2),
323  mySCHelper->subClusterPhi(2),
324  mySCHelper->subClusterEmax(2),
325  mySCHelper->subClusterE3x3(2),
326  mySCHelper->subClusterEnergy(3),
327  mySCHelper->subClusterEta(3),
328  mySCHelper->subClusterPhi(3),
329  mySCHelper->subClusterEmax(3),
330  mySCHelper->subClusterE3x3(3),
331  mySCHelper->nPreshowerClusters(),
332  mySCHelper->eESClusters(),
333  mySCHelper->esClusterEnergy(0),
334  mySCHelper->esClusterEta(0),
335  mySCHelper->esClusterPhi(0),
336  mySCHelper->esClusterEnergy(1),
337  mySCHelper->esClusterEta(1),
338  mySCHelper->esClusterPhi(1),
339  mySCHelper->esClusterEnergy(2),
340  mySCHelper->esClusterEta(2),
341  mySCHelper->esClusterPhi(2),
342  ele->isEB(),
343  debug_);
344  RegressionMomentumError =
346  mySCHelper->eta(),
347  mySCHelper->phi(),
348  mySCHelper->r9(),
349  mySCHelper->etaWidth(),
350  mySCHelper->phiWidth(),
351  mySCHelper->clustersSize(),
352  mySCHelper->hadronicOverEm(),
353  rho,
354  nvertices,
355  mySCHelper->seedEta(),
356  mySCHelper->seedPhi(),
357  mySCHelper->seedEnergy(),
358  mySCHelper->e3x3(),
359  mySCHelper->e5x5(),
360  mySCHelper->sigmaIetaIeta(),
361  mySCHelper->spp(),
362  mySCHelper->sep(),
363  mySCHelper->eMax(),
364  mySCHelper->e2nd(),
365  mySCHelper->eTop(),
366  mySCHelper->eBottom(),
367  mySCHelper->eLeft(),
368  mySCHelper->eRight(),
369  mySCHelper->e2x5Max(),
370  mySCHelper->e2x5Top(),
371  mySCHelper->e2x5Bottom(),
372  mySCHelper->e2x5Left(),
373  mySCHelper->e2x5Right(),
374  mySCHelper->ietaSeed(),
375  mySCHelper->iphiSeed(),
376  mySCHelper->etaCrySeed(),
377  mySCHelper->phiCrySeed(),
378  mySCHelper->preshowerEnergyOverRaw(),
379  ele->ecalDrivenSeed(),
380  ele->isEBEtaGap(),
381  ele->isEBPhiGap(),
382  ele->isEEDeeGap(),
383  mySCHelper->eSubClusters(),
384  mySCHelper->subClusterEnergy(1),
385  mySCHelper->subClusterEta(1),
386  mySCHelper->subClusterPhi(1),
387  mySCHelper->subClusterEmax(1),
388  mySCHelper->subClusterE3x3(1),
389  mySCHelper->subClusterEnergy(2),
390  mySCHelper->subClusterEta(2),
391  mySCHelper->subClusterPhi(2),
392  mySCHelper->subClusterEmax(2),
393  mySCHelper->subClusterE3x3(2),
394  mySCHelper->subClusterEnergy(3),
395  mySCHelper->subClusterEta(3),
396  mySCHelper->subClusterPhi(3),
397  mySCHelper->subClusterEmax(3),
398  mySCHelper->subClusterE3x3(3),
399  mySCHelper->nPreshowerClusters(),
400  mySCHelper->eESClusters(),
401  mySCHelper->esClusterEnergy(0),
402  mySCHelper->esClusterEta(0),
403  mySCHelper->esClusterPhi(0),
404  mySCHelper->esClusterEnergy(1),
405  mySCHelper->esClusterEta(1),
406  mySCHelper->esClusterPhi(1),
407  mySCHelper->esClusterEnergy(2),
408  mySCHelper->esClusterEta(2),
409  mySCHelper->esClusterPhi(2),
410  ele->isEB(),
411  debug_);
412 
413  // PAT method
414  if (inputCollectionType_ == 1) {
415  myPatElectron->setEcalRegressionEnergy(RegressionMomentum, RegressionMomentumError);
416  }
417  energyValues.push_back(RegressionMomentum);
418  energyErrorValues.push_back(RegressionMomentumError);
419 
420  }
421 
422  else if (energyRegressionType_ == 3) {
423  RegressionMomentum = regressionEvaluator_->regressionValueWithTrkVar(ele->p(),
424  mySCHelper->rawEnergy(),
425  mySCHelper->eta(),
426  mySCHelper->phi(),
427  mySCHelper->etaWidth(),
428  mySCHelper->phiWidth(),
429  mySCHelper->clustersSize(),
430  mySCHelper->hadronicOverEm(),
431  mySCHelper->r9(),
432  rho,
433  nvertices,
434  mySCHelper->seedEta(),
435  mySCHelper->seedPhi(),
436  mySCHelper->seedEnergy(),
437  mySCHelper->e3x3(),
438  mySCHelper->e5x5(),
439  mySCHelper->sigmaIetaIeta(),
440  mySCHelper->spp(),
441  mySCHelper->sep(),
442  mySCHelper->eMax(),
443  mySCHelper->e2nd(),
444  mySCHelper->eTop(),
445  mySCHelper->eBottom(),
446  mySCHelper->eLeft(),
447  mySCHelper->eRight(),
448  mySCHelper->e2x5Max(),
449  mySCHelper->e2x5Top(),
450  mySCHelper->e2x5Bottom(),
451  mySCHelper->e2x5Left(),
452  mySCHelper->e2x5Right(),
453  ele->pt(),
454  ele->trackMomentumAtVtx().R(),
455  ele->fbrem(),
456  ele->charge(),
457  ele->eSuperClusterOverP(),
458  mySCHelper->ietaSeed(),
459  mySCHelper->iphiSeed(),
460  mySCHelper->etaCrySeed(),
461  mySCHelper->phiCrySeed(),
462  mySCHelper->preshowerEnergy(),
463  debug_);
464  RegressionMomentumError = regressionEvaluator_->regressionUncertaintyWithTrkVar(ele->p(),
465  mySCHelper->rawEnergy(),
466  mySCHelper->eta(),
467  mySCHelper->phi(),
468  mySCHelper->etaWidth(),
469  mySCHelper->phiWidth(),
470  mySCHelper->clustersSize(),
471  mySCHelper->hadronicOverEm(),
472  mySCHelper->r9(),
473  rho,
474  nvertices,
475  mySCHelper->seedEta(),
476  mySCHelper->seedPhi(),
477  mySCHelper->seedEnergy(),
478  mySCHelper->e3x3(),
479  mySCHelper->e5x5(),
480  mySCHelper->sigmaIetaIeta(),
481  mySCHelper->spp(),
482  mySCHelper->sep(),
483  mySCHelper->eMax(),
484  mySCHelper->e2nd(),
485  mySCHelper->eTop(),
486  mySCHelper->eBottom(),
487  mySCHelper->eLeft(),
488  mySCHelper->eRight(),
489  mySCHelper->e2x5Max(),
490  mySCHelper->e2x5Top(),
491  mySCHelper->e2x5Bottom(),
492  mySCHelper->e2x5Left(),
493  mySCHelper->e2x5Right(),
494  ele->pt(),
495  ele->trackMomentumAtVtx().R(),
496  ele->fbrem(),
497  ele->charge(),
498  ele->eSuperClusterOverP(),
499  mySCHelper->ietaSeed(),
500  mySCHelper->iphiSeed(),
501  mySCHelper->etaCrySeed(),
502  mySCHelper->phiCrySeed(),
503  mySCHelper->preshowerEnergy(),
504  debug_);
505  FinalMomentum = RegressionMomentum;
506  FinalMomentumError = RegressionMomentumError;
507  const math::XYZTLorentzVector& oldMomentum = ele->p4();
508  math::XYZTLorentzVector newMomentum = math::XYZTLorentzVector(oldMomentum.x() * FinalMomentum / oldMomentum.t(),
509  oldMomentum.y() * FinalMomentum / oldMomentum.t(),
510  oldMomentum.z() * FinalMomentum / oldMomentum.t(),
511  FinalMomentum);
512 
513  myPatElectron->correctEcalEnergy(RegressionMomentum, RegressionMomentumError);
514  myPatElectron->correctMomentum(newMomentum, ele->trackMomentumError(), FinalMomentumError);
515 
516  energyValues.push_back(RegressionMomentum);
517  energyErrorValues.push_back(RegressionMomentumError);
518  } else {
519  edm::LogPrint("RegressionEnergyPatElectronProducer")
520  << "Error: RegressionType = " << energyRegressionType_ << " is not supported.\n";
521  }
522 
523  if (inputCollectionType_ == 1) {
524  patElectrons->push_back(*myPatElectron);
525  }
526  if (myPatElectron)
527  delete myPatElectron;
528  if (mySCHelper)
529  delete mySCHelper;
530  } // loop on electrons
531 
532  // Write the new collection in the event (AOD case)
533  if (inputCollectionType_ == 1) {
534  event.put(std::move(patElectrons));
535  }
536 
537  // now AOD case: write ValueMaps
538  if (produceValueMaps_) {
539  if (inputCollectionType_ == 0) {
540  energyFiller.insert(gsfCollectionH, energyValues.begin(), energyValues.end());
541  energyErrorFiller.insert(gsfCollectionH, energyErrorValues.begin(), energyErrorValues.end());
542  } else if (inputCollectionType_ == 1) {
543  energyFiller.insert(patCollectionH, energyValues.begin(), energyValues.end());
544  energyErrorFiller.insert(patCollectionH, energyErrorValues.begin(), energyErrorValues.end());
545  }
546 
547  energyFiller.fill();
548  energyErrorFiller.fill();
549  event.put(std::move(regrEnergyMap), nameEnergyReg_);
550  event.put(std::move(regrEnergyErrorMap), nameEnergyErrorReg_);
551  }
552 }
553 
T getUntrackedParameter(std::string const &, T const &) const
float trackMomentumError() const
Definition: GsfElectron.h:884
tuple cfg
Definition: looper.py:296
float eESClusters() const
float e2x5Max() const
bool isEBEtaGap() const
Definition: GsfElectron.h:333
double pt() const final
transverse momentum
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:217
float eSuperClusterOverP() const
Definition: GsfElectron.h:221
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > ecalTopoToken_
float esClusterEnergy(unsigned i) const
float sigmaIetaIeta() const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
float subClusterE3x3(unsigned i) const
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
Definition: GsfElectron.h:905
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:268
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:53
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
double regressionValueWithTrkVar(double electronP, double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double pt, double GsfTrackPIn, double fbrem, double Charge, double EoP, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, bool printDebug=false)
float fbrem() const
Definition: GsfElectron.h:809
float eSubClusters() const
double regressionUncertaintyNoTrkVar(double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, bool printDebug=false)
assert(be >=bs)
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEBToken_
float e2x5Right() const
double regressionValueWithSubClusters(double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, double isEcalDriven, double isEtaGap, double isPhiGap, double isDeeGap, double ESubs, double ESub1, double EtaSub1, double PhiSub1, double EMaxSub1, double E3x3Sub1, double ESub2, double EtaSub2, double PhiSub2, double EMaxSub2, double E3x3Sub2, double ESub3, double EtaSub3, double PhiSub3, double EMaxSub3, double E3x3Sub3, double NPshwClusters, double EPshwSubs, double EPshwSub1, double EtaPshwSub1, double PhiPshwSub1, double EPshwSub2, double EtaPshwSub2, double PhiPshwSub2, double EPshwSub3, double EtaPshwSub3, double PhiPshwSub3, bool isEB, bool printDebug=false)
bool isEEDeeGap() const
Definition: GsfElectron.h:336
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEEToken_
float eBottom() const
bool isEB() const
Definition: GsfElectron.h:328
float e2x5Bottom() const
bool getData(T &iHolder) const
Definition: EventSetup.h:128
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
float esClusterEta(unsigned i) const
float etaWidth() const
float rawEnergy() const
float subClusterEnergy(unsigned i) const
double p() const final
magnitude of momentum vector
std::vector< Electron > ElectronCollection
Definition: Electron.h:36
edm::EDGetTokenT< reco::VertexCollection > verticesInputToken_
double regressionValueNoTrkVar(double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, bool printDebug=false)
def move
Definition: eostools.py:511
float eLeft() const
float preshowerEnergyOverRaw() const
void initialize(std::string weightsFile, ElectronEnergyRegressionEvaluate::ElectronEnergyRegressionType type)
float eRight() const
float e2x5Top() const
Log< level::Warning, true > LogPrint
float preshowerEnergy() const
float hadronicOverEm() const
float phiWidth() const
void correctEcalEnergy(float newEnergy, float newEnergyError, bool corrEovP=true)
Definition: GsfElectron.h:901
float subClusterEmax(unsigned i) const
ElectronEnergyRegressionEvaluate * regressionEvaluator_
float esClusterPhi(unsigned i) const
float subClusterPhi(unsigned i) const
T const * product() const
Definition: Handle.h:70
double regressionUncertaintyWithTrkVar(double electronP, double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double pt, double GsfTrackPIn, double fbrem, double Charge, double EoP, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, bool printDebug=false)
float seedEta() const
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Analysis-level electron class.
Definition: Electron.h:51
edm::EDGetTokenT< reco::GsfElectronCollection > inputGsfElectronsToken_
bool isEBPhiGap() const
Definition: GsfElectron.h:334
float nPreshowerClusters() const
void produce(edm::Event &, const edm::EventSetup &) override
float seedPhi() const
float clustersSize() const
float subClusterEta(unsigned i) const
float seedEnergy() const
double regressionUncertaintyWithSubClusters(double SCRawEnergy, double scEta, double scPhi, double R9, double etawidth, double phiwidth, double NClusters, double HoE, double rho, double vertices, double EtaSeed, double PhiSeed, double ESeed, double E3x3Seed, double E5x5Seed, double see, double spp, double sep, double EMaxSeed, double E2ndSeed, double ETopSeed, double EBottomSeed, double ELeftSeed, double ERightSeed, double E2x5MaxSeed, double E2x5TopSeed, double E2x5BottomSeed, double E2x5LeftSeed, double E2x5RightSeed, double IEtaSeed, double IPhiSeed, double EtaCrySeed, double PhiCrySeed, double PreShowerOverRaw, double isEcalDriven, double isEtaGap, double isPhiGap, double isDeeGap, double ESubs, double ESub1, double EtaSub1, double PhiSub1, double EMaxSub1, double E3x3Sub1, double ESub2, double EtaSub2, double PhiSub2, double EMaxSub2, double E3x3Sub2, double ESub3, double EtaSub3, double PhiSub3, double EMaxSub3, double E3x3Sub3, double NPshwClusters, double EPshwSubs, double EPshwSub1, double EtaPshwSub1, double PhiPshwSub1, double EPshwSub2, double EtaPshwSub2, double PhiPshwSub2, double EPshwSub3, double EtaPshwSub3, double PhiPshwSub3, bool isEB, bool printDebug=false)
double phi() const final
momentum azimuthal angle
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
float e2x5Left() const
void setEcalRegressionEnergy(double val, double err)
set regression1
Definition: Electron.h:230
edm::EDGetTokenT< pat::ElectronCollection > inputPatElectronsToken_
int charge() const final
electric charge
bool ecalDrivenSeed() const
Definition: GsfElectron.h:158
double eta() const final
momentum pseudorapidity