25 if (
type_ ==
"classbased" and (version_ ==
"V06")) {
29 if (
type_ ==
"classbased" and (version_ ==
"V03" or version_ ==
"V04" or version_ ==
"V05" or version_ ==
"")) {
34 if (
type_ ==
"robust" ||
type_ ==
"classbased") {
40 <<
"Invalid electronType parameter in CutBasedElectronID: must be robust or classbased\n";
48 if (
type_ ==
"classbased")
50 else if (
type_ ==
"robust")
61 double fBrem = electron->
fbrem();
65 if((electron->
isEB() && fBrem<0.06) || (electron->
isEE() && fBrem<0.1))
67 else if (eOverP < 1.2 && eOverP > 0.8)
75 if (electron->
isEB()) {
78 else if (eOverP < 1.2 && eOverP > 0.9)
85 else if (eOverP < 1.22 && eOverP > 0.82)
94 if (electron->
isEB()) {
95 if ((fBrem >= 0.12) and (eOverP > 0.9) and (eOverP < 1.2))
97 else if (((eta > .445 and eta < .45 )
or
98 (eta > .79 and eta < .81 )
or
99 (eta > 1.137 and eta < 1.157 )
or
104 else if (fBrem < 0.12)
109 if ((fBrem >= 0.2) and (eOverP > 0.82) and (eOverP < 1.22))
115 else if (fBrem < 0.2)
138 double fBrem = electron->
fbrem();
152 if (electron->
isEE())
153 sigmaee = sigmaee - 0.02*(fabs(eta) - 2.3);
159 if (vtxH->size() != 0) {
163 ip = fabs(electron->
gsfTrack()->dxy());
165 if (electron->
isEB()) {
170 std::vector<double>
cut;
175 if (electron->
isEB())
183 if ((eOverP < 0.8) && (fBrem < 0.2))
187 if (hOverE > cut[cat+4*eb])
191 if (sigmaee > cut[cat+4*eb])
196 if (fabs(deltaPhiIn) > cut[cat+4*eb])
199 if (fabs(deltaPhiIn) > cut[3+4*eb])
204 if (fabs(deltaEtaIn) > cut[cat+4*eb])
208 if (eSeedOverPin < cut[cat+4*eb])
212 if (eOverP < 0.9*(1-fBrem))
231 eSeedOverPin = eSeedOverPin + fBrem;
234 tkIso = tkIso*
pow(40./scEt, 2);
235 ecalIso = ecalIso*
pow(40./scEt, 2);
236 hcalIso = hcalIso*
pow(40./scEt, 2);
239 std::vector<double> cutTk =
cuts_.
getParameter<std::vector<double> >(
"cutisotk");
240 std::vector<double> cutEcal =
cuts_.
getParameter<std::vector<double> >(
"cutisoecal");
241 std::vector<double> cutHcal =
cuts_.
getParameter<std::vector<double> >(
"cutisohcal");
242 if ((tkIso > cutTk[cat+3*eb+bin*6]) ||
243 (ecalIso > cutEcal[cat+3*eb+bin*6]) ||
244 (hcalIso > cutHcal[cat+3*eb+bin*6]))
252 std::vector<double> cutdphi =
cuts_.
getParameter<std::vector<double> >(
"cutdphiin");
253 std::vector<double> cutdeta =
cuts_.
getParameter<std::vector<double> >(
"cutdetain");
254 std::vector<double> cuteopin =
cuts_.
getParameter<std::vector<double> >(
"cuteseedopcor");
257 std::vector<double> cutmishits =
cuts_.
getParameter<std::vector<double> >(
"cutmishits");
258 if ((hOverE < cuthoe[cat+3*eb+bin*6]) and
259 (sigmaee < cutsee[cat+3*eb+bin*6]) and
260 (fabs(deltaPhiIn) < cutdphi[cat+3*eb+bin*6]) and
261 (fabs(deltaEtaIn) < cutdeta[cat+3*eb+bin*6]) and
262 (eSeedOverPin > cuteopin[cat+3*eb+bin*6]) and
263 (ip < cutip[cat+3*eb+bin*6]) and
264 (mishits < cutmishits[cat+3*eb+bin*6]))
265 result = result + 1.;
285 eSeedOverPin = eSeedOverPin + fBrem;
287 float iso_sum = tkIso + ecalIso + hcalIso;
288 float iso_sum_corrected = iso_sum*
pow(40./scEt, 2);
290 std::vector<double> cutIsoSum =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sum");
291 std::vector<double> cutIsoSumCorr =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoet");
292 if ((iso_sum < cutIsoSum[cat+bin*9]) and
293 (iso_sum_corrected < cutIsoSumCorr[cat+bin*9]))
299 std::vector<double> cutdphi =
cuts_.
getParameter<std::vector<double> >(
"cutdphiin");
300 std::vector<double> cutdeta =
cuts_.
getParameter<std::vector<double> >(
"cutdetain");
301 std::vector<double> cuteopin =
cuts_.
getParameter<std::vector<double> >(
"cuteseedopcor");
304 if ((hOverE < cuthoe[cat+bin*9]) and
305 (sigmaee < cutsee[cat+bin*9]) and
306 (fabs(deltaPhiIn) < cutdphi[cat+bin*9]) and
307 (fabs(deltaEtaIn) < cutdeta[cat+bin*9]) and
308 (eSeedOverPin > cuteopin[cat+bin*9]) and
309 (scEt > cutet[cat+bin*9]))
313 std::vector<double> cutip =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsf");
314 if (ip < cutip[cat+bin*9])
317 std::vector<double> cutmishits =
cuts_.
getParameter<std::vector<double> >(
"cutfmishits");
323 float dcotdistcomb = ((0.04 -
std::max(fabs(dist), fabs(dcot))) > 0?(0.04 -
std::max(fabs(dist), fabs(dcot))):0);
325 if ((mishits < cutmishits[cat+bin*9]) and
326 (dcotdistcomb < cutdcotdist[cat+bin*9]))
333 std::vector<double> cutIsoSum =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sum");
334 std::vector<double> cutIsoSumCorr =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoet");
337 std::vector<double> cutdphi =
cuts_.
getParameter<std::vector<double> >(
"cutdphiin");
338 std::vector<double> cutdeta =
cuts_.
getParameter<std::vector<double> >(
"cutdetain");
339 std::vector<double> cuteopin =
cuts_.
getParameter<std::vector<double> >(
"cuteseedopcor");
340 std::vector<double> cutmishits =
cuts_.
getParameter<std::vector<double> >(
"cutfmishits");
342 std::vector<double> cutip =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsf");
343 std::vector<double> cutIsoSumCorrl =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoetl");
346 std::vector<double> cutdphil =
cuts_.
getParameter<std::vector<double> >(
"cutdphiinl");
347 std::vector<double> cutdetal =
cuts_.
getParameter<std::vector<double> >(
"cutdetainl");
348 std::vector<double> cutipl =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsfl");
352 const int ncuts = 10;
353 std::vector<bool> cut_results(ncuts,
false);
355 float iso_sum = tkIso + ecalIso + hcalIso;
358 iso_sum += (fabs(scEta)-1.5)*1.09;
360 float iso_sumoet = iso_sum*(40./scEt);
362 float eseedopincor = eSeedOverPin + fBrem;
364 eseedopincor = eSeedOverPin;
369 float dcotdistcomb = ((0.04 -
std::max(fabs(dist), fabs(dcot))) > 0?(0.04 -
std::max(fabs(dist), fabs(dcot))):0);
371 for (
int cut=0; cut<ncuts; cut++) {
374 cut_results[
cut] =
compute_cut(fabs(deltaEtaIn), scEt, cutdetal[cat], cutdeta[cat]);
377 cut_results[
cut] =
compute_cut(fabs(deltaPhiIn), scEt, cutdphil[cat], cutdphi[cat]);
380 cut_results[
cut] = (eseedopincor > cuteopin[
cat]);
383 cut_results[
cut] =
compute_cut(hOverE, scEt, cuthoel[cat], cuthoe[cat]);
386 cut_results[
cut] =
compute_cut(sigmaee, scEt, cutseel[cat], cutsee[cat]);
389 cut_results[
cut] =
compute_cut(iso_sumoet, scEt, cutIsoSumCorrl[cat], cutIsoSumCorr[cat]);
392 cut_results[
cut] = (iso_sum < cutIsoSum[
cat]);
395 cut_results[
cut] =
compute_cut(fabs(ip), scEt, cutipl[cat], cutip[cat]);
398 cut_results[
cut] = (mishits < cutmishits[
cat]);
401 cut_results[
cut] = (dcotdistcomb < cutdcotdist[
cat]);
407 if (cut_results[0] & cut_results[1] & cut_results[2] & cut_results[3] & cut_results[4])
411 if (cut_results[5] & cut_results[6])
419 if (cut_results[8] & cut_results[9])
438 cut = cut_min + (1/et_min - 1/et)*(cut_max - cut_min)/(1/et_min - 1/et_max);
462 double eta = electron->
p4().Eta();
466 double e25Max = electron->
e2x5Max();
467 double e15 = electron->
e1x5();
468 double e55 = electron->
e5x5();
469 double e25Maxoe55 = e25Max/e55;
470 double e15oe55 = e15/e55 ;
478 double ecalIsoPed = (electron->
isEB())?
std::max(0.,ecalIso-1.):ecalIso;
485 if (electron->
isEE())
486 sigmaee = sigmaee - 0.02*(fabs(eta) - 2.3);
496 ip = fabs(electron->
gsfTrack()->dxy(bspotPosition));
498 ip = fabs(electron->
gsfTrack()->dxy());
503 ecalIsoPed = (electron->
isEB())?
std::max(0.,ecalIso-1.):ecalIso;
512 if (vtxH->size() != 0) {
516 ip = fabs(electron->
gsfTrack()->dxy());
520 std::vector<double>
cut;
522 if (
type_ ==
"robust") {
527 if (electron->
isEB())
533 if ((tkIso > cut[6] || hcalIso2 > cut[11]) ||
534 (electron->
isEB() && ((ecalIso + hcalIso1) > cut[7]+cut[8]*scEt)) ||
535 (electron->
isEE() && (scEt >= 50.) && ((ecalIso + hcalIso1) > cut[7]+cut[8]*(scEt-50))) ||
536 (electron->
isEE() && (scEt < 50.) && ((ecalIso + hcalIso1) > cut[9]+cut[10]*(scEt-50))))
541 if ((tkIso > cut[6]) || (ecalIso > cut[7]) || (hcalIso > cut[8]) || (hcalIso1 > cut[9]) || (hcalIso2 > cut[10]) ||
542 (tkIso/electron->
p4().Pt() > cut[11]) || (ecalIso/electron->
p4().Pt() > cut[12]) || (hcalIso/electron->
p4().Pt() > cut[13]) ||
543 ((tkIso+ecalIso+hcalIso)>cut[14]) || (((tkIso+ecalIso+hcalIso)/ electron->
p4().Pt()) > cut[15]) ||
544 ((tkIso+ecalIsoPed+hcalIso)>cut[16]) || (((tkIso+ecalIsoPed+hcalIso)/ electron->
p4().Pt()) > cut[17]) )
550 if ((hOverE < cut[0]) && (sigmaee < cut[1]) && (fabs(deltaPhiIn) < cut[2]) &&
551 (fabs(deltaEtaIn) < cut[3]) && (e25Maxoe55 > cut[4] && e15oe55 > cut[5]) &&
552 (sigmaee >= cut[18]) && (eOverP > cut[19] && eOverP < cut[20]) )
553 { result = result + 1 ; }
557 if (mishits > cut[22])
560 if (cut[23] > 0 && !electron->
gsfTrack()->hitPattern().hasValidHitInFirstPixelBarrel())
564 float dist = fabs(electron->
convDist());
565 float dcot = fabs(electron->
convDcot());
566 bool isConversion = (cut[24]>99. || cut[25]>99.)?
false:(dist < cut[24] && dcot < cut[25]);
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
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
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
CutBasedElectronID(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
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 &)
edm::EDGetTokenT< std::vector< reco::Vertex > > verticesCollection_
int classify(const reco::GsfElectron *)
float dr04HcalDepth2TowerSumEt() const
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 &)
virtual SuperClusterRef superCluster() const
reference to a SuperCluster
float deltaPhiSuperClusterTrackAtVtx() const
double cicSelection(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &)
float dr03TkSumPt() const
float dr03HcalDepth1TowerSumEt() const
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
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