CMS 3D CMS Logo

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"));
28  nameEnergyReg_ = cfg.getParameter<std::string>("nameEnergyReg");
29  nameEnergyErrorReg_ = cfg.getParameter<std::string>("nameEnergyErrorReg");
30  debug_ = cfg.getUntrackedParameter<bool>("debug");
31  useReducedRecHits_ = cfg.getParameter<bool>("useRecHitCollections");
32  produceValueMaps_ = cfg.getParameter<bool>("produceValueMaps");
33 
34  // if Gsf Electrons; useReducedRecHits should be used)
36  throw cms::Exception("InconsistentParameters")
37  << " *** Inconsistent configuration : if you read GsfElectrons, you should set useRecHitCollections to true "
38  "and provide the correcte values to recHitCollectionEB and recHitCollectionEE (most probably "
39  "reducedEcalRecHitsEB and reducedEcalRecHitsEE )"
40  << std::endl;
41  }
42 
44  std::cout << " You are running on GsfElectrons and the producer is not configured to produce ValueMaps with the "
45  "results. In that case, it does not nothing !! "
46  << std::endl;
47  }
48 
49  if (inputCollectionType_ == 0) {
50  // do nothing
51  } else if (inputCollectionType_ == 1) {
52  produces<pat::ElectronCollection>();
53  } else {
54  throw cms::Exception("InconsistentParameters")
55  << " inputCollectionType should be either 0 (GsfElectrons) or 1 (pat::Electrons) " << std::endl;
56  }
57 
58  //set regression type
60  if (energyRegressionType_ == 1)
62  else if (energyRegressionType_ == 2)
64  else if (energyRegressionType_ == 3)
66 
67  //load weights and initialize
70 
71  if (produceValueMaps_) {
72  produces<edm::ValueMap<double> >(nameEnergyReg_);
73  produces<edm::ValueMap<double> >(nameEnergyErrorReg_);
74  }
75 
76  //****************************************************************************************
77  //set up regression calculator
78  //****************************************************************************************
79 
80  geomInitialized_ = false;
81 
82  std::cout << " Finished initialization " << std::endl;
83 }
84 
86 
89  if (!geomInitialized_) {
90  edm::ESHandle<CaloTopology> theCaloTopology;
91  setup.get<CaloTopologyRecord>().get(theCaloTopology);
92  ecalTopology_ = &(*theCaloTopology);
93 
94  edm::ESHandle<CaloGeometry> theCaloGeometry;
95  setup.get<CaloGeometryRecord>().get(theCaloGeometry);
96  caloGeometry_ = &(*theCaloGeometry);
97  geomInitialized_ = true;
98  }
99 
100  //**************************************************************************
101  //Get Number of Vertices
102  //**************************************************************************
104  event.getByToken(verticesInputToken_, hVertexProduct);
105  const reco::VertexCollection inVertices = *(hVertexProduct.product());
106 
107  // loop through all vertices
108  Int_t nvertices = 0;
109  for (reco::VertexCollection::const_iterator inV = inVertices.begin(); inV != inVertices.end(); ++inV) {
110  //pass these vertex cuts
111  if (inV->ndof() >= 4 && inV->position().Rho() <= 2.0 && fabs(inV->z()) <= 24.0) {
112  nvertices++;
113  }
114  }
115 
116  //**************************************************************************
117  //Get Rho
118  //**************************************************************************
119  double rho = 0;
120  edm::Handle<double> hRhoKt6PFJets;
121  event.getByToken(rhoInputToken_, hRhoKt6PFJets);
122  rho = (*hRhoKt6PFJets);
123 
124  //*************************************************************************
125  // Get the RecHits
126  //************************************************************************
127 
130  if (useReducedRecHits_) {
131  event.getByToken(recHitCollectionEBToken_, pEBRecHits);
132  event.getByToken(recHitCollectionEEToken_, pEERecHits);
133  }
134 
137  if (inputCollectionType_ == 0) {
138  event.getByToken(inputGsfElectronsToken_, gsfCollectionH);
139  nElectrons_ = gsfCollectionH->size();
140  }
141  if (inputCollectionType_ == 1) {
142  event.getByToken(inputPatElectronsToken_, patCollectionH);
143  nElectrons_ = patCollectionH->size();
144  }
145 
146  // prepare the two even if only one is used
147  std::unique_ptr<pat::ElectronCollection> patElectrons(new pat::ElectronCollection);
148 
149  // Fillers for ValueMaps:
150  std::unique_ptr<edm::ValueMap<double> > regrEnergyMap(new edm::ValueMap<double>());
151  edm::ValueMap<double>::Filler energyFiller(*regrEnergyMap);
152 
153  std::unique_ptr<edm::ValueMap<double> > regrEnergyErrorMap(new edm::ValueMap<double>());
154  edm::ValueMap<double>::Filler energyErrorFiller(*regrEnergyErrorMap);
155 
156  // Reserve the vectors with outputs
157  std::vector<double> energyValues;
158  std::vector<double> energyErrorValues;
159  energyValues.reserve(nElectrons_);
160  energyErrorValues.reserve(nElectrons_);
161 
162  for (unsigned iele = 0; iele < nElectrons_; ++iele) {
163  const reco::GsfElectron* ele = (inputCollectionType_ == 0) ? &(*gsfCollectionH)[iele] : &(*patCollectionH)[iele];
164  if (debug_) {
165  std::cout << "***********************************************************************\n";
166  std::cout << "Run Lumi Event: " << event.id().run() << " " << event.luminosityBlock() << " " << event.id().event()
167  << "\n";
168  std::cout << "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  std::cout << "Error: RegressionType = " << energyRegressionType_ << " is not supported.\n";
520  }
521 
522  if (inputCollectionType_ == 1) {
523  patElectrons->push_back(*myPatElectron);
524  }
525  if (myPatElectron)
526  delete myPatElectron;
527  if (mySCHelper)
528  delete mySCHelper;
529  } // loop on electrons
530 
531  // Write the new collection in the event (AOD case)
532  if (inputCollectionType_ == 1) {
533  event.put(std::move(patElectrons));
534  }
535 
536  // now AOD case: write ValueMaps
537  if (produceValueMaps_) {
538  if (inputCollectionType_ == 0) {
539  energyFiller.insert(gsfCollectionH, energyValues.begin(), energyValues.end());
540  energyErrorFiller.insert(gsfCollectionH, energyErrorValues.begin(), energyErrorValues.end());
541  } else if (inputCollectionType_ == 1) {
542  energyFiller.insert(patCollectionH, energyValues.begin(), energyValues.end());
543  energyErrorFiller.insert(patCollectionH, energyErrorValues.begin(), energyErrorValues.end());
544  }
545 
546  energyFiller.fill();
547  energyErrorFiller.fill();
548  event.put(std::move(regrEnergyMap), nameEnergyReg_);
549  event.put(std::move(regrEnergyErrorMap), nameEnergyErrorReg_);
550  }
551 }
552 
ConfigurationDescriptions.h
SuperClusterHelper::phi
float phi() const
Definition: SuperClusterHelper.h:26
SuperClusterHelper::sigmaIetaIeta
float sigmaIetaIeta() const
Definition: SuperClusterHelper.h:31
ElectronEnergyRegressionEvaluate::isInitialized
bool isInitialized() const
Definition: ElectronEnergyRegressionEvaluate.h:48
edm::helper::Filler::insert
void insert(const H &h, I begin, I end)
Definition: ValueMap.h:53
reco::GsfElectron::isEB
bool isEB() const
Definition: GsfElectron.h:336
SuperClusterHelper::e2x5Right
float e2x5Right() const
Definition: SuperClusterHelper.h:46
MessageLogger.h
RegressionEnergyPatElectronProducer::nameEnergyReg_
std::string nameEnergyReg_
Definition: RegressionEnergyPatElectronProducer.h:39
RegressionEnergyPatElectronProducer::inputCollectionType_
uint32_t inputCollectionType_
Definition: RegressionEnergyPatElectronProducer.h:43
SuperClusterHelper::spp
float spp()
Definition: SuperClusterHelper.cc:124
edm::Handle::product
T const * product() const
Definition: Handle.h:70
SuperClusterHelper::subClusterE3x3
float subClusterE3x3(unsigned i) const
Definition: SuperClusterHelper.cc:164
SuperClusterHelper::etaWidth
float etaWidth() const
Definition: SuperClusterHelper.h:27
ESHandle.h
RegressionEnergyPatElectronProducer::inputPatElectronsToken_
edm::EDGetTokenT< pat::ElectronCollection > inputPatElectronsToken_
Definition: RegressionEnergyPatElectronProducer.h:28
pat::ElectronCollection
std::vector< Electron > ElectronCollection
Definition: Electron.h:36
reco::GsfElectron::correctMomentum
void correctMomentum(const LorentzVector &p4, float trackMomentumError, float p4Error)
Definition: GsfElectron.h:829
SuperClusterHelper::eRight
float eRight() const
Definition: SuperClusterHelper.h:41
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
RegressionEnergyPatElectronProducer::recHitCollectionEBToken_
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEBToken_
Definition: RegressionEnergyPatElectronProducer.h:31
SuperClusterHelper::hadronicOverEm
float hadronicOverEm() const
Definition: SuperClusterHelper.h:30
RegressionEnergyPatElectronProducer::ecalTopology_
const CaloTopology * ecalTopology_
Definition: RegressionEnergyPatElectronProducer.h:51
reco::GsfElectron::correctEcalEnergy
void correctEcalEnergy(float newEnergy, float newEnergyError)
Definition: GsfElectron.h:825
ElectronEnergyRegressionEvaluate
Definition: ElectronEnergyRegressionEvaluate.h:32
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
gather_cfg.cout
cout
Definition: gather_cfg.py:144
SuperClusterHelper.h
SuperClusterHelper::seedEnergy
float seedEnergy() const
Definition: SuperClusterHelper.h:54
edm::helper::Filler::fill
void fill()
Definition: ValueMap.h:65
SuperClusterHelper::e2x5Max
float e2x5Max() const
Definition: SuperClusterHelper.h:42
ESProducer.h
cms::cuda::assert
assert(be >=bs)
SuperClusterHelper::esClusterPhi
float esClusterPhi(unsigned i) const
Definition: SuperClusterHelper.cc:176
RegressionEnergyPatElectronProducer::nElectrons_
unsigned nElectrons_
Definition: RegressionEnergyPatElectronProducer.h:53
edm::SortedCollection< EcalRecHit >
RegressionEnergyPatElectronProducer::RegressionEnergyPatElectronProducer
RegressionEnergyPatElectronProducer(const edm::ParameterSet &)
Definition: RegressionEnergyPatElectronProducer.cc:17
ElectronEnergyRegressionEvaluate::regressionUncertaintyNoTrkVar
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)
Definition: ElectronEnergyRegressionEvaluate.cc:726
RegressionEnergyPatElectronProducer::produceValueMaps_
bool produceValueMaps_
Definition: RegressionEnergyPatElectronProducer.h:49
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
RegressionEnergyPatElectronProducer::useReducedRecHits_
bool useReducedRecHits_
Definition: RegressionEnergyPatElectronProducer.h:35
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
RegressionEnergyPatElectronProducer::geomInitialized_
bool geomInitialized_
Definition: RegressionEnergyPatElectronProducer.h:47
SuperClusterHelper::nPreshowerClusters
float nPreshowerClusters() const
Definition: SuperClusterHelper.h:93
edm::Handle< reco::VertexCollection >
SuperClusterHelper::sep
float sep()
Definition: SuperClusterHelper.cc:129
SuperClusterHelper::iphiSeed
int iphiSeed()
Definition: SuperClusterHelper.h:59
reco::GsfElectron::fbrem
float fbrem() const
Definition: GsfElectron.h:734
SuperClusterHelper::subClusterEnergy
float subClusterEnergy(unsigned i) const
Definition: SuperClusterHelper.cc:148
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
EDMException.h
SuperClusterHelper::eMax
float eMax() const
Definition: SuperClusterHelper.h:36
MakerMacros.h
RegressionEnergyPatElectronProducer::~RegressionEnergyPatElectronProducer
~RegressionEnergyPatElectronProducer() override
Definition: RegressionEnergyPatElectronProducer.cc:85
SuperClusterHelper::eESClusters
float eESClusters() const
Definition: SuperClusterHelper.h:94
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
RegressionEnergyPatElectronProducer::verticesInputToken_
edm::EDGetTokenT< reco::VertexCollection > verticesInputToken_
Definition: RegressionEnergyPatElectronProducer.h:30
SuperClusterHelper::clustersSize
float clustersSize() const
Definition: SuperClusterHelper.h:29
ElectronEnergyRegressionEvaluate::regressionValueNoTrkVar
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)
Definition: ElectronEnergyRegressionEvaluate.cc:564
reco::GsfElectron::trackMomentumAtVtx
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:276
reco::GsfElectron::ecalDrivenSeed
bool ecalDrivenSeed() const
Definition: GsfElectron.h:166
SuperClusterHelper::e2x5Bottom
float e2x5Bottom() const
Definition: SuperClusterHelper.h:44
edm::ESHandle< CaloTopology >
reco::GsfElectron::isEEDeeGap
bool isEEDeeGap() const
Definition: GsfElectron.h:344
ElectronEnergyRegressionEvaluate::ElectronEnergyRegressionType
ElectronEnergyRegressionType
Definition: ElectronEnergyRegressionEvaluate.h:37
reco::GsfElectron
Definition: GsfElectron.h:35
SuperClusterHelper::e2nd
float e2nd() const
Definition: SuperClusterHelper.h:37
ElectronEnergyRegressionEvaluate::kNoTrkVar
Definition: ElectronEnergyRegressionEvaluate.h:38
ParameterSetDescription.h
SuperClusterHelper::rawEnergy
float rawEnergy() const
Definition: SuperClusterHelper.h:24
SuperClusterHelper::phiWidth
float phiWidth() const
Definition: SuperClusterHelper.h:28
RegressionEnergyPatElectronProducer::recHitCollectionEEToken_
edm::EDGetTokenT< EcalRecHitCollection > recHitCollectionEEToken_
Definition: RegressionEnergyPatElectronProducer.h:32
CaloGeometryRecord.h
DDAxes::rho
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SuperClusterHelper::esClusterEta
float esClusterEta(unsigned i) const
Definition: SuperClusterHelper.cc:172
RegressionEnergyPatElectronProducer::regressionEvaluator_
ElectronEnergyRegressionEvaluate * regressionEvaluator_
Definition: RegressionEnergyPatElectronProducer.h:46
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
ElectronEnergyRegressionEvaluate::regressionUncertaintyWithTrkVar
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)
Definition: ElectronEnergyRegressionEvaluate.cc:1389
SuperClusterHelper::e2x5Top
float e2x5Top() const
Definition: SuperClusterHelper.h:43
edm::ParameterSet
Definition: ParameterSet.h:36
SuperClusterHelper::eSubClusters
float eSubClusters() const
Definition: SuperClusterHelper.h:87
ElectronEnergyRegressionEvaluate::kWithSubCluVar
Definition: ElectronEnergyRegressionEvaluate.h:43
SuperClusterHelper::eta
float eta() const
Definition: SuperClusterHelper.h:25
RegressionEnergyPatElectronProducer::regressionInputFile_
std::string regressionInputFile_
Definition: RegressionEnergyPatElectronProducer.h:44
ElectronEnergyRegressionEvaluate::regressionUncertaintyWithSubClusters
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)
Definition: ElectronEnergyRegressionEvaluate.cc:3327
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
SuperClusterHelper::e2x5Left
float e2x5Left() const
Definition: SuperClusterHelper.h:45
CaloTopologyRecord.h
SuperClusterHelper::phiCrySeed
float phiCrySeed()
Definition: SuperClusterHelper.h:67
SuperClusterHelper::seedEta
float seedEta() const
Definition: SuperClusterHelper.h:52
RegressionEnergyPatElectronProducer::debug_
bool debug_
Definition: RegressionEnergyPatElectronProducer.h:45
SuperClusterHelper::preshowerEnergyOverRaw
float preshowerEnergyOverRaw() const
Definition: SuperClusterHelper.h:33
RegressionEnergyPatElectronProducer::nameEnergyErrorReg_
std::string nameEnergyErrorReg_
Definition: RegressionEnergyPatElectronProducer.h:40
SuperClusterHelper::esClusterEnergy
float esClusterEnergy(unsigned i) const
Definition: SuperClusterHelper.cc:168
pat::Electron::setEcalRegressionEnergy
void setEcalRegressionEnergy(double val, double err)
set regression1
Definition: Electron.h:230
SuperClusterHelper::preshowerEnergy
float preshowerEnergy() const
Definition: SuperClusterHelper.h:32
reco::LeafCandidate::charge
int charge() const final
electric charge
Definition: LeafCandidate.h:106
reco::GsfElectron::isEBEtaGap
bool isEBEtaGap() const
Definition: GsfElectron.h:341
RegressionEnergyPatElectronProducer::inputGsfElectronsToken_
edm::EDGetTokenT< reco::GsfElectronCollection > inputGsfElectronsToken_
Definition: RegressionEnergyPatElectronProducer.h:27
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
RegressionEnergyPatElectronProducer::caloGeometry_
const CaloGeometry * caloGeometry_
Definition: RegressionEnergyPatElectronProducer.h:52
reco::GsfElectron::p4
const LorentzVector & p4(P4Kind kind) const
Definition: GsfElectron.cc:211
SuperClusterHelper::ietaSeed
int ietaSeed()
Definition: SuperClusterHelper.h:55
RegressionEnergyPatElectronProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: RegressionEnergyPatElectronProducer.cc:87
looper.cfg
cfg
Definition: looper.py:297
SuperClusterHelper
Definition: SuperClusterHelper.h:12
ModuleFactory.h
type
type
Definition: HCALResponse.h:21
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
SuperClusterHelper::subClusterEmax
float subClusterEmax(unsigned i) const
Definition: SuperClusterHelper.cc:160
ElectronEnergyRegressionEvaluate::regressionValueWithSubClusters
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)
Definition: ElectronEnergyRegressionEvaluate.cc:3077
SuperClusterHelper::subClusterPhi
float subClusterPhi(unsigned i) const
Definition: SuperClusterHelper.cc:156
Frameworkfwd.h
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
edm::ValueMap
Definition: ValueMap.h:107
Exception
Definition: hltDiff.cc:246
reco::LeafCandidate::p
double p() const final
magnitude of momentum vector
Definition: LeafCandidate.h:123
RegressionEnergyPatElectronProducer.h
SuperClusterHelper::e5x5
float e5x5() const
Definition: SuperClusterHelper.h:35
RegressionEnergyPatElectronProducer
Definition: RegressionEnergyPatElectronProducer.h:19
reco::GsfElectron::eSuperClusterOverP
float eSuperClusterOverP() const
Definition: GsfElectron.h:229
ElectronEnergyRegressionEvaluate::regressionValueWithTrkVar
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)
Definition: ElectronEnergyRegressionEvaluate.cc:1217
reco::GsfElectron::isEBPhiGap
bool isEBPhiGap() const
Definition: GsfElectron.h:342
SuperClusterHelper::eTop
float eTop() const
Definition: SuperClusterHelper.h:38
patElectronEAIsoCorrectionProducer_cfi.patElectrons
patElectrons
Definition: patElectronEAIsoCorrectionProducer_cfi.py:4
reco::GsfElectron::trackMomentumError
float trackMomentumError() const
Definition: GsfElectron.h:808
edm::helper::Filler
Definition: ValueMap.h:22
pat::Electron
Analysis-level electron class.
Definition: Electron.h:51
RegressionEnergyPatElectronProducer::rhoInputToken_
edm::EDGetTokenT< double > rhoInputToken_
Definition: RegressionEnergyPatElectronProducer.h:29
ParameterSet.h
SuperClusterHelper::etaCrySeed
float etaCrySeed()
Definition: SuperClusterHelper.h:63
SuperClusterHelper::subClusterEta
float subClusterEta(unsigned i) const
Definition: SuperClusterHelper.cc:152
RegressionEnergyPatElectronProducer::energyRegressionType_
uint32_t energyRegressionType_
Definition: RegressionEnergyPatElectronProducer.h:42
SuperClusterHelper::eBottom
float eBottom() const
Definition: SuperClusterHelper.h:39
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
SuperClusterHelper::r9
float r9() const
Definition: SuperClusterHelper.h:47
edm::InputTag
Definition: InputTag.h:15
ElectronEnergyRegressionEvaluate::initialize
void initialize(std::string weightsFile, ElectronEnergyRegressionEvaluate::ElectronEnergyRegressionType type)
Definition: ElectronEnergyRegressionEvaluate.cc:25
ElectronEnergyRegressionEvaluate::kWithTrkVar
Definition: ElectronEnergyRegressionEvaluate.h:40
SuperClusterHelper::seedPhi
float seedPhi() const
Definition: SuperClusterHelper.h:53
SuperClusterHelper::eLeft
float eLeft() const
Definition: SuperClusterHelper.h:40
SuperClusterHelper::e3x3
float e3x3() const
Definition: SuperClusterHelper.h:34