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 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::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 43 of file EGammaMvaEleEstimator.h.

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

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 1647 of file EGammaMvaEleEstimator.cc.

References IPTools::absoluteImpactParameter3D(), 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, 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.

1654  {
1655 
1656  if (!fisInitialized) {
1657  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1658  return -9999;
1659  }
1660 
1661  bool validKF= false;
1662  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
1663  validKF = (myTrackRef.isAvailable());
1664  validKF = (myTrackRef.isNonnull());
1665 
1666  // Pure tracking variables
1667  fMVAVar_fbrem = (ele.fbrem() < -1. ) ? -1. : ele.fbrem();
1668  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
1669  if (fMVAVar_kfchi2 > 10) fMVAVar_kfchi2 = 10;
1670  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
1671  fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative
1672  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
1673  if (fMVAVar_gsfchi2 > 200) fMVAVar_gsfchi2 = 200;
1674 
1675 
1676  // Geometrical matchings
1677  fMVAVar_deta = ( fabs(ele.deltaEtaSuperClusterTrackAtVtx()) > 0.06 ) ? 0.06 : fabs(ele.deltaEtaSuperClusterTrackAtVtx());
1680 
1681 
1682  // Pure ECAL -> shower shapes
1683  fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1684  std::vector<float> vCov = myEcalCluster.localCovariances(*(ele.superCluster()->seed())) ;
1685  if (!isnan(vCov[2])) fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi
1686  else fMVAVar_spp = 0.;
1687 
1688  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1689  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1690  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ;
1692  fMVAVar_R9 = myEcalCluster.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy();
1693  if (fMVAVar_R9 > 5) fMVAVar_R9 = 5;
1694 
1695  // Energy matching
1696  fMVAVar_HoE = ele.hadronicOverEm();
1697  fMVAVar_EoP = ( ele.eSuperClusterOverP() > 20 ) ? 20 : ele.eSuperClusterOverP();
1698  fMVAVar_IoEmIoP = (1.0/ele.superCluster()->energy()) - (1.0 / ele.trackMomentumAtVtx().R()); //this is the proper variable
1699  fMVAVar_eleEoPout = ( ele.eEleClusterOverPout() > 20 ) ? 20 : ele.eEleClusterOverPout();
1700  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1701 
1702  // Spectators
1703  fMVAVar_eta = ele.superCluster()->eta();
1704  fMVAVar_pt = ele.pt();
1705 
1706 
1707 
1708  // for triggering electrons get the impact parameteres
1709  if(fMVAType == kTrig) {
1710  //d0
1711  if (ele.gsfTrack().isNonnull()) {
1712  fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position());
1713  } else if (ele.closestCtfTrackRef().isNonnull()) {
1714  fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position());
1715  } else {
1716  fMVAVar_d0 = -9999.0;
1717  }
1718 
1719  //default values for IP3D
1720  fMVAVar_ip3d = -999.0;
1721  fMVAVar_ip3dSig = 0.0;
1722  if (ele.gsfTrack().isNonnull()) {
1723  const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.;
1724 
1725  const reco::TransientTrack &tt = transientTrackBuilder.build(ele.gsfTrack());
1726  const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,vertex);
1727  if (ip3dpv.first) {
1728  double ip3d = gsfsign*ip3dpv.second.value();
1729  double ip3derr = ip3dpv.second.error();
1730  fMVAVar_ip3d = ip3d;
1731  fMVAVar_ip3dSig = ip3d/ip3derr;
1732  }
1733  }
1734  }
1735 
1736  //**********************************************************
1737  //Isolation variables
1738  //**********************************************************
1739  Double_t tmpChargedIso_DR0p0To0p1 = 0;
1740  Double_t tmpChargedIso_DR0p1To0p2 = 0;
1741  Double_t tmpChargedIso_DR0p2To0p3 = 0;
1742  Double_t tmpChargedIso_DR0p3To0p4 = 0;
1743  Double_t tmpChargedIso_DR0p4To0p5 = 0;
1744  Double_t tmpGammaIso_DR0p0To0p1 = 0;
1745  Double_t tmpGammaIso_DR0p1To0p2 = 0;
1746  Double_t tmpGammaIso_DR0p2To0p3 = 0;
1747  Double_t tmpGammaIso_DR0p3To0p4 = 0;
1748  Double_t tmpGammaIso_DR0p4To0p5 = 0;
1749  Double_t tmpNeutralHadronIso_DR0p0To0p1 = 0;
1750  Double_t tmpNeutralHadronIso_DR0p1To0p2 = 0;
1751  Double_t tmpNeutralHadronIso_DR0p2To0p3 = 0;
1752  Double_t tmpNeutralHadronIso_DR0p3To0p4 = 0;
1753  Double_t tmpNeutralHadronIso_DR0p4To0p5 = 0;
1754 
1755  for (reco::PFCandidateCollection::const_iterator iP = PFCandidates.begin();
1756  iP != PFCandidates.end(); ++iP) {
1757 
1758  double dr = sqrt(pow(iP->eta() - ele.eta(),2) + pow(acos(cos(iP->phi() - ele.phi())),2));
1759 
1760  Bool_t passVeto = kTRUE;
1761  //Charged
1762  if(iP->trackRef().isNonnull()) {
1763 
1764  //make sure charged pf candidates pass the PFNoPU condition (assumed)
1765 
1766  //************************************************************
1767  // Veto any PFmuon, or PFEle
1768  if (iP->particleId() == reco::PFCandidate::e || iP->particleId() == reco::PFCandidate::mu) passVeto = kFALSE;
1769  //************************************************************
1770  //************************************************************
1771  // Footprint Veto
1772  if (fabs(fMVAVar_eta) > 1.479 && dr < 0.015) passVeto = kFALSE;
1773  //************************************************************
1774  if (passVeto) {
1775  if (dr < 0.1) tmpChargedIso_DR0p0To0p1 += iP->pt();
1776  if (dr >= 0.1 && dr < 0.2) tmpChargedIso_DR0p1To0p2 += iP->pt();
1777  if (dr >= 0.2 && dr < 0.3) tmpChargedIso_DR0p2To0p3 += iP->pt();
1778  if (dr >= 0.3 && dr < 0.4) tmpChargedIso_DR0p3To0p4 += iP->pt();
1779  if (dr >= 0.4 && dr < 0.5) tmpChargedIso_DR0p4To0p5 += iP->pt();
1780  } //pass veto
1781  }
1782  //Gamma
1783  else if (iP->particleId() == reco::PFCandidate::gamma) {
1784  //************************************************************
1785  // Footprint Veto
1786  if (fabs(fMVAVar_eta) > 1.479 && dr < 0.08) passVeto = kFALSE;
1787  //************************************************************
1788  if (passVeto) {
1789  if (dr < 0.1) tmpGammaIso_DR0p0To0p1 += iP->pt();
1790  if (dr >= 0.1 && dr < 0.2) tmpGammaIso_DR0p1To0p2 += iP->pt();
1791  if (dr >= 0.2 && dr < 0.3) tmpGammaIso_DR0p2To0p3 += iP->pt();
1792  if (dr >= 0.3 && dr < 0.4) tmpGammaIso_DR0p3To0p4 += iP->pt();
1793  if (dr >= 0.4 && dr < 0.5) tmpGammaIso_DR0p4To0p5 += iP->pt();
1794  }
1795  }
1796  //NeutralHadron
1797  else {
1798  if (dr < 0.1) tmpNeutralHadronIso_DR0p0To0p1 += iP->pt();
1799  if (dr >= 0.1 && dr < 0.2) tmpNeutralHadronIso_DR0p1To0p2 += iP->pt();
1800  if (dr >= 0.2 && dr < 0.3) tmpNeutralHadronIso_DR0p2To0p3 += iP->pt();
1801  if (dr >= 0.3 && dr < 0.4) tmpNeutralHadronIso_DR0p3To0p4 += iP->pt();
1802  if (dr >= 0.4 && dr < 0.5) tmpNeutralHadronIso_DR0p4To0p5 += iP->pt();
1803  }
1804  } //loop over PF candidates
1805 
1807  fMVAVar_ChargedIso_DR0p0To0p1 = TMath::Min((tmpChargedIso_DR0p0To0p1)/ele.pt(), 2.5);
1808  fMVAVar_ChargedIso_DR0p1To0p2 = TMath::Min((tmpChargedIso_DR0p1To0p2)/ele.pt(), 2.5);
1809  fMVAVar_ChargedIso_DR0p2To0p3 = TMath::Min((tmpChargedIso_DR0p2To0p3)/ele.pt(), 2.5);
1810  fMVAVar_ChargedIso_DR0p3To0p4 = TMath::Min((tmpChargedIso_DR0p3To0p4)/ele.pt(), 2.5);
1811  fMVAVar_ChargedIso_DR0p4To0p5 = TMath::Min((tmpChargedIso_DR0p4To0p5)/ele.pt(), 2.5);
1822  } else if (fMVAType == kTrigIDIsoCombined) {
1823  fMVAVar_ChargedIso_DR0p0To0p1 = TMath::Min((tmpChargedIso_DR0p0To0p1)/ele.pt(), 2.5);
1824  fMVAVar_ChargedIso_DR0p1To0p2 = TMath::Min((tmpChargedIso_DR0p1To0p2)/ele.pt(), 2.5);
1825  fMVAVar_ChargedIso_DR0p2To0p3 = TMath::Min((tmpChargedIso_DR0p2To0p3)/ele.pt(), 2.5);
1826  fMVAVar_ChargedIso_DR0p3To0p4 = TMath::Min((tmpChargedIso_DR0p3To0p4)/ele.pt(), 2.5);
1827  fMVAVar_ChargedIso_DR0p4To0p5 = TMath::Min((tmpChargedIso_DR0p4To0p5)/ele.pt(), 2.5);
1828  fMVAVar_GammaIso_DR0p0To0p1 = TMath::Max(TMath::Min((tmpGammaIso_DR0p0To0p1)/ele.pt(), 2.5), 0.0);
1829  fMVAVar_GammaIso_DR0p1To0p2 = TMath::Max(TMath::Min((tmpGammaIso_DR0p1To0p2)/ele.pt(), 2.5), 0.0);
1830  fMVAVar_GammaIso_DR0p2To0p3 = TMath::Max(TMath::Min((tmpGammaIso_DR0p2To0p3)/ele.pt(), 2.5), 0.0);
1831  fMVAVar_GammaIso_DR0p3To0p4 = TMath::Max(TMath::Min((tmpGammaIso_DR0p3To0p4)/ele.pt(), 2.5), 0.0);
1832  fMVAVar_GammaIso_DR0p4To0p5 = TMath::Max(TMath::Min((tmpGammaIso_DR0p4To0p5)/ele.pt(), 2.5), 0.0);
1833  fMVAVar_NeutralHadronIso_DR0p0To0p1 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p0To0p1)/ele.pt(), 2.5), 0.0);
1834  fMVAVar_NeutralHadronIso_DR0p1To0p2 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p1To0p2)/ele.pt(), 2.5), 0.0);
1835  fMVAVar_NeutralHadronIso_DR0p2To0p3 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p2To0p3)/ele.pt(), 2.5), 0.0);
1836  fMVAVar_NeutralHadronIso_DR0p3To0p4 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p3To0p4)/ele.pt(), 2.5), 0.0);
1837  fMVAVar_NeutralHadronIso_DR0p4To0p5 = TMath::Max(TMath::Min((tmpNeutralHadronIso_DR0p4To0p5)/ele.pt(), 2.5), 0.0);
1838  fMVAVar_rho = Rho;
1839  } else {
1840  cout << "Warning: Type " << fMVAType << " is not supported.\n";
1841  }
1842 
1843  // evaluate
1844  Double_t mva = -9999;
1845  if (fUseBinnedVersion) {
1846  mva = fTMVAReader[GetMVABin(fMVAVar_eta,fMVAVar_pt)]->EvaluateMVA(fMethodname);
1847  } else {
1848  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
1849  }
1850 
1851 
1852 
1853  if(printDebug) {
1854  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1855  cout << " fbrem " << fMVAVar_fbrem
1856  << " kfchi2 " << fMVAVar_kfchi2
1857  << " mykfhits " << fMVAVar_kfhits
1858  << " gsfchi2 " << fMVAVar_gsfchi2
1859  << " deta " << fMVAVar_deta
1860  << " dphi " << fMVAVar_dphi
1861  << " detacalo " << fMVAVar_detacalo
1862  << " see " << fMVAVar_see
1863  << " spp " << fMVAVar_spp
1864  << " etawidth " << fMVAVar_etawidth
1865  << " phiwidth " << fMVAVar_phiwidth
1866  << " OneMinusE1x5E5x5 " << fMVAVar_OneMinusE1x5E5x5
1867  << " R9 " << fMVAVar_R9
1868  << " HoE " << fMVAVar_HoE
1869  << " EoP " << fMVAVar_EoP
1870  << " IoEmIoP " << fMVAVar_IoEmIoP
1871  << " eleEoPout " << fMVAVar_eleEoPout
1872  << " d0 " << fMVAVar_d0
1873  << " ip3d " << fMVAVar_ip3d
1874  << " eta " << fMVAVar_eta
1875  << " pt " << fMVAVar_pt << endl;
1876  cout << "ChargedIso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1881  << fMVAVar_ChargedIso_DR0p4To0p5 << endl;
1882  cout << "PF Gamma Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1883  << fMVAVar_GammaIso_DR0p0To0p1 << " "
1884  << fMVAVar_GammaIso_DR0p1To0p2 << " "
1885  << fMVAVar_GammaIso_DR0p2To0p3 << " "
1886  << fMVAVar_GammaIso_DR0p3To0p4 << " "
1887  << fMVAVar_GammaIso_DR0p4To0p5 << endl;
1888  cout << "PF Neutral Hadron Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1894  << endl;
1895  cout << "Rho : " << Rho << endl;
1896  cout << " ### MVA " << mva << endl;
1897  }
1898 
1899 
1900 
1901  return mva;
1902 }
bool isAvailable() const
Definition: Ref.h:614
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
virtual float pt() const
transverse momentum
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
virtual float phi() const
momentum azimuthal angle
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
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
virtual float eta() const
momentum pseudorapidity
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
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 744 of file EGammaMvaEleEstimator.cc.

References 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, fTMVAReader, fUseBinnedVersion, GetMVABin(), bookConverter::max, min(), and EnergyCorrector::pt.

782  {
783 
784  if (!fisInitialized) {
785  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
786  return -9999;
787  }
788 
789  fMVAVar_fbrem = ( fbrem < -1.0 ) ? -1.0 : fbrem;
790  fMVAVar_kfchi2 = ( kfchi2 > 10 ) ? 10 : kfchi2;
791  fMVAVar_kfhits = float(kfhits); // BTD does not support int variables
792  fMVAVar_gsfchi2 = ( gsfchi2 > 200 ) ? 200 : gsfchi2;
793  fMVAVar_deta = ( fabs(deta) > 0.06 ) ? 0.06 : fabs(deta);
794  fMVAVar_dphi = dphi;
795  fMVAVar_detacalo = detacalo;
796 
797  fMVAVar_see = see;
798  fMVAVar_spp = spp;
799  fMVAVar_etawidth = etawidth;
800  fMVAVar_phiwidth = phiwidth;
801  fMVAVar_OneMinusE1x5E5x5= max(min(double(OneMinusE1x5E5x5),2.0),-1.0);
802  fMVAVar_R9 = (R9 > 5) ? 5: R9;
803 
804  fMVAVar_HoE = HoE;
805  fMVAVar_EoP = (EoP > 20) ? 20 : EoP;
806  fMVAVar_IoEmIoP = IoEmIoP;
807  fMVAVar_eleEoPout = (eleEoPout > 20) ? 20 : eleEoPout;
808  fMVAVar_PreShowerOverRaw= PreShowerOverRaw;
809 
810  fMVAVar_d0 = d0;
811  fMVAVar_ip3d = ip3d;
812 
813  fMVAVar_ChargedIso_DR0p0To0p1 = ChargedIso_DR0p0To0p1;
814  fMVAVar_ChargedIso_DR0p1To0p2 = ChargedIso_DR0p1To0p2;
815  fMVAVar_ChargedIso_DR0p2To0p3 = ChargedIso_DR0p2To0p3;
816  fMVAVar_ChargedIso_DR0p3To0p4 = ChargedIso_DR0p3To0p4;
817  fMVAVar_ChargedIso_DR0p4To0p5 = ChargedIso_DR0p4To0p5;
818  fMVAVar_GammaIso_DR0p0To0p1 = GammaIso_DR0p0To0p1;
819  fMVAVar_GammaIso_DR0p1To0p2 = GammaIso_DR0p1To0p2;
820  fMVAVar_GammaIso_DR0p2To0p3 = GammaIso_DR0p2To0p3;
821  fMVAVar_GammaIso_DR0p3To0p4 = GammaIso_DR0p3To0p4;
822  fMVAVar_GammaIso_DR0p4To0p5 = GammaIso_DR0p4To0p5;
823  fMVAVar_NeutralHadronIso_DR0p0To0p1 = NeutralHadronIso_DR0p0To0p1;
824  fMVAVar_NeutralHadronIso_DR0p1To0p2 = NeutralHadronIso_DR0p1To0p2;
825  fMVAVar_NeutralHadronIso_DR0p2To0p3 = NeutralHadronIso_DR0p2To0p3;
826  fMVAVar_NeutralHadronIso_DR0p3To0p4 = NeutralHadronIso_DR0p3To0p4;
827  fMVAVar_NeutralHadronIso_DR0p4To0p5 = NeutralHadronIso_DR0p4To0p5;
828 
829  fMVAVar_rho = Rho;
830  fMVAVar_eta = eta;
831  fMVAVar_pt = pt;
832 
833  Double_t mva = -9999;
834  if (fUseBinnedVersion) {
836  } else {
837  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
838  }
839 
840  if(printDebug) {
841  cout << " *** Inside the class fMethodname " << fMethodname << endl;
842  cout << " fbrem " << fMVAVar_fbrem
843  << " kfchi2 " << fMVAVar_kfchi2
844  << " mykfhits " << fMVAVar_kfhits
845  << " gsfchi2 " << fMVAVar_gsfchi2
846  << " deta " << fMVAVar_deta
847  << " dphi " << fMVAVar_dphi
848  << " detacalo " << fMVAVar_detacalo
849  << " see " << fMVAVar_see
850  << " spp " << fMVAVar_spp
851  << " etawidth " << fMVAVar_etawidth
852  << " phiwidth " << fMVAVar_phiwidth
853  << " OneMinusE1x5E5x5 " << fMVAVar_OneMinusE1x5E5x5
854  << " R9 " << fMVAVar_R9
855  << " HoE " << fMVAVar_HoE
856  << " EoP " << fMVAVar_EoP
857  << " IoEmIoP " << fMVAVar_IoEmIoP
858  << " eleEoPout " << fMVAVar_eleEoPout
859  << " PreShowerOverRaw " << fMVAVar_PreShowerOverRaw
860  << " d0 " << fMVAVar_d0
861  << " ip3d " << fMVAVar_ip3d
862  << " ChargedIso_DR0p0To0p1 " << ChargedIso_DR0p0To0p1
863  << " ChargedIso_DR0p1To0p2 " << ChargedIso_DR0p1To0p2
864  << " ChargedIso_DR0p2To0p3 " << ChargedIso_DR0p2To0p3
865  << " ChargedIso_DR0p3To0p4 " << ChargedIso_DR0p3To0p4
866  << " ChargedIso_DR0p4To0p5 " << ChargedIso_DR0p4To0p5
867  << " GammaIso_DR0p0To0p1 " << GammaIso_DR0p0To0p1
868  << " GammaIso_DR0p1To0p2 " << GammaIso_DR0p1To0p2
869  << " GammaIso_DR0p2To0p3 " << GammaIso_DR0p2To0p3
870  << " GammaIso_DR0p3To0p4 " << GammaIso_DR0p3To0p4
871  << " GammaIso_DR0p4To0p5 " << GammaIso_DR0p4To0p5
872  << " NeutralHadronIso_DR0p0To0p1 " << NeutralHadronIso_DR0p0To0p1
873  << " NeutralHadronIso_DR0p1To0p2 " << NeutralHadronIso_DR0p1To0p2
874  << " NeutralHadronIso_DR0p2To0p3 " << NeutralHadronIso_DR0p2To0p3
875  << " NeutralHadronIso_DR0p3To0p4 " << NeutralHadronIso_DR0p3To0p4
876  << " NeutralHadronIso_DR0p4To0p5 " << NeutralHadronIso_DR0p4To0p5
877  << " Rho " << Rho
878  << " eta " << fMVAVar_eta
879  << " pt " << fMVAVar_pt << endl;
880  cout << " ### MVA " << mva << endl;
881  }
882 
883  return mva;
884 }
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
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 60 of file EGammaMvaEleEstimator.h.

References fisInitialized.

60 { 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 1447 of file EGammaMvaEleEstimator.cc.

References 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, 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().

1454  {
1455 
1456  if (!fisInitialized) {
1457  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1458  return -9999;
1459  }
1460 
1461  // Spectators
1462  fMVAVar_eta = ele.superCluster()->eta();
1463  fMVAVar_pt = ele.pt();
1464 
1465  //**********************************************************
1466  //Isolation variables
1467  //**********************************************************
1468  Double_t tmpChargedIso_DR0p0To0p1 = 0;
1469  Double_t tmpChargedIso_DR0p1To0p2 = 0;
1470  Double_t tmpChargedIso_DR0p2To0p3 = 0;
1471  Double_t tmpChargedIso_DR0p3To0p4 = 0;
1472  Double_t tmpChargedIso_DR0p4To0p5 = 0;
1473  Double_t tmpGammaIso_DR0p0To0p1 = 0;
1474  Double_t tmpGammaIso_DR0p1To0p2 = 0;
1475  Double_t tmpGammaIso_DR0p2To0p3 = 0;
1476  Double_t tmpGammaIso_DR0p3To0p4 = 0;
1477  Double_t tmpGammaIso_DR0p4To0p5 = 0;
1478  Double_t tmpNeutralHadronIso_DR0p0To0p1 = 0;
1479  Double_t tmpNeutralHadronIso_DR0p1To0p2 = 0;
1480  Double_t tmpNeutralHadronIso_DR0p2To0p3 = 0;
1481  Double_t tmpNeutralHadronIso_DR0p3To0p4 = 0;
1482  Double_t tmpNeutralHadronIso_DR0p4To0p5 = 0;
1483 
1484  double electronTrackZ = 0;
1485  if (ele.gsfTrack().isNonnull()) {
1486  electronTrackZ = ele.gsfTrack()->dz(vertex.position());
1487  } else if (ele.closestCtfTrackRef().isNonnull()) {
1488  electronTrackZ = ele.closestCtfTrackRef()->dz(vertex.position());
1489  }
1490 
1491  for (reco::PFCandidateCollection::const_iterator iP = PFCandidates.begin();
1492  iP != PFCandidates.end(); ++iP) {
1493 
1494  //exclude the electron itself
1495  if(iP->gsfTrackRef().isNonnull() && ele.gsfTrack().isNonnull() &&
1496  refToPtr(iP->gsfTrackRef()) == refToPtr(ele.gsfTrack())) continue;
1497  if(iP->trackRef().isNonnull() && ele.closestCtfTrackRef().isNonnull() &&
1498  refToPtr(iP->trackRef()) == refToPtr(ele.closestCtfTrackRef())) continue;
1499 
1500  //************************************************************
1501  // New Isolation Calculations
1502  //************************************************************
1503  double dr = sqrt(pow(iP->eta() - ele.eta(),2) + pow(acos(cos(iP->phi() - ele.phi())),2));
1504  //Double_t deta = (iP->eta() - ele.eta());
1505 
1506  if (dr < 1.0) {
1507  Bool_t IsLeptonFootprint = kFALSE;
1508  //************************************************************
1509  // Lepton Footprint Removal
1510  //************************************************************
1511  for (reco::GsfElectronCollection::const_iterator iE = IdentifiedElectrons.begin();
1512  iE != IdentifiedElectrons.end(); ++iE) {
1513  //if pf candidate matches an electron passing ID cuts, then veto it
1514  if(iP->gsfTrackRef().isNonnull() && iE->gsfTrack().isNonnull() &&
1515  refToPtr(iP->gsfTrackRef()) == refToPtr(iE->gsfTrack())) IsLeptonFootprint = kTRUE;
1516  if(iP->trackRef().isNonnull() && iE->closestCtfTrackRef().isNonnull() &&
1517  refToPtr(iP->trackRef()) == refToPtr(iE->closestCtfTrackRef())) IsLeptonFootprint = kTRUE;
1518 
1519  //if pf candidate lies in veto regions of electron passing ID cuts, then veto it
1520  double tmpDR = sqrt(pow(iP->eta() - iE->eta(),2) + pow(acos(cos(iP->phi() - iE->phi())),2));
1521  if(iP->trackRef().isNonnull() && fabs(iE->superCluster()->eta()) >= 1.479
1522  && tmpDR < 0.015) IsLeptonFootprint = kTRUE;
1523  if(iP->particleId() == reco::PFCandidate::gamma && fabs(iE->superCluster()->eta()) >= 1.479
1524  && tmpDR < 0.08) IsLeptonFootprint = kTRUE;
1525  }
1526  for (reco::MuonCollection::const_iterator iM = IdentifiedMuons.begin();
1527  iM != IdentifiedMuons.end(); ++iM) {
1528  //if pf candidate matches an muon passing ID cuts, then veto it
1529  if(iP->trackRef().isNonnull() && iM->innerTrack().isNonnull() &&
1530  refToPtr(iP->trackRef()) == refToPtr(iM->innerTrack())) IsLeptonFootprint = kTRUE;
1531 
1532  //if pf candidate lies in veto regions of muon passing ID cuts, then veto it
1533  double tmpDR = sqrt(pow(iP->eta() - iM->eta(),2) + pow(acos(cos(iP->phi() - iM->phi())),2));
1534  if(iP->trackRef().isNonnull() && tmpDR < 0.01) IsLeptonFootprint = kTRUE;
1535  }
1536 
1537  if (!IsLeptonFootprint) {
1538  Bool_t passVeto = kTRUE;
1539  //Charged
1540  if(iP->trackRef().isNonnull()) {
1541  if (!(fabs(iP->trackRef()->dz(vertex.position()) - electronTrackZ) < 0.2)) passVeto = kFALSE;
1542  //************************************************************
1543  // Veto any PFmuon, or PFEle
1544  if (iP->particleId() == reco::PFCandidate::e || iP->particleId() == reco::PFCandidate::mu) passVeto = kFALSE;
1545  //************************************************************
1546  //************************************************************
1547  // Footprint Veto
1548  if (fabs(fMVAVar_eta) > 1.479 && dr < 0.015) passVeto = kFALSE;
1549  //************************************************************
1550  if (passVeto) {
1551  if (dr < 0.1) tmpChargedIso_DR0p0To0p1 += iP->pt();
1552  if (dr >= 0.1 && dr < 0.2) tmpChargedIso_DR0p1To0p2 += iP->pt();
1553  if (dr >= 0.2 && dr < 0.3) tmpChargedIso_DR0p2To0p3 += iP->pt();
1554  if (dr >= 0.3 && dr < 0.4) tmpChargedIso_DR0p3To0p4 += iP->pt();
1555  if (dr >= 0.4 && dr < 0.5) tmpChargedIso_DR0p4To0p5 += iP->pt();
1556  } //pass veto
1557  }
1558  //Gamma
1559  else if (iP->particleId() == reco::PFCandidate::gamma) {
1560  //************************************************************
1561  // Footprint Veto
1562  if (fabs(fMVAVar_eta) > 1.479 && dr < 0.08) passVeto = kFALSE;
1563  //************************************************************
1564  if (passVeto) {
1565  if (dr < 0.1) tmpGammaIso_DR0p0To0p1 += iP->pt();
1566  if (dr >= 0.1 && dr < 0.2) tmpGammaIso_DR0p1To0p2 += iP->pt();
1567  if (dr >= 0.2 && dr < 0.3) tmpGammaIso_DR0p2To0p3 += iP->pt();
1568  if (dr >= 0.3 && dr < 0.4) tmpGammaIso_DR0p3To0p4 += iP->pt();
1569  if (dr >= 0.4 && dr < 0.5) tmpGammaIso_DR0p4To0p5 += iP->pt();
1570  }
1571  }
1572  //NeutralHadron
1573  else {
1574  if (dr < 0.1) tmpNeutralHadronIso_DR0p0To0p1 += iP->pt();
1575  if (dr >= 0.1 && dr < 0.2) tmpNeutralHadronIso_DR0p1To0p2 += iP->pt();
1576  if (dr >= 0.2 && dr < 0.3) tmpNeutralHadronIso_DR0p2To0p3 += iP->pt();
1577  if (dr >= 0.3 && dr < 0.4) tmpNeutralHadronIso_DR0p3To0p4 += iP->pt();
1578  if (dr >= 0.4 && dr < 0.5) tmpNeutralHadronIso_DR0p4To0p5 += iP->pt();
1579  }
1580  } //not lepton footprint
1581  } //in 1.0 dr cone
1582  } //loop over PF candidates
1583 
1584  fMVAVar_ChargedIso_DR0p0To0p1 = TMath::Min((tmpChargedIso_DR0p0To0p1)/ele.pt(), 2.5);
1585  fMVAVar_ChargedIso_DR0p1To0p2 = TMath::Min((tmpChargedIso_DR0p1To0p2)/ele.pt(), 2.5);
1586  fMVAVar_ChargedIso_DR0p2To0p3 = TMath::Min((tmpChargedIso_DR0p2To0p3)/ele.pt(), 2.5);
1587  fMVAVar_ChargedIso_DR0p3To0p4 = TMath::Min((tmpChargedIso_DR0p3To0p4)/ele.pt(), 2.5);
1588  fMVAVar_ChargedIso_DR0p4To0p5 = TMath::Min((tmpChargedIso_DR0p4To0p5)/ele.pt(), 2.5);
1599 
1600  if (printDebug) {
1601  cout << "UseBinnedVersion=" << fUseBinnedVersion << " -> BIN: " << fMVAVar_eta << " " << fMVAVar_pt << " : " << GetMVABin(fMVAVar_eta,fMVAVar_pt) << endl;
1602  }
1603 
1604  // evaluate
1605  bindVariables();
1606  Double_t mva = -9999;
1607 
1608 // mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
1609  if (fUseBinnedVersion) {
1610  mva = fTMVAReader[GetMVABin(fMVAVar_eta,fMVAVar_pt)]->EvaluateMVA(fMethodname);
1611  } else {
1612  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
1613  }
1614 
1615 
1616  if(printDebug) {
1617  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1618  cout << "ChargedIso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1623  << fMVAVar_ChargedIso_DR0p4To0p5 << endl;
1624  cout << "PF Gamma Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1625  << fMVAVar_GammaIso_DR0p0To0p1 << " "
1626  << fMVAVar_GammaIso_DR0p1To0p2 << " "
1627  << fMVAVar_GammaIso_DR0p2To0p3 << " "
1628  << fMVAVar_GammaIso_DR0p3To0p4 << " "
1629  << fMVAVar_GammaIso_DR0p4To0p5 << endl;
1630  cout << "PF Neutral Hadron Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
1636  << endl;
1637  cout << " ### MVA " << mva << endl;
1638  }
1639 
1640 
1641  return mva;
1642 }
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
virtual float pt() const
transverse momentum
virtual float phi() const
momentum azimuthal angle
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
TrackRef closestCtfTrackRef() const
Definition: GsfElectron.h:199
virtual float eta() const
momentum pseudorapidity
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
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 891 of file EGammaMvaEleEstimator.cc.

References 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, 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().

910  {
911 
912  if (!fisInitialized) {
913  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
914  return -9999;
915  }
916 
917  fMVAVar_ChargedIso_DR0p0To0p1 = TMath::Min((ChargedIso_DR0p0To0p1)/Pt, 2.5);
918  fMVAVar_ChargedIso_DR0p1To0p2 = TMath::Min((ChargedIso_DR0p1To0p2)/Pt, 2.5);
919  fMVAVar_ChargedIso_DR0p2To0p3 = TMath::Min((ChargedIso_DR0p2To0p3)/Pt, 2.5);
920  fMVAVar_ChargedIso_DR0p3To0p4 = TMath::Min((ChargedIso_DR0p3To0p4)/Pt, 2.5);
921  fMVAVar_ChargedIso_DR0p4To0p5 = TMath::Min((ChargedIso_DR0p4To0p5)/Pt, 2.5);
932 
933  // evaluate
934  Double_t mva = fTMVAReader[GetMVABin(Eta,Pt)]->EvaluateMVA(fMethodname);
935 
936  if(printDebug) {
937  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
938  cout << "ChargedIso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
944  cout << "PF Gamma Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
949  << fMVAVar_GammaIso_DR0p4To0p5 << endl;
950  cout << "PF Neutral Hadron Iso ( 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 ): "
956  << endl;
957  cout << " ### MVA " << mva << endl;
958  }
959 
960  return mva;
961 
962 }
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
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(), 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 968 of file EGammaMvaEleEstimator.cc.

References IPTools::absoluteImpactParameter3D(), 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, 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.

972  {
973 
974  if (!fisInitialized) {
975  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
976  return -9999;
977  }
978 
980  std::cout << "Error: This method should be called for kTrig or kNonTrig MVA only" << endl;
981  return -9999;
982  }
983 
984  bool validKF= false;
985  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
986  validKF = (myTrackRef.isAvailable());
987  validKF = (myTrackRef.isNonnull());
988 
989  // Pure tracking variables
990  fMVAVar_fbrem = ele.fbrem();
991  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
992  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
993  fMVAVar_kfhitsall = (validKF) ? myTrackRef->numberOfValidHits() : -1. ; // save also this in your ntuple as possible alternative
994  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
995 
996 
997  // Geometrical matchings
1001 
1002 
1003  // Pure ECAL -> shower shapes
1004  fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1005  std::vector<float> vCov = myEcalCluster.localCovariances(*(ele.superCluster()->seed())) ;
1006  if (!isnan(vCov[2])) fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi
1007  else fMVAVar_spp = 0.;
1008 
1009  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1010  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1011  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ;
1012  fMVAVar_R9 = myEcalCluster.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy();
1013 
1014  // Energy matching
1015  fMVAVar_HoE = ele.hadronicOverEm();
1017  fMVAVar_IoEmIoP = (1.0/ele.ecalEnergy()) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p()
1019  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1020 
1021 
1022  // Spectators
1023  fMVAVar_eta = ele.superCluster()->eta();
1024  fMVAVar_pt = ele.pt();
1025 
1026 
1027 
1028  // for triggering electrons get the impact parameteres
1029  if(fMVAType == kTrig) {
1030  //d0
1031  if (ele.gsfTrack().isNonnull()) {
1032  fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position());
1033  } else if (ele.closestCtfTrackRef().isNonnull()) {
1034  fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position());
1035  } else {
1036  fMVAVar_d0 = -9999.0;
1037  }
1038 
1039  //default values for IP3D
1040  fMVAVar_ip3d = -999.0;
1041  fMVAVar_ip3dSig = 0.0;
1042  if (ele.gsfTrack().isNonnull()) {
1043  const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.;
1044 
1045  const reco::TransientTrack &tt = transientTrackBuilder.build(ele.gsfTrack());
1046  const std::pair<bool,Measurement1D> &ip3dpv = IPTools::absoluteImpactParameter3D(tt,vertex);
1047  if (ip3dpv.first) {
1048  double ip3d = gsfsign*ip3dpv.second.value();
1049  double ip3derr = ip3dpv.second.error();
1050  fMVAVar_ip3d = ip3d;
1051  fMVAVar_ip3dSig = ip3d/ip3derr;
1052  }
1053  }
1054  }
1055 
1056 
1057  // evaluate
1058  bindVariables();
1059  Double_t mva = -9999;
1060  if (fUseBinnedVersion) {
1061  mva = fTMVAReader[GetMVABin(fMVAVar_eta,fMVAVar_pt)]->EvaluateMVA(fMethodname);
1062  } else {
1063  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
1064  }
1065 
1066 
1067 
1068  if(printDebug) {
1069  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1070  cout << " fbrem " << fMVAVar_fbrem
1071  << " kfchi2 " << fMVAVar_kfchi2
1072  << " mykfhits " << fMVAVar_kfhits
1073  << " gsfchi2 " << fMVAVar_gsfchi2
1074  << " deta " << fMVAVar_deta
1075  << " dphi " << fMVAVar_dphi
1076  << " detacalo " << fMVAVar_detacalo
1077  << " see " << fMVAVar_see
1078  << " spp " << fMVAVar_spp
1079  << " etawidth " << fMVAVar_etawidth
1080  << " phiwidth " << fMVAVar_phiwidth
1081  << " OneMinusE1x5E5x5 " << fMVAVar_OneMinusE1x5E5x5
1082  << " R9 " << fMVAVar_R9
1083  << " HoE " << fMVAVar_HoE
1084  << " EoP " << fMVAVar_EoP
1085  << " IoEmIoP " << fMVAVar_IoEmIoP
1086  << " eleEoPout " << fMVAVar_eleEoPout
1087  << " d0 " << fMVAVar_d0
1088  << " ip3d " << fMVAVar_ip3d
1089  << " eta " << fMVAVar_eta
1090  << " pt " << fMVAVar_pt << endl;
1091  cout << " ### MVA " << mva << endl;
1092  }
1093 
1094 
1095 
1096  return mva;
1097 }
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
virtual float pt() const
transverse momentum
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
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
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 1101 of file EGammaMvaEleEstimator.cc.

References 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, 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().

1106  {
1107 
1108  if (!fisInitialized) {
1109  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1110  return -9999;
1111  }
1112 
1114  std::cout << "Error: This method should be called for kTrigNoIP MVA only" << endl;
1115  return -9999;
1116  }
1117 
1118  bool validKF= false;
1119  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
1120  validKF = (myTrackRef.isAvailable());
1121  validKF = (myTrackRef.isNonnull());
1122 
1123  // Pure tracking variables
1124  fMVAVar_fbrem = ele.fbrem();
1125  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
1126  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
1127  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
1128 
1129 
1130  // Geometrical matchings
1134 
1135 
1136  // Pure ECAL -> shower shapes
1137  fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1138  std::vector<float> vCov = myEcalCluster.localCovariances(*(ele.superCluster()->seed())) ;
1139  if (!isnan(vCov[2])) fMVAVar_spp = sqrt (vCov[2]); //EleSigmaIPhiIPhi
1140  else fMVAVar_spp = 0.;
1141 
1142 
1143  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1144  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1145  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ;
1146  fMVAVar_R9 = myEcalCluster.e3x3(*(ele.superCluster()->seed())) / ele.superCluster()->rawEnergy();
1147 
1148 
1149  // Energy matching
1150  fMVAVar_HoE = ele.hadronicOverEm();
1152  fMVAVar_IoEmIoP = (1.0/ele.superCluster()->energy()) - (1.0 / ele.gsfTrack()->p()); // in the future to be changed with ele.gsfTrack()->p()
1154  fMVAVar_rho = rho;
1155  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1156 
1157 
1158  // Spectators
1159  fMVAVar_eta = ele.superCluster()->eta();
1160  fMVAVar_pt = ele.pt();
1161 
1162 
1163 
1164 
1165 
1166  // evaluate
1167  bindVariables();
1168  Double_t mva = -9999;
1169  if (fUseBinnedVersion) {
1170  mva = fTMVAReader[GetMVABin(fMVAVar_eta,fMVAVar_pt)]->EvaluateMVA(fMethodname);
1171  } else {
1172  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
1173  }
1174 
1175 
1176 
1177  if(printDebug) {
1178  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1179  cout << " fbrem " << fMVAVar_fbrem
1180  << " kfchi2 " << fMVAVar_kfchi2
1181  << " mykfhits " << fMVAVar_kfhits
1182  << " gsfchi2 " << fMVAVar_gsfchi2
1183  << " deta " << fMVAVar_deta
1184  << " dphi " << fMVAVar_dphi
1185  << " detacalo " << fMVAVar_detacalo
1186  // << " dphicalo " << fMVAVar_dphicalo
1187  << " see " << fMVAVar_see
1188  << " spp " << fMVAVar_spp
1189  << " etawidth " << fMVAVar_etawidth
1190  << " phiwidth " << fMVAVar_phiwidth
1191  << " e1x5e5x5 " << fMVAVar_OneMinusE1x5E5x5
1192  << " R9 " << fMVAVar_R9
1193  // << " mynbrems " << fMVAVar_nbrems
1194  << " HoE " << fMVAVar_HoE
1195  << " EoP " << fMVAVar_EoP
1196  << " IoEmIoP " << fMVAVar_IoEmIoP
1197  << " eleEoPout " << fMVAVar_eleEoPout
1198  << " rho " << fMVAVar_rho
1199  // << " EoPout " << fMVAVar_EoPout
1200  << " eta " << fMVAVar_eta
1201  << " pt " << fMVAVar_pt << endl;
1202  cout << " ### MVA " << mva << endl;
1203  }
1204 
1205 
1206 
1207  return mva;
1208 }
bool isAvailable() const
Definition: Ref.h:614
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
virtual float pt() const
transverse momentum
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
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
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 1335 of file EGammaMvaEleEstimator.cc.

References 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, 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().

1337  {
1338 
1339  if (!fisInitialized) {
1340  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1341  return -9999;
1342  }
1343 
1345  std::cout << "Error: This method should be called for kTrigNoIP mva only" << endl;
1346  return -9999;
1347  }
1348 
1349 
1350  bool validKF= false;
1351  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
1352  validKF = (myTrackRef.isAvailable());
1353  validKF = (myTrackRef.isNonnull());
1354 
1355  // Pure tracking variables
1356  fMVAVar_fbrem = ele.fbrem();
1357  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
1358  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
1359  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
1360 
1361 
1362  // Geometrical matchings
1366 
1367 
1368  // Pure ECAL -> shower shapes
1369  fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1370 
1371  fMVAVar_spp = ele.sigmaIphiIphi();
1372 
1373  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1374  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1375  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ;
1376  fMVAVar_R9 = ele.r9();
1377 
1378  // Energy matching
1379  fMVAVar_HoE = ele.hadronicOverEm();
1381  fMVAVar_IoEmIoP = (1.0/ele.superCluster()->energy()) - (1.0 / ele.gsfTrack()->p()); // in the future to be changed with ele.gsfTrack()->p()
1383  fMVAVar_rho = rho;
1384  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1385 
1386 
1387  // Spectators
1388  fMVAVar_eta = ele.superCluster()->eta();
1389  fMVAVar_pt = ele.pt();
1390 
1391 
1392 
1393 
1394 
1395  // evaluate
1396  bindVariables();
1397  Double_t mva = -9999;
1398  if (fUseBinnedVersion) {
1399  mva = fTMVAReader[GetMVABin(fMVAVar_eta,fMVAVar_pt)]->EvaluateMVA(fMethodname);
1400  } else {
1401  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
1402  }
1403 
1404 
1405 
1406  if(printDebug) {
1407  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1408  cout << " fbrem " << fMVAVar_fbrem
1409  << " kfchi2 " << fMVAVar_kfchi2
1410  << " mykfhits " << fMVAVar_kfhits
1411  << " gsfchi2 " << fMVAVar_gsfchi2
1412  << " deta " << fMVAVar_deta
1413  << " dphi " << fMVAVar_dphi
1414  << " detacalo " << fMVAVar_detacalo
1415  // << " dphicalo " << fMVAVar_dphicalo
1416  << " see " << fMVAVar_see
1417  << " spp " << fMVAVar_spp
1418  << " etawidth " << fMVAVar_etawidth
1419  << " phiwidth " << fMVAVar_phiwidth
1420  << " e1x5e5x5 " << fMVAVar_OneMinusE1x5E5x5
1421  << " R9 " << fMVAVar_R9
1422  // << " mynbrems " << fMVAVar_nbrems
1423  << " HoE " << fMVAVar_HoE
1424  << " EoP " << fMVAVar_EoP
1425  << " IoEmIoP " << fMVAVar_IoEmIoP
1426  << " eleEoPout " << fMVAVar_eleEoPout
1427  << " rho " << fMVAVar_rho
1428  // << " EoPout " << fMVAVar_EoPout
1429  << " eta " << fMVAVar_eta
1430  << " pt " << fMVAVar_pt << endl;
1431  cout << " ### MVA " << mva << endl;
1432  }
1433 
1434 
1435 
1436  return mva;
1437 }
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
virtual float pt() const
transverse momentum
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
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
Double_t EGammaMvaEleEstimator::mvaValue ( const pat::Electron ele,
const reco::Vertex vertex,
double  rho,
bool  printDebug = kFALSE 
)

Definition at line 1211 of file EGammaMvaEleEstimator.cc.

References 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, fTMVAReader, 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().

1214  {
1215 
1216  if (!fisInitialized) {
1217  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
1218  return -9999;
1219  }
1220 
1221  bool validKF= false;
1222  reco::TrackRef myTrackRef = ele.closestCtfTrackRef();
1223  validKF = (myTrackRef.isAvailable());
1224  validKF = (myTrackRef.isNonnull());
1225 
1226  // Pure tracking variables
1227  fMVAVar_fbrem = ele.fbrem();
1228  fMVAVar_kfchi2 = (validKF) ? myTrackRef->normalizedChi2() : 0 ;
1229  fMVAVar_kfhits = (validKF) ? myTrackRef->hitPattern().trackerLayersWithMeasurement() : -1. ;
1230  fMVAVar_gsfchi2 = ele.gsfTrack()->normalizedChi2();
1231 
1232 
1233  // Geometrical matchings
1237 
1238  // Pure ECAL -> shower shapes
1239  fMVAVar_see = ele.sigmaIetaIeta(); //EleSigmaIEtaIEta
1240 
1241  fMVAVar_spp = ele.sigmaIphiIphi();
1242 
1243  fMVAVar_etawidth = ele.superCluster()->etaWidth();
1244  fMVAVar_phiwidth = ele.superCluster()->phiWidth();
1245  fMVAVar_OneMinusE1x5E5x5 = (ele.e5x5()) !=0. ? 1.-(ele.e1x5()/ele.e5x5()) : -1. ;
1246  fMVAVar_R9 = ele.r9();
1247 
1248  // Energy matching
1249  fMVAVar_HoE = ele.hadronicOverEm();
1251 
1252  // unify this in the future?
1253  if( fMVAType == kTrig || fMVAType == kNonTrig){
1254  fMVAVar_IoEmIoP = (1.0/ele.ecalEnergy()) - (1.0 / ele.p()); // in the future to be changed with ele.gsfTrack()->p()
1255  }else{
1256  fMVAVar_IoEmIoP = (1.0/ele.superCluster()->energy()) - (1.0 / ele.gsfTrack()->p()); // in the future to be changed with ele.gsfTrack()->p()
1257  }
1259  fMVAVar_rho = rho;
1260  fMVAVar_PreShowerOverRaw= ele.superCluster()->preshowerEnergy() / ele.superCluster()->rawEnergy();
1261 
1262  // for triggering electrons get the impact parameteres
1263  if(fMVAType == kTrig) {
1264  //d0
1265  if (ele.gsfTrack().isNonnull()) {
1266  fMVAVar_d0 = (-1.0)*ele.gsfTrack()->dxy(vertex.position());
1267  } else if (ele.closestCtfTrackRef().isNonnull()) {
1268  fMVAVar_d0 = (-1.0)*ele.closestCtfTrackRef()->dxy(vertex.position());
1269  } else {
1270  fMVAVar_d0 = -9999.0;
1271  }
1272 
1273  //default values for IP3D
1274  fMVAVar_ip3d = -999.0;
1275  fMVAVar_ip3dSig = 0.0;
1276  if (ele.gsfTrack().isNonnull()) {
1277  const double gsfsign = ( (-ele.gsfTrack()->dxy(vertex.position())) >=0 ) ? 1. : -1.;
1278 
1279  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;
1280  double ip3d = gsfsign*ele.dB();
1281  double ip3derr = ele.edB();
1282  fMVAVar_ip3d = ip3d;
1283  fMVAVar_ip3dSig = ip3d/ip3derr;
1284  }
1285  }
1286 
1287  // Spectators
1288  fMVAVar_eta = ele.superCluster()->eta();
1289  fMVAVar_pt = ele.pt();
1290 
1291  // evaluate
1292  bindVariables();
1293  Double_t mva = -9999;
1294  if (fUseBinnedVersion) {
1295  mva = fTMVAReader[GetMVABin(fMVAVar_eta,fMVAVar_pt)]->EvaluateMVA(fMethodname);
1296  } else {
1297  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
1298  }
1299 
1300  if(printDebug) {
1301  cout << " *** Inside the class fMethodname " << fMethodname << " fMVAType " << fMVAType << endl;
1302  cout << " fbrem " << fMVAVar_fbrem
1303  << " kfchi2 " << fMVAVar_kfchi2
1304  << " mykfhits " << fMVAVar_kfhits
1305  << " gsfchi2 " << fMVAVar_gsfchi2
1306  << " deta " << fMVAVar_deta
1307  << " dphi " << fMVAVar_dphi
1308  << " detacalo " << fMVAVar_detacalo
1309  // << " dphicalo " << fMVAVar_dphicalo
1310  << " see " << fMVAVar_see
1311  << " spp " << fMVAVar_spp
1312  << " etawidth " << fMVAVar_etawidth
1313  << " phiwidth " << fMVAVar_phiwidth
1314  << " e1x5e5x5 " << fMVAVar_OneMinusE1x5E5x5
1315  << " R9 " << fMVAVar_R9
1316  // << " mynbrems " << fMVAVar_nbrems
1317  << " HoE " << fMVAVar_HoE
1318  << " EoP " << fMVAVar_EoP
1319  << " IoEmIoP " << fMVAVar_IoEmIoP
1320  << " eleEoPout " << fMVAVar_eleEoPout
1321  << " rho " << fMVAVar_rho
1322  // << " EoPout " << fMVAVar_EoPout
1323  << " d0 " << fMVAVar_d0
1324  << " ip3d " << fMVAVar_ip3d
1325  << " eta " << fMVAVar_eta
1326  << " pt " << fMVAVar_pt << endl;
1327  cout << " ### MVA " << mva << endl;
1328  }
1329 
1330  return mva;
1331 }
float sigmaIphiIphi() const
Definition: GsfElectron.h:403
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
virtual float pt() const
transverse momentum
float eSuperClusterOverP() const
Definition: GsfElectron.h:243
double edB(IpType type=None) const
Uncertainty on the corresponding impact parameter.
Definition: DDAxes.h:10
float fbrem() const
Definition: GsfElectron.h:684
UInt_t GetMVABin(double eta, double pt) const
const Point & position() const
position
Definition: Vertex.h:106
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
double dB(IpType type=None) const
Impact parameter wrt primary vertex or beamspot.
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 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
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(), 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
bool first
Definition: L1TdeRCT.cc:75
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 538 of file EGammaMvaEleEstimator.cc.

References 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, fTMVAReader, fUseBinnedVersion, GetMVABin(), kTrigNoIP, EnergyCorrector::pt, and rho.

559  {
560 
561  if (!fisInitialized) {
562  std::cout << "Error: EGammaMvaEleEstimator not properly initialized.\n";
563  return -9999;
564  }
565 
567  std::cout << "Error: This method should be called for kTrigNoIP MVA only" << endl;
568  return -9999;
569  }
570 
571  fMVAVar_fbrem = fbrem;
572  fMVAVar_kfchi2 = kfchi2;
573  fMVAVar_kfhits = float(kfhits); // BTD does not support int variables
574  fMVAVar_gsfchi2 = gsfchi2;
575 
576  fMVAVar_deta = deta;
577  fMVAVar_dphi = dphi;
578  fMVAVar_detacalo = detacalo;
579 
580  fMVAVar_see = see;
581  fMVAVar_spp = spp;
582  fMVAVar_etawidth = etawidth;
583  fMVAVar_phiwidth = phiwidth;
584  fMVAVar_OneMinusE1x5E5x5 = e1x5e5x5;
585  fMVAVar_R9 = R9;
586 
587  fMVAVar_HoE = HoE;
588  fMVAVar_EoP = EoP;
589  fMVAVar_IoEmIoP = IoEmIoP;
590  fMVAVar_eleEoPout = eleEoPout;
591  fMVAVar_rho = rho;
592  fMVAVar_PreShowerOverRaw= PreShowerOverRaw;
593 
594 
595  fMVAVar_eta = eta;
596  fMVAVar_pt = pt;
597 
598 
599  bindVariables();
600  Double_t mva = -9999;
601  if (fUseBinnedVersion) {
603  } else {
604  mva = fTMVAReader[0]->EvaluateMVA(fMethodname);
605  }
606 
607  if(printDebug) {
608  cout << " *** Inside the class fMethodname " << fMethodname << endl;
609  cout << " fbrem " << fMVAVar_fbrem
610  << " kfchi2 " << fMVAVar_kfchi2
611  << " mykfhits " << fMVAVar_kfhits
612  << " gsfchi2 " << fMVAVar_gsfchi2
613  << " deta " << fMVAVar_deta
614  << " dphi " << fMVAVar_dphi
615  << " detacalo " << fMVAVar_detacalo
616  << " see " << fMVAVar_see
617  << " spp " << fMVAVar_spp
618  << " etawidth " << fMVAVar_etawidth
619  << " phiwidth " << fMVAVar_phiwidth
620  << " e1x5e5x5 " << fMVAVar_OneMinusE1x5E5x5
621  << " R9 " << fMVAVar_R9
622  << " HoE " << fMVAVar_HoE
623  << " EoP " << fMVAVar_EoP
624  << " IoEmIoP " << fMVAVar_IoEmIoP
625  << " eleEoPout " << fMVAVar_eleEoPout
626  << " rho " << fMVAVar_rho
627  << " PreShowerOverRaw " << fMVAVar_PreShowerOverRaw
628  << " eta " << fMVAVar_eta
629  << " pt " << fMVAVar_pt << endl;
630  cout << " ### MVA " << mva << endl;
631  }
632 
633 
634  return mva;
635 }
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
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 280 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 268 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 284 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::Reader * > EGammaMvaEleEstimator::fTMVAReader
private
Bool_t EGammaMvaEleEstimator::fUseBinnedVersion
private

Definition at line 116 of file EGammaMvaEleEstimator.h.

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