Reimplemented from ElectronIDAlgo.
Definition at line 39 of file PTDRElectronID.cc.
References acceptCracks_, reco::GsfElectron::caloEnergy(), reco::GsfElectron::classification(), EcalClusterLazyTools::covariances(), cuts_, reco::GsfElectron::deltaEtaSuperClusterTrackAtVtx(), reco::GsfElectron::deltaPhiSeedClusterTrackAtCalo(), reco::GsfElectron::deltaPhiSuperClusterTrackAtVtx(), EcalClusterLazyTools::e3x3(), EcalClusterLazyTools::e5x5(), reco::GsfElectron::eSeedClusterOverPout(), reco::GsfElectron::eSuperClusterOverP(), ElectronIDAlgo::getClusterShape(), edm::ParameterSet::getParameter(), reco::GsfElectron::hadronicOverEm(), funct::sqrt(), reco::GsfElectron::superCluster(), reco::GsfElectron::trackMomentumAtVtx(), reco::GsfElectron::trackMomentumOut(), useBremFraction_, useDeltaEtaIn_, useDeltaPhiIn_, useDeltaPhiOut_, useE9overE25_, useEoverPIn_, useEoverPOut_, useHoverE_, useInvEMinusInvP_, useSigmaEtaEta_, useSigmaPhiPhi_, value, and variables_.
00041 {
00042
00043
00044
00045 int icut=0;
00046 switch (electron->classification()) {
00047 case 0: icut=0; break;
00048 case 10: icut=1; break;
00049 case 20: icut=2; break;
00050 case 30: icut=3; break;
00051 case 31: icut=3; break;
00052 case 32: icut=3; break;
00053 case 33: icut=3; break;
00054 case 34: icut=3; break;
00055 case 40: icut=8; break;
00056 case 100: icut=4; break;
00057 case 110: icut=5; break;
00058 case 120: icut=6; break;
00059 case 130: icut=7; break;
00060 case 131: icut=7; break;
00061 case 132: icut=7; break;
00062 case 133: icut=7; break;
00063 case 134: icut=7; break;
00064
00065 default:
00066 edm::LogError("CutBasedElectronID") << "Error: unrecognized electron classification ";
00067 break;
00068 }
00069
00070 if (acceptCracks_[variables_])
00071 if (electron->classification()==40) return 1.;
00072
00073 if (useEoverPIn_[variables_]) {
00074 double value = electron->eSuperClusterOverP();
00075 std::vector<double> maxcut = cuts_.getParameter<std::vector<double> >("EoverPInMax");
00076 std::vector<double> mincut = cuts_.getParameter<std::vector<double> >("EoverPInMin");
00077 if (value<mincut[icut] || value>maxcut[icut]) return 0.;
00078 }
00079
00080 if (useDeltaEtaIn_[variables_]) {
00081 double value = electron->deltaEtaSuperClusterTrackAtVtx();
00082 std::vector<double> maxcut = cuts_.getParameter<std::vector<double> >("deltaEtaIn");
00083 if (fabs(value)>maxcut[icut]) return 0.;
00084 }
00085
00086 if (useDeltaPhiIn_[variables_]) {
00087 double value = electron->deltaPhiSuperClusterTrackAtVtx();
00088 std::vector<double> maxcut = cuts_.getParameter<std::vector<double> >("deltaPhiIn");
00089 if (fabs(value)>maxcut[icut]) return 0.;
00090 }
00091
00092 if (useHoverE_[variables_]) {
00093 double value = electron->hadronicOverEm();
00094 std::vector<double> maxcut = cuts_.getParameter<std::vector<double> >("HoverE");
00095 if (fabs(value)>maxcut[icut]) return 0.;
00096 }
00097
00098 if (useEoverPOut_[variables_]) {
00099 double value = electron->eSeedClusterOverPout();
00100 std::vector<double> maxcut = cuts_.getParameter<std::vector<double> >("EoverPOutMax");
00101 std::vector<double> mincut = cuts_.getParameter<std::vector<double> >("EoverPOutMin");
00102 if (value<mincut[icut] || value>maxcut[icut]) return 0.;
00103 }
00104
00105 if (useDeltaPhiOut_[variables_]) {
00106 double value = electron->deltaPhiSeedClusterTrackAtCalo();
00107 std::vector<double> maxcut = cuts_.getParameter<std::vector<double> >("deltaPhiOut");
00108 if (fabs(value)>maxcut[icut]) return 0.;
00109 }
00110
00111 if (useInvEMinusInvP_[variables_]) {
00112 double value = (1./electron->caloEnergy())-(1./electron->trackMomentumAtVtx().R());
00113 std::vector<double> maxcut = cuts_.getParameter<std::vector<double> >("invEMinusInvP");
00114 if (value>maxcut[icut]) return 0.;
00115 }
00116
00117 if (useBremFraction_[variables_]) {
00118 double value = electron->trackMomentumAtVtx().R()-electron->trackMomentumOut().R();
00119 std::vector<double> mincut = cuts_.getParameter<std::vector<double> >("bremFraction");
00120 if (value<mincut[icut]) return 0.;
00121 }
00122
00123 EcalClusterLazyTools lazyTools = getClusterShape(e,es);
00124 std::vector<float> vCov = lazyTools.covariances(*(electron->superCluster()->seed())) ;
00125
00126 if (useE9overE25_[variables_]) {
00127 double value = lazyTools.e3x3(*(electron->superCluster()->seed()))/lazyTools.e5x5(*(electron->superCluster()->seed()));
00128 std::vector<double> mincut = cuts_.getParameter<std::vector<double> >("E9overE25");
00129 if (fabs(value)<mincut[icut]) return 0.;
00130 }
00131
00132 if (useSigmaEtaEta_[variables_]) {
00133 std::vector<double> maxcut = cuts_.getParameter<std::vector<double> >("sigmaEtaEtaMax");
00134 std::vector<double> mincut = cuts_.getParameter<std::vector<double> >("sigmaEtaEtaMin");
00135 if (sqrt(vCov[0])<mincut[icut] || sqrt(vCov[0])>maxcut[icut]) return 0.;
00136 }
00137
00138 if (useSigmaPhiPhi_[variables_]) {
00139 std::vector<double> mincut = cuts_.getParameter<std::vector<double> >("sigmaPhiPhiMin");
00140 std::vector<double> maxcut = cuts_.getParameter<std::vector<double> >("sigmaPhiPhiMax");
00141 if (sqrt(vCov[1])<mincut[icut] || sqrt(vCov[1])>maxcut[icut]) return 0.;
00142 }
00143
00144 return 1.;
00145
00146 }