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")
58 else if (eOverP < 1.2 && eOverP > 0.8)
69 else if (eOverP < 1.2 && eOverP > 0.9)
76 else if (eOverP < 1.22 && eOverP > 0.82)
86 if ((fBrem >= 0.12) and (
eOverP > 0.9) and (
eOverP < 1.2))
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)
120 double scTheta = (2 * atan(
exp(-
electron->superCluster()->eta())));
121 double scEt =
electron->superCluster()->energy() *
sin(scTheta);
123 double eta = fabs(
electron->superCluster()->eta());
129 double sigmaee =
electron->sigmaIetaIeta();
134 int mishits =
electron->gsfTrack()->missingInnerHits();
135 double tkIso =
electron->dr03TkSumPt();
136 double ecalIso =
electron->dr04EcalRecHitSumEt();
137 double hcalIso =
electron->dr04HcalTowerSumEt();
142 sigmaee = sigmaee - 0.02 * (fabs(
eta) - 2.3);
148 if (!vtxH->empty()) {
152 ip = fabs(
electron->gsfTrack()->dxy());
155 sigmaee =
electron->sigmaIetaIeta();
159 std::vector<double>
cut;
171 if ((
eOverP < 0.8) && (fBrem < 0.2))
179 if (sigmaee >
cut[
cat + 4 * eb])
200 if (
eOverP < 0.9 * (1 - fBrem))
222 tkIso = tkIso *
pow(40. / scEt, 2);
223 ecalIso = ecalIso *
pow(40. / scEt, 2);
224 hcalIso = hcalIso *
pow(40. / scEt, 2);
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]))
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]))
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);
313 std::vector<double> cutIsoSum =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sum");
314 std::vector<double> cutIsoSumCorr =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoet");
323 std::vector<double> cutIsoSumCorrl =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoetl");
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;
336 float scEta =
electron->superCluster()->eta();
337 if (fabs(scEta) > 1.5)
338 iso_sum += (fabs(scEta) - 1.5) * 1.09;
340 float iso_sumoet = iso_sum * (40. / scEt);
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);
373 cut_results[
cut] = (iso_sum < cutIsoSum[
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);
437 double scTheta = (2 * atan(
exp(-
electron->superCluster()->eta())));
438 double scEt =
electron->superCluster()->energy() *
sin(scTheta);
442 double sigmaee =
electron->sigmaIetaIeta();
443 double e25Max =
electron->e2x5Max();
446 double e25Maxoe55 = e25Max / e55;
447 double e15oe55 = e15 / e55;
452 int mishits =
electron->gsfTrack()->missingInnerHits();
453 double tkIso =
electron->dr03TkSumPt();
454 double ecalIso =
electron->dr04EcalRecHitSumEt();
455 double ecalIsoPed = (
electron->isEB()) ?
std::max(0., ecalIso - 1.) : ecalIso;
456 double hcalIso =
electron->dr04HcalTowerSumEt();
457 double hcalIso1 =
electron->dr04HcalTowerSumEt(1);
458 double hcalIso2 =
electron->dr04HcalTowerSumEt(2);
463 sigmaee = sigmaee - 0.02 * (fabs(
eta) - 2.3);
473 ip = fabs(
electron->gsfTrack()->dxy(bspotPosition));
475 ip = fabs(
electron->gsfTrack()->dxy());
479 ecalIso =
electron->dr03EcalRecHitSumEt();
481 hcalIso =
electron->dr03HcalTowerSumEt();
482 hcalIso1 =
electron->dr03HcalTowerSumEt(1);
483 hcalIso2 =
electron->dr03HcalTowerSumEt(2);
489 if (!vtxH->empty()) {
493 ip = fabs(
electron->gsfTrack()->dxy());
497 std::vector<double>
cut;
499 if (
type_ ==
"robust") {
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]) ||
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]))
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)
T getParameter(std::string const &) const
const Point & position() const
position
double result(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &) override
Sin< T >::type sin(const T &t)
T const * product() const
CutBasedElectronID(const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
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 *)
double robustSelection(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &)
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
double cicSelection(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &)
XYZPointD XYZPoint
point in space with cartesian internal representation
void setup(const edm::ParameterSet &conf) override
bool compute_cut(double x, double et, double cut_min, double cut_max, bool gtn=false)
Power< A, B >::type pow(const A &a, const B &b)