21 if (
type_ ==
"classbased" and (version_ ==
"V06")) {
25 if (
type_ ==
"classbased" and (version_ ==
"V03" or version_ ==
"V04" or version_ ==
"V05" or version_ ==
"")) {
30 if (
type_ ==
"robust" ||
type_ ==
"classbased") {
36 <<
"Invalid electronType parameter in CutBasedElectronID: must be robust or classbased\n";
44 if (
type_ ==
"classbased")
46 else if (
type_ ==
"robust")
57 double fBrem = electron->
fbrem();
61 if((electron->
isEB() && fBrem<0.06) || (electron->
isEE() && fBrem<0.1))
63 else if (eOverP < 1.2 && eOverP > 0.8)
71 if (electron->
isEB()) {
74 else if (eOverP < 1.2 && eOverP > 0.9)
81 else if (eOverP < 1.22 && eOverP > 0.82)
90 if (electron->
isEB()) {
91 if ((fBrem >= 0.12) and (eOverP > 0.9) and (eOverP < 1.2))
93 else if (((eta > .445 and eta < .45 )
or
94 (eta > .79 and eta < .81 )
or
95 (eta > 1.137 and eta < 1.157 )
or
100 else if (fBrem < 0.12)
105 if ((fBrem >= 0.2) and (eOverP > 0.82) and (eOverP < 1.22))
111 else if (fBrem < 0.2)
134 double fBrem = electron->
fbrem();
141 int mishits = electron->
gsfTrack()->trackerExpectedHitsInner().numberOfHits();
148 if (electron->
isEE())
149 sigmaee = sigmaee - 0.02*(fabs(eta) - 2.3);
155 if (vtxH->size() != 0) {
159 ip = fabs(electron->
gsfTrack()->dxy());
161 if (electron->
isEB()) {
166 std::vector<double>
cut;
171 if (electron->
isEB())
179 if ((eOverP < 0.8) && (fBrem < 0.2))
183 if (hOverE > cut[cat+4*eb])
187 if (sigmaee > cut[cat+4*eb])
192 if (fabs(deltaPhiIn) > cut[cat+4*eb])
195 if (fabs(deltaPhiIn) > cut[3+4*eb])
200 if (fabs(deltaEtaIn) > cut[cat+4*eb])
204 if (eSeedOverPin < cut[cat+4*eb])
208 if (eOverP < 0.9*(1-fBrem))
227 eSeedOverPin = eSeedOverPin + fBrem;
230 tkIso = tkIso*
pow(40./scEt, 2);
231 ecalIso = ecalIso*
pow(40./scEt, 2);
232 hcalIso = hcalIso*
pow(40./scEt, 2);
235 std::vector<double> cutTk =
cuts_.
getParameter<std::vector<double> >(
"cutisotk");
236 std::vector<double> cutEcal =
cuts_.
getParameter<std::vector<double> >(
"cutisoecal");
237 std::vector<double> cutHcal =
cuts_.
getParameter<std::vector<double> >(
"cutisohcal");
238 if ((tkIso > cutTk[cat+3*eb+bin*6]) ||
239 (ecalIso > cutEcal[cat+3*eb+bin*6]) ||
240 (hcalIso > cutHcal[cat+3*eb+bin*6]))
248 std::vector<double> cutdphi =
cuts_.
getParameter<std::vector<double> >(
"cutdphiin");
249 std::vector<double> cutdeta =
cuts_.
getParameter<std::vector<double> >(
"cutdetain");
250 std::vector<double> cuteopin =
cuts_.
getParameter<std::vector<double> >(
"cuteseedopcor");
253 std::vector<double> cutmishits =
cuts_.
getParameter<std::vector<double> >(
"cutmishits");
254 if ((hOverE < cuthoe[cat+3*eb+bin*6]) and
255 (sigmaee < cutsee[cat+3*eb+bin*6]) and
256 (fabs(deltaPhiIn) < cutdphi[cat+3*eb+bin*6]) and
257 (fabs(deltaEtaIn) < cutdeta[cat+3*eb+bin*6]) and
258 (eSeedOverPin > cuteopin[cat+3*eb+bin*6]) and
259 (ip < cutip[cat+3*eb+bin*6]) and
260 (mishits < cutmishits[cat+3*eb+bin*6]))
261 result = result + 1.;
281 eSeedOverPin = eSeedOverPin + fBrem;
283 float iso_sum = tkIso + ecalIso + hcalIso;
284 float iso_sum_corrected = iso_sum*
pow(40./scEt, 2);
286 std::vector<double> cutIsoSum =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sum");
287 std::vector<double> cutIsoSumCorr =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoet");
288 if ((iso_sum < cutIsoSum[cat+bin*9]) and
289 (iso_sum_corrected < cutIsoSumCorr[cat+bin*9]))
295 std::vector<double> cutdphi =
cuts_.
getParameter<std::vector<double> >(
"cutdphiin");
296 std::vector<double> cutdeta =
cuts_.
getParameter<std::vector<double> >(
"cutdetain");
297 std::vector<double> cuteopin =
cuts_.
getParameter<std::vector<double> >(
"cuteseedopcor");
300 if ((hOverE < cuthoe[cat+bin*9]) and
301 (sigmaee < cutsee[cat+bin*9]) and
302 (fabs(deltaPhiIn) < cutdphi[cat+bin*9]) and
303 (fabs(deltaEtaIn) < cutdeta[cat+bin*9]) and
304 (eSeedOverPin > cuteopin[cat+bin*9]) and
305 (scEt > cutet[cat+bin*9]))
309 std::vector<double> cutip =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsf");
310 if (ip < cutip[cat+bin*9])
313 std::vector<double> cutmishits =
cuts_.
getParameter<std::vector<double> >(
"cutfmishits");
319 float dcotdistcomb = ((0.04 -
std::max(fabs(dist), fabs(dcot))) > 0?(0.04 -
std::max(fabs(dist), fabs(dcot))):0);
321 if ((mishits < cutmishits[cat+bin*9]) and
322 (dcotdistcomb < cutdcotdist[cat+bin*9]))
329 std::vector<double> cutIsoSum =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sum");
330 std::vector<double> cutIsoSumCorr =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoet");
333 std::vector<double> cutdphi =
cuts_.
getParameter<std::vector<double> >(
"cutdphiin");
334 std::vector<double> cutdeta =
cuts_.
getParameter<std::vector<double> >(
"cutdetain");
335 std::vector<double> cuteopin =
cuts_.
getParameter<std::vector<double> >(
"cuteseedopcor");
336 std::vector<double> cutmishits =
cuts_.
getParameter<std::vector<double> >(
"cutfmishits");
338 std::vector<double> cutip =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsf");
339 std::vector<double> cutIsoSumCorrl =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoetl");
342 std::vector<double> cutdphil =
cuts_.
getParameter<std::vector<double> >(
"cutdphiinl");
343 std::vector<double> cutdetal =
cuts_.
getParameter<std::vector<double> >(
"cutdetainl");
344 std::vector<double> cutipl =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsfl");
348 const int ncuts = 10;
349 std::vector<bool> cut_results(ncuts,
false);
351 float iso_sum = tkIso + ecalIso + hcalIso;
354 iso_sum += (fabs(scEta)-1.5)*1.09;
356 float iso_sumoet = iso_sum*(40./scEt);
358 float eseedopincor = eSeedOverPin + fBrem;
360 eseedopincor = eSeedOverPin;
365 float dcotdistcomb = ((0.04 -
std::max(fabs(dist), fabs(dcot))) > 0?(0.04 -
std::max(fabs(dist), fabs(dcot))):0);
367 for (
int cut=0; cut<ncuts; cut++) {
370 cut_results[
cut] =
compute_cut(fabs(deltaEtaIn), scEt, cutdetal[cat], cutdeta[cat]);
373 cut_results[
cut] =
compute_cut(fabs(deltaPhiIn), scEt, cutdphil[cat], cutdphi[cat]);
376 cut_results[
cut] = (eseedopincor > cuteopin[cat]);
379 cut_results[
cut] =
compute_cut(hOverE, scEt, cuthoel[cat], cuthoe[cat]);
382 cut_results[
cut] =
compute_cut(sigmaee, scEt, cutseel[cat], cutsee[cat]);
385 cut_results[
cut] =
compute_cut(iso_sumoet, scEt, cutIsoSumCorrl[cat], cutIsoSumCorr[cat]);
388 cut_results[
cut] = (iso_sum < cutIsoSum[cat]);
391 cut_results[
cut] =
compute_cut(fabs(ip), scEt, cutipl[cat], cutip[cat]);
394 cut_results[
cut] = (mishits < cutmishits[cat]);
397 cut_results[
cut] = (dcotdistcomb < cutdcotdist[cat]);
403 if (cut_results[0] & cut_results[1] & cut_results[2] & cut_results[3] & cut_results[4])
407 if (cut_results[5] & cut_results[6])
415 if (cut_results[8] & cut_results[9])
434 cut = cut_min + (1/et_min - 1/et)*(cut_max - cut_min)/(1/et_min - 1/et_max);
458 double eta = electron->
p4().Eta();
462 double e25Max = electron->
e2x5Max();
463 double e15 = electron->
e1x5();
464 double e55 = electron->
e5x5();
465 double e25Maxoe55 = e25Max/e55;
466 double e15oe55 = e15/e55 ;
471 int mishits = electron->
gsfTrack()->trackerExpectedHitsInner().numberOfHits();
474 double ecalIsoPed = (electron->
isEB())?
std::max(0.,ecalIso-1.):ecalIso;
481 if (electron->
isEE())
482 sigmaee = sigmaee - 0.02*(fabs(eta) - 2.3);
492 ip = fabs(electron->
gsfTrack()->dxy(bspotPosition));
494 ip = fabs(electron->
gsfTrack()->dxy());
499 ecalIsoPed = (electron->
isEB())?
std::max(0.,ecalIso-1.):ecalIso;
508 if (vtxH->size() != 0) {
512 ip = fabs(electron->
gsfTrack()->dxy());
516 std::vector<double>
cut;
518 if (
type_ ==
"robust") {
523 if (electron->
isEB())
529 if ((tkIso > cut[6] || hcalIso2 > cut[11]) ||
530 (electron->
isEB() && ((ecalIso + hcalIso1) > cut[7]+cut[8]*scEt)) ||
531 (electron->
isEE() && (scEt >= 50.) && ((ecalIso + hcalIso1) > cut[7]+cut[8]*(scEt-50))) ||
532 (electron->
isEE() && (scEt < 50.) && ((ecalIso + hcalIso1) > cut[9]+cut[10]*(scEt-50))))
537 if ((tkIso > cut[6]) || (ecalIso > cut[7]) || (hcalIso > cut[8]) || (hcalIso1 > cut[9]) || (hcalIso2 > cut[10]) ||
538 (tkIso/electron->
p4().Pt() > cut[11]) || (ecalIso/electron->
p4().Pt() > cut[12]) || (hcalIso/electron->
p4().Pt() > cut[13]) ||
539 ((tkIso+ecalIso+hcalIso)>cut[14]) || (((tkIso+ecalIso+hcalIso)/ electron->
p4().Pt()) > cut[15]) ||
540 ((tkIso+ecalIsoPed+hcalIso)>cut[16]) || (((tkIso+ecalIsoPed+hcalIso)/ electron->
p4().Pt()) > cut[17]) )
546 if ((hOverE < cut[0]) && (sigmaee < cut[1]) && (fabs(deltaPhiIn) < cut[2]) &&
547 (fabs(deltaEtaIn) < cut[3]) && (e25Maxoe55 > cut[4] && e15oe55 > cut[5]) &&
548 (sigmaee >= cut[18]) && (eOverP > cut[19] && eOverP < cut[20]) )
549 { result = result + 1 ; }
553 if (mishits > cut[22])
556 if (cut[23] >0 && not (electron->
gsfTrack()->hitPattern().hasValidHitInFirstPixelBarrel()))
560 float dist = fabs(electron->
convDist());
561 float dcot = fabs(electron->
convDcot());
562 bool isConversion = (cut[24]>99. || cut[25]>99.)?
false:(dist < cut[24] && dcot < cut[25]);
T getParameter(std::string const &) const
float dr04HcalTowerSumEt() const
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
float dr04HcalDepth1TowerSumEt() const
Sin< T >::type sin(const T &t)
void baseSetup(const edm::ParameterSet &conf)
float dr03HcalDepth2TowerSumEt() const
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
double result(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &)
int classify(const reco::GsfElectron *)
float dr04HcalDepth2TowerSumEt() const
float deltaEtaSuperClusterTrackAtVtx() const
float sigmaIetaIeta() const
float hadronicOverEm() const
float eSeedClusterOverP() const
float dr04EcalRecHitSumEt() const
const T & max(const T &a, const T &b)
double robustSelection(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &)
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
edm::InputTag verticesCollection_
float deltaPhiSuperClusterTrackAtVtx() const
double cicSelection(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &)
float dr03TkSumPt() const
float dr03HcalDepth1TowerSumEt() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
float dr03EcalRecHitSumEt() const
bool compute_cut(double x, double et, double cut_min, double cut_max, bool gtn=false)
bool trackerDrivenSeed() const
float dr03HcalTowerSumEt() const
const Point & position() const
position
void setup(const edm::ParameterSet &conf)
Power< A, B >::type pow(const A &a, const B &b)
float sigmaEtaEta() const
virtual GsfTrackRef gsfTrack() const
reference to a GsfTrack
bool ecalDrivenSeed() const