22 if (
type_ ==
"classbased" and (version_ ==
"V06")) {
26 if (
type_ ==
"classbased" and (version_ ==
"V03" or version_ ==
"V04" or version_ ==
"V05" or version_.empty())) {
31 if (
type_ ==
"robust" ||
type_ ==
"classbased") {
36 <<
"Invalid electronType parameter in CutBasedElectronID: must be robust or classbased\n";
41 if (
type_ ==
"classbased")
43 else if (
type_ ==
"robust")
52 double fBrem = electron->
fbrem();
56 if ((electron->
isEB() && fBrem < 0.06) || (electron->
isEE() && fBrem < 0.1))
58 else if (eOverP < 1.2 && eOverP > 0.8)
66 if (electron->
isEB()) {
69 else if (eOverP < 1.2 && eOverP > 0.9)
76 else if (eOverP < 1.22 && eOverP > 0.82)
85 if (electron->
isEB()) {
86 if ((fBrem >= 0.12) and (eOverP > 0.9) and (eOverP < 1.2))
88 else if (((eta > .445 and eta < .45)
or (eta > .79 and eta < .81)
or (eta > 1.137 and eta < 1.157)
or
89 (eta > 1.47285 and eta < 1.4744)) and
94 else if (fBrem < 0.12)
99 if ((fBrem >= 0.2) and (eOverP > 0.82) and (eOverP < 1.22))
105 else if (fBrem < 0.2)
127 double fBrem = electron->
fbrem();
134 int mishits = electron->
gsfTrack()->missingInnerHits();
141 if (electron->
isEE())
142 sigmaee = sigmaee - 0.02 * (fabs(eta) - 2.3);
148 if (!vtxH->empty()) {
152 ip = fabs(electron->
gsfTrack()->dxy());
154 if (electron->
isEB()) {
159 std::vector<double>
cut;
164 if (electron->
isEB())
171 if ((eOverP < 0.8) && (fBrem < 0.2))
175 if (hOverE > cut[cat + 4 * eb])
179 if (sigmaee > cut[cat + 4 * eb])
184 if (fabs(deltaPhiIn) > cut[cat + 4 * eb])
187 if (fabs(deltaPhiIn) > cut[3 + 4 * eb])
192 if (fabs(deltaEtaIn) > cut[cat + 4 * eb])
196 if (eSeedOverPin < cut[cat + 4 * eb])
200 if (eOverP < 0.9 * (1 - fBrem))
219 eSeedOverPin = eSeedOverPin + fBrem;
222 tkIso = tkIso *
pow(40. / scEt, 2);
223 ecalIso = ecalIso *
pow(40. / scEt, 2);
224 hcalIso = hcalIso *
pow(40. / scEt, 2);
227 std::vector<double> cutTk =
cuts_.
getParameter<std::vector<double> >(
"cutisotk");
228 std::vector<double> cutEcal =
cuts_.
getParameter<std::vector<double> >(
"cutisoecal");
229 std::vector<double> cutHcal =
cuts_.
getParameter<std::vector<double> >(
"cutisohcal");
230 if ((tkIso > cutTk[cat + 3 * eb + bin * 6]) || (ecalIso > cutEcal[cat + 3 * eb + bin * 6]) ||
231 (hcalIso > cutHcal[cat + 3 * eb + bin * 6]))
239 std::vector<double> cutdphi =
cuts_.
getParameter<std::vector<double> >(
"cutdphiin");
240 std::vector<double> cutdeta =
cuts_.
getParameter<std::vector<double> >(
"cutdetain");
241 std::vector<double> cuteopin =
cuts_.
getParameter<std::vector<double> >(
"cuteseedopcor");
244 std::vector<double> cutmishits =
cuts_.
getParameter<std::vector<double> >(
"cutmishits");
245 if ((hOverE < cuthoe[cat + 3 * eb + bin * 6]) and (sigmaee < cutsee[cat + 3 * eb + bin * 6]) and
246 (fabs(deltaPhiIn) < cutdphi[cat + 3 * eb + bin * 6]) and
247 (fabs(deltaEtaIn) < cutdeta[cat + 3 * eb + bin * 6]) and (eSeedOverPin > cuteopin[cat + 3 * eb + bin * 6]) and
248 (ip < cutip[cat + 3 * eb + bin * 6]) and (mishits < cutmishits[cat + 3 * eb + bin * 6]))
249 result = result + 1.;
269 eSeedOverPin = eSeedOverPin + fBrem;
271 float iso_sum = tkIso + ecalIso + hcalIso;
272 float iso_sum_corrected = iso_sum *
pow(40. / scEt, 2);
274 std::vector<double> cutIsoSum =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sum");
275 std::vector<double> cutIsoSumCorr =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoet");
276 if ((iso_sum < cutIsoSum[cat + bin * 9]) and (iso_sum_corrected < cutIsoSumCorr[cat + bin * 9]))
282 std::vector<double> cutdphi =
cuts_.
getParameter<std::vector<double> >(
"cutdphiin");
283 std::vector<double> cutdeta =
cuts_.
getParameter<std::vector<double> >(
"cutdetain");
284 std::vector<double> cuteopin =
cuts_.
getParameter<std::vector<double> >(
"cuteseedopcor");
287 if ((hOverE < cuthoe[cat + bin * 9]) and (sigmaee < cutsee[cat + bin * 9]) and
288 (fabs(deltaPhiIn) < cutdphi[cat + bin * 9]) and (fabs(deltaEtaIn) < cutdeta[cat + bin * 9]) and
289 (eSeedOverPin > cuteopin[cat + bin * 9]) and (scEt > cutet[cat + bin * 9]))
293 std::vector<double> cutip =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsf");
294 if (ip < cutip[cat + bin * 9])
297 std::vector<double> cutmishits =
cuts_.
getParameter<std::vector<double> >(
"cutfmishits");
298 std::vector<double> cutdcotdist =
cuts_.
getParameter<std::vector<double> >(
"cutdcotdist");
300 float dist = (electron->
convDist() == -9999. ? 9999 : electron->
convDist());
301 float dcot = (electron->
convDcot() == -9999. ? 9999 : electron->
convDcot());
304 ((0.04 -
std::max(fabs(dist), fabs(dcot))) > 0 ? (0.04 -
std::max(fabs(dist), fabs(dcot))) : 0);
306 if ((mishits < cutmishits[cat + bin * 9]) and (dcotdistcomb < cutdcotdist[cat + bin * 9]))
313 std::vector<double> cutIsoSum =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sum");
314 std::vector<double> cutIsoSumCorr =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoet");
317 std::vector<double> cutdphi =
cuts_.
getParameter<std::vector<double> >(
"cutdphiin");
318 std::vector<double> cutdeta =
cuts_.
getParameter<std::vector<double> >(
"cutdetain");
319 std::vector<double> cuteopin =
cuts_.
getParameter<std::vector<double> >(
"cuteseedopcor");
320 std::vector<double> cutmishits =
cuts_.
getParameter<std::vector<double> >(
"cutfmishits");
321 std::vector<double> cutdcotdist =
cuts_.
getParameter<std::vector<double> >(
"cutdcotdist");
322 std::vector<double> cutip =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsf");
323 std::vector<double> cutIsoSumCorrl =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoetl");
324 std::vector<double> cuthoel =
cuts_.
getParameter<std::vector<double> >(
"cuthoel");
325 std::vector<double> cutseel =
cuts_.
getParameter<std::vector<double> >(
"cutseel");
326 std::vector<double> cutdphil =
cuts_.
getParameter<std::vector<double> >(
"cutdphiinl");
327 std::vector<double> cutdetal =
cuts_.
getParameter<std::vector<double> >(
"cutdetainl");
328 std::vector<double> cutipl =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsfl");
332 const int ncuts = 10;
333 std::vector<bool> cut_results(ncuts,
false);
335 float iso_sum = tkIso + ecalIso + hcalIso;
337 if (fabs(scEta) > 1.5)
338 iso_sum += (fabs(scEta) - 1.5) * 1.09;
340 float iso_sumoet = iso_sum * (40. / scEt);
342 float eseedopincor = eSeedOverPin + fBrem;
344 eseedopincor = eSeedOverPin;
346 float dist = (electron->
convDist() == -9999. ? 9999 : electron->
convDist());
347 float dcot = (electron->
convDcot() == -9999. ? 9999 : electron->
convDcot());
350 ((0.04 -
std::max(fabs(dist), fabs(dcot))) > 0 ? (0.04 -
std::max(fabs(dist), fabs(dcot))) : 0);
352 for (
int cut = 0; cut < ncuts; cut++) {
355 cut_results[
cut] =
compute_cut(fabs(deltaEtaIn), scEt, cutdetal[cat], cutdeta[cat]);
358 cut_results[
cut] =
compute_cut(fabs(deltaPhiIn), scEt, cutdphil[cat], cutdphi[cat]);
361 cut_results[
cut] = (eseedopincor > cuteopin[
cat]);
364 cut_results[
cut] =
compute_cut(hOverE, scEt, cuthoel[cat], cuthoe[cat]);
367 cut_results[
cut] =
compute_cut(sigmaee, scEt, cutseel[cat], cutsee[cat]);
370 cut_results[
cut] =
compute_cut(iso_sumoet, scEt, cutIsoSumCorrl[cat], cutIsoSumCorr[cat]);
373 cut_results[
cut] = (iso_sum < cutIsoSum[
cat]);
376 cut_results[
cut] =
compute_cut(fabs(ip), scEt, cutipl[cat], cutip[cat]);
379 cut_results[
cut] = (mishits < cutmishits[
cat]);
382 cut_results[
cut] = (dcotdistcomb < cutdcotdist[
cat]);
388 if (cut_results[0] & cut_results[1] & cut_results[2] & cut_results[3] & cut_results[4])
392 if (cut_results[5] & cut_results[6])
400 if (cut_results[8] & cut_results[9])
417 cut = cut_min + (1 / et_min - 1 / et) * (cut_max - cut_min) / (1 / et_min - 1 / et_max);
439 double eta = electron->
p4().Eta();
443 double e25Max = electron->
e2x5Max();
444 double e15 = electron->
e1x5();
445 double e55 = electron->
e5x5();
446 double e25Maxoe55 = e25Max / e55;
447 double e15oe55 = e15 / e55;
452 int mishits = electron->
gsfTrack()->missingInnerHits();
455 double ecalIsoPed = (electron->
isEB()) ?
std::max(0., ecalIso - 1.) : ecalIso;
462 if (electron->
isEE())
463 sigmaee = sigmaee - 0.02 * (fabs(eta) - 2.3);
473 ip = fabs(electron->
gsfTrack()->dxy(bspotPosition));
475 ip = fabs(electron->
gsfTrack()->dxy());
480 ecalIsoPed = (electron->
isEB()) ?
std::max(0., ecalIso - 1.) : ecalIso;
489 if (!vtxH->empty()) {
493 ip = fabs(electron->
gsfTrack()->dxy());
497 std::vector<double>
cut;
499 if (
type_ ==
"robust") {
503 if (electron->
isEB())
509 if ((tkIso > cut[6] || hcalIso2 > cut[11]) ||
510 (electron->
isEB() && ((ecalIso + hcalIso1) > cut[7] + cut[8] * scEt)) ||
511 (electron->
isEE() && (scEt >= 50.) && ((ecalIso + hcalIso1) > cut[7] + cut[8] * (scEt - 50))) ||
512 (electron->
isEE() && (scEt < 50.) && ((ecalIso + hcalIso1) > cut[9] + cut[10] * (scEt - 50))))
517 if ((tkIso > cut[6]) || (ecalIso > cut[7]) || (hcalIso > cut[8]) || (hcalIso1 > cut[9]) || (hcalIso2 > cut[10]) ||
518 (tkIso / electron->
p4().Pt() > cut[11]) || (ecalIso / electron->
p4().Pt() > cut[12]) ||
519 (hcalIso / electron->
p4().Pt() > cut[13]) || ((tkIso + ecalIso + hcalIso) > cut[14]) ||
520 (((tkIso + ecalIso + hcalIso) / electron->
p4().Pt()) > cut[15]) ||
521 ((tkIso + ecalIsoPed + hcalIso) > cut[16]) ||
522 (((tkIso + ecalIsoPed + hcalIso) / electron->
p4().Pt()) > cut[17]))
528 if ((hOverE < cut[0]) && (sigmaee < cut[1]) && (fabs(deltaPhiIn) < cut[2]) && (fabs(deltaEtaIn) < cut[3]) &&
529 (e25Maxoe55 > cut[4] && e15oe55 > cut[5]) && (sigmaee >= cut[18]) && (eOverP > cut[19] && eOverP < cut[20])) {
535 if (mishits > cut[22])
543 float dist = fabs(electron->
convDist());
544 float dcot = fabs(electron->
convDcot());
545 bool isConversion = (cut[24] > 99. || cut[25] > 99.) ?
false : (dist < cut[24] && dcot < cut[25]);
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const LorentzVector & p4(P4Kind kind) const
float eSuperClusterOverP() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool getByToken(EDGetToken token, Handle< PROD > &result) const
double result(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &) override
Sin< T >::type sin(const T &t)
CutBasedElectronID(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
float dr03HcalTowerSumEt(int depth=0) const
Exp< T >::type exp(const T &t)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
edm::EDGetTokenT< std::vector< reco::Vertex > > verticesCollection_
int classify(const reco::GsfElectron *)
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
float deltaEtaSuperClusterTrackAtVtx() const
float sigmaIetaIeta() const
float hadronicOverEm() const
float eSeedClusterOverP() const
float dr04EcalRecHitSumEt() const
double robustSelection(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &)
float deltaPhiSuperClusterTrackAtVtx() const
double cicSelection(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &)
float dr03TkSumPt() const
uint16_t const *__restrict__ x
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
T getParameter(std::string const &) const
void setup(const edm::ParameterSet &conf) override
float dr03EcalRecHitSumEt() const
bool compute_cut(double x, double et, double cut_min, double cut_max, bool gtn=false)
bool trackerDrivenSeed() const
const Point & position() const
position
float dr04HcalTowerSumEt(int depth=0) const
Power< A, B >::type pow(const A &a, const B &b)
SuperClusterRef superCluster() const override
reference to a SuperCluster
float sigmaEtaEta() const
bool ecalDrivenSeed() const