CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Constructor & Destructor Documentation

EcalIsolationCorrector::EcalIsolationCorrector ( bool  forElectrons)

Definition at line 7 of file EcalIsolationCorrector.cc.

7  :isElectron_(forElectrons)
8 {}
EcalIsolationCorrector::~EcalIsolationCorrector ( )
inline

Definition at line 23 of file EcalIsolationCorrector.h.

23 {};

Member Function Documentation

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

Definition at line 10 of file EcalIsolationCorrector.cc.

References RunAB, RunC, and RunD.

Referenced by correctForHLTDefinition(), and correctForNoise().

10  {
11 
13 
14  if (runNumber <= 203755 && runNumber > 197770)
15  runRange = RunC;
16  else if (runNumber > 203755)
17  runRange = RunD;
18 
19  return runRange;
20 }
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 380 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), isElectron_, RunAB, RunC, and RunD.

Referenced by correctForHLTDefinition().

380  {
381 
382  if (!isElectron_)
383  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
384 
385  float iso = e.dr03EcalRecHitSumEt();
386  if (!isData)
387  iso = correctForNoise(e, isData, intL_AB, intL_C, intL_D);
388 
389  float combination = (intL_AB * correctForHLTDefinition(iso, e.isEB(), RunAB) +
390  intL_C * correctForHLTDefinition(iso, e.isEB(), RunC ) +
391  intL_D * correctForHLTDefinition(iso, e.isEB(), RunD ))/(intL_AB + intL_C + intL_D);
392 
393  return combination;
394 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: GsfElectron.h:350
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
float EcalIsolationCorrector::correctForHLTDefinition ( reco::GsfElectron  e,
int  runNumber,
bool  isData = false 
)

Definition at line 342 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, checkRunRange(), correctForHLTDefinition(), correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), and isElectron_.

342  {
343 
344  if (!isElectron_)
345  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
346 
347  float iso = e.dr03EcalRecHitSumEt();
349 
350  if (!isData)
351  iso = correctForNoise(iso, e.isEB(), runRange, false);
352 
353  return correctForHLTDefinition(iso, e.isEB(), runRange);
354 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: GsfElectron.h:350
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)
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
float EcalIsolationCorrector::correctForHLTDefinition ( reco::GsfElectron  e,
std::string  runName,
bool  isData = false 
)

Definition at line 356 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForHLTDefinition(), correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), isElectron_, RunAB, RunC, and RunD.

356  {
357 
358  if (!isElectron_)
359  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
360 
361  float iso = e.dr03EcalRecHitSumEt();
363  if (runName == "RunAB")
364  runRange = RunAB;
365  else if (runName == "RunC")
366  runRange = RunC;
367  else if (runName == "RunD")
368  runRange = RunD;
369  else {
370  std::cerr << "Error: Unknown run range " << runName << std::endl;
371  abort();
372  }
373 
374  if (!isData)
375  iso = correctForNoise(iso, e.isEB(), runRange, false);
376 
377  return correctForHLTDefinition(iso, e.isEB(), runRange);
378 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: GsfElectron.h:350
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
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 491 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForHLTDefinition(), correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), isElectron_, RunAB, RunC, and RunD.

491  {
492 
493  if (isElectron_)
494  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
495 
496  float iso = p.ecalRecHitSumEtConeDR03();
497 
498  if (!isData)
499  iso = correctForNoise(p, isData, intL_AB, intL_C, intL_D);
500 
501  float combination = (intL_AB * correctForHLTDefinition(iso, p.isEB(), RunAB) +
502  intL_C * correctForHLTDefinition(iso, p.isEB(), RunC ) +
503  intL_D * correctForHLTDefinition(iso, p.isEB(), RunD ))/(intL_AB + intL_C + intL_D);
504 
505  return combination;
506 }
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)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForHLTDefinition ( reco::Photon  p,
int  runNumber,
bool  isData = false 
)

Definition at line 452 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, checkRunRange(), correctForHLTDefinition(), correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), and isElectron_.

452  {
453 
454  if (isElectron_)
455  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
456 
457  float iso = p.ecalRecHitSumEtConeDR03();
459 
460  if (!isData)
461  iso = correctForNoise(iso, p.isEB(), runRange, false);
462 
463  return correctForHLTDefinition(iso, p.isEB(), runRange);
464 }
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)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForHLTDefinition ( reco::Photon  p,
std::string  runName,
bool  isData = false 
)

Definition at line 466 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForHLTDefinition(), correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), isElectron_, RunAB, RunC, and RunD.

466  {
467 
468  if (isElectron_)
469  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
470 
471  float iso = p.ecalRecHitSumEtConeDR03();
472 
474  if (runName == "RunAB")
475  runRange = RunAB;
476  else if (runName == "RunC")
477  runRange = RunC;
478  else if (runName == "RunD")
479  runRange = RunD;
480  else {
481  std::cerr << "Error: Unknown run range " << runName << std::endl;
482  abort();
483  }
484 
485  if (!isData)
486  iso = correctForNoise(iso, p.isEB(), runRange, false);
487 
488  return correctForHLTDefinition(iso, p.isEB(), runRange);
489 }
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)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
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 435 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForHLTDefinition(), correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), isElectron_, RunAB, RunC, and RunD.

435  {
436 
437  if (!isElectron_)
438  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
439 
440  float iso = e.dr03EcalRecHitSumEt();
441  if (!isData)
442  iso = correctForNoise(e, isData, intL_AB, intL_C, intL_D);
443 
444  float combination = (intL_AB * correctForHLTDefinition(iso, e.isEB(), RunAB) +
445  intL_C * correctForHLTDefinition(iso, e.isEB(), RunC ) +
446  intL_D * correctForHLTDefinition(iso, e.isEB(), RunD ))/(intL_AB + intL_C + intL_D);
447 
448  return combination;
449 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: GsfElectron.h:350
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
float EcalIsolationCorrector::correctForHLTDefinition ( pat::Electron  e,
int  runNumber,
bool  isData = false 
)

Definition at line 397 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, checkRunRange(), correctForHLTDefinition(), correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), and isElectron_.

397  {
398 
399  if (!isElectron_)
400  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
401 
402  float iso = e.dr03EcalRecHitSumEt();
404 
405  if (!isData)
406  iso = correctForNoise(iso, e.isEB(), runRange, false);
407 
408  return correctForHLTDefinition(iso, e.isEB(), runRange);
409 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: GsfElectron.h:350
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)
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
float EcalIsolationCorrector::correctForHLTDefinition ( pat::Electron  e,
std::string  runName,
bool  isData = false 
)

Definition at line 411 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForHLTDefinition(), correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), isElectron_, RunAB, RunC, and RunD.

411  {
412 
413  if (!isElectron_)
414  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
415 
416  float iso = e.dr03EcalRecHitSumEt();
418  if (runName == "RunAB")
419  runRange = RunAB;
420  else if (runName == "RunC")
421  runRange = RunC;
422  else if (runName == "RunD")
423  runRange = RunD;
424  else {
425  std::cerr << "Error: Unknown run range " << runName << std::endl;
426  abort();
427  }
428 
429  if (!isData)
430  iso = correctForNoise(iso, e.isEB(), runRange, false);
431 
432  return correctForHLTDefinition(iso, e.isEB(), runRange);
433 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: GsfElectron.h:350
float correctForHLTDefinition(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
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 548 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForHLTDefinition(), correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), isElectron_, RunAB, RunC, and RunD.

548  {
549 
550  if (isElectron_)
551  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
552 
553  float iso = p.ecalRecHitSumEtConeDR03();
554 
555  if (!isData)
556  iso = correctForNoise(p, isData, intL_AB, intL_C, intL_D);
557 
558  float combination = (intL_AB * correctForHLTDefinition(iso, p.isEB(), RunAB) +
559  intL_C * correctForHLTDefinition(iso, p.isEB(), RunC ) +
560  intL_D * correctForHLTDefinition(iso, p.isEB(), RunD ))/(intL_AB + intL_C + intL_D);
561 
562  return combination;
563 }
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)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForHLTDefinition ( pat::Photon  p,
int  runNumber,
bool  isData = false 
)

Definition at line 509 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, checkRunRange(), correctForHLTDefinition(), correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), and isElectron_.

509  {
510 
511  if (isElectron_)
512  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
513 
514  float iso = p.ecalRecHitSumEtConeDR03();
516 
517  if (!isData)
518  iso = correctForNoise(iso, p.isEB(), runRange, false);
519 
520  return correctForHLTDefinition(iso, p.isEB(), runRange);
521 }
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)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForHLTDefinition ( pat::Photon  p,
std::string  runName,
bool  isData = false 
)

Definition at line 523 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForHLTDefinition(), correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), isElectron_, RunAB, RunC, and RunD.

523  {
524 
525  if (isElectron_)
526  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
527 
528  float iso = p.ecalRecHitSumEtConeDR03();
529 
531  if (runName == "RunAB")
532  runRange = RunAB;
533  else if (runName == "RunC")
534  runRange = RunC;
535  else if (runName == "RunD")
536  runRange = RunD;
537  else {
538  std::cerr << "Error: Unknown run range " << runName << std::endl;
539  abort();
540  }
541 
542  if (!isData)
543  iso = correctForNoise(iso, p.isEB(), runRange, false);
544 
545  return correctForHLTDefinition(iso, p.isEB(), runRange);
546 }
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)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForHLTDefinition ( float  iso,
bool  isBarrel,
EcalIsolationCorrector::RunRange  runRange 
)
protected

Definition at line 297 of file EcalIsolationCorrector.cc.

References isElectron_, mps_fire::result, RunAB, RunC, and RunD.

297  {
298 
299  float result = iso;
300 
301  if (!isElectron_) {
302  if (runRange == RunAB) {
303  if (!isBarrel)
304  result = iso*0.8499-0.6510;
305  else
306  result = iso*0.8504-0.5658;
307  } else if (runRange == RunC) {
308  if (!isBarrel)
309  result = iso*0.9346-0.9987;
310  else
311  result = iso*0.8529-0.6816;
312  } else if (runRange == RunD) {
313  if (!isBarrel)
314  result = iso*0.8318-0.9999;
315  else
316  result = iso*0.8853-0.8783;
317  }
318  } else {
319  if (runRange == RunAB) {
320  if (!isBarrel)
321  result = iso*0.9849-0.6871;
322  else
323  result = iso*0.8542-0.3558;
324  } else if (runRange == RunC) {
325  if (!isBarrel)
326  result = iso*0.9996-0.8485;
327  else
328  result = iso*0.9994-0.5085;
329  } else if (runRange == RunD) {
330  if (!isBarrel)
331  result = iso*0.9467-0.9998;
332  else
333  result = iso*0.8574-0.4862;
334  }
335  }
336 
337  return result;
338 }
bool isBarrel(GeomDetEnumerators::SubDetector m)
tuple result
Definition: mps_fire.py:83
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 108 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), isElectron_, RunAB, RunC, and RunD.

Referenced by correctForHLTDefinition(), and correctForNoise().

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

Definition at line 75 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, checkRunRange(), correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), and isElectron_.

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

Definition at line 86 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), isElectron_, RunAB, RunC, and RunD.

86  {
87 
88  if (!isElectron_)
89  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
90 
91  float iso = e.dr03EcalRecHitSumEt();
93 
94  if (runName == "RunAB")
95  runRange = RunAB;
96  else if (runName == "RunC")
97  runRange = RunC;
98  else if (runName == "RunD")
99  runRange = RunD;
100  else {
101  std::cerr << "Error: Unknown run range " << runName << std::endl;
102  abort();
103  }
104 
105  return correctForNoise(iso, e.isEB(), runRange, isData);
106 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: GsfElectron.h:350
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
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 202 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), isElectron_, RunAB, RunC, and RunD.

202  {
203 
204  if (isElectron_)
205  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
206 
207  float iso = p.ecalRecHitSumEtConeDR03();
208  float combination = (intL_AB * correctForNoise(iso, p.isEB(), RunAB, isData) +
209  intL_C * correctForNoise(iso, p.isEB(), RunC, isData) +
210  intL_D * correctForNoise(iso, p.isEB(), RunD, isData))/(intL_AB + intL_C + intL_D);
211 
212  return combination;
213 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForNoise ( reco::Photon  p,
int  runNumber,
bool  isData = false 
)

Definition at line 169 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, checkRunRange(), correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), and isElectron_.

169  {
170 
171  if (isElectron_)
172  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
173 
174  float iso = p.ecalRecHitSumEtConeDR03();
176 
177  return correctForNoise(iso, p.isEB(), runRange, isData);
178 }
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)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForNoise ( reco::Photon  p,
std::string  runName,
bool  isData = false 
)

Definition at line 180 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), isElectron_, RunAB, RunC, and RunD.

180  {
181 
182  if (isElectron_)
183  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
184 
185  float iso = p.ecalRecHitSumEtConeDR03();
187 
188  if (runName == "RunAB")
189  runRange = RunAB;
190  else if (runName == "RunC")
191  runRange = RunC;
192  else if (runName == "RunD")
193  runRange = RunD;
194  else {
195  std::cerr << "Error: Unknown run range " << runName << std::endl;
196  abort();
197  }
198 
199  return correctForNoise(iso, p.isEB(), runRange, isData);
200 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
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 155 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), isElectron_, RunAB, RunC, and RunD.

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

Definition at line 122 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, checkRunRange(), correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), and isElectron_.

122  {
123 
124  if (!isElectron_)
125  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
126 
127  float iso = e.dr03EcalRecHitSumEt();
129 
130  return correctForNoise(iso, e.isEB(), runRange, isData);
131 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: GsfElectron.h:350
RunRange checkRunRange(int runNumber)
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
float EcalIsolationCorrector::correctForNoise ( pat::Electron  e,
std::string  runName,
bool  isData = false 
)

Definition at line 133 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForNoise(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::isEB(), isElectron_, RunAB, RunC, and RunD.

133  {
134 
135  if (!isElectron_)
136  std::cerr << "Warning: this corrector is setup for photons and you are passing an electron !" << std::endl;
137 
138  float iso = e.dr03EcalRecHitSumEt();
140 
141  if (runName == "RunAB")
142  runRange = RunAB;
143  else if (runName == "RunC")
144  runRange = RunC;
145  else if (runName == "RunD")
146  runRange = RunD;
147  else {
148  std::cerr << "Error: Unknown run range " << runName << std::endl;
149  abort();
150  }
151 
152  return correctForNoise(iso, e.isEB(), runRange, isData);
153 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: GsfElectron.h:350
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:492
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 249 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), isElectron_, RunAB, RunC, and RunD.

249  {
250 
251  if (isElectron_)
252  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
253 
254  float iso = p.ecalRecHitSumEtConeDR03();
255  float combination = (intL_AB * correctForNoise(iso, p.isEB(), RunAB, isData) +
256  intL_C * correctForNoise(iso, p.isEB(), RunC, isData) +
257  intL_D * correctForNoise(iso, p.isEB(), RunD, isData))/(intL_AB + intL_C + intL_D);
258 
259  return combination;
260 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForNoise ( pat::Photon  p,
int  runNumber,
bool  isData = false 
)

Definition at line 216 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, checkRunRange(), correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), and isElectron_.

216  {
217 
218  if (isElectron_)
219  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
220 
221  float iso = p.ecalRecHitSumEtConeDR03();
223 
224  return correctForNoise(iso, p.isEB(), runRange, isData);
225 }
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)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForNoise ( pat::Photon  p,
std::string  runName,
bool  isData = false 
)

Definition at line 227 of file EcalIsolationCorrector.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, correctForNoise(), reco::Photon::ecalRecHitSumEtConeDR03(), reco::Photon::isEB(), isElectron_, RunAB, RunC, and RunD.

227  {
228 
229  if (isElectron_)
230  std::cerr << "Warning: this corrector is setup for electrons and you are passing a photon !" << std::endl;
231 
232  float iso = p.ecalRecHitSumEtConeDR03();
234 
235  if (runName == "RunAB")
236  runRange = RunAB;
237  else if (runName == "RunC")
238  runRange = RunC;
239  else if (runName == "RunD")
240  runRange = RunD;
241  else {
242  std::cerr << "Error: Unknown run range " << runName << std::endl;
243  abort();
244  }
245 
246  return correctForNoise(iso, p.isEB(), runRange, isData);
247 }
float correctForNoise(reco::GsfElectron e, bool isData=false, float intL_AB=5.5, float intL_C=6.7, float intL_D=7.3)
bool isEB() const
Definition: Photon.h:120
float ecalRecHitSumEtConeDR03() const
Isolation variables in cone dR=0.3.
Definition: Photon.h:409
float EcalIsolationCorrector::correctForNoise ( float  iso,
bool  isBarrel,
EcalIsolationCorrector::RunRange  runRange,
bool  isData 
)
protected

Definition at line 22 of file EcalIsolationCorrector.cc.

References gather_cfg::cout, isElectron_, mps_fire::result, RunAB, RunC, and RunD.

22  {
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 }
bool isBarrel(GeomDetEnumerators::SubDetector m)
tuple result
Definition: mps_fire.py:83
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

bool EcalIsolationCorrector::isElectron_
private

Definition at line 93 of file EcalIsolationCorrector.h.

Referenced by correctForHLTDefinition(), and correctForNoise().