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 | Private Attributes
EGammaMvaEleEstimator Class Reference

#include <EGammaMvaEleEstimator.h>

Public Types

enum  MVAType {
  kTrig = 0, kNonTrig = 2, kIsoRings, kTrig = 0,
  kTrigNoIP = 1, kNonTrig = 2, kIsoRings, kTrigIDIsoCombined,
  kTrigIDIsoCombinedPUCorrected
}
 
enum  MVAType {
  kTrig = 0, kNonTrig = 2, kIsoRings, kTrig = 0,
  kTrigNoIP = 1, kNonTrig = 2, kIsoRings, kTrigIDIsoCombined,
  kTrigIDIsoCombinedPUCorrected
}
 

Public Member Functions

void bindVariables ()
 
void bindVariables ()
 
 EGammaMvaEleEstimator ()
 
 EGammaMvaEleEstimator ()
 
UInt_t GetMVABin (double eta, double pt) const
 
UInt_t GetMVABin (double eta, double pt) const
 
Double_t IDIsoCombinedMvaValue (const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, EcalClusterLazyTools myEcalCluster, const reco::PFCandidateCollection &PFCandidates, double Rho, ElectronEffectiveArea::ElectronEffectiveAreaTarget EATarget, bool printDebug=kFALSE)
 
Double_t IDIsoCombinedMvaValue (Double_t fbrem, Double_t kfchi2, Int_t kfhits, Double_t gsfchi2, Double_t deta, Double_t dphi, Double_t detacalo, Double_t see, Double_t spp, Double_t etawidth, Double_t phiwidth, Double_t OneMinusE1x5E5x5, Double_t R9, Double_t HoE, Double_t EoP, Double_t IoEmIoP, Double_t eleEoPout, Double_t PreShowerOverRaw, Double_t d0, Double_t ip3d, Double_t ChargedIso_DR0p0To0p1, Double_t ChargedIso_DR0p1To0p2, Double_t ChargedIso_DR0p2To0p3, Double_t ChargedIso_DR0p3To0p4, Double_t ChargedIso_DR0p4To0p5, Double_t GammaIso_DR0p0To0p1, Double_t GammaIso_DR0p1To0p2, Double_t GammaIso_DR0p2To0p3, Double_t GammaIso_DR0p3To0p4, Double_t GammaIso_DR0p4To0p5, Double_t NeutralHadronIso_DR0p0To0p1, Double_t NeutralHadronIso_DR0p1To0p2, Double_t NeutralHadronIso_DR0p2To0p3, Double_t NeutralHadronIso_DR0p3To0p4, Double_t NeutralHadronIso_DR0p4To0p5, Double_t Rho, Double_t eta, Double_t pt, Bool_t printDebug=kFALSE)
 
void initialize (std::string methodName, std::string weightsfile, EGammaMvaEleEstimator::MVAType type)
 
void initialize (std::string methodName, EGammaMvaEleEstimator::MVAType type, Bool_t useBinnedVersion, std::vector< std::string > weightsfiles)
 
void initialize (std::string methodName, std::string weightsfile, EGammaMvaEleEstimator::MVAType type)
 
void initialize (std::string methodName, EGammaMvaEleEstimator::MVAType type, Bool_t useBinnedVersion, std::vector< std::string > weightsfiles)
 
Bool_t isInitialized () const
 
Bool_t isInitialized () const
 
Double_t isoMvaValue (const reco::GsfElectron &ele, const reco::Vertex &vertex, const reco::PFCandidateCollection &PFCandidates, double Rho, ElectronEffectiveArea::ElectronEffectiveAreaTarget EATarget, const reco::GsfElectronCollection &IdentifiedElectrons, const reco::MuonCollection &IdentifiedMuons, bool printDebug=kFALSE)
 
Double_t isoMvaValue (Double_t Pt, Double_t Eta, Double_t Rho, ElectronEffectiveArea::ElectronEffectiveAreaTarget EATarget, Double_t ChargedIso_DR0p0To0p1, Double_t ChargedIso_DR0p1To0p2, Double_t ChargedIso_DR0p2To0p3, Double_t ChargedIso_DR0p3To0p4, Double_t ChargedIso_DR0p4To0p5, Double_t GammaIso_DR0p0To0p1, Double_t GammaIso_DR0p1To0p2, Double_t GammaIso_DR0p2To0p3, Double_t GammaIso_DR0p3To0p4, Double_t GammaIso_DR0p4To0p5, Double_t NeutralHadronIso_DR0p0To0p1, Double_t NeutralHadronIso_DR0p1To0p2, Double_t NeutralHadronIso_DR0p2To0p3, Double_t NeutralHadronIso_DR0p3To0p4, Double_t NeutralHadronIso_DR0p4To0p5, Bool_t printDebug=kFALSE)
 
Double_t mvaValue (Double_t fbrem, Double_t kfchi2, Int_t kfhits, Double_t gsfchi2, Double_t deta, Double_t dphi, Double_t detacalo, Double_t see, Double_t spp, Double_t etawidth, Double_t phiwidth, Double_t e1x5e5x5, Double_t R9, Double_t HoE, Double_t EoP, Double_t IoEmIoP, Double_t eleEoPout, Double_t PreShowerOverRaw, Double_t d0, Double_t ip3d, Double_t eta, Double_t pt, Bool_t printDebug=kFALSE)
 
Double_t mvaValue (const reco::GsfElectron &ele, const reco::Vertex &vertex, const TransientTrackBuilder &transientTrackBuilder, EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)
 
Double_t mvaValue (const reco::GsfElectron &ele, const reco::Vertex &vertex, double rho, EcalClusterLazyTools myEcalCluster, bool printDebug=kFALSE)
 
Double_t mvaValue (Double_t fbrem, Double_t kfchi2, Int_t kfhits, Double_t gsfchi2, Double_t deta, Double_t dphi, Double_t detacalo, Double_t see, Double_t spp, Double_t etawidth, Double_t phiwidth, Double_t e1x5e5x5, Double_t R9, Double_t HoE, Double_t EoP, Double_t IoEmIoP, Double_t eleEoPout, Double_t PreShowerOverRaw, Double_t eta, Double_t pt, Bool_t printDebug=kFALSE)
 
Double_t mvaValue (const pat::Electron &ele, double rho, bool printDebug=kFALSE)
 
Double_t mvaValue (const pat::Electron &ele, const reco::Vertex &vertex, double rho, bool useFull5x5=kFALSE, bool printDebug=kFALSE)
 
Double_t mvaValue (HWW &, Int_t ele, Bool_t printDebug=kFALSE)
 
Double_t mvaValue (Double_t fbrem, Double_t kfchi2, Int_t kfhits, Double_t gsfchi2, Double_t deta, Double_t dphi, Double_t detacalo, Double_t see, Double_t spp, Double_t etawidth, Double_t phiwidth, Double_t e1x5e5x5, Double_t R9, Double_t HoE, Double_t EoP, Double_t IoEmIoP, Double_t eleEoPout, Double_t PreShowerOverRaw, Double_t d0, Double_t ip3d, Double_t eta, Double_t pt, Bool_t printDebug=kFALSE)
 
Double_t mvaValue (Double_t fbrem, Double_t kfchi2, Int_t kfhits, Double_t gsfchi2, Double_t deta, Double_t dphi, Double_t detacalo, Double_t see, Double_t spp, Double_t etawidth, Double_t phiwidth, Double_t e1x5e5x5, Double_t R9, Double_t HoE, Double_t EoP, Double_t IoEmIoP, Double_t eleEoPout, Double_t rho, Double_t PreShowerOverRaw, Double_t eta, Double_t pt, Bool_t printDebug=kFALSE)
 
Double_t mvaValue (Double_t fbrem, Double_t kfchi2, Int_t kfhits, Double_t gsfchi2, Double_t deta, Double_t dphi, Double_t detacalo, Double_t see, Double_t spp, Double_t etawidth, Double_t phiwidth, Double_t e1x5e5x5, Double_t R9, Double_t HoE, Double_t EoP, Double_t IoEmIoP, Double_t eleEoPout, Double_t PreShowerOverRaw, Double_t eta, Double_t pt, Bool_t printDebug=kFALSE)
 
void SetPrintMVADebug (bool b)
 
 ~EGammaMvaEleEstimator ()
 
 ~EGammaMvaEleEstimator ()
 

Private Attributes

Bool_t fisInitialized
 
std::string fMethodname
 
MVAType fMVAType
 
Float_t fMVAVar_ChargedIso_DR0p0To0p1
 
Float_t fMVAVar_ChargedIso_DR0p1To0p2
 
Float_t fMVAVar_ChargedIso_DR0p2To0p3
 
Float_t fMVAVar_ChargedIso_DR0p3To0p4
 
Float_t fMVAVar_ChargedIso_DR0p4To0p5
 
Float_t fMVAVar_d0
 
Float_t fMVAVar_deta
 
Float_t fMVAVar_detacalo
 
Float_t fMVAVar_dphi
 
Float_t fMVAVar_e1x5e5x5
 
Float_t fMVAVar_eleEoPout
 
Float_t fMVAVar_EoP
 
Float_t fMVAVar_EoPout
 
Float_t fMVAVar_eta
 
Float_t fMVAVar_etawidth
 
Float_t fMVAVar_fbrem
 
Float_t fMVAVar_GammaIso_DR0p0To0p1
 
Float_t fMVAVar_GammaIso_DR0p1To0p2
 
Float_t fMVAVar_GammaIso_DR0p2To0p3
 
Float_t fMVAVar_GammaIso_DR0p3To0p4
 
Float_t fMVAVar_GammaIso_DR0p4To0p5
 
Float_t fMVAVar_gsfchi2
 
Float_t fMVAVar_HoE
 
Float_t fMVAVar_IoEmIoP
 
Float_t fMVAVar_ip3d
 
Float_t fMVAVar_ip3dSig
 
Float_t fMVAVar_kfchi2
 
Float_t fMVAVar_kfhits
 
Float_t fMVAVar_kfhitsall
 
Float_t fMVAVar_NeutralHadronIso_DR0p0To0p1
 
Float_t fMVAVar_NeutralHadronIso_DR0p1To0p2
 
Float_t fMVAVar_NeutralHadronIso_DR0p2To0p3
 
Float_t fMVAVar_NeutralHadronIso_DR0p3To0p4
 
Float_t fMVAVar_NeutralHadronIso_DR0p4To0p5
 
Float_t fMVAVar_OneMinusE1x5E5x5
 
Float_t fMVAVar_phiwidth
 
Float_t fMVAVar_PreShowerOverRaw
 
Float_t fMVAVar_pt
 
Float_t fMVAVar_R9
 
Float_t fMVAVar_rho
 
Float_t fMVAVar_see
 
Float_t fMVAVar_spp
 
UInt_t fNMVABins
 
Bool_t fPrintMVADebug
 
std::vector< TMVA::MethodBase * > fTMVAMethod
 
std::vector< TMVA::Reader * > fTMVAReader
 
Bool_t fUseBinnedVersion
 

Detailed Description

–> NOTE if you want to use this class as standalone without the CMSSW part you need to uncomment the below line and compile normally with scramv1 b Then you need just to load it in your root macro the lib with the correct path, eg: gSystem->Load("/data/benedet/CMSSW_5_2_2/lib/slc5_amd64_gcc462/pluginEGammaEGammaAnalysisTools.so");

Definition at line 26 of file EGammaMvaEleEstimator.h.

Member Enumeration Documentation

Enumerator
kTrig 
kNonTrig 
kIsoRings 
kTrig 
kTrigNoIP 
kNonTrig 
kIsoRings 
kTrigIDIsoCombined 
kTrigIDIsoCombinedPUCorrected 

Definition at line 31 of file EGammaMvaEleEstimator.h.

31  {
32  kTrig = 0, // MVA for non-triggering electrons
33  kNonTrig, // MVA for triggering electrons
34  kIsoRings
35  };
Enumerator
kTrig 
kNonTrig 
kIsoRings 
kTrig 
kTrigNoIP 
kNonTrig 
kIsoRings 
kTrigIDIsoCombined 
kTrigIDIsoCombinedPUCorrected 

Definition at line 44 of file EGammaMvaEleEstimator.h.

44  {
45  kTrig = 0, // MVA for triggering electrons
46  kTrigNoIP = 1, // MVA for triggering electrons without IP info
47  kNonTrig = 2, // MVA for non-triggering electrons
48  kIsoRings, // Isolation MVA for non-trigger electrons
49  kTrigIDIsoCombined, // ID+Iso Combined MVA for triggering electrons
50  kTrigIDIsoCombinedPUCorrected // ID+Iso Combined MVA for triggering electrons
51  };

Constructor & Destructor Documentation

EGammaMvaEleEstimator::EGammaMvaEleEstimator ( )

Definition at line 36 of file EGammaMvaEleEstimator.cc.

EGammaMvaEleEstimator::~EGammaMvaEleEstimator ( )

Definition at line 48 of file EGammaMvaEleEstimator.cc.

References fTMVAReader, and i.

49 {
50  for (unsigned int i=0;i<fTMVAReader.size(); ++i) {
51  if (fTMVAReader[i]) delete fTMVAReader[i];
52  }
53 }
int i
Definition: DBlmapReader.cc:9
std::vector< TMVA::Reader * > fTMVAReader
EGammaMvaEleEstimator::EGammaMvaEleEstimator ( )
EGammaMvaEleEstimator::~EGammaMvaEleEstimator ( )

Member Function Documentation

void EGammaMvaEleEstimator::bindVariables ( )

Definition at line 525 of file EGammaMvaEleEstimator.cc.

References fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_e1x5e5x5, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_fbrem, fMVAVar_gsfchi2, fMVAVar_kfchi2, fMVAVar_R9, fMVAVar_spp, and edm::detail::isnan().

Referenced by isoMvaValue(), and mvaValue().

525  {
526 
527  // this binding is needed for variables that sometime diverge.
528 
529 
530  if(fMVAVar_fbrem < -1.)
531  fMVAVar_fbrem = -1.;
532 
533  fMVAVar_deta = fabs(fMVAVar_deta);
534  if(fMVAVar_deta > 0.06)
535  fMVAVar_deta = 0.06;
536 
537  fMVAVar_dphi = fabs(fMVAVar_dphi);
538  if(fMVAVar_dphi > 0.6)
539  fMVAVar_dphi = 0.6;
540 
541  if(fMVAVar_EoP > 20.)
542  fMVAVar_EoP = 20.;
543 
544  if(fMVAVar_eleEoPout > 20.)
545  fMVAVar_eleEoPout = 20.;
546 
548  if(fMVAVar_detacalo > 0.2)
549  fMVAVar_detacalo = 0.2;
550 
551  if(fMVAVar_e1x5e5x5 < -1.)
552  fMVAVar_e1x5e5x5 = -1;
553 
554  if(fMVAVar_e1x5e5x5 > 2.)
555  fMVAVar_e1x5e5x5 = 2.;
556 
557  if(fMVAVar_R9 > 5)
558  fMVAVar_R9 = 5;
559 
560  if(fMVAVar_gsfchi2 > 200.)
561  fMVAVar_gsfchi2 = 200;
562 
563  if(fMVAVar_kfchi2 > 10.)
564  fMVAVar_kfchi2 = 10.;
565 
566  // Needed for a bug in CMSSW_420, fixed in more recent CMSSW versions
568  fMVAVar_spp = 0.;
569 
570 
571  return;
572 }
bool isnan(float x)
Definition: math.h:13
void EGammaMvaEleEstimator::bindVariables ( )
UInt_t EGammaMvaEleEstimator::GetMVABin ( double  eta,
double  pt 
) const

Definition at line 221 of file EGammaMvaEleEstimator.cc.

References newFWLiteAna::bin, fMVAType, kIsoRings, kNonTrig, and kTrig.

Referenced by IDIsoCombinedMvaValue(), isoMvaValue(), and mvaValue().

221  {
222 
223  //Default is to return the first bin
224  unsigned int bin = 0;
225 
227  if (pt < 10 && fabs(eta) < 1.479) bin = 0;
228  if (pt < 10 && fabs(eta) >= 1.479) bin = 1;
229  if (pt >= 10 && fabs(eta) < 1.479) bin = 2;
230  if (pt >= 10 && fabs(eta) >= 1.479) bin = 3;
231  }
232 
234  bin = 0;
235  if (pt < 10 && fabs(eta) < 0.8) bin = 0;
236  if (pt < 10 && fabs(eta) >= 0.8 && fabs(eta) < 1.479 ) bin = 1;
237  if (pt < 10 && fabs(eta) >= 1.479) bin = 2;
238  if (pt >= 10 && fabs(eta) < 0.8) bin = 3;
239  if (pt >= 10 && fabs(eta) >= 0.8 && fabs(eta) < 1.479 ) bin = 4;
240  if (pt >= 10 && fabs(eta) >= 1.479) bin = 5;
241  }
242 
243 
245  bin = 0;
246  if (pt < 20 && fabs(eta) < 0.8) bin = 0;
247  if (pt < 20 && fabs(eta) >= 0.8 && fabs(eta) < 1.479 ) bin = 1;
248  if (pt < 20 && fabs(eta) >= 1.479) bin = 2;
249  if (pt >= 20 && fabs(eta) < 0.8) bin = 3;
250  if (pt >= 20 && fabs(eta) >= 0.8 && fabs(eta) < 1.479 ) bin = 4;
251  if (pt >= 20 && fabs(eta) >= 1.479) bin = 5;
252  }
253 
254 
255 
256  return bin;
257 }
T eta() const
UInt_t EGammaMvaEleEstimator::GetMVABin ( double  eta,
double  pt 
) const
Double_t EGammaMvaEleEstimator::IDIsoCombinedMvaValue ( const reco::GsfElectron ele,
const reco::Vertex vertex,
const TransientTrackBuilder transientTrackBuilder,
EcalClusterLazyTools  myEcalCluster,
const reco::PFCandidateCollection PFCandidates,
double  Rho,
ElectronEffectiveArea::ElectronEffectiveAreaTarget  EATarget,
bool  printDebug = kFALSE 
)

Definition at line 1684 of file EGammaMvaEleEstimator.cc.

References IPTools::absoluteImpactParameter3D(), newFWLiteAna::bin, TransientTrackBuilder::build(), reco::GsfElectron::closestCtfTrackRef(), funct::cos(), gather_cfg::cout, reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::PFCandidate::e, reco::GsfElectron::e1x5(), reco::GsfElectron::e5x5(), reco::GsfElectron::eEleClusterOverPout(), reco::GsfElectron::eSuperClusterOverP(), reco::LeafCandidate::eta(), reco::GsfElectron::fbrem(), fisInitialized, fMethodname, fMVAType, fMVAVar_ChargedIso_DR0p0To0p1, fMVAVar_ChargedIso_DR0p1To0p2, fMVAVar_ChargedIso_DR0p2To0p3, fMVAVar_ChargedIso_DR0p3To0p4, fMVAVar_ChargedIso_DR0p4To0p5, fMVAVar_d0, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_GammaIso_DR0p0To0p1, fMVAVar_GammaIso_DR0p1To0p2, fMVAVar_GammaIso_DR0p2To0p3, fMVAVar_GammaIso_DR0p3To0p4, fMVAVar_GammaIso_DR0p4To0p5, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_ip3d, fMVAVar_ip3dSig, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_kfhitsall, fMVAVar_NeutralHadronIso_DR0p0To0p1, fMVAVar_NeutralHadronIso_DR0p1To0p2, fMVAVar_NeutralHadronIso_DR0p2To0p3, fMVAVar_NeutralHadronIso_DR0p3To0p4, fMVAVar_NeutralHadronIso_DR0p4To0p5, fMVAVar_OneMinusE1x5E5x5, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_rho, fMVAVar_see, fMVAVar_spp, fTMVAMethod, fTMVAReader, fUseBinnedVersion, reco::PFCandidate::gamma, ElectronEffectiveArea::GetElectronEffectiveArea(), GetMVABin(), reco::GsfElectron::gsfTrack(), reco::GsfElectron::hadronicOverEm(), edm::Ref< C, T, F >::isAvailable(), edm::detail::isnan(), edm::Ref< C, T, F >::isNonnull(), ElectronEffectiveArea::kEleGammaIsoDR0p0To0p1, ElectronEffectiveArea::kEleGammaIsoDR0p1To0p2, ElectronEffectiveArea::kEleGammaIsoDR0p2To0p3, ElectronEffectiveArea::kEleGammaIsoDR0p3To0p4, ElectronEffectiveArea::kEleGammaIsoDR0p4To0p5, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p0To0p1, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p1To0p2, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p2To0p3, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p3To0p4, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p4To0p5, kTrig, kTrigIDIsoCombined, kTrigIDIsoCombinedPUCorrected, Max(), bookConverter::max, Min(), min(), reco::PFCandidate::mu, reco::LeafCandidate::phi(), reco::Vertex::position(), funct::pow(), reco::LeafCandidate::pt(), reco::GsfElectron::sigmaIetaIeta(), mathSSE::sqrt(), reco::GsfElectron::superCluster(), reco::GsfElectron::trackMomentumAtVtx(), and groupFilesInBlocks::tt.

1691  {
1692 
1693  if (!fisInitialized) {
1694  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1695  return -9999;
1696  }
1697 
1698  bool validKF= false;
1699  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
1700  validKF = (myTrackRef.isAvailable());
1701  validKF = (myTrackRef.isNonnull());
1702 
1703  // Pure tracking variables
1704  fMVAVar_fbrem = (ele.fbrem() < -1. ) ? -1. : ele.fbrem();
1705  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
1706  if (fMVAVar_kfchi2 > 10) fMVAVar_kfchi2 = 10;
1707  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
1708  fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative
1709  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
1710  if (fMVAVar_gsfchi2 > 200) fMVAVar_gsfchi2 = 200;
1711 
1712 
1713  // Geometrical matchings
1714  fMVAVar_deta = ( fabs(ele.deltaEtaSuperClusterTrackAtVtx()) > 0.06 ) ? 0.06 : fabs(ele.deltaEtaSuperClusterTrackAtVtx());
1717 
1718 
1719  // Pure ECAL -> shower shapes
1720  fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1721  std::vector<float> vCov = myEcalCluster.localCovariances(*(ele.superCluster()->seed())) ;
1722  if (!isnan(vCov[2])) fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi
1723  else fMVAVar_spp = 0.;
1724 
1725  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1726  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1727  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ;
1729  fMVAVar_R9 = myEcalCluster.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy();
1730  if (fMVAVar_R9 > 5) fMVAVar_R9 = 5;
1731 
1732  // Energy matching
1733  fMVAVar_HoE = ele.hadronicOverEm();
1734  fMVAVar_EoP = ( ele.eSuperClusterOverP() > 20 ) ? 20 : ele.eSuperClusterOverP();
1735  fMVAVar_IoEmIoP = (1.0/ele.superCluster()->energy()) - (1.0 / ele.trackMomentumAtVtx().R()); //this is the proper variable
1736  fMVAVar_eleEoPout = ( ele.eEleClusterOverPout() > 20 ) ? 20 : ele.eEleClusterOverPout();
1737  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1738 
1739  // Spectators
1740  fMVAVar_eta = ele.superCluster()->eta();
1741  fMVAVar_pt = ele.pt();
1742 
1743 
1744 
1745  // for triggering electrons get the impact parameteres
1746  if(fMVAType == kTrig) {
1747  //d0
1748  if (ele.gsfTrack().isNonnull()) {
1749  fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position());
1750  } else if (ele.closestCtfTrackRef().isNonnull()) {
1751  fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position());
1752  } else {
1753  fMVAVar_d0 = -9999.0;
1754  }
1755 
1756  //default values for IP3D
1757  fMVAVar_ip3d = -999.0;
1758  fMVAVar_ip3dSig = 0.0;
1759  if (ele.gsfTrack().isNonnull()) {
1760  const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.;
1761 
1762  const reco::TransientTrack &tt = transientTrackBuilder.build(ele.gsfTrack());
1763  const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,vertex);
1764  if (ip3dpv.first) {
1765  double ip3d = gsfsign*ip3dpv.second.value();
1766  double ip3derr = ip3dpv.second.error();
1767  fMVAVar_ip3d = ip3d;
1768  fMVAVar_ip3dSig = ip3d/ip3derr;
1769  }
1770  }
1771  }
1772 
1773  //**********************************************************
1774  //Isolation variables
1775  //**********************************************************
1776  Double_t tmpChargedIso_DR0p0To0p1 = 0;
1777  Double_t tmpChargedIso_DR0p1To0p2 = 0;
1778  Double_t tmpChargedIso_DR0p2To0p3 = 0;
1779  Double_t tmpChargedIso_DR0p3To0p4 = 0;
1780  Double_t tmpChargedIso_DR0p4To0p5 = 0;
1781  Double_t tmpGammaIso_DR0p0To0p1 = 0;
1782  Double_t tmpGammaIso_DR0p1To0p2 = 0;
1783  Double_t tmpGammaIso_DR0p2To0p3 = 0;
1784  Double_t tmpGammaIso_DR0p3To0p4 = 0;
1785  Double_t tmpGammaIso_DR0p4To0p5 = 0;
1786  Double_t tmpNeutralHadronIso_DR0p0To0p1 = 0;
1787  Double_t tmpNeutralHadronIso_DR0p1To0p2 = 0;
1788  Double_t tmpNeutralHadronIso_DR0p2To0p3 = 0;
1789  Double_t tmpNeutralHadronIso_DR0p3To0p4 = 0;
1790  Double_t tmpNeutralHadronIso_DR0p4To0p5 = 0;
1791 
1792  for (reco::PFCandidateCollection::const_iterator iP = PFCandidates.begin();
1793  iP != PFCandidates.end(); ++iP) {
1794 
1795  double dr = sqrt(pow(iP->eta() - ele.eta(),2) + pow(acos(cos(iP->phi() - ele.phi())),2));
1796 
1797  Bool_t passVeto = kTRUE;
1798  //Charged
1799  if(iP->trackRef().isNonnull()) {
1800 
1801  //make sure charged pf candidates pass the PFNoPU condition (assumed)
1802 
1803  //************************************************************
1804  // Veto any PFmuon, or PFEle
1805  if (iP->particleId() == reco::PFCandidate::e || iP->particleId() == reco::PFCandidate::mu) passVeto = kFALSE;
1806  //************************************************************
1807  //************************************************************
1808  // Footprint Veto
1809  if (fabs(fMVAVar_eta) > 1.479 && dr < 0.015) passVeto = kFALSE;
1810  //************************************************************
1811  if (passVeto) {
1812  if (dr < 0.1) tmpChargedIso_DR0p0To0p1 += iP->pt();
1813  if (dr >= 0.1 && dr < 0.2) tmpChargedIso_DR0p1To0p2 += iP->pt();
1814  if (dr >= 0.2 && dr < 0.3) tmpChargedIso_DR0p2To0p3 += iP->pt();
1815  if (dr >= 0.3 && dr < 0.4) tmpChargedIso_DR0p3To0p4 += iP->pt();
1816  if (dr >= 0.4 && dr < 0.5) tmpChargedIso_DR0p4To0p5 += iP->pt();
1817  } //pass veto
1818  }
1819  //Gamma
1820  else if (iP->particleId() == reco::PFCandidate::gamma) {
1821  //************************************************************
1822  // Footprint Veto
1823  if (fabs(fMVAVar_eta) > 1.479 && dr < 0.08) passVeto = kFALSE;
1824  //************************************************************
1825  if (passVeto) {
1826  if (dr < 0.1) tmpGammaIso_DR0p0To0p1 += iP->pt();
1827  if (dr >= 0.1 && dr < 0.2) tmpGammaIso_DR0p1To0p2 += iP->pt();
1828  if (dr >= 0.2 && dr < 0.3) tmpGammaIso_DR0p2To0p3 += iP->pt();
1829  if (dr >= 0.3 && dr < 0.4) tmpGammaIso_DR0p3To0p4 += iP->pt();
1830  if (dr >= 0.4 && dr < 0.5) tmpGammaIso_DR0p4To0p5 += iP->pt();
1831  }
1832  }
1833  //NeutralHadron
1834  else {
1835  if (dr < 0.1) tmpNeutralHadronIso_DR0p0To0p1 += iP->pt();
1836  if (dr >= 0.1 && dr < 0.2) tmpNeutralHadronIso_DR0p1To0p2 += iP->pt();
1837  if (dr >= 0.2 && dr < 0.3) tmpNeutralHadronIso_DR0p2To0p3 += iP->pt();
1838  if (dr >= 0.3 && dr < 0.4) tmpNeutralHadronIso_DR0p3To0p4 += iP->pt();
1839  if (dr >= 0.4 && dr < 0.5) tmpNeutralHadronIso_DR0p4To0p5 += iP->pt();
1840  }
1841  } //loop over PF candidates
1842 
1844  fMVAVar_ChargedIso_DR0p0To0p1 = TMath::Min((tmpChargedIso_DR0p0To0p1)/ele.pt(), 2.5);
1845  fMVAVar_ChargedIso_DR0p1To0p2 = TMath::Min((tmpChargedIso_DR0p1To0p2)/ele.pt(), 2.5);
1846  fMVAVar_ChargedIso_DR0p2To0p3 = TMath::Min((tmpChargedIso_DR0p2To0p3)/ele.pt(), 2.5);
1847  fMVAVar_ChargedIso_DR0p3To0p4 = TMath::Min((tmpChargedIso_DR0p3To0p4)/ele.pt(), 2.5);
1848  fMVAVar_ChargedIso_DR0p4To0p5 = TMath::Min((tmpChargedIso_DR0p4To0p5)/ele.pt(), 2.5);
1859  } else if (fMVAType == kTrigIDIsoCombined) {
1860  fMVAVar_ChargedIso_DR0p0To0p1 = TMath::Min((tmpChargedIso_DR0p0To0p1)/ele.pt(), 2.5);
1861  fMVAVar_ChargedIso_DR0p1To0p2 = TMath::Min((tmpChargedIso_DR0p1To0p2)/ele.pt(), 2.5);
1862  fMVAVar_ChargedIso_DR0p2To0p3 = TMath::Min((tmpChargedIso_DR0p2To0p3)/ele.pt(), 2.5);
1863  fMVAVar_ChargedIso_DR0p3To0p4 = TMath::Min((tmpChargedIso_DR0p3To0p4)/ele.pt(), 2.5);
1864  fMVAVar_ChargedIso_DR0p4To0p5 = TMath::Min((tmpChargedIso_DR0p4To0p5)/ele.pt(), 2.5);
1865  fMVAVar_GammaIso_DR0p0To0p1 = TMath::Max(TMath::Min((tmpGammaIso_DR0p0To0p1)/ele.pt(), 2.5), 0.0);
1866  fMVAVar_GammaIso_DR0p1To0p2 = TMath::Max(TMath::Min((tmpGammaIso_DR0p1To0p2)/ele.pt(), 2.5), 0.0);
1867  fMVAVar_GammaIso_DR0p2To0p3 = TMath::Max(TMath::Min((tmpGammaIso_DR0p2To0p3)/ele.pt(), 2.5), 0.0);
1868  fMVAVar_GammaIso_DR0p3To0p4 = TMath::Max(TMath::Min((tmpGammaIso_DR0p3To0p4)/ele.pt(), 2.5), 0.0);
1869  fMVAVar_GammaIso_DR0p4To0p5 = TMath::Max(TMath::Min((tmpGammaIso_DR0p4To0p5)/ele.pt(), 2.5), 0.0);
1870  fMVAVar_NeutralHadronIso_DR0p0To0p1 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p0To0p1)/ele.pt(), 2.5), 0.0);
1871  fMVAVar_NeutralHadronIso_DR0p1To0p2 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p1To0p2)/ele.pt(), 2.5), 0.0);
1872  fMVAVar_NeutralHadronIso_DR0p2To0p3 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p2To0p3)/ele.pt(), 2.5), 0.0);
1873  fMVAVar_NeutralHadronIso_DR0p3To0p4 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p3To0p4)/ele.pt(), 2.5), 0.0);
1874  fMVAVar_NeutralHadronIso_DR0p4To0p5 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p4To0p5)/ele.pt(), 2.5), 0.0);
1875  fMVAVar_rho = Rho;
1876  } else {
1877  cout << "Warning: Type " << fMVAType << " is not supported.\n";
1878  }
1879 
1880  // evaluate
1881  Double_t mva = -9999;
1882  if (fUseBinnedVersion) {
1884  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
1885  } else {
1886  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
1887  }
1888 
1889 
1890 
1891  if(printDebug) {
1892  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1893  cout << " fbrem " << fMVAVar_fbrem
1894  << " kfchi2 " << fMVAVar_kfchi2
1895  << " mykfhits " << fMVAVar_kfhits
1896  << " gsfchi2 " << fMVAVar_gsfchi2
1897  << " deta " << fMVAVar_deta
1898  << " dphi " << fMVAVar_dphi
1899  << " detacalo " << fMVAVar_detacalo
1900  << " see " << fMVAVar_see
1901  << " spp " << fMVAVar_spp
1902  << " etawidth " << fMVAVar_etawidth
1903  << " phiwidth " << fMVAVar_phiwidth
1904  << " OneMinusE1x5E5x5 " << fMVAVar_OneMinusE1x5E5x5
1905  << " R9 " << fMVAVar_R9
1906  << " HoE " << fMVAVar_HoE
1907  << " EoP " << fMVAVar_EoP
1908  << " IoEmIoP " << fMVAVar_IoEmIoP
1909  << " eleEoPout " << fMVAVar_eleEoPout
1910  << " d0 " << fMVAVar_d0
1911  << " ip3d " << fMVAVar_ip3d
1912  << " eta " << fMVAVar_eta
1913  << " pt " << fMVAVar_pt << endl;
1914  cout << "ChargedIso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1919  << fMVAVar_ChargedIso_DR0p4To0p5 << endl;
1920  cout << "PF Gamma Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1921  << fMVAVar_GammaIso_DR0p0To0p1 << " "
1922  << fMVAVar_GammaIso_DR0p1To0p2 << " "
1923  << fMVAVar_GammaIso_DR0p2To0p3 << " "
1924  << fMVAVar_GammaIso_DR0p3To0p4 << " "
1925  << fMVAVar_GammaIso_DR0p4To0p5 << endl;
1926  cout << "PF Neutral Hadron Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1932  << endl;
1933  cout << "Rho : " << Rho << endl;
1934  cout << " ### MVA " << mva << endl;
1935  }
1936 
1937 
1938 
1939  return mva;
1940 }
bool isAvailable() const
Definition: Ref.h:614
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:289
static Double_t GetElectronEffectiveArea(ElectronEffectiveAreaType type, Double_t SCEta, ElectronEffectiveAreaTarget EffectiveAreaTarget=kEleEAData2011)
reco::TransientTrack build(const reco::Track *p) const
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:37
float fbrem() const
Definition: GsfElectron.h:684
T Min(T a, T b)
Definition: MathUtil.h:39
UInt_t GetMVABin(double eta, double pt) const
const Point & position() const
position
Definition: Vertex.h:106
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
TrackRef closestCtfTrackRef() const
Definition: GsfElectron.h:199
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
float sigmaIetaIeta() const
Definition: GsfElectron.h:402
float hadronicOverEm() const
Definition: GsfElectron.h:443
bool isnan(float x)
Definition: math.h:13
T sqrt(T t)
Definition: SSEVec.h:48
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:182
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:250
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float eEleClusterOverPout() const
Definition: GsfElectron.h:246
T min(T a, T b)
Definition: MathUtil.h:58
T Max(T a, T b)
Definition: MathUtil.h:44
float e1x5() const
Definition: GsfElectron.h:404
float e5x5() const
Definition: GsfElectron.h:406
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:248
tuple cout
Definition: gather_cfg.py:121
std::vector< TMVA::Reader * > fTMVAReader
std::vector< TMVA::MethodBase * > fTMVAMethod
virtual double phi() const
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
tuple PFCandidates
Double_t EGammaMvaEleEstimator::IDIsoCombinedMvaValue ( Double_t  fbrem,
Double_t  kfchi2,
Int_t  kfhits,
Double_t  gsfchi2,
Double_t  deta,
Double_t  dphi,
Double_t  detacalo,
Double_t  see,
Double_t  spp,
Double_t  etawidth,
Double_t  phiwidth,
Double_t  OneMinusE1x5E5x5,
Double_t  R9,
Double_t  HoE,
Double_t  EoP,
Double_t  IoEmIoP,
Double_t  eleEoPout,
Double_t  PreShowerOverRaw,
Double_t  d0,
Double_t  ip3d,
Double_t  ChargedIso_DR0p0To0p1,
Double_t  ChargedIso_DR0p1To0p2,
Double_t  ChargedIso_DR0p2To0p3,
Double_t  ChargedIso_DR0p3To0p4,
Double_t  ChargedIso_DR0p4To0p5,
Double_t  GammaIso_DR0p0To0p1,
Double_t  GammaIso_DR0p1To0p2,
Double_t  GammaIso_DR0p2To0p3,
Double_t  GammaIso_DR0p3To0p4,
Double_t  GammaIso_DR0p4To0p5,
Double_t  NeutralHadronIso_DR0p0To0p1,
Double_t  NeutralHadronIso_DR0p1To0p2,
Double_t  NeutralHadronIso_DR0p2To0p3,
Double_t  NeutralHadronIso_DR0p3To0p4,
Double_t  NeutralHadronIso_DR0p4To0p5,
Double_t  Rho,
Double_t  eta,
Double_t  pt,
Bool_t  printDebug = kFALSE 
)

Definition at line 773 of file EGammaMvaEleEstimator.cc.

References newFWLiteAna::bin, gather_cfg::cout, eta(), fisInitialized, fMethodname, fMVAVar_ChargedIso_DR0p0To0p1, fMVAVar_ChargedIso_DR0p1To0p2, fMVAVar_ChargedIso_DR0p2To0p3, fMVAVar_ChargedIso_DR0p3To0p4, fMVAVar_ChargedIso_DR0p4To0p5, fMVAVar_d0, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_GammaIso_DR0p0To0p1, fMVAVar_GammaIso_DR0p1To0p2, fMVAVar_GammaIso_DR0p2To0p3, fMVAVar_GammaIso_DR0p3To0p4, fMVAVar_GammaIso_DR0p4To0p5, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_ip3d, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_NeutralHadronIso_DR0p0To0p1, fMVAVar_NeutralHadronIso_DR0p1To0p2, fMVAVar_NeutralHadronIso_DR0p2To0p3, fMVAVar_NeutralHadronIso_DR0p3To0p4, fMVAVar_NeutralHadronIso_DR0p4To0p5, fMVAVar_OneMinusE1x5E5x5, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_rho, fMVAVar_see, fMVAVar_spp, fTMVAMethod, fTMVAReader, fUseBinnedVersion, GetMVABin(), bookConverter::max, min(), and EnergyCorrector::pt.

811  {
812 
813  if (!fisInitialized) {
814  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
815  return -9999;
816  }
817 
818  fMVAVar_fbrem = ( fbrem < -1.0 ) ? -1.0 : fbrem;
819  fMVAVar_kfchi2 = ( kfchi2 > 10 ) ? 10 : kfchi2;
820  fMVAVar_kfhits = float(kfhits); // BTD does not support int variables
821  fMVAVar_gsfchi2 = ( gsfchi2 > 200 ) ? 200 : gsfchi2;
822  fMVAVar_deta = ( fabs(deta) > 0.06 ) ? 0.06 : fabs(deta);
823  fMVAVar_dphi = dphi;
824  fMVAVar_detacalo = detacalo;
825 
826  fMVAVar_see = see;
827  fMVAVar_spp = spp;
828  fMVAVar_etawidth = etawidth;
829  fMVAVar_phiwidth = phiwidth;
830  fMVAVar_OneMinusE1x5E5x5= max(min(double(OneMinusE1x5E5x5),2.0),-1.0);
831  fMVAVar_R9 = (R9 > 5) ? 5: R9;
832 
833  fMVAVar_HoE = HoE;
834  fMVAVar_EoP = (EoP > 20) ? 20 : EoP;
835  fMVAVar_IoEmIoP = IoEmIoP;
836  fMVAVar_eleEoPout = (eleEoPout > 20) ? 20 : eleEoPout;
837  fMVAVar_PreShowerOverRaw= PreShowerOverRaw;
838 
839  fMVAVar_d0 = d0;
840  fMVAVar_ip3d = ip3d;
841 
842  fMVAVar_ChargedIso_DR0p0To0p1 = ChargedIso_DR0p0To0p1;
843  fMVAVar_ChargedIso_DR0p1To0p2 = ChargedIso_DR0p1To0p2;
844  fMVAVar_ChargedIso_DR0p2To0p3 = ChargedIso_DR0p2To0p3;
845  fMVAVar_ChargedIso_DR0p3To0p4 = ChargedIso_DR0p3To0p4;
846  fMVAVar_ChargedIso_DR0p4To0p5 = ChargedIso_DR0p4To0p5;
847  fMVAVar_GammaIso_DR0p0To0p1 = GammaIso_DR0p0To0p1;
848  fMVAVar_GammaIso_DR0p1To0p2 = GammaIso_DR0p1To0p2;
849  fMVAVar_GammaIso_DR0p2To0p3 = GammaIso_DR0p2To0p3;
850  fMVAVar_GammaIso_DR0p3To0p4 = GammaIso_DR0p3To0p4;
851  fMVAVar_GammaIso_DR0p4To0p5 = GammaIso_DR0p4To0p5;
852  fMVAVar_NeutralHadronIso_DR0p0To0p1 = NeutralHadronIso_DR0p0To0p1;
853  fMVAVar_NeutralHadronIso_DR0p1To0p2 = NeutralHadronIso_DR0p1To0p2;
854  fMVAVar_NeutralHadronIso_DR0p2To0p3 = NeutralHadronIso_DR0p2To0p3;
855  fMVAVar_NeutralHadronIso_DR0p3To0p4 = NeutralHadronIso_DR0p3To0p4;
856  fMVAVar_NeutralHadronIso_DR0p4To0p5 = NeutralHadronIso_DR0p4To0p5;
857 
858  fMVAVar_rho = Rho;
859  fMVAVar_eta = eta;
860  fMVAVar_pt = pt;
861 
862  Double_t mva = -9999;
863  if (fUseBinnedVersion) {
865  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
866  } else {
867  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
868  }
869 
870  if(printDebug) {
871  cout << " *** Inside the class fMethodname " << fMethodname << endl;
872  cout << " fbrem " << fMVAVar_fbrem
873  << " kfchi2 " << fMVAVar_kfchi2
874  << " mykfhits " << fMVAVar_kfhits
875  << " gsfchi2 " << fMVAVar_gsfchi2
876  << " deta " << fMVAVar_deta
877  << " dphi " << fMVAVar_dphi
878  << " detacalo " << fMVAVar_detacalo
879  << " see " << fMVAVar_see
880  << " spp " << fMVAVar_spp
881  << " etawidth " << fMVAVar_etawidth
882  << " phiwidth " << fMVAVar_phiwidth
883  << " OneMinusE1x5E5x5 " << fMVAVar_OneMinusE1x5E5x5
884  << " R9 " << fMVAVar_R9
885  << " HoE " << fMVAVar_HoE
886  << " EoP " << fMVAVar_EoP
887  << " IoEmIoP " << fMVAVar_IoEmIoP
888  << " eleEoPout " << fMVAVar_eleEoPout
889  << " PreShowerOverRaw " << fMVAVar_PreShowerOverRaw
890  << " d0 " << fMVAVar_d0
891  << " ip3d " << fMVAVar_ip3d
892  << " ChargedIso_DR0p0To0p1 " << ChargedIso_DR0p0To0p1
893  << " ChargedIso_DR0p1To0p2 " << ChargedIso_DR0p1To0p2
894  << " ChargedIso_DR0p2To0p3 " << ChargedIso_DR0p2To0p3
895  << " ChargedIso_DR0p3To0p4 " << ChargedIso_DR0p3To0p4
896  << " ChargedIso_DR0p4To0p5 " << ChargedIso_DR0p4To0p5
897  << " GammaIso_DR0p0To0p1 " << GammaIso_DR0p0To0p1
898  << " GammaIso_DR0p1To0p2 " << GammaIso_DR0p1To0p2
899  << " GammaIso_DR0p2To0p3 " << GammaIso_DR0p2To0p3
900  << " GammaIso_DR0p3To0p4 " << GammaIso_DR0p3To0p4
901  << " GammaIso_DR0p4To0p5 " << GammaIso_DR0p4To0p5
902  << " NeutralHadronIso_DR0p0To0p1 " << NeutralHadronIso_DR0p0To0p1
903  << " NeutralHadronIso_DR0p1To0p2 " << NeutralHadronIso_DR0p1To0p2
904  << " NeutralHadronIso_DR0p2To0p3 " << NeutralHadronIso_DR0p2To0p3
905  << " NeutralHadronIso_DR0p3To0p4 " << NeutralHadronIso_DR0p3To0p4
906  << " NeutralHadronIso_DR0p4To0p5 " << NeutralHadronIso_DR0p4To0p5
907  << " Rho " << Rho
908  << " eta " << fMVAVar_eta
909  << " pt " << fMVAVar_pt << endl;
910  cout << " ### MVA " << mva << endl;
911  }
912 
913  return mva;
914 }
T eta() const
UInt_t GetMVABin(double eta, double pt) const
T min(T a, T b)
Definition: MathUtil.h:58
tuple cout
Definition: gather_cfg.py:121
std::vector< TMVA::Reader * > fTMVAReader
std::vector< TMVA::MethodBase * > fTMVAMethod
void EGammaMvaEleEstimator::initialize ( std::string  methodName,
std::string  weightsfile,
EGammaMvaEleEstimator::MVAType  type 
)

Definition at line 56 of file EGammaMvaEleEstimator.cc.

Referenced by HWWAnalyzer::HWWAnalyzer(), and heppy::EGammaMvaEleEstimatorFWLite::initialize().

59 {
60 
61  std::vector<std::string> tempWeightFileVector;
62  tempWeightFileVector.push_back(weightsfile);
63  initialize(methodName,type,kFALSE,tempWeightFileVector);
64 }
type
Definition: HCALResponse.h:21
void initialize(std::string methodName, std::string weightsfile, EGammaMvaEleEstimator::MVAType type)
void EGammaMvaEleEstimator::initialize ( std::string  methodName,
EGammaMvaEleEstimator::MVAType  type,
Bool_t  useBinnedVersion,
std::vector< std::string >  weightsfiles 
)

Definition at line 68 of file EGammaMvaEleEstimator.cc.

References fisInitialized, fMethodname, fMVAType, fMVAVar_ChargedIso_DR0p0To0p1, fMVAVar_ChargedIso_DR0p1To0p2, fMVAVar_ChargedIso_DR0p2To0p3, fMVAVar_ChargedIso_DR0p3To0p4, fMVAVar_ChargedIso_DR0p4To0p5, fMVAVar_d0, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_e1x5e5x5, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_GammaIso_DR0p0To0p1, fMVAVar_GammaIso_DR0p1To0p2, fMVAVar_GammaIso_DR0p2To0p3, fMVAVar_GammaIso_DR0p3To0p4, fMVAVar_GammaIso_DR0p4To0p5, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_ip3d, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_NeutralHadronIso_DR0p0To0p1, fMVAVar_NeutralHadronIso_DR0p1To0p2, fMVAVar_NeutralHadronIso_DR0p2To0p3, fMVAVar_NeutralHadronIso_DR0p3To0p4, fMVAVar_NeutralHadronIso_DR0p4To0p5, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_see, fMVAVar_spp, fNMVABins, fTMVAReader, fUseBinnedVersion, i, kIsoRings, kNonTrig, and kTrig.

72  {
73 
74  //clean up first
75  for (unsigned int i=0;i<fTMVAReader.size(); ++i) {
76  if (fTMVAReader[i]) delete fTMVAReader[i];
77  }
78  fTMVAReader.clear();
79 
80  //initialize
81  fisInitialized = kTRUE;
82  fMVAType = type;
83  fMethodname = methodName;
84  fUseBinnedVersion = useBinnedVersion;
85 
86  //Define expected number of bins
87  UInt_t ExpectedNBins = 0;
88  if (!fUseBinnedVersion) {
89  ExpectedNBins = 1;
90  } else if (type == kTrig) {
91  ExpectedNBins = 6;
92  } else if (type == kNonTrig) {
93  ExpectedNBins = 6;
94  } else if (type == kIsoRings) {
95  ExpectedNBins = 4;
96  }
97  fNMVABins = ExpectedNBins;
98 
99  //Check number of weight files given
100  if (fNMVABins != weightsfiles.size() ) {
101  edm::LogError("InvalidInput") << "Error: Expected Number of bins = " << fNMVABins << " does not equal to weightsfiles.size() = "
102  << weightsfiles.size();
103  }
104 
105  //Loop over all bins
106  for (unsigned int i=0;i<fNMVABins; ++i) {
107 
108  //TMVA::Reader *tmpTMVAReader = new TMVA::Reader( "!Color:!Silent:Error" );
109  TMVA::Reader *tmpTMVAReader = new TMVA::Reader( "!Color:Silent:Error" );
110  //tmpTMVAReader->SetVerbose(kTRUE);
111  tmpTMVAReader->SetVerbose(kFALSE);
112 
113  if (type == kTrig) {
114  // Pure tracking variables
115  tmpTMVAReader->AddVariable("fbrem", &fMVAVar_fbrem);
116  tmpTMVAReader->AddVariable("kfchi2", &fMVAVar_kfchi2);
117  tmpTMVAReader->AddVariable("kfhits", &fMVAVar_kfhits);
118  tmpTMVAReader->AddVariable("gsfchi2", &fMVAVar_gsfchi2);
119 
120  // Geometrical matchings
121  tmpTMVAReader->AddVariable("deta", &fMVAVar_deta);
122  tmpTMVAReader->AddVariable("dphi", &fMVAVar_dphi);
123  tmpTMVAReader->AddVariable("detacalo", &fMVAVar_detacalo);
124  // tmpTMVAReader->AddVariable("dphicalo", &fMVAVar_dphicalo); // Pruned but save in your ntuple.
125 
126  // Pure ECAL -> shower shapes
127  tmpTMVAReader->AddVariable("see", &fMVAVar_see);
128  tmpTMVAReader->AddVariable("spp", &fMVAVar_spp);
129  tmpTMVAReader->AddVariable("etawidth", &fMVAVar_etawidth);
130  tmpTMVAReader->AddVariable("phiwidth", &fMVAVar_phiwidth);
131  tmpTMVAReader->AddVariable("e1x5e5x5", &fMVAVar_e1x5e5x5);
132  tmpTMVAReader->AddVariable("R9", &fMVAVar_R9);
133  // tmpTMVAReader->AddVariable("nbrems", &fMVAVar_nbrems); // Pruned but save in your ntuple.
134 
135  // Energy matching
136  tmpTMVAReader->AddVariable("HoE", &fMVAVar_HoE);
137  tmpTMVAReader->AddVariable("EoP", &fMVAVar_EoP);
138  tmpTMVAReader->AddVariable("IoEmIoP", &fMVAVar_IoEmIoP);
139  tmpTMVAReader->AddVariable("eleEoPout", &fMVAVar_eleEoPout);
140  // tmpTMVAReader->AddVariable("EoPout", &fMVAVar_EoPout); // Pruned but save in your ntuple.
141  if(i == 2 || i == 5)
142  tmpTMVAReader->AddVariable("PreShowerOverRaw",&fMVAVar_PreShowerOverRaw);
143 
144  if(!fUseBinnedVersion)
145  tmpTMVAReader->AddVariable("PreShowerOverRaw",&fMVAVar_PreShowerOverRaw);
146 
147  // IP
148  tmpTMVAReader->AddVariable("d0", &fMVAVar_d0);
149  tmpTMVAReader->AddVariable("ip3d", &fMVAVar_ip3d);
150 
151  tmpTMVAReader->AddSpectator("eta", &fMVAVar_eta);
152  tmpTMVAReader->AddSpectator("pt", &fMVAVar_pt);
153  }
154 
155  if (type == kNonTrig) {
156  // Pure tracking variables
157  tmpTMVAReader->AddVariable("fbrem", &fMVAVar_fbrem);
158  tmpTMVAReader->AddVariable("kfchi2", &fMVAVar_kfchi2);
159  tmpTMVAReader->AddVariable("kfhits", &fMVAVar_kfhits);
160  tmpTMVAReader->AddVariable("gsfchi2", &fMVAVar_gsfchi2);
161 
162  // Geometrical matchings
163  tmpTMVAReader->AddVariable("deta", &fMVAVar_deta);
164  tmpTMVAReader->AddVariable("dphi", &fMVAVar_dphi);
165  tmpTMVAReader->AddVariable("detacalo", &fMVAVar_detacalo);
166  // tmpTMVAReader->AddVariable("dphicalo", &fMVAVar_dphicalo); // Pruned but save in your ntuple.
167 
168  // Pure ECAL -> shower shapes
169  tmpTMVAReader->AddVariable("see", &fMVAVar_see);
170  tmpTMVAReader->AddVariable("spp", &fMVAVar_spp);
171  tmpTMVAReader->AddVariable("etawidth", &fMVAVar_etawidth);
172  tmpTMVAReader->AddVariable("phiwidth", &fMVAVar_phiwidth);
173  tmpTMVAReader->AddVariable("e1x5e5x5", &fMVAVar_e1x5e5x5);
174  tmpTMVAReader->AddVariable("R9", &fMVAVar_R9);
175  // tmpTMVAReader->AddVariable("nbrems", &fMVAVar_nbrems); // Pruned but save in your ntuple.
176 
177  // Energy matching
178  tmpTMVAReader->AddVariable("HoE", &fMVAVar_HoE);
179  tmpTMVAReader->AddVariable("EoP", &fMVAVar_EoP);
180  tmpTMVAReader->AddVariable("IoEmIoP", &fMVAVar_IoEmIoP);
181  tmpTMVAReader->AddVariable("eleEoPout", &fMVAVar_eleEoPout);
182  // tmpTMVAReader->AddVariable("EoPout", &fMVAVar_EoPout); // Pruned but save in your ntuple.
183  if(i == 2 || i == 5)
184  tmpTMVAReader->AddVariable("PreShowerOverRaw",&fMVAVar_PreShowerOverRaw);
185 
186  if(!fUseBinnedVersion)
187  tmpTMVAReader->AddVariable("PreShowerOverRaw",&fMVAVar_PreShowerOverRaw);
188 
189  tmpTMVAReader->AddSpectator("eta", &fMVAVar_eta);
190  tmpTMVAReader->AddSpectator("pt", &fMVAVar_pt);
191  }
192 
193  if (type == kIsoRings) {
194  tmpTMVAReader->AddVariable( "ChargedIso_DR0p0To0p1", &fMVAVar_ChargedIso_DR0p0To0p1 );
195  tmpTMVAReader->AddVariable( "ChargedIso_DR0p1To0p2", &fMVAVar_ChargedIso_DR0p1To0p2 );
196  tmpTMVAReader->AddVariable( "ChargedIso_DR0p2To0p3", &fMVAVar_ChargedIso_DR0p2To0p3 );
197  tmpTMVAReader->AddVariable( "ChargedIso_DR0p3To0p4", &fMVAVar_ChargedIso_DR0p3To0p4 );
198  tmpTMVAReader->AddVariable( "ChargedIso_DR0p4To0p5", &fMVAVar_ChargedIso_DR0p4To0p5 );
199  tmpTMVAReader->AddVariable( "GammaIso_DR0p0To0p1", &fMVAVar_GammaIso_DR0p0To0p1 );
200  tmpTMVAReader->AddVariable( "GammaIso_DR0p1To0p2", &fMVAVar_GammaIso_DR0p1To0p2 );
201  tmpTMVAReader->AddVariable( "GammaIso_DR0p2To0p3", &fMVAVar_GammaIso_DR0p2To0p3 );
202  tmpTMVAReader->AddVariable( "GammaIso_DR0p3To0p4", &fMVAVar_GammaIso_DR0p3To0p4 );
203  tmpTMVAReader->AddVariable( "GammaIso_DR0p4To0p5", &fMVAVar_GammaIso_DR0p4To0p5 );
204  tmpTMVAReader->AddVariable( "NeutralHadronIso_DR0p0To0p1", &fMVAVar_NeutralHadronIso_DR0p0To0p1 );
205  tmpTMVAReader->AddVariable( "NeutralHadronIso_DR0p1To0p2", &fMVAVar_NeutralHadronIso_DR0p1To0p2 );
206  tmpTMVAReader->AddVariable( "NeutralHadronIso_DR0p2To0p3", &fMVAVar_NeutralHadronIso_DR0p2To0p3 );
207  tmpTMVAReader->AddVariable( "NeutralHadronIso_DR0p3To0p4", &fMVAVar_NeutralHadronIso_DR0p3To0p4 );
208  tmpTMVAReader->AddVariable( "NeutralHadronIso_DR0p4To0p5", &fMVAVar_NeutralHadronIso_DR0p4To0p5 );
209  tmpTMVAReader->AddSpectator("eta", &fMVAVar_eta);
210  tmpTMVAReader->AddSpectator("pt", &fMVAVar_pt);
211  }
212 
213  tmpTMVAReader->BookMVA(fMethodname , weightsfiles[i]);
214  fTMVAReader.push_back(tmpTMVAReader);
215  }
216 
217 }
type
Definition: HCALResponse.h:21
int i
Definition: DBlmapReader.cc:9
std::vector< TMVA::Reader * > fTMVAReader
void EGammaMvaEleEstimator::initialize ( std::string  methodName,
std::string  weightsfile,
EGammaMvaEleEstimator::MVAType  type 
)
void EGammaMvaEleEstimator::initialize ( std::string  methodName,
EGammaMvaEleEstimator::MVAType  type,
Bool_t  useBinnedVersion,
std::vector< std::string >  weightsfiles 
)
Bool_t EGammaMvaEleEstimator::isInitialized ( ) const
inline

Definition at line 45 of file EGammaMvaEleEstimator.h.

References fisInitialized.

45 { return fisInitialized; }
Bool_t EGammaMvaEleEstimator::isInitialized ( ) const
inline

Definition at line 61 of file EGammaMvaEleEstimator.h.

References fisInitialized.

61 { return fisInitialized; }
Double_t EGammaMvaEleEstimator::isoMvaValue ( const reco::GsfElectron ele,
const reco::Vertex vertex,
const reco::PFCandidateCollection PFCandidates,
double  Rho,
ElectronEffectiveArea::ElectronEffectiveAreaTarget  EATarget,
const reco::GsfElectronCollection IdentifiedElectrons,
const reco::MuonCollection IdentifiedMuons,
bool  printDebug = kFALSE 
)

Definition at line 1483 of file EGammaMvaEleEstimator.cc.

References newFWLiteAna::bin, bindVariables(), reco::GsfElectron::closestCtfTrackRef(), funct::cos(), gather_cfg::cout, reco::PFCandidate::e, reco::LeafCandidate::eta(), fisInitialized, fMethodname, fMVAType, fMVAVar_ChargedIso_DR0p0To0p1, fMVAVar_ChargedIso_DR0p1To0p2, fMVAVar_ChargedIso_DR0p2To0p3, fMVAVar_ChargedIso_DR0p3To0p4, fMVAVar_ChargedIso_DR0p4To0p5, fMVAVar_eta, fMVAVar_GammaIso_DR0p0To0p1, fMVAVar_GammaIso_DR0p1To0p2, fMVAVar_GammaIso_DR0p2To0p3, fMVAVar_GammaIso_DR0p3To0p4, fMVAVar_GammaIso_DR0p4To0p5, fMVAVar_NeutralHadronIso_DR0p0To0p1, fMVAVar_NeutralHadronIso_DR0p1To0p2, fMVAVar_NeutralHadronIso_DR0p2To0p3, fMVAVar_NeutralHadronIso_DR0p3To0p4, fMVAVar_NeutralHadronIso_DR0p4To0p5, fMVAVar_pt, fTMVAMethod, fTMVAReader, fUseBinnedVersion, reco::PFCandidate::gamma, ElectronEffectiveArea::GetElectronEffectiveArea(), GetMVABin(), reco::GsfElectron::gsfTrack(), edm::Ref< C, T, F >::isNonnull(), ElectronEffectiveArea::kEleGammaIsoDR0p0To0p1, ElectronEffectiveArea::kEleGammaIsoDR0p1To0p2, ElectronEffectiveArea::kEleGammaIsoDR0p2To0p3, ElectronEffectiveArea::kEleGammaIsoDR0p3To0p4, ElectronEffectiveArea::kEleGammaIsoDR0p4To0p5, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p0To0p1, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p1To0p2, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p2To0p3, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p3To0p4, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p4To0p5, Max(), Min(), reco::PFCandidate::mu, reco::LeafCandidate::phi(), reco::Vertex::position(), funct::pow(), reco::LeafCandidate::pt(), edm::refToPtr(), mathSSE::sqrt(), and reco::GsfElectron::superCluster().

1490  {
1491 
1492  if (!fisInitialized) {
1493  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1494  return -9999;
1495  }
1496 
1497  // Spectators
1498  fMVAVar_eta = ele.superCluster()->eta();
1499  fMVAVar_pt = ele.pt();
1500 
1501  //**********************************************************
1502  //Isolation variables
1503  //**********************************************************
1504  Double_t tmpChargedIso_DR0p0To0p1 = 0;
1505  Double_t tmpChargedIso_DR0p1To0p2 = 0;
1506  Double_t tmpChargedIso_DR0p2To0p3 = 0;
1507  Double_t tmpChargedIso_DR0p3To0p4 = 0;
1508  Double_t tmpChargedIso_DR0p4To0p5 = 0;
1509  Double_t tmpGammaIso_DR0p0To0p1 = 0;
1510  Double_t tmpGammaIso_DR0p1To0p2 = 0;
1511  Double_t tmpGammaIso_DR0p2To0p3 = 0;
1512  Double_t tmpGammaIso_DR0p3To0p4 = 0;
1513  Double_t tmpGammaIso_DR0p4To0p5 = 0;
1514  Double_t tmpNeutralHadronIso_DR0p0To0p1 = 0;
1515  Double_t tmpNeutralHadronIso_DR0p1To0p2 = 0;
1516  Double_t tmpNeutralHadronIso_DR0p2To0p3 = 0;
1517  Double_t tmpNeutralHadronIso_DR0p3To0p4 = 0;
1518  Double_t tmpNeutralHadronIso_DR0p4To0p5 = 0;
1519 
1520  double electronTrackZ = 0;
1521  if (ele.gsfTrack().isNonnull()) {
1522  electronTrackZ = ele.gsfTrack()->dz(vertex.position());
1523  } else if (ele.closestCtfTrackRef().isNonnull()) {
1524  electronTrackZ = ele.closestCtfTrackRef()->dz(vertex.position());
1525  }
1526 
1527  for (reco::PFCandidateCollection::const_iterator iP = PFCandidates.begin();
1528  iP != PFCandidates.end(); ++iP) {
1529 
1530  //exclude the electron itself
1531  if(iP->gsfTrackRef().isNonnull() && ele.gsfTrack().isNonnull() &&
1532  refToPtr(iP->gsfTrackRef()) == refToPtr(ele.gsfTrack())) continue;
1533  if(iP->trackRef().isNonnull() && ele.closestCtfTrackRef().isNonnull() &&
1534  refToPtr(iP->trackRef()) == refToPtr(ele.closestCtfTrackRef())) continue;
1535 
1536  //************************************************************
1537  // New Isolation Calculations
1538  //************************************************************
1539  double dr = sqrt(pow(iP->eta() - ele.eta(),2) + pow(acos(cos(iP->phi() - ele.phi())),2));
1540  //Double_t deta = (iP->eta() - ele.eta());
1541 
1542  if (dr < 1.0) {
1543  Bool_t IsLeptonFootprint = kFALSE;
1544  //************************************************************
1545  // Lepton Footprint Removal
1546  //************************************************************
1547  for (reco::GsfElectronCollection::const_iterator iE = IdentifiedElectrons.begin();
1548  iE != IdentifiedElectrons.end(); ++iE) {
1549  //if pf candidate matches an electron passing ID cuts, then veto it
1550  if(iP->gsfTrackRef().isNonnull() && iE->gsfTrack().isNonnull() &&
1551  refToPtr(iP->gsfTrackRef()) == refToPtr(iE->gsfTrack())) IsLeptonFootprint = kTRUE;
1552  if(iP->trackRef().isNonnull() && iE->closestCtfTrackRef().isNonnull() &&
1553  refToPtr(iP->trackRef()) == refToPtr(iE->closestCtfTrackRef())) IsLeptonFootprint = kTRUE;
1554 
1555  //if pf candidate lies in veto regions of electron passing ID cuts, then veto it
1556  double tmpDR = sqrt(pow(iP->eta() - iE->eta(),2) + pow(acos(cos(iP->phi() - iE->phi())),2));
1557  if(iP->trackRef().isNonnull() && fabs(iE->superCluster()->eta()) >= 1.479
1558  && tmpDR < 0.015) IsLeptonFootprint = kTRUE;
1559  if(iP->particleId() == reco::PFCandidate::gamma && fabs(iE->superCluster()->eta()) >= 1.479
1560  && tmpDR < 0.08) IsLeptonFootprint = kTRUE;
1561  }
1562  for (reco::MuonCollection::const_iterator iM = IdentifiedMuons.begin();
1563  iM != IdentifiedMuons.end(); ++iM) {
1564  //if pf candidate matches an muon passing ID cuts, then veto it
1565  if(iP->trackRef().isNonnull() && iM->innerTrack().isNonnull() &&
1566  refToPtr(iP->trackRef()) == refToPtr(iM->innerTrack())) IsLeptonFootprint = kTRUE;
1567 
1568  //if pf candidate lies in veto regions of muon passing ID cuts, then veto it
1569  double tmpDR = sqrt(pow(iP->eta() - iM->eta(),2) + pow(acos(cos(iP->phi() - iM->phi())),2));
1570  if(iP->trackRef().isNonnull() && tmpDR < 0.01) IsLeptonFootprint = kTRUE;
1571  }
1572 
1573  if (!IsLeptonFootprint) {
1574  Bool_t passVeto = kTRUE;
1575  //Charged
1576  if(iP->trackRef().isNonnull()) {
1577  if (!(fabs(iP->trackRef()->dz(vertex.position()) - electronTrackZ) < 0.2)) passVeto = kFALSE;
1578  //************************************************************
1579  // Veto any PFmuon, or PFEle
1580  if (iP->particleId() == reco::PFCandidate::e || iP->particleId() == reco::PFCandidate::mu) passVeto = kFALSE;
1581  //************************************************************
1582  //************************************************************
1583  // Footprint Veto
1584  if (fabs(fMVAVar_eta) > 1.479 && dr < 0.015) passVeto = kFALSE;
1585  //************************************************************
1586  if (passVeto) {
1587  if (dr < 0.1) tmpChargedIso_DR0p0To0p1 += iP->pt();
1588  if (dr >= 0.1 && dr < 0.2) tmpChargedIso_DR0p1To0p2 += iP->pt();
1589  if (dr >= 0.2 && dr < 0.3) tmpChargedIso_DR0p2To0p3 += iP->pt();
1590  if (dr >= 0.3 && dr < 0.4) tmpChargedIso_DR0p3To0p4 += iP->pt();
1591  if (dr >= 0.4 && dr < 0.5) tmpChargedIso_DR0p4To0p5 += iP->pt();
1592  } //pass veto
1593  }
1594  //Gamma
1595  else if (iP->particleId() == reco::PFCandidate::gamma) {
1596  //************************************************************
1597  // Footprint Veto
1598  if (fabs(fMVAVar_eta) > 1.479 && dr < 0.08) passVeto = kFALSE;
1599  //************************************************************
1600  if (passVeto) {
1601  if (dr < 0.1) tmpGammaIso_DR0p0To0p1 += iP->pt();
1602  if (dr >= 0.1 && dr < 0.2) tmpGammaIso_DR0p1To0p2 += iP->pt();
1603  if (dr >= 0.2 && dr < 0.3) tmpGammaIso_DR0p2To0p3 += iP->pt();
1604  if (dr >= 0.3 && dr < 0.4) tmpGammaIso_DR0p3To0p4 += iP->pt();
1605  if (dr >= 0.4 && dr < 0.5) tmpGammaIso_DR0p4To0p5 += iP->pt();
1606  }
1607  }
1608  //NeutralHadron
1609  else {
1610  if (dr < 0.1) tmpNeutralHadronIso_DR0p0To0p1 += iP->pt();
1611  if (dr >= 0.1 && dr < 0.2) tmpNeutralHadronIso_DR0p1To0p2 += iP->pt();
1612  if (dr >= 0.2 && dr < 0.3) tmpNeutralHadronIso_DR0p2To0p3 += iP->pt();
1613  if (dr >= 0.3 && dr < 0.4) tmpNeutralHadronIso_DR0p3To0p4 += iP->pt();
1614  if (dr >= 0.4 && dr < 0.5) tmpNeutralHadronIso_DR0p4To0p5 += iP->pt();
1615  }
1616  } //not lepton footprint
1617  } //in 1.0 dr cone
1618  } //loop over PF candidates
1619 
1620  fMVAVar_ChargedIso_DR0p0To0p1 = TMath::Min((tmpChargedIso_DR0p0To0p1)/ele.pt(), 2.5);
1621  fMVAVar_ChargedIso_DR0p1To0p2 = TMath::Min((tmpChargedIso_DR0p1To0p2)/ele.pt(), 2.5);
1622  fMVAVar_ChargedIso_DR0p2To0p3 = TMath::Min((tmpChargedIso_DR0p2To0p3)/ele.pt(), 2.5);
1623  fMVAVar_ChargedIso_DR0p3To0p4 = TMath::Min((tmpChargedIso_DR0p3To0p4)/ele.pt(), 2.5);
1624  fMVAVar_ChargedIso_DR0p4To0p5 = TMath::Min((tmpChargedIso_DR0p4To0p5)/ele.pt(), 2.5);
1635 
1636  if (printDebug) {
1637  cout << "UseBinnedVersion=" << fUseBinnedVersion << " -> BIN: " << fMVAVar_eta << " " << fMVAVar_pt << " : " << GetMVABin(fMVAVar_eta,fMVAVar_pt) << endl;
1638  }
1639 
1640  // evaluate
1641  bindVariables();
1642  Double_t mva = -9999;
1643 
1644 // mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
1645  if (fUseBinnedVersion) {
1647  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
1648  } else {
1649  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
1650  }
1651 
1652 
1653  if(printDebug) {
1654  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1655  cout << "ChargedIso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1660  << fMVAVar_ChargedIso_DR0p4To0p5 << endl;
1661  cout << "PF Gamma Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1662  << fMVAVar_GammaIso_DR0p0To0p1 << " "
1663  << fMVAVar_GammaIso_DR0p1To0p2 << " "
1664  << fMVAVar_GammaIso_DR0p2To0p3 << " "
1665  << fMVAVar_GammaIso_DR0p3To0p4 << " "
1666  << fMVAVar_GammaIso_DR0p4To0p5 << endl;
1667  cout << "PF Neutral Hadron Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1673  << endl;
1674  cout << " ### MVA " << mva << endl;
1675  }
1676 
1677 
1678  return mva;
1679 }
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
Definition: RefToPtr.h:18
static Double_t GetElectronEffectiveArea(ElectronEffectiveAreaType type, Double_t SCEta, ElectronEffectiveAreaTarget EffectiveAreaTarget=kEleEAData2011)
T Min(T a, T b)
Definition: MathUtil.h:39
UInt_t GetMVABin(double eta, double pt) const
const Point & position() const
position
Definition: Vertex.h:106
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
TrackRef closestCtfTrackRef() const
Definition: GsfElectron.h:199
T sqrt(T t)
Definition: SSEVec.h:48
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:182
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
T Max(T a, T b)
Definition: MathUtil.h:44
tuple cout
Definition: gather_cfg.py:121
std::vector< TMVA::Reader * > fTMVAReader
std::vector< TMVA::MethodBase * > fTMVAMethod
virtual double phi() const
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
tuple PFCandidates
Double_t EGammaMvaEleEstimator::isoMvaValue ( Double_t  Pt,
Double_t  Eta,
Double_t  Rho,
ElectronEffectiveArea::ElectronEffectiveAreaTarget  EATarget,
Double_t  ChargedIso_DR0p0To0p1,
Double_t  ChargedIso_DR0p1To0p2,
Double_t  ChargedIso_DR0p2To0p3,
Double_t  ChargedIso_DR0p3To0p4,
Double_t  ChargedIso_DR0p4To0p5,
Double_t  GammaIso_DR0p0To0p1,
Double_t  GammaIso_DR0p1To0p2,
Double_t  GammaIso_DR0p2To0p3,
Double_t  GammaIso_DR0p3To0p4,
Double_t  GammaIso_DR0p4To0p5,
Double_t  NeutralHadronIso_DR0p0To0p1,
Double_t  NeutralHadronIso_DR0p1To0p2,
Double_t  NeutralHadronIso_DR0p2To0p3,
Double_t  NeutralHadronIso_DR0p3To0p4,
Double_t  NeutralHadronIso_DR0p4To0p5,
Bool_t  printDebug = kFALSE 
)

Definition at line 921 of file EGammaMvaEleEstimator.cc.

References newFWLiteAna::bin, gather_cfg::cout, fisInitialized, fMethodname, fMVAType, fMVAVar_ChargedIso_DR0p0To0p1, fMVAVar_ChargedIso_DR0p1To0p2, fMVAVar_ChargedIso_DR0p2To0p3, fMVAVar_ChargedIso_DR0p3To0p4, fMVAVar_ChargedIso_DR0p4To0p5, fMVAVar_GammaIso_DR0p0To0p1, fMVAVar_GammaIso_DR0p1To0p2, fMVAVar_GammaIso_DR0p2To0p3, fMVAVar_GammaIso_DR0p3To0p4, fMVAVar_GammaIso_DR0p4To0p5, fMVAVar_NeutralHadronIso_DR0p0To0p1, fMVAVar_NeutralHadronIso_DR0p1To0p2, fMVAVar_NeutralHadronIso_DR0p2To0p3, fMVAVar_NeutralHadronIso_DR0p3To0p4, fMVAVar_NeutralHadronIso_DR0p4To0p5, fTMVAMethod, fTMVAReader, ElectronEffectiveArea::GetElectronEffectiveArea(), GetMVABin(), ElectronEffectiveArea::kEleGammaIsoDR0p0To0p1, ElectronEffectiveArea::kEleGammaIsoDR0p1To0p2, ElectronEffectiveArea::kEleGammaIsoDR0p2To0p3, ElectronEffectiveArea::kEleGammaIsoDR0p3To0p4, ElectronEffectiveArea::kEleGammaIsoDR0p4To0p5, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p0To0p1, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p1To0p2, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p2To0p3, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p3To0p4, ElectronEffectiveArea::kEleNeutralHadronIsoDR0p4To0p5, Max(), and Min().

940  {
941 
942  if (!fisInitialized) {
943  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
944  return -9999;
945  }
946 
947  fMVAVar_ChargedIso_DR0p0To0p1 = TMath::Min((ChargedIso_DR0p0To0p1)/Pt, 2.5);
948  fMVAVar_ChargedIso_DR0p1To0p2 = TMath::Min((ChargedIso_DR0p1To0p2)/Pt, 2.5);
949  fMVAVar_ChargedIso_DR0p2To0p3 = TMath::Min((ChargedIso_DR0p2To0p3)/Pt, 2.5);
950  fMVAVar_ChargedIso_DR0p3To0p4 = TMath::Min((ChargedIso_DR0p3To0p4)/Pt, 2.5);
951  fMVAVar_ChargedIso_DR0p4To0p5 = TMath::Min((ChargedIso_DR0p4To0p5)/Pt, 2.5);
962 
963  // evaluate
964  int bin = GetMVABin(Eta,Pt);
965  Double_t mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
966 
967  if(printDebug) {
968  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
969  cout << "ChargedIso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
975  cout << "PF Gamma Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
980  << fMVAVar_GammaIso_DR0p4To0p5 << endl;
981  cout << "PF Neutral Hadron Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
987  << endl;
988  cout << " ### MVA " << mva << endl;
989  }
990 
991  return mva;
992 
993 }
static Double_t GetElectronEffectiveArea(ElectronEffectiveAreaType type, Double_t SCEta, ElectronEffectiveAreaTarget EffectiveAreaTarget=kEleEAData2011)
T Min(T a, T b)
Definition: MathUtil.h:39
UInt_t GetMVABin(double eta, double pt) const
T Max(T a, T b)
Definition: MathUtil.h:44
tuple cout
Definition: gather_cfg.py:121
std::vector< TMVA::Reader * > fTMVAReader
std::vector< TMVA::MethodBase * > fTMVAMethod
Double_t EGammaMvaEleEstimator::mvaValue ( Double_t  fbrem,
Double_t  kfchi2,
Int_t  kfhits,
Double_t  gsfchi2,
Double_t  deta,
Double_t  dphi,
Double_t  detacalo,
Double_t  see,
Double_t  spp,
Double_t  etawidth,
Double_t  phiwidth,
Double_t  e1x5e5x5,
Double_t  R9,
Double_t  HoE,
Double_t  EoP,
Double_t  IoEmIoP,
Double_t  eleEoPout,
Double_t  PreShowerOverRaw,
Double_t  d0,
Double_t  ip3d,
Double_t  eta,
Double_t  pt,
Bool_t  printDebug = kFALSE 
)

Definition at line 322 of file EGammaMvaEleEstimator.cc.

References bindVariables(), eta(), fisInitialized, fMethodname, fMVAVar_d0, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_e1x5e5x5, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_ip3d, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_see, fMVAVar_spp, fTMVAReader, fUseBinnedVersion, GetMVABin(), LogDebug, and EnergyCorrector::pt.

Referenced by HWWFunctions::goodElectronTMVA(), heppy::EGammaMvaEleEstimatorFWLite::mvaValue(), and mvaValue().

347  {
348 
349  if (!fisInitialized) {
350  edm::LogError("NotInitialized") << "Error: EGammaMvaEleEstimator not properly initialized.";
351  return -9999;
352  }
353 
354  fMVAVar_fbrem = fbrem;
355  fMVAVar_kfchi2 = kfchi2;
356  fMVAVar_kfhits = float(kfhits); // BTD does not support int variables
357  fMVAVar_gsfchi2 = gsfchi2;
358 
359  fMVAVar_deta = deta;
360  fMVAVar_dphi = dphi;
361  fMVAVar_detacalo = detacalo;
362  // fMVAVar_dphicalo = dphicalo;
363 
364 
365  fMVAVar_see = see;
366  fMVAVar_spp = spp;
367  fMVAVar_etawidth = etawidth;
368  fMVAVar_phiwidth = phiwidth;
369  fMVAVar_e1x5e5x5 = e1x5e5x5;
370  fMVAVar_R9 = R9;
371  //fMVAVar_nbrems = float(nbrems); // BTD does not support int variables
372 
373 
374  fMVAVar_HoE = HoE;
375  fMVAVar_EoP = EoP;
376  fMVAVar_IoEmIoP = IoEmIoP;
377  fMVAVar_eleEoPout = eleEoPout;
378  fMVAVar_PreShowerOverRaw= PreShowerOverRaw;
379  //fMVAVar_EoPout = EoPout;
380 
381  fMVAVar_d0 = d0;
382  fMVAVar_ip3d = ip3d;
383  fMVAVar_eta = eta;
384  fMVAVar_pt = pt;
385 
386 
387  bindVariables();
388  Double_t mva = -9999;
389  if (fUseBinnedVersion) {
391  } else {
392  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
393  }
394 
395  if(printDebug) {
396  LogDebug("EGammaMvaEleEstimator") << " bin " << GetMVABin(fMVAVar_eta,fMVAVar_pt)
397  << " fbrem " << fMVAVar_fbrem
398  << " kfchi2 " << fMVAVar_kfchi2
399  << " kfhits " << fMVAVar_kfhits
400  << " gsfchi2 " << fMVAVar_gsfchi2
401  << " deta " << fMVAVar_deta
402  << " dphi " << fMVAVar_dphi
403  << " detacalo " << fMVAVar_detacalo
404  << " see " << fMVAVar_see
405  << " spp " << fMVAVar_spp
406  << " etawidth " << fMVAVar_etawidth
407  << " phiwidth " << fMVAVar_phiwidth
408  << " e1x5e5x5 " << fMVAVar_e1x5e5x5
409  << " R9 " << fMVAVar_R9
410  << " HoE " << fMVAVar_HoE
411  << " EoP " << fMVAVar_EoP
412  << " IoEmIoP " << fMVAVar_IoEmIoP
413  << " eleEoPout " << fMVAVar_eleEoPout
414  << " PreShowerOverRaw " << fMVAVar_PreShowerOverRaw
415  << " d0 " << fMVAVar_d0
416  << " ip3d " << fMVAVar_ip3d
417  << " eta " << fMVAVar_eta
418  << " pt " << fMVAVar_pt
419  << " ### MVA " << mva;
420  }
421 
422 
423  return mva;
424 }
#define LogDebug(id)
T eta() const
UInt_t GetMVABin(double eta, double pt) const
std::vector< TMVA::Reader * > fTMVAReader
Double_t EGammaMvaEleEstimator::mvaValue ( const reco::GsfElectron ele,
const reco::Vertex vertex,
const TransientTrackBuilder transientTrackBuilder,
EcalClusterLazyTools  myEcalCluster,
bool  printDebug = kFALSE 
)

Definition at line 999 of file EGammaMvaEleEstimator.cc.

References IPTools::absoluteImpactParameter3D(), newFWLiteAna::bin, bindVariables(), TransientTrackBuilder::build(), reco::GsfElectron::closestCtfTrackRef(), gather_cfg::cout, reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::e1x5(), reco::GsfElectron::e5x5(), reco::GsfElectron::ecalEnergy(), reco::GsfElectron::eEleClusterOverPout(), reco::GsfElectron::eSuperClusterOverP(), reco::GsfElectron::fbrem(), fisInitialized, fMethodname, fMVAType, fMVAVar_d0, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_ip3d, fMVAVar_ip3dSig, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_kfhitsall, fMVAVar_OneMinusE1x5E5x5, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_see, fMVAVar_spp, fTMVAMethod, fTMVAReader, fUseBinnedVersion, GetMVABin(), reco::GsfElectron::gsfTrack(), reco::GsfElectron::hadronicOverEm(), edm::Ref< C, T, F >::isAvailable(), edm::detail::isnan(), edm::Ref< C, T, F >::isNonnull(), kNonTrig, kTrig, reco::LeafCandidate::p(), reco::Vertex::position(), reco::LeafCandidate::pt(), reco::GsfElectron::sigmaIetaIeta(), mathSSE::sqrt(), reco::GsfElectron::superCluster(), and groupFilesInBlocks::tt.

1003  {
1004 
1005  if (!fisInitialized) {
1006  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1007  return -9999;
1008  }
1009 
1011  std::cout << "Error: This method should be called for kTrig or kNonTrig MVA only" << endl;
1012  return -9999;
1013  }
1014 
1015  bool validKF= false;
1016  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
1017  validKF = (myTrackRef.isAvailable());
1018  validKF = (myTrackRef.isNonnull());
1019 
1020  // Pure tracking variables
1021  fMVAVar_fbrem = ele.fbrem();
1022  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
1023  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
1024  fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative
1025  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
1026 
1027 
1028  // Geometrical matchings
1032 
1033 
1034  // Pure ECAL -> shower shapes
1035  fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1036  std::vector<float> vCov = myEcalCluster.localCovariances(*(ele.superCluster()->seed())) ;
1037  if (!isnan(vCov[2])) fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi
1038  else fMVAVar_spp = 0.;
1039 
1040  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1041  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1042  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ;
1043  fMVAVar_R9 = myEcalCluster.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy();
1044 
1045  // Energy matching
1046  fMVAVar_HoE = ele.hadronicOverEm();
1048  fMVAVar_IoEmIoP = (1.0/ele.ecalEnergy()) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p()
1050  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1051 
1052 
1053  // Spectators
1054  fMVAVar_eta = ele.superCluster()->eta();
1055  fMVAVar_pt = ele.pt();
1056 
1057 
1058 
1059  // for triggering electrons get the impact parameteres
1060  if(fMVAType == kTrig) {
1061  //d0
1062  if (ele.gsfTrack().isNonnull()) {
1063  fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position());
1064  } else if (ele.closestCtfTrackRef().isNonnull()) {
1065  fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position());
1066  } else {
1067  fMVAVar_d0 = -9999.0;
1068  }
1069 
1070  //default values for IP3D
1071  fMVAVar_ip3d = -999.0;
1072  fMVAVar_ip3dSig = 0.0;
1073  if (ele.gsfTrack().isNonnull()) {
1074  const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.;
1075 
1076  const reco::TransientTrack &tt = transientTrackBuilder.build(ele.gsfTrack());
1077  const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,vertex);
1078  if (ip3dpv.first) {
1079  double ip3d = gsfsign*ip3dpv.second.value();
1080  double ip3derr = ip3dpv.second.error();
1081  fMVAVar_ip3d = ip3d;
1082  fMVAVar_ip3dSig = ip3d/ip3derr;
1083  }
1084  }
1085  }
1086 
1087 
1088  // evaluate
1089  bindVariables();
1090  Double_t mva = -9999;
1091  if (fUseBinnedVersion) {
1093  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
1094  } else {
1095  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
1096  }
1097 
1098 
1099 
1100  if(printDebug) {
1101  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1102  cout << " fbrem " << fMVAVar_fbrem
1103  << " kfchi2 " << fMVAVar_kfchi2
1104  << " mykfhits " << fMVAVar_kfhits
1105  << " gsfchi2 " << fMVAVar_gsfchi2
1106  << " deta " << fMVAVar_deta
1107  << " dphi " << fMVAVar_dphi
1108  << " detacalo " << fMVAVar_detacalo
1109  << " see " << fMVAVar_see
1110  << " spp " << fMVAVar_spp
1111  << " etawidth " << fMVAVar_etawidth
1112  << " phiwidth " << fMVAVar_phiwidth
1113  << " OneMinusE1x5E5x5 " << fMVAVar_OneMinusE1x5E5x5
1114  << " R9 " << fMVAVar_R9
1115  << " HoE " << fMVAVar_HoE
1116  << " EoP " << fMVAVar_EoP
1117  << " IoEmIoP " << fMVAVar_IoEmIoP
1118  << " eleEoPout " << fMVAVar_eleEoPout
1119  << " d0 " << fMVAVar_d0
1120  << " ip3d " << fMVAVar_ip3d
1121  << " eta " << fMVAVar_eta
1122  << " pt " << fMVAVar_pt << endl;
1123  cout << " ### MVA " << mva << endl;
1124  }
1125 
1126 
1127 
1128  return mva;
1129 }
bool isAvailable() const
Definition: Ref.h:614
virtual double p() const
magnitude of momentum vector
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
reco::TransientTrack build(const reco::Track *p) const
std::pair< bool, Measurement1D > absoluteImpactParameter3D(const reco::TransientTrack &transientTrack, const reco::Vertex &vertex)
Definition: IPTools.cc:37
float fbrem() const
Definition: GsfElectron.h:684
UInt_t GetMVABin(double eta, double pt) const
const Point & position() const
position
Definition: Vertex.h:106
virtual double pt() const
transverse momentum
TrackRef closestCtfTrackRef() const
Definition: GsfElectron.h:199
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
float sigmaIetaIeta() const
Definition: GsfElectron.h:402
float hadronicOverEm() const
Definition: GsfElectron.h:443
bool isnan(float x)
Definition: math.h:13
T sqrt(T t)
Definition: SSEVec.h:48
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:182
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:250
float eEleClusterOverPout() const
Definition: GsfElectron.h:246
float e1x5() const
Definition: GsfElectron.h:404
float ecalEnergy() const
Definition: GsfElectron.h:771
float e5x5() const
Definition: GsfElectron.h:406
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:248
tuple cout
Definition: gather_cfg.py:121
std::vector< TMVA::Reader * > fTMVAReader
std::vector< TMVA::MethodBase * > fTMVAMethod
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
Double_t EGammaMvaEleEstimator::mvaValue ( const reco::GsfElectron ele,
const reco::Vertex vertex,
double  rho,
EcalClusterLazyTools  myEcalCluster,
bool  printDebug = kFALSE 
)

Definition at line 1133 of file EGammaMvaEleEstimator.cc.

References newFWLiteAna::bin, bindVariables(), reco::GsfElectron::closestCtfTrackRef(), gather_cfg::cout, reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::e1x5(), reco::GsfElectron::e5x5(), reco::GsfElectron::eEleClusterOverPout(), reco::GsfElectron::eSuperClusterOverP(), reco::GsfElectron::fbrem(), fisInitialized, fMethodname, fMVAType, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_OneMinusE1x5E5x5, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_rho, fMVAVar_see, fMVAVar_spp, fTMVAMethod, fTMVAReader, fUseBinnedVersion, GetMVABin(), reco::GsfElectron::gsfTrack(), reco::GsfElectron::hadronicOverEm(), edm::Ref< C, T, F >::isAvailable(), edm::detail::isnan(), edm::Ref< C, T, F >::isNonnull(), kTrigNoIP, reco::LeafCandidate::pt(), rho, reco::GsfElectron::sigmaIetaIeta(), mathSSE::sqrt(), and reco::GsfElectron::superCluster().

1138  {
1139 
1140  if (!fisInitialized) {
1141  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1142  return -9999;
1143  }
1144 
1146  std::cout << "Error: This method should be called for kTrigNoIP MVA only" << endl;
1147  return -9999;
1148  }
1149 
1150  bool validKF= false;
1151  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
1152  validKF = (myTrackRef.isAvailable());
1153  validKF = (myTrackRef.isNonnull());
1154 
1155  // Pure tracking variables
1156  fMVAVar_fbrem = ele.fbrem();
1157  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
1158  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
1159  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
1160 
1161 
1162  // Geometrical matchings
1166 
1167 
1168  // Pure ECAL -> shower shapes
1169  fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1170  std::vector<float> vCov = myEcalCluster.localCovariances(*(ele.superCluster()->seed())) ;
1171  if (!isnan(vCov[2])) fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi
1172  else fMVAVar_spp = 0.;
1173 
1174 
1175  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1176  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1177  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ;
1178  fMVAVar_R9 = myEcalCluster.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy();
1179 
1180 
1181  // Energy matching
1182  fMVAVar_HoE = ele.hadronicOverEm();
1184  fMVAVar_IoEmIoP = (1.0/ele.superCluster()->energy()) - (1.0 / ele.gsfTrack()->p()); // in the future to be changed with ele.gsfTrack()->p()
1186  fMVAVar_rho = rho;
1187  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1188 
1189 
1190  // Spectators
1191  fMVAVar_eta = ele.superCluster()->eta();
1192  fMVAVar_pt = ele.pt();
1193 
1194 
1195 
1196 
1197 
1198  // evaluate
1199  bindVariables();
1200  Double_t mva = -9999;
1201  if (fUseBinnedVersion) {
1203  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
1204  } else {
1205  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
1206  }
1207 
1208 
1209 
1210  if(printDebug) {
1211  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1212  cout << " fbrem " << fMVAVar_fbrem
1213  << " kfchi2 " << fMVAVar_kfchi2
1214  << " mykfhits " << fMVAVar_kfhits
1215  << " gsfchi2 " << fMVAVar_gsfchi2
1216  << " deta " << fMVAVar_deta
1217  << " dphi " << fMVAVar_dphi
1218  << " detacalo " << fMVAVar_detacalo
1219  // << " dphicalo " << fMVAVar_dphicalo
1220  << " see " << fMVAVar_see
1221  << " spp " << fMVAVar_spp
1222  << " etawidth " << fMVAVar_etawidth
1223  << " phiwidth " << fMVAVar_phiwidth
1224  << " e1x5e5x5 " << fMVAVar_OneMinusE1x5E5x5
1225  << " R9 " << fMVAVar_R9
1226  // << " mynbrems " << fMVAVar_nbrems
1227  << " HoE " << fMVAVar_HoE
1228  << " EoP " << fMVAVar_EoP
1229  << " IoEmIoP " << fMVAVar_IoEmIoP
1230  << " eleEoPout " << fMVAVar_eleEoPout
1231  << " rho " << fMVAVar_rho
1232  // << " EoPout " << fMVAVar_EoPout
1233  << " eta " << fMVAVar_eta
1234  << " pt " << fMVAVar_pt << endl;
1235  cout << " ### MVA " << mva << endl;
1236  }
1237 
1238 
1239 
1240  return mva;
1241 }
bool isAvailable() const
Definition: Ref.h:614
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
Definition: DDAxes.h:10
float fbrem() const
Definition: GsfElectron.h:684
UInt_t GetMVABin(double eta, double pt) const
virtual double pt() const
transverse momentum
TrackRef closestCtfTrackRef() const
Definition: GsfElectron.h:199
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
float sigmaIetaIeta() const
Definition: GsfElectron.h:402
float hadronicOverEm() const
Definition: GsfElectron.h:443
bool isnan(float x)
Definition: math.h:13
T sqrt(T t)
Definition: SSEVec.h:48
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
Definition: GsfElectron.h:182
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:250
float eEleClusterOverPout() const
Definition: GsfElectron.h:246
float e1x5() const
Definition: GsfElectron.h:404
float e5x5() const
Definition: GsfElectron.h:406
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:248
tuple cout
Definition: gather_cfg.py:121
std::vector< TMVA::Reader * > fTMVAReader
std::vector< TMVA::MethodBase * > fTMVAMethod
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
Definition: GsfElectron.h:183
Double_t EGammaMvaEleEstimator::mvaValue ( Double_t  fbrem,
Double_t  kfchi2,
Int_t  kfhits,
Double_t  gsfchi2,
Double_t  deta,
Double_t  dphi,
Double_t  detacalo,
Double_t  see,
Double_t  spp,
Double_t  etawidth,
Double_t  phiwidth,
Double_t  e1x5e5x5,
Double_t  R9,
Double_t  HoE,
Double_t  EoP,
Double_t  IoEmIoP,
Double_t  eleEoPout,
Double_t  PreShowerOverRaw,
Double_t  eta,
Double_t  pt,
Bool_t  printDebug = kFALSE 
)

Definition at line 426 of file EGammaMvaEleEstimator.cc.

References bindVariables(), eta(), fisInitialized, fMethodname, fMVAVar_d0, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_e1x5e5x5, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_ip3d, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_see, fMVAVar_spp, fTMVAReader, fUseBinnedVersion, GetMVABin(), LogDebug, and EnergyCorrector::pt.

449  {
450 
451  if (!fisInitialized) {
452  edm::LogError("NotInitialized") << "Error: EGammaMvaEleEstimator not properly initialized.";
453  return -9999;
454  }
455 
456  fMVAVar_fbrem = fbrem;
457  fMVAVar_kfchi2 = kfchi2;
458  fMVAVar_kfhits = float(kfhits); // BTD does not support int variables
459  fMVAVar_gsfchi2 = gsfchi2;
460 
461  fMVAVar_deta = deta;
462  fMVAVar_dphi = dphi;
463  fMVAVar_detacalo = detacalo;
464 
465 
466  fMVAVar_see = see;
467  fMVAVar_spp = spp;
468  fMVAVar_etawidth = etawidth;
469  fMVAVar_phiwidth = phiwidth;
470  fMVAVar_e1x5e5x5 = e1x5e5x5;
471  fMVAVar_R9 = R9;
472 
473 
474  fMVAVar_HoE = HoE;
475  fMVAVar_EoP = EoP;
476  fMVAVar_IoEmIoP = IoEmIoP;
477  fMVAVar_eleEoPout = eleEoPout;
478  fMVAVar_PreShowerOverRaw= PreShowerOverRaw;
479 
480  fMVAVar_eta = eta;
481  fMVAVar_pt = pt;
482 
483 
484  bindVariables();
485  Double_t mva = -9999;
486  if (fUseBinnedVersion) {
488  } else {
489  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
490  }
491 
492 
493 
494  if(printDebug) {
495  LogDebug("EGammaMvaEleEstimator") << " bin " << GetMVABin(fMVAVar_eta,fMVAVar_pt)
496  << " fbrem " << fMVAVar_fbrem
497  << " kfchi2 " << fMVAVar_kfchi2
498  << " kfhits " << fMVAVar_kfhits
499  << " gsfchi2 " << fMVAVar_gsfchi2
500  << " deta " << fMVAVar_deta
501  << " dphi " << fMVAVar_dphi
502  << " detacalo " << fMVAVar_detacalo
503  << " see " << fMVAVar_see
504  << " spp " << fMVAVar_spp
505  << " etawidth " << fMVAVar_etawidth
506  << " phiwidth " << fMVAVar_phiwidth
507  << " e1x5e5x5 " << fMVAVar_e1x5e5x5
508  << " R9 " << fMVAVar_R9
509  << " HoE " << fMVAVar_HoE
510  << " EoP " << fMVAVar_EoP
511  << " IoEmIoP " << fMVAVar_IoEmIoP
512  << " eleEoPout " << fMVAVar_eleEoPout
513  << " PreShowerOverRaw " << fMVAVar_PreShowerOverRaw
514  << " d0 " << fMVAVar_d0
515  << " ip3d " << fMVAVar_ip3d
516  << " eta " << fMVAVar_eta
517  << " pt " << fMVAVar_pt
518  << " ### MVA " << mva;
519  }
520 
521 
522  return mva;
523 }
#define LogDebug(id)
T eta() const
UInt_t GetMVABin(double eta, double pt) const
std::vector< TMVA::Reader * > fTMVAReader
Double_t EGammaMvaEleEstimator::mvaValue ( const pat::Electron ele,
double  rho,
bool  printDebug = kFALSE 
)

Definition at line 1370 of file EGammaMvaEleEstimator.cc.

References newFWLiteAna::bin, bindVariables(), pat::Electron::closestCtfTrackRef(), gather_cfg::cout, reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::e1x5(), reco::GsfElectron::e5x5(), reco::GsfElectron::eEleClusterOverPout(), reco::GsfElectron::eSuperClusterOverP(), reco::GsfElectron::fbrem(), fisInitialized, fMethodname, fMVAType, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_OneMinusE1x5E5x5, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_rho, fMVAVar_see, fMVAVar_spp, fTMVAMethod, fTMVAReader, fUseBinnedVersion, GetMVABin(), pat::Electron::gsfTrack(), reco::GsfElectron::hadronicOverEm(), edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), kTrigNoIP, reco::LeafCandidate::pt(), reco::GsfElectron::r9(), rho, reco::GsfElectron::sigmaIetaIeta(), reco::GsfElectron::sigmaIphiIphi(), and pat::Electron::superCluster().

1372  {
1373 
1374  if (!fisInitialized) {
1375  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1376  return -9999;
1377  }
1378 
1380  std::cout << "Error: This method should be called for kTrigNoIP mva only" << endl;
1381  return -9999;
1382  }
1383 
1384 
1385  bool validKF= false;
1386  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
1387  validKF = (myTrackRef.isAvailable());
1388  validKF = (myTrackRef.isNonnull());
1389 
1390  // Pure tracking variables
1391  fMVAVar_fbrem = ele.fbrem();
1392  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
1393  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
1394  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
1395 
1396 
1397  // Geometrical matchings
1401 
1402 
1403  // Pure ECAL -> shower shapes
1404  fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1405 
1406  fMVAVar_spp = ele.sigmaIphiIphi();
1407 
1408  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1409  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1410  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ;
1411  fMVAVar_R9 = ele.r9();
1412 
1413  // Energy matching
1414  fMVAVar_HoE = ele.hadronicOverEm();
1416  fMVAVar_IoEmIoP = (1.0/ele.superCluster()->energy()) - (1.0 / ele.gsfTrack()->p()); // in the future to be changed with ele.gsfTrack()->p()
1418  fMVAVar_rho = rho;
1419  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1420 
1421 
1422  // Spectators
1423  fMVAVar_eta = ele.superCluster()->eta();
1424  fMVAVar_pt = ele.pt();
1425 
1426 
1427 
1428 
1429 
1430  // evaluate
1431  bindVariables();
1432  Double_t mva = -9999;
1433  if (fUseBinnedVersion) {
1435  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
1436  } else {
1437  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
1438  }
1439 
1440 
1441 
1442  if(printDebug) {
1443  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1444  cout << " fbrem " << fMVAVar_fbrem
1445  << " kfchi2 " << fMVAVar_kfchi2
1446  << " mykfhits " << fMVAVar_kfhits
1447  << " gsfchi2 " << fMVAVar_gsfchi2
1448  << " deta " << fMVAVar_deta
1449  << " dphi " << fMVAVar_dphi
1450  << " detacalo " << fMVAVar_detacalo
1451  // << " dphicalo " << fMVAVar_dphicalo
1452  << " see " << fMVAVar_see
1453  << " spp " << fMVAVar_spp
1454  << " etawidth " << fMVAVar_etawidth
1455  << " phiwidth " << fMVAVar_phiwidth
1456  << " e1x5e5x5 " << fMVAVar_OneMinusE1x5E5x5
1457  << " R9 " << fMVAVar_R9
1458  // << " mynbrems " << fMVAVar_nbrems
1459  << " HoE " << fMVAVar_HoE
1460  << " EoP " << fMVAVar_EoP
1461  << " IoEmIoP " << fMVAVar_IoEmIoP
1462  << " eleEoPout " << fMVAVar_eleEoPout
1463  << " rho " << fMVAVar_rho
1464  // << " EoPout " << fMVAVar_EoPout
1465  << " eta " << fMVAVar_eta
1466  << " pt " << fMVAVar_pt << endl;
1467  cout << " ### MVA " << mva << endl;
1468  }
1469 
1470 
1471 
1472  return mva;
1473 }
float sigmaIphiIphi() const
Definition: GsfElectron.h:403
bool isAvailable() const
Definition: Ref.h:614
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
Definition: DDAxes.h:10
float fbrem() const
Definition: GsfElectron.h:684
UInt_t GetMVABin(double eta, double pt) const
virtual double pt() const
transverse momentum
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
float sigmaIetaIeta() const
Definition: GsfElectron.h:402
float hadronicOverEm() const
Definition: GsfElectron.h:443
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
reco::TrackRef closestCtfTrackRef() const
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:250
float eEleClusterOverPout() const
Definition: GsfElectron.h:246
float e1x5() const
Definition: GsfElectron.h:404
float e5x5() const
Definition: GsfElectron.h:406
float r9() const
Definition: GsfElectron.h:407
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:248
tuple cout
Definition: gather_cfg.py:121
std::vector< TMVA::Reader * > fTMVAReader
std::vector< TMVA::MethodBase * > fTMVAMethod
Double_t EGammaMvaEleEstimator::mvaValue ( const pat::Electron ele,
const reco::Vertex vertex,
double  rho,
bool  useFull5x5 = kFALSE,
bool  printDebug = kFALSE 
)

Definition at line 1244 of file EGammaMvaEleEstimator.cc.

References newFWLiteAna::bin, bindVariables(), pat::Electron::closestCtfTrackRef(), gather_cfg::cout, pat::Electron::dB(), reco::GsfElectron::deltaEtaSeedClusterTrackAtCalo(), reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), reco::GsfElectron::e1x5(), reco::GsfElectron::e5x5(), reco::GsfElectron::ecalEnergy(), pat::Electron::edB(), reco::GsfElectron::eEleClusterOverPout(), reco::GsfElectron::eSuperClusterOverP(), reco::GsfElectron::fbrem(), fisInitialized, fMethodname, fMVAType, fMVAVar_d0, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_ip3d, fMVAVar_ip3dSig, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_OneMinusE1x5E5x5, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_rho, fMVAVar_see, fMVAVar_spp, fTMVAMethod, fTMVAReader, reco::GsfElectron::full5x5_e1x5(), reco::GsfElectron::full5x5_e5x5(), reco::GsfElectron::full5x5_r9(), reco::GsfElectron::full5x5_sigmaIetaIeta(), reco::GsfElectron::full5x5_sigmaIphiIphi(), fUseBinnedVersion, GetMVABin(), pat::Electron::gsfTrack(), reco::GsfElectron::hadronicOverEm(), edm::Ref< C, T, F >::isAvailable(), edm::Ref< C, T, F >::isNonnull(), kNonTrig, kTrig, reco::LeafCandidate::p(), reco::Vertex::position(), reco::LeafCandidate::pt(), reco::GsfElectron::r9(), rho, reco::GsfElectron::sigmaIetaIeta(), reco::GsfElectron::sigmaIphiIphi(), and pat::Electron::superCluster().

1248  {
1249 
1250  if (!fisInitialized) {
1251  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1252  return -9999;
1253  }
1254 
1255  bool validKF= false;
1256  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
1257  validKF = (myTrackRef.isAvailable());
1258  validKF = (myTrackRef.isNonnull());
1259 
1260  // Pure tracking variables
1261  fMVAVar_fbrem = ele.fbrem();
1262  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
1263  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
1264  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
1265 
1266 
1267  // Geometrical matchings
1271 
1272  // Pure ECAL -> shower shapes
1273  fMVAVar_see = useFull5x5 ? ele.full5x5_sigmaIetaIeta() : ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1274  fMVAVar_spp = useFull5x5 ? ele.full5x5_sigmaIphiIphi() : ele.sigmaIphiIphi(); //EleSigmaIEtaIEta
1275 
1276  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1277  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1278  fMVAVar_OneMinusE1x5E5x5 = useFull5x5 ? ( (ele.full5x5_e5x5()) !=0. ? 1.-(ele.full5x5_e1x5()/ele.full5x5_e5x5()) : -1. )
1279  : ( (ele.e5x5() ) !=0. ? 1.-(ele.e1x5() /ele.e5x5() ) : -1. ) ;
1280  fMVAVar_R9 = useFull5x5 ? ele.full5x5_r9() : ele.r9();
1281 
1282  // Energy matching
1283  fMVAVar_HoE = ele.hadronicOverEm(); // this is identical for both
1285 
1286  // unify this in the future?
1287  if( fMVAType == kTrig || fMVAType == kNonTrig){
1288  fMVAVar_IoEmIoP = (1.0/ele.ecalEnergy()) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p()
1289  }else{
1290  fMVAVar_IoEmIoP = (1.0/ele.superCluster()->energy()) - (1.0 / ele.gsfTrack()->p()); // in the future to be changed with ele.gsfTrack()->p()
1291  }
1293  fMVAVar_rho = rho;
1294  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1295 
1296  // for triggering electrons get the impact parameteres
1297  if(fMVAType == kTrig) {
1298  //d0
1299  if (ele.gsfTrack().isNonnull()) {
1300  fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position());
1301  } else if (ele.closestCtfTrackRef().isNonnull()) {
1302  fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position());
1303  } else {
1304  fMVAVar_d0 = -9999.0;
1305  }
1306 
1307  //default values for IP3D
1308  fMVAVar_ip3d = -999.0;
1309  fMVAVar_ip3dSig = 0.0;
1310  if (ele.gsfTrack().isNonnull()) {
1311  const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.;
1312 
1313  //std::cout << "Warning : if usePV = false when pat-electrons were produced, dB() was calculated with respect to beamspot while original mva uses primary vertex" << std::endl;
1314  double ip3d = gsfsign*ele.dB();
1315  double ip3derr = ele.edB();
1316  fMVAVar_ip3d = ip3d;
1317  fMVAVar_ip3dSig = ip3d/ip3derr;
1318  }
1319  }
1320 
1321  // Spectators
1322  fMVAVar_eta = ele.superCluster()->eta();
1323  fMVAVar_pt = ele.pt();
1324 
1325  // evaluate
1326  bindVariables();
1327  Double_t mva = -9999;
1328  if (fUseBinnedVersion) {
1330  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
1331  } else {
1332  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
1333  }
1334 
1335  if(printDebug) {
1336  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1337  cout << " fbrem " << fMVAVar_fbrem
1338  << " kfchi2 " << fMVAVar_kfchi2
1339  << " mykfhits " << fMVAVar_kfhits
1340  << " gsfchi2 " << fMVAVar_gsfchi2
1341  << " deta " << fMVAVar_deta
1342  << " dphi " << fMVAVar_dphi
1343  << " detacalo " << fMVAVar_detacalo
1344  // << " dphicalo " << fMVAVar_dphicalo
1345  << " see " << fMVAVar_see
1346  << " spp " << fMVAVar_spp
1347  << " etawidth " << fMVAVar_etawidth
1348  << " phiwidth " << fMVAVar_phiwidth
1349  << " e1x5e5x5 " << fMVAVar_OneMinusE1x5E5x5
1350  << " R9 " << fMVAVar_R9
1351  // << " mynbrems " << fMVAVar_nbrems
1352  << " HoE " << fMVAVar_HoE
1353  << " EoP " << fMVAVar_EoP
1354  << " IoEmIoP " << fMVAVar_IoEmIoP
1355  << " eleEoPout " << fMVAVar_eleEoPout
1356  << " rho " << fMVAVar_rho
1357  // << " EoPout " << fMVAVar_EoPout
1358  << " d0 " << fMVAVar_d0
1359  << " ip3d " << fMVAVar_ip3d
1360  << " eta " << fMVAVar_eta
1361  << " pt " << fMVAVar_pt << endl;
1362  cout << " ### MVA " << mva << endl;
1363  }
1364 
1365  return mva;
1366 }
float sigmaIphiIphi() const
Definition: GsfElectron.h:403
bool isAvailable() const
Definition: Ref.h:614
double edB(IpType type) const
Uncertainty on the corresponding impact parameter.
virtual double p() const
magnitude of momentum vector
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
float full5x5_e5x5() const
Definition: GsfElectron.h:423
float full5x5_e1x5() const
Definition: GsfElectron.h:421
Definition: DDAxes.h:10
float full5x5_sigmaIphiIphi() const
Definition: GsfElectron.h:420
float fbrem() const
Definition: GsfElectron.h:684
UInt_t GetMVABin(double eta, double pt) const
const Point & position() const
position
Definition: Vertex.h:106
virtual double pt() const
transverse momentum
float full5x5_sigmaIetaIeta() const
Definition: GsfElectron.h:419
reco::SuperClusterRef superCluster() const
override the reco::GsfElectron::superCluster method, to access the internal storage of the superclust...
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:247
float sigmaIetaIeta() const
Definition: GsfElectron.h:402
float hadronicOverEm() const
Definition: GsfElectron.h:443
reco::GsfTrackRef gsfTrack() const
override the reco::GsfElectron::gsfTrack method, to access the internal storage of the supercluster ...
double dB(IpType type) const
Impact parameter wrt primary vertex or beamspot.
reco::TrackRef closestCtfTrackRef() const
override the reco::GsfElectron::closestCtfTrackRef method, to access the internal storage of the trac...
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:250
float eEleClusterOverPout() const
Definition: GsfElectron.h:246
float ecalEnergy() const
Definition: GsfElectron.h:771
float full5x5_r9() const
Definition: GsfElectron.h:424
float r9() const
Definition: GsfElectron.h:407
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:248
tuple cout
Definition: gather_cfg.py:121
std::vector< TMVA::Reader * > fTMVAReader
std::vector< TMVA::MethodBase * > fTMVAMethod
Double_t EGammaMvaEleEstimator::mvaValue ( HWW hww,
Int_t  ele,
Bool_t  printDebug = kFALSE 
)

Definition at line 259 of file EGammaMvaEleEstimator.cc.

References electron_d0PV_wwV1_local(), HWW::els_chi2(), HWW::els_dEtaIn(), HWW::els_dEtaOut(), HWW::els_dPhiIn(), HWW::els_e1x5(), HWW::els_e3x3(), HWW::els_e5x5(), HWW::els_ecalEnergy(), HWW::els_eOverPIn(), HWW::els_eOverPOut(), HWW::els_eSCPresh(), HWW::els_eSCRaw(), HWW::els_etaSC(), HWW::els_etaSCwidth(), HWW::els_fbrem(), HWW::els_gsftrkidx(), HWW::els_hOverE(), HWW::els_ip3d(), HWW::els_ndof(), HWW::els_p4(), HWW::els_phiSCwidth(), HWW::els_sigmaIEtaIEta(), HWW::els_sigmaIPhiIPhi(), HWW::els_trkidx(), eta(), plotBeamSpotDB::first, HWWFunctions::gsftrks_d0_pv(), mvaValue(), EnergyCorrector::pt, HWW::trks_chi2(), HWW::trks_ndof(), and HWW::trks_nlayers().

259  {
260 
261  Double_t mvavalue = -999.;
262 
263  Double_t fbrem = hww.els_fbrem().at(ele);
264  Double_t kfchi2 = hww.els_trkidx().at(ele)>=0 ? hww.trks_chi2().at(hww.els_trkidx().at(ele))/hww.trks_ndof().at(hww.els_trkidx().at(ele)) : 0.;
265  Int_t kfhits = hww.els_trkidx().at(ele)>=0 ? hww.trks_nlayers().at(hww.els_trkidx().at(ele)) : -1;
266  Double_t gsfchi2 = hww.els_chi2().at(ele) / hww.els_ndof().at(ele);
267  Double_t deta = hww.els_dEtaIn().at(ele);
268  Double_t dphi = hww.els_dPhiIn().at(ele);
269  Double_t detacalo = hww.els_dEtaOut().at(ele);
270  Double_t see = hww.els_sigmaIEtaIEta().at(ele);
271  Double_t spp = hww.els_sigmaIPhiIPhi().at(ele); // FIXME : check the case where it's 0
272  Double_t etawidth = hww.els_etaSCwidth().at(ele);
273  Double_t phiwidth = hww.els_phiSCwidth().at(ele);
274  Double_t e1x5e5x5 = hww.els_e5x5().at(ele)!=0. ? 1. - hww.els_e1x5().at(ele)/hww.els_e5x5().at(ele) : -1;
275  Double_t R9 = hww.els_e3x3().at(ele) / hww.els_eSCRaw().at(ele);
276  Double_t HoE = hww.els_hOverE().at(ele);
277  Double_t EoP = hww.els_eOverPIn().at(ele);
278  //Double_t IoEmIoP = 1./hww.els_eSC().at(ele) - 1./hww.els_p4().at(ele).P();
279  Double_t IoEmIoP = 1./hww.els_ecalEnergy().at(ele) - 1./hww.els_p4().at(ele).P(); // this is consistent with CMSSW
280  Double_t eleEoPout = hww.els_eOverPOut().at(ele);
281  Double_t PreShowerOverRaw = hww.els_eSCPresh().at(ele) / hww.els_eSCRaw().at(ele);
282  Double_t d0 = electron_d0PV_wwV1_local(hww, ele);
283  const double gsfsign = ( (gsftrks_d0_pv(hww, hww.els_gsftrkidx().at(ele),0).first) >=0 ) ? 1. : -1.;
284  Double_t ip3d = hww.els_ip3d().at(ele)*gsfsign;
285  Double_t eta = hww.els_etaSC().at(ele);
286  Double_t pt = hww.els_p4().at(ele).pt();
287 
288 
290  fbrem,
291  kfchi2,
292  kfhits,
293  gsfchi2,
294  deta,
295  dphi,
296  detacalo,
297  // dphicalo,
298  see,
299  spp,
300  etawidth,
301  phiwidth,
302  e1x5e5x5,
303  R9,
304  //Int_t nbrems,
305  HoE,
306  EoP,
307  IoEmIoP,
308  eleEoPout,
309  PreShowerOverRaw,
310  // EoPout,
311  d0,
312  ip3d,
313  eta,
314  pt,
315  printDebug);
316 
317 
318  return mvavalue;
319 }
Double_t mvaValue(Double_t fbrem, Double_t kfchi2, Int_t kfhits, Double_t gsfchi2, Double_t deta, Double_t dphi, Double_t detacalo, Double_t see, Double_t spp, Double_t etawidth, Double_t phiwidth, Double_t e1x5e5x5, Double_t R9, Double_t HoE, Double_t EoP, Double_t IoEmIoP, Double_t eleEoPout, Double_t PreShowerOverRaw, Double_t d0, Double_t ip3d, Double_t eta, Double_t pt, Bool_t printDebug=kFALSE)
std::vector< float > & els_e3x3()
Definition: HWW.cc:249
std::vector< float > & els_ndof()
Definition: HWW.cc:189
std::vector< float > & els_hOverE()
Definition: HWW.cc:133
std::vector< float > & els_ecalEnergy()
Definition: HWW.cc:253
std::vector< float > & els_eOverPOut()
Definition: HWW.cc:257
std::vector< float > & els_ip3d()
Definition: HWW.cc:177
std::vector< float > & els_fbrem()
Definition: HWW.cc:153
T eta() const
std::vector< int > & els_gsftrkidx()
Definition: HWW.cc:333
std::vector< float > & els_eOverPIn()
Definition: HWW.cc:157
std::vector< float > & trks_chi2()
Definition: HWW.cc:47
std::vector< float > & els_chi2()
Definition: HWW.cc:185
double electron_d0PV_wwV1_local(HWW &hww, unsigned int index)
std::vector< float > & trks_ndof()
Definition: HWW.cc:51
std::vector< float > & els_dEtaOut()
Definition: HWW.cc:193
std::vector< LorentzVector > & els_p4()
Definition: HWW.cc:101
std::vector< float > & els_etaSC()
Definition: HWW.cc:117
std::vector< float > & els_eSCPresh()
Definition: HWW.cc:213
std::vector< float > & els_e5x5()
Definition: HWW.cc:241
std::vector< float > & els_etaSCwidth()
Definition: HWW.cc:205
std::vector< float > & els_eSCRaw()
Definition: HWW.cc:201
std::vector< float > & els_dPhiIn()
Definition: HWW.cc:129
std::vector< float > & els_e1x5()
Definition: HWW.cc:245
std::pair< double, double > gsftrks_d0_pv(HWW &, int itrk, int ipv)
std::vector< float > & els_dEtaIn()
Definition: HWW.cc:125
std::vector< float > & els_phiSCwidth()
Definition: HWW.cc:209
std::vector< int > & trks_nlayers()
Definition: HWW.cc:59
std::vector< float > & els_sigmaIEtaIEta()
Definition: HWW.cc:121
std::vector< float > & els_sigmaIPhiIPhi()
Definition: HWW.cc:169
std::vector< int > & els_trkidx()
Definition: HWW.cc:341
Double_t EGammaMvaEleEstimator::mvaValue ( Double_t  fbrem,
Double_t  kfchi2,
Int_t  kfhits,
Double_t  gsfchi2,
Double_t  deta,
Double_t  dphi,
Double_t  detacalo,
Double_t  see,
Double_t  spp,
Double_t  etawidth,
Double_t  phiwidth,
Double_t  e1x5e5x5,
Double_t  R9,
Double_t  HoE,
Double_t  EoP,
Double_t  IoEmIoP,
Double_t  eleEoPout,
Double_t  PreShowerOverRaw,
Double_t  d0,
Double_t  ip3d,
Double_t  eta,
Double_t  pt,
Bool_t  printDebug = kFALSE 
)
Double_t EGammaMvaEleEstimator::mvaValue ( Double_t  fbrem,
Double_t  kfchi2,
Int_t  kfhits,
Double_t  gsfchi2,
Double_t  deta,
Double_t  dphi,
Double_t  detacalo,
Double_t  see,
Double_t  spp,
Double_t  etawidth,
Double_t  phiwidth,
Double_t  e1x5e5x5,
Double_t  R9,
Double_t  HoE,
Double_t  EoP,
Double_t  IoEmIoP,
Double_t  eleEoPout,
Double_t  rho,
Double_t  PreShowerOverRaw,
Double_t  eta,
Double_t  pt,
Bool_t  printDebug = kFALSE 
)

Definition at line 565 of file EGammaMvaEleEstimator.cc.

References newFWLiteAna::bin, bindVariables(), gather_cfg::cout, eta(), fisInitialized, fMethodname, fMVAType, fMVAVar_deta, fMVAVar_detacalo, fMVAVar_dphi, fMVAVar_eleEoPout, fMVAVar_EoP, fMVAVar_eta, fMVAVar_etawidth, fMVAVar_fbrem, fMVAVar_gsfchi2, fMVAVar_HoE, fMVAVar_IoEmIoP, fMVAVar_kfchi2, fMVAVar_kfhits, fMVAVar_OneMinusE1x5E5x5, fMVAVar_phiwidth, fMVAVar_PreShowerOverRaw, fMVAVar_pt, fMVAVar_R9, fMVAVar_rho, fMVAVar_see, fMVAVar_spp, fTMVAMethod, fTMVAReader, fUseBinnedVersion, GetMVABin(), kTrigNoIP, EnergyCorrector::pt, and rho.

586  {
587 
588  if (!fisInitialized) {
589  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
590  return -9999;
591  }
592 
594  std::cout << "Error: This method should be called for kTrigNoIP MVA only" << endl;
595  return -9999;
596  }
597 
598  fMVAVar_fbrem = fbrem;
599  fMVAVar_kfchi2 = kfchi2;
600  fMVAVar_kfhits = float(kfhits); // BTD does not support int variables
601  fMVAVar_gsfchi2 = gsfchi2;
602 
603  fMVAVar_deta = deta;
604  fMVAVar_dphi = dphi;
605  fMVAVar_detacalo = detacalo;
606 
607  fMVAVar_see = see;
608  fMVAVar_spp = spp;
609  fMVAVar_etawidth = etawidth;
610  fMVAVar_phiwidth = phiwidth;
611  fMVAVar_OneMinusE1x5E5x5 = e1x5e5x5;
612  fMVAVar_R9 = R9;
613 
614  fMVAVar_HoE = HoE;
615  fMVAVar_EoP = EoP;
616  fMVAVar_IoEmIoP = IoEmIoP;
617  fMVAVar_eleEoPout = eleEoPout;
618  fMVAVar_rho = rho;
619  fMVAVar_PreShowerOverRaw= PreShowerOverRaw;
620 
621 
622  fMVAVar_eta = eta;
623  fMVAVar_pt = pt;
624 
625 
626  bindVariables();
627  Double_t mva = -9999;
628  if (fUseBinnedVersion) {
630  mva = fTMVAReader[bin]->EvaluateMVA(fTMVAMethod[bin]);
631  } else {
632  mva = fTMVAReader[0]->EvaluateMVA(fTMVAMethod[0]);
633  }
634 
635  if(printDebug) {
636  cout << " *** Inside the class fMethodname " << fMethodname << endl;
637  cout << " fbrem " << fMVAVar_fbrem
638  << " kfchi2 " << fMVAVar_kfchi2
639  << " mykfhits " << fMVAVar_kfhits
640  << " gsfchi2 " << fMVAVar_gsfchi2
641  << " deta " << fMVAVar_deta
642  << " dphi " << fMVAVar_dphi
643  << " detacalo " << fMVAVar_detacalo
644  << " see " << fMVAVar_see
645  << " spp " << fMVAVar_spp
646  << " etawidth " << fMVAVar_etawidth
647  << " phiwidth " << fMVAVar_phiwidth
648  << " e1x5e5x5 " << fMVAVar_OneMinusE1x5E5x5
649  << " R9 " << fMVAVar_R9
650  << " HoE " << fMVAVar_HoE
651  << " EoP " << fMVAVar_EoP
652  << " IoEmIoP " << fMVAVar_IoEmIoP
653  << " eleEoPout " << fMVAVar_eleEoPout
654  << " rho " << fMVAVar_rho
655  << " PreShowerOverRaw " << fMVAVar_PreShowerOverRaw
656  << " eta " << fMVAVar_eta
657  << " pt " << fMVAVar_pt << endl;
658  cout << " ### MVA " << mva << endl;
659  }
660 
661 
662  return mva;
663 }
Definition: DDAxes.h:10
T eta() const
UInt_t GetMVABin(double eta, double pt) const
tuple cout
Definition: gather_cfg.py:121
std::vector< TMVA::Reader * > fTMVAReader
std::vector< TMVA::MethodBase * > fTMVAMethod
Double_t EGammaMvaEleEstimator::mvaValue ( Double_t  fbrem,
Double_t  kfchi2,
Int_t  kfhits,
Double_t  gsfchi2,
Double_t  deta,
Double_t  dphi,
Double_t  detacalo,
Double_t  see,
Double_t  spp,
Double_t  etawidth,
Double_t  phiwidth,
Double_t  e1x5e5x5,
Double_t  R9,
Double_t  HoE,
Double_t  EoP,
Double_t  IoEmIoP,
Double_t  eleEoPout,
Double_t  PreShowerOverRaw,
Double_t  eta,
Double_t  pt,
Bool_t  printDebug = kFALSE 
)
void EGammaMvaEleEstimator::SetPrintMVADebug ( bool  b)
inline

Definition at line 48 of file EGammaMvaEleEstimator.h.

References b, and fPrintMVADebug.

48 { fPrintMVADebug = b; }
double b
Definition: hdecay.h:120

Member Data Documentation

Bool_t EGammaMvaEleEstimator::fisInitialized
private
std::string EGammaMvaEleEstimator::fMethodname
private

Definition at line 112 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), isoMvaValue(), and mvaValue().

MVAType EGammaMvaEleEstimator::fMVAType
private
Float_t EGammaMvaEleEstimator::fMVAVar_ChargedIso_DR0p0To0p1
private

Definition at line 152 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_ChargedIso_DR0p1To0p2
private

Definition at line 153 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_ChargedIso_DR0p2To0p3
private

Definition at line 154 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_ChargedIso_DR0p3To0p4
private

Definition at line 155 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_ChargedIso_DR0p4To0p5
private

Definition at line 156 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_d0
private

Definition at line 145 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_deta
private
Float_t EGammaMvaEleEstimator::fMVAVar_detacalo
private
Float_t EGammaMvaEleEstimator::fMVAVar_dphi
private
Float_t EGammaMvaEleEstimator::fMVAVar_e1x5e5x5
private

Definition at line 134 of file EGammaMvaEleEstimator.h.

Referenced by bindVariables(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_eleEoPout
private
Float_t EGammaMvaEleEstimator::fMVAVar_EoP
private
Float_t EGammaMvaEleEstimator::fMVAVar_EoPout
private

Definition at line 142 of file EGammaMvaEleEstimator.h.

Float_t EGammaMvaEleEstimator::fMVAVar_eta
private

Definition at line 148 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), isoMvaValue(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_etawidth
private

Definition at line 132 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_fbrem
private
Float_t EGammaMvaEleEstimator::fMVAVar_GammaIso_DR0p0To0p1
private

Definition at line 157 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_GammaIso_DR0p1To0p2
private

Definition at line 158 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_GammaIso_DR0p2To0p3
private

Definition at line 159 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_GammaIso_DR0p3To0p4
private

Definition at line 160 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_GammaIso_DR0p4To0p5
private

Definition at line 161 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_gsfchi2
private
Float_t EGammaMvaEleEstimator::fMVAVar_HoE
private

Definition at line 138 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_IoEmIoP
private

Definition at line 140 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_ip3d
private

Definition at line 146 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_ip3dSig
private

Definition at line 283 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_kfchi2
private
Float_t EGammaMvaEleEstimator::fMVAVar_kfhits
private

Definition at line 121 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_kfhitsall
private

Definition at line 122 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_NeutralHadronIso_DR0p0To0p1
private

Definition at line 162 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_NeutralHadronIso_DR0p1To0p2
private

Definition at line 163 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_NeutralHadronIso_DR0p2To0p3
private

Definition at line 164 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_NeutralHadronIso_DR0p3To0p4
private

Definition at line 165 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_NeutralHadronIso_DR0p4To0p5
private

Definition at line 166 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and isoMvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_OneMinusE1x5E5x5
private

Definition at line 271 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_phiwidth
private

Definition at line 133 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_PreShowerOverRaw
private

Definition at line 143 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_pt
private

Definition at line 149 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), isoMvaValue(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_R9
private
Float_t EGammaMvaEleEstimator::fMVAVar_rho
private

Definition at line 287 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_see
private

Definition at line 130 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), and mvaValue().

Float_t EGammaMvaEleEstimator::fMVAVar_spp
private
UInt_t EGammaMvaEleEstimator::fNMVABins
private

Definition at line 117 of file EGammaMvaEleEstimator.h.

Referenced by initialize().

Bool_t EGammaMvaEleEstimator::fPrintMVADebug
private

Definition at line 114 of file EGammaMvaEleEstimator.h.

Referenced by SetPrintMVADebug().

std::vector<TMVA::MethodBase*> EGammaMvaEleEstimator::fTMVAMethod
private

Definition at line 250 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), isoMvaValue(), and mvaValue().

std::vector< TMVA::Reader * > EGammaMvaEleEstimator::fTMVAReader
private
Bool_t EGammaMvaEleEstimator::fUseBinnedVersion
private

Definition at line 116 of file EGammaMvaEleEstimator.h.

Referenced by IDIsoCombinedMvaValue(), initialize(), isoMvaValue(), and mvaValue().