CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
EcalIsolationCorrector Class Reference

#include <EcalIsolationCorrector.h>

Public Types

enum  RunRange { RunAB, RunC, RunD }
 

Public Member Functions

float correctForHLTDefinition (reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
 
float correctForHLTDefinition (reco::GsfElectron e, int runNumber, bool isData=false)
 
float correctForHLTDefinition (reco::GsfElectron e, std::string runName, bool isData=false)
 
float correctForHLTDefinition (reco::Photon p, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
 
float correctForHLTDefinition (reco::Photon p, int runNumber, bool isData=false)
 
float correctForHLTDefinition (reco::Photon p, std::string runName, bool isData=false)
 
float correctForHLTDefinition (pat::Electron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
 
float correctForHLTDefinition (pat::Electron e, int runNumber, bool isData=false)
 
float correctForHLTDefinition (pat::Electron e, std::string runName, bool isData=false)
 
float correctForHLTDefinition (pat::Photon p, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
 
float correctForHLTDefinition (pat::Photon p, int runNumber, bool isData=false)
 
float correctForHLTDefinition (pat::Photon p, std::string runName, bool isData=false)
 
float correctForNoise (reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
 
float correctForNoise (reco::GsfElectron e, int runNumber, bool isData=false)
 
float correctForNoise (reco::GsfElectron e, std::string runName, bool isData=false)
 
float correctForNoise (reco::Photon p, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
 
float correctForNoise (reco::Photon p, int runNumber, bool isData=false)
 
float correctForNoise (reco::Photon p, std::string runName, bool isData=false)
 
float correctForNoise (pat::Electron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
 
float correctForNoise (pat::Electron e, int runNumber, bool isData=false)
 
float correctForNoise (pat::Electron e, std::string runName, bool isData=false)
 
float correctForNoise (pat::Photon p, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
 
float correctForNoise (pat::Photon p, int runNumber, bool isData=false)
 
float correctForNoise (pat::Photon p, std::string runName, bool isData=false)
 
 EcalIsolationCorrector (bool forElectrons)
 
 ~EcalIsolationCorrector ()
 

Protected Member Functions

RunRange checkRunRange (int runNumber)
 
float correctForHLTDefinition (float iso, bool isBarrel, RunRange runRange)
 
float correctForNoise (float iso, bool isBarrel, RunRange runRange, bool isData)
 

Private Attributes

bool isElectron_
 

Detailed Description

Definition at line 17 of file EcalIsolationCorrector.h.

Member Enumeration Documentation

◆ RunRange

Constructor & Destructor Documentation

◆ EcalIsolationCorrector()

EcalIsolationCorrector::EcalIsolationCorrector ( bool  forElectrons)

Definition at line 7 of file EcalIsolationCorrector.cc.

7 : isElectron_(forElectrons) {}

◆ ~EcalIsolationCorrector()

EcalIsolationCorrector::~EcalIsolationCorrector ( )
inline

Definition at line 22 of file EcalIsolationCorrector.h.

22 {};

Member Function Documentation

◆ checkRunRange()

EcalIsolationCorrector::RunRange EcalIsolationCorrector::checkRunRange ( int  runNumber)
protected

◆ correctForHLTDefinition() [1/13]

float EcalIsolationCorrector::correctForHLTDefinition ( reco::GsfElectron  e,
bool  isData = false,
float  intL_AB = 5.5,
float  intL_C = 6.7,
float  intL_D = 7.3 
)

Definition at line 371 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, RunAB, RunC, and RunD.

Referenced by correctForHLTDefinition().

372  {
373  if (!isElectron_)
374  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
375 
376  float iso = e.dr03EcalRecHitSumEt();
377  if (!isData)
378  iso = correctForNoise(e, isData, intL_AB, intL_C, intL_D);
379 
380  float combination =
381  (intL_AB * correctForHLTDefinition(iso, e.isEB(), RunAB) + intL_C * correctForHLTDefinition(iso, e.isEB(), RunC) +
382  intL_D * correctForHLTDefinition(iso, e.isEB(), RunD)) /
383  (intL_AB + intL_C + intL_D);
384 
385  return combination;
386 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [2/13]

float EcalIsolationCorrector::correctForHLTDefinition ( reco::GsfElectron  e,
int  runNumber,
bool  isData = false 
)

Definition at line 335 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, checkRunRange(), correctForHLTDefinition(), correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, convertSQLiteXML::runNumber, and crab_NZS2018C_1::runRange.

335  {
336  if (!isElectron_)
337  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
338 
339  float iso = e.dr03EcalRecHitSumEt();
341 
342  if (!isData)
343  iso = correctForNoise(iso, e.isEB(), runRange, false);
344 
345  return correctForHLTDefinition(iso, e.isEB(), runRange);
346 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
RunRange checkRunRange(int runNumber)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [3/13]

float EcalIsolationCorrector::correctForHLTDefinition ( reco::GsfElectron  e,
std::string  runName,
bool  isData = false 
)

Definition at line 348 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForHLTDefinition(), correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

348  {
349  if (!isElectron_)
350  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
351 
352  float iso = e.dr03EcalRecHitSumEt();
354  if (runName == "RunAB")
355  runRange = RunAB;
356  else if (runName == "RunC")
357  runRange = RunC;
358  else if (runName == "RunD")
359  runRange = RunD;
360  else {
361  std::cerr << "Error: Unknown run range " << runName << std::endl;
362  abort();
363  }
364 
365  if (!isData)
366  iso = correctForNoise(iso, e.isEB(), runRange, false);
367 
368  return correctForHLTDefinition(iso, e.isEB(), runRange);
369 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [4/13]

float EcalIsolationCorrector::correctForHLTDefinition ( reco::Photon  p,
bool  isData = false,
float  intL_AB = 5.5,
float  intL_C = 6.7,
float  intL_D = 7.3 
)

Definition at line 480 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForHLTDefinition(), correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, RunAB, RunC, and RunD.

481  {
482  if (isElectron_)
483  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
484 
485  float iso = p.ecalRecHitSumEtConeDR03();
486 
487  if (!isData)
488  iso = correctForNoise(p, isData, intL_AB, intL_C, intL_D);
489 
490  float combination =
491  (intL_AB * correctForHLTDefinition(iso, p.isEB(), RunAB) + intL_C * correctForHLTDefinition(iso, p.isEB(), RunC) +
492  intL_D * correctForHLTDefinition(iso, p.isEB(), RunD)) /
493  (intL_AB + intL_C + intL_D);
494 
495  return combination;
496 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [5/13]

float EcalIsolationCorrector::correctForHLTDefinition ( reco::Photon  p,
int  runNumber,
bool  isData = false 
)

Definition at line 443 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, checkRunRange(), correctForHLTDefinition(), correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, convertSQLiteXML::runNumber, and crab_NZS2018C_1::runRange.

443  {
444  if (isElectron_)
445  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
446 
447  float iso = p.ecalRecHitSumEtConeDR03();
449 
450  if (!isData)
451  iso = correctForNoise(iso, p.isEB(), runRange, false);
452 
453  return correctForHLTDefinition(iso, p.isEB(), runRange);
454 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
RunRange checkRunRange(int runNumber)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [6/13]

float EcalIsolationCorrector::correctForHLTDefinition ( reco::Photon  p,
std::string  runName,
bool  isData = false 
)

Definition at line 456 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForHLTDefinition(), correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

456  {
457  if (isElectron_)
458  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
459 
460  float iso = p.ecalRecHitSumEtConeDR03();
461 
463  if (runName == "RunAB")
464  runRange = RunAB;
465  else if (runName == "RunC")
466  runRange = RunC;
467  else if (runName == "RunD")
468  runRange = RunD;
469  else {
470  std::cerr << "Error: Unknown run range " << runName << std::endl;
471  abort();
472  }
473 
474  if (!isData)
475  iso = correctForNoise(iso, p.isEB(), runRange, false);
476 
477  return correctForHLTDefinition(iso, p.isEB(), runRange);
478 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [7/13]

float EcalIsolationCorrector::correctForHLTDefinition ( pat::Electron  e,
bool  isData = false,
float  intL_AB = 5.5,
float  intL_C = 6.7,
float  intL_D = 7.3 
)

Definition at line 425 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForHLTDefinition(), correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, RunAB, RunC, and RunD.

426  {
427  if (!isElectron_)
428  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
429 
430  float iso = e.dr03EcalRecHitSumEt();
431  if (!isData)
432  iso = correctForNoise(e, isData, intL_AB, intL_C, intL_D);
433 
434  float combination =
435  (intL_AB * correctForHLTDefinition(iso, e.isEB(), RunAB) + intL_C * correctForHLTDefinition(iso, e.isEB(), RunC) +
436  intL_D * correctForHLTDefinition(iso, e.isEB(), RunD)) /
437  (intL_AB + intL_C + intL_D);
438 
439  return combination;
440 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [8/13]

float EcalIsolationCorrector::correctForHLTDefinition ( pat::Electron  e,
int  runNumber,
bool  isData = false 
)

Definition at line 389 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, checkRunRange(), correctForHLTDefinition(), correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, convertSQLiteXML::runNumber, and crab_NZS2018C_1::runRange.

389  {
390  if (!isElectron_)
391  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
392 
393  float iso = e.dr03EcalRecHitSumEt();
395 
396  if (!isData)
397  iso = correctForNoise(iso, e.isEB(), runRange, false);
398 
399  return correctForHLTDefinition(iso, e.isEB(), runRange);
400 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
RunRange checkRunRange(int runNumber)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [9/13]

float EcalIsolationCorrector::correctForHLTDefinition ( pat::Electron  e,
std::string  runName,
bool  isData = false 
)

Definition at line 402 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForHLTDefinition(), correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

402  {
403  if (!isElectron_)
404  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
405 
406  float iso = e.dr03EcalRecHitSumEt();
408  if (runName == "RunAB")
409  runRange = RunAB;
410  else if (runName == "RunC")
411  runRange = RunC;
412  else if (runName == "RunD")
413  runRange = RunD;
414  else {
415  std::cerr << "Error: Unknown run range " << runName << std::endl;
416  abort();
417  }
418 
419  if (!isData)
420  iso = correctForNoise(iso, e.isEB(), runRange, false);
421 
422  return correctForHLTDefinition(iso, e.isEB(), runRange);
423 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [10/13]

float EcalIsolationCorrector::correctForHLTDefinition ( pat::Photon  p,
bool  isData = false,
float  intL_AB = 5.5,
float  intL_C = 6.7,
float  intL_D = 7.3 
)

Definition at line 536 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForHLTDefinition(), correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, RunAB, RunC, and RunD.

537  {
538  if (isElectron_)
539  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
540 
541  float iso = p.ecalRecHitSumEtConeDR03();
542 
543  if (!isData)
544  iso = correctForNoise(p, isData, intL_AB, intL_C, intL_D);
545 
546  float combination =
547  (intL_AB * correctForHLTDefinition(iso, p.isEB(), RunAB) + intL_C * correctForHLTDefinition(iso, p.isEB(), RunC) +
548  intL_D * correctForHLTDefinition(iso, p.isEB(), RunD)) /
549  (intL_AB + intL_C + intL_D);
550 
551  return combination;
552 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [11/13]

float EcalIsolationCorrector::correctForHLTDefinition ( pat::Photon  p,
int  runNumber,
bool  isData = false 
)

Definition at line 499 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, checkRunRange(), correctForHLTDefinition(), correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, convertSQLiteXML::runNumber, and crab_NZS2018C_1::runRange.

499  {
500  if (isElectron_)
501  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
502 
503  float iso = p.ecalRecHitSumEtConeDR03();
505 
506  if (!isData)
507  iso = correctForNoise(iso, p.isEB(), runRange, false);
508 
509  return correctForHLTDefinition(iso, p.isEB(), runRange);
510 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
RunRange checkRunRange(int runNumber)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [12/13]

float EcalIsolationCorrector::correctForHLTDefinition ( pat::Photon  p,
std::string  runName,
bool  isData = false 
)

Definition at line 512 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForHLTDefinition(), correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

512  {
513  if (isElectron_)
514  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
515 
516  float iso = p.ecalRecHitSumEtConeDR03();
517 
519  if (runName == "RunAB")
520  runRange = RunAB;
521  else if (runName == "RunC")
522  runRange = RunC;
523  else if (runName == "RunD")
524  runRange = RunD;
525  else {
526  std::cerr << "Error: Unknown run range " << runName << std::endl;
527  abort();
528  }
529 
530  if (!isData)
531  iso = correctForNoise(iso, p.isEB(), runRange, false);
532 
533  return correctForHLTDefinition(iso, p.isEB(), runRange);
534 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForHLTDefinition() [13/13]

float EcalIsolationCorrector::correctForHLTDefinition ( float  iso,
bool  isBarrel,
EcalIsolationCorrector::RunRange  runRange 
)
protected

Definition at line 289 of file EcalIsolationCorrector.cc.

References PixelPluginsPhase0_cfi::isBarrel, isElectron_, genparticles_cff::iso, mps_fire::result, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

291  {
292  float result = iso;
293 
294  if (!isElectron_) {
295  if (runRange == RunAB) {
296  if (!isBarrel)
297  result = iso * 0.8499 - 0.6510;
298  else
299  result = iso * 0.8504 - 0.5658;
300  } else if (runRange == RunC) {
301  if (!isBarrel)
302  result = iso * 0.9346 - 0.9987;
303  else
304  result = iso * 0.8529 - 0.6816;
305  } else if (runRange == RunD) {
306  if (!isBarrel)
307  result = iso * 0.8318 - 0.9999;
308  else
309  result = iso * 0.8853 - 0.8783;
310  }
311  } else {
312  if (runRange == RunAB) {
313  if (!isBarrel)
314  result = iso * 0.9849 - 0.6871;
315  else
316  result = iso * 0.8542 - 0.3558;
317  } else if (runRange == RunC) {
318  if (!isBarrel)
319  result = iso * 0.9996 - 0.8485;
320  else
321  result = iso * 0.9994 - 0.5085;
322  } else if (runRange == RunD) {
323  if (!isBarrel)
324  result = iso * 0.9467 - 0.9998;
325  else
326  result = iso * 0.8574 - 0.4862;
327  }
328  }
329 
330  return result;
331 }

◆ correctForNoise() [1/13]

float EcalIsolationCorrector::correctForNoise ( reco::GsfElectron  e,
bool  isData = false,
float  intL_AB = 5.5,
float  intL_C = 6.7,
float  intL_D = 7.3 
)

Definition at line 106 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, RunAB, RunC, and RunD.

Referenced by correctForHLTDefinition(), and correctForNoise().

107  {
108  if (!isElectron_)
109  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
110 
111  float iso = e.dr03EcalRecHitSumEt();
112  float combination =
113  (intL_AB * correctForNoise(iso, e.isEB(), RunAB, isData) + intL_C * correctForNoise(iso, e.isEB(), RunC, isData) +
114  intL_D * correctForNoise(iso, e.isEB(), RunD, isData)) /
115  (intL_AB + intL_C + intL_D);
116 
117  return combination;
118 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForNoise() [2/13]

float EcalIsolationCorrector::correctForNoise ( reco::GsfElectron  e,
int  runNumber,
bool  isData = false 
)

Definition at line 75 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, checkRunRange(), correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, convertSQLiteXML::runNumber, and crab_NZS2018C_1::runRange.

75  {
76  if (!isElectron_)
77  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
78 
79  float iso = e.dr03EcalRecHitSumEt();
81 
82  return correctForNoise(iso, e.isEB(), runRange, isData);
83 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
RunRange checkRunRange(int runNumber)

◆ correctForNoise() [3/13]

float EcalIsolationCorrector::correctForNoise ( reco::GsfElectron  e,
std::string  runName,
bool  isData = false 
)

Definition at line 85 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

85  {
86  if (!isElectron_)
87  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
88 
89  float iso = e.dr03EcalRecHitSumEt();
91 
92  if (runName == "RunAB")
93  runRange = RunAB;
94  else if (runName == "RunC")
95  runRange = RunC;
96  else if (runName == "RunD")
97  runRange = RunD;
98  else {
99  std::cerr << "Error: Unknown run range " << runName << std::endl;
100  abort();
101  }
102 
103  return correctForNoise(iso, e.isEB(), runRange, isData);
104 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForNoise() [4/13]

float EcalIsolationCorrector::correctForNoise ( reco::Photon  p,
bool  isData = false,
float  intL_AB = 5.5,
float  intL_C = 6.7,
float  intL_D = 7.3 
)

Definition at line 197 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, RunAB, RunC, and RunD.

197  {
198  if (isElectron_)
199  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
200 
201  float iso = p.ecalRecHitSumEtConeDR03();
202  float combination =
203  (intL_AB * correctForNoise(iso, p.isEB(), RunAB, isData) + intL_C * correctForNoise(iso, p.isEB(), RunC, isData) +
204  intL_D * correctForNoise(iso, p.isEB(), RunD, isData)) /
205  (intL_AB + intL_C + intL_D);
206 
207  return combination;
208 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForNoise() [5/13]

float EcalIsolationCorrector::correctForNoise ( reco::Photon  p,
int  runNumber,
bool  isData = false 
)

Definition at line 166 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, checkRunRange(), correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, convertSQLiteXML::runNumber, and crab_NZS2018C_1::runRange.

166  {
167  if (isElectron_)
168  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
169 
170  float iso = p.ecalRecHitSumEtConeDR03();
172 
173  return correctForNoise(iso, p.isEB(), runRange, isData);
174 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
RunRange checkRunRange(int runNumber)

◆ correctForNoise() [6/13]

float EcalIsolationCorrector::correctForNoise ( reco::Photon  p,
std::string  runName,
bool  isData = false 
)

Definition at line 176 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

176  {
177  if (isElectron_)
178  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
179 
180  float iso = p.ecalRecHitSumEtConeDR03();
182 
183  if (runName == "RunAB")
184  runRange = RunAB;
185  else if (runName == "RunC")
186  runRange = RunC;
187  else if (runName == "RunD")
188  runRange = RunD;
189  else {
190  std::cerr << "Error: Unknown run range " << runName << std::endl;
191  abort();
192  }
193 
194  return correctForNoise(iso, p.isEB(), runRange, isData);
195 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForNoise() [7/13]

float EcalIsolationCorrector::correctForNoise ( pat::Electron  e,
bool  isData = false,
float  intL_AB = 5.5,
float  intL_C = 6.7,
float  intL_D = 7.3 
)

Definition at line 152 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, RunAB, RunC, and RunD.

152  {
153  if (!isElectron_)
154  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
155 
156  float iso = e.dr03EcalRecHitSumEt();
157  float combination =
158  (intL_AB * correctForNoise(iso, e.isEB(), RunAB, isData) + intL_C * correctForNoise(iso, e.isEB(), RunC, isData) +
159  intL_D * correctForNoise(iso, e.isEB(), RunD, isData)) /
160  (intL_AB + intL_C + intL_D);
161 
162  return combination;
163 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForNoise() [8/13]

float EcalIsolationCorrector::correctForNoise ( pat::Electron  e,
int  runNumber,
bool  isData = false 
)

Definition at line 121 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, checkRunRange(), correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, convertSQLiteXML::runNumber, and crab_NZS2018C_1::runRange.

121  {
122  if (!isElectron_)
123  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
124 
125  float iso = e.dr03EcalRecHitSumEt();
127 
128  return correctForNoise(iso, e.isEB(), runRange, isData);
129 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
RunRange checkRunRange(int runNumber)

◆ correctForNoise() [9/13]

float EcalIsolationCorrector::correctForNoise ( pat::Electron  e,
std::string  runName,
bool  isData = false 
)

Definition at line 131 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForNoise(), MillePedeFileConverter_cfg::e, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

131  {
132  if (!isElectron_)
133  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
134 
135  float iso = e.dr03EcalRecHitSumEt();
137 
138  if (runName == "RunAB")
139  runRange = RunAB;
140  else if (runName == "RunC")
141  runRange = RunC;
142  else if (runName == "RunD")
143  runRange = RunD;
144  else {
145  std::cerr << "Error: Unknown run range " << runName << std::endl;
146  abort();
147  }
148 
149  return correctForNoise(iso, e.isEB(), runRange, isData);
150 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForNoise() [10/13]

float EcalIsolationCorrector::correctForNoise ( pat::Photon  p,
bool  isData = false,
float  intL_AB = 5.5,
float  intL_C = 6.7,
float  intL_D = 7.3 
)

Definition at line 242 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, RunAB, RunC, and RunD.

242  {
243  if (isElectron_)
244  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
245 
246  float iso = p.ecalRecHitSumEtConeDR03();
247  float combination =
248  (intL_AB * correctForNoise(iso, p.isEB(), RunAB, isData) + intL_C * correctForNoise(iso, p.isEB(), RunC, isData) +
249  intL_D * correctForNoise(iso, p.isEB(), RunD, isData)) /
250  (intL_AB + intL_C + intL_D);
251 
252  return combination;
253 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForNoise() [11/13]

float EcalIsolationCorrector::correctForNoise ( pat::Photon  p,
int  runNumber,
bool  isData = false 
)

Definition at line 211 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, checkRunRange(), correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, convertSQLiteXML::runNumber, and crab_NZS2018C_1::runRange.

211  {
212  if (isElectron_)
213  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
214 
215  float iso = p.ecalRecHitSumEtConeDR03();
217 
218  return correctForNoise(iso, p.isEB(), runRange, isData);
219 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
RunRange checkRunRange(int runNumber)

◆ correctForNoise() [12/13]

float EcalIsolationCorrector::correctForNoise ( pat::Photon  p,
std::string  runName,
bool  isData = false 
)

Definition at line 221 of file EcalIsolationCorrector.cc.

References DMR_cfg::cerr, correctForNoise(), HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, AlCaHLTBitMon_ParallelJobs::p, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

221  {
222  if (isElectron_)
223  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
224 
225  float iso = p.ecalRecHitSumEtConeDR03();
227 
228  if (runName == "RunAB")
229  runRange = RunAB;
230  else if (runName == "RunC")
231  runRange = RunC;
232  else if (runName == "RunD")
233  runRange = RunD;
234  else {
235  std::cerr << "Error: Unknown run range " << runName << std::endl;
236  abort();
237  }
238 
239  return correctForNoise(iso, p.isEB(), runRange, isData);
240 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)

◆ correctForNoise() [13/13]

float EcalIsolationCorrector::correctForNoise ( float  iso,
bool  isBarrel,
EcalIsolationCorrector::RunRange  runRange,
bool  isData 
)
protected

Definition at line 20 of file EcalIsolationCorrector.cc.

References gather_cfg::cout, PixelPluginsPhase0_cfi::isBarrel, HLTBitAnalyser_cfi::isData, isElectron_, genparticles_cff::iso, mps_fire::result, RunAB, RunC, RunD, and crab_NZS2018C_1::runRange.

23  {
24  float result = iso;
25 
26  if (!isElectron_) {
27  if (!isData) {
28  if (runRange == RunAB) {
29  if (!isBarrel)
30  result = (iso - 0.2827) / 1.0949;
31  else
32  result = (iso - 0.0931) / 1.0738;
33  } else if (runRange == RunC) {
34  if (!isBarrel)
35  result = (iso - 0.5690) / 0.9217;
36  else
37  result = (iso - 0.1824) / 0.9279;
38  } else if (runRange == RunD) {
39  if (!isBarrel)
40  result = (iso - 0.9997) / 0.8781;
41  else
42  result = (iso - 0.0944) / 0.8140;
43  }
44  } else {
45  std::cout << "Warning: you should correct MC to data" << std::endl;
46  }
47  } else {
48  if (!isData) {
49  if (runRange == RunAB) {
50  if (!isBarrel)
51  result = (iso + 0.1174) / 1.0012;
52  else
53  result = (iso + 0.2736) / 0.9948;
54  } else if (runRange == RunC) {
55  if (!isBarrel)
56  result = (iso + 0.2271) / 0.9684;
57  else
58  result = (iso + 0.5962) / 0.9568;
59  } else if (runRange == RunD) {
60  if (!isBarrel)
61  result = (iso + 0.2907) / 1.0005;
62  else
63  result = (iso + 0.9098) / 0.9395;
64  }
65  } else {
66  std::cout << "Warning: you should correct MC to data" << std::endl;
67  }
68  }
69 
70  return result;
71 }

Member Data Documentation

◆ isElectron_

bool EcalIsolationCorrector::isElectron_
private

Definition at line 105 of file EcalIsolationCorrector.h.

Referenced by correctForHLTDefinition(), and correctForNoise().