24 if (
type_ ==
"classbased" and (version_ ==
"V06")) {
28 if (
type_ ==
"classbased" and (version_ ==
"V03" or version_ ==
"V04" or version_ ==
"V05" or version_.empty())) {
33 if (
type_ ==
"robust" ||
type_ ==
"classbased") {
39 <<
"Invalid electronType parameter in CutBasedElectronID: must be robust or classbased\n";
47 if (
type_ ==
"classbased")
49 else if (
type_ ==
"robust")
60 double fBrem = electron->
fbrem();
64 if((electron->
isEB() && fBrem<0.06) || (electron->
isEE() && fBrem<0.1))
66 else if (eOverP < 1.2 && eOverP > 0.8)
74 if (electron->
isEB()) {
77 else if (eOverP < 1.2 && eOverP > 0.9)
84 else if (eOverP < 1.22 && eOverP > 0.82)
93 if (electron->
isEB()) {
94 if ((fBrem >= 0.12) and (eOverP > 0.9) and (eOverP < 1.2))
96 else if (((eta > .445 and eta < .45 )
or 97 (eta > .79 and eta < .81 )
or 98 (eta > 1.137 and eta < 1.157 )
or 103 else if (fBrem < 0.12)
108 if ((fBrem >= 0.2) and (eOverP > 0.82) and (eOverP < 1.22))
114 else if (fBrem < 0.2)
137 double fBrem = electron->
fbrem();
151 if (electron->
isEE())
152 sigmaee = sigmaee - 0.02*(fabs(eta) - 2.3);
158 if (!vtxH->empty()) {
162 ip = fabs(electron->
gsfTrack()->dxy());
164 if (electron->
isEB()) {
169 std::vector<double>
cut;
174 if (electron->
isEB())
182 if ((eOverP < 0.8) && (fBrem < 0.2))
186 if (hOverE > cut[cat+4*eb])
190 if (sigmaee > cut[cat+4*eb])
195 if (fabs(deltaPhiIn) > cut[cat+4*eb])
198 if (fabs(deltaPhiIn) > cut[3+4*eb])
203 if (fabs(deltaEtaIn) > cut[cat+4*eb])
207 if (eSeedOverPin < cut[cat+4*eb])
211 if (eOverP < 0.9*(1-fBrem))
230 eSeedOverPin = eSeedOverPin + fBrem;
233 tkIso = tkIso*
pow(40./scEt, 2);
234 ecalIso = ecalIso*
pow(40./scEt, 2);
235 hcalIso = hcalIso*
pow(40./scEt, 2);
238 std::vector<double> cutTk =
cuts_.
getParameter<std::vector<double> >(
"cutisotk");
239 std::vector<double> cutEcal =
cuts_.
getParameter<std::vector<double> >(
"cutisoecal");
240 std::vector<double> cutHcal =
cuts_.
getParameter<std::vector<double> >(
"cutisohcal");
241 if ((tkIso > cutTk[cat+3*eb+bin*6]) ||
242 (ecalIso > cutEcal[cat+3*eb+bin*6]) ||
243 (hcalIso > cutHcal[cat+3*eb+bin*6]))
257 if ((hOverE < cuthoe[cat+3*eb+bin*6]) and
258 (sigmaee < cutsee[cat+3*eb+bin*6]) and
259 (fabs(deltaPhiIn) < cutdphi[cat+3*eb+bin*6]) and
260 (fabs(deltaEtaIn) < cutdeta[cat+3*eb+bin*6]) and
261 (eSeedOverPin > cuteopin[cat+3*eb+bin*6]) and
262 (ip < cutip[cat+3*eb+bin*6]) and
263 (mishits < cutmishits[cat+3*eb+bin*6]))
264 result = result + 1.;
284 eSeedOverPin = eSeedOverPin + fBrem;
286 float iso_sum = tkIso + ecalIso + hcalIso;
287 float iso_sum_corrected = iso_sum*
pow(40./scEt, 2);
289 std::vector<double> cutIsoSum =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sum");
290 std::vector<double> cutIsoSumCorr =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoet");
291 if ((iso_sum < cutIsoSum[cat+bin*9]) and
292 (iso_sum_corrected < cutIsoSumCorr[cat+bin*9]))
303 if ((hOverE < cuthoe[cat+bin*9]) and
304 (sigmaee < cutsee[cat+bin*9]) and
305 (fabs(deltaPhiIn) < cutdphi[cat+bin*9]) and
306 (fabs(deltaEtaIn) < cutdeta[cat+bin*9]) and
307 (eSeedOverPin > cuteopin[cat+bin*9]) and
308 (scEt > cutet[cat+bin*9]))
313 if (ip < cutip[cat+bin*9])
322 float dcotdistcomb = ((0.04 -
std::max(fabs(dist), fabs(dcot))) > 0?(0.04 -
std::max(fabs(dist), fabs(dcot))):0);
324 if ((mishits < cutmishits[cat+bin*9]) and
325 (dcotdistcomb < cutdcotdist[cat+bin*9]))
332 std::vector<double> cutIsoSum =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sum");
333 std::vector<double> cutIsoSumCorr =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoet");
342 std::vector<double> cutIsoSumCorrl =
cuts_.
getParameter<std::vector<double> >(
"cutiso_sumoetl");
345 std::vector<double> cutdphil =
cuts_.
getParameter<std::vector<double> >(
"cutdphiinl");
346 std::vector<double> cutdetal =
cuts_.
getParameter<std::vector<double> >(
"cutdetainl");
347 std::vector<double> cutipl =
cuts_.
getParameter<std::vector<double> >(
"cutip_gsfl");
351 const int ncuts = 10;
352 std::vector<bool> cut_results(ncuts,
false);
354 float iso_sum = tkIso + ecalIso + hcalIso;
357 iso_sum += (fabs(scEta)-1.5)*1.09;
359 float iso_sumoet = iso_sum*(40./scEt);
361 float eseedopincor = eSeedOverPin + fBrem;
368 float dcotdistcomb = ((0.04 -
std::max(fabs(dist), fabs(dcot))) > 0?(0.04 -
std::max(fabs(dist), fabs(dcot))):0);
370 for (
int cut=0; cut<ncuts; cut++) {
373 cut_results[
cut] =
compute_cut(fabs(deltaEtaIn), scEt, cutdetal[cat], cutdeta[cat]);
376 cut_results[
cut] =
compute_cut(fabs(deltaPhiIn), scEt, cutdphil[cat], cutdphi[cat]);
379 cut_results[
cut] = (eseedopincor > cuteopin[
cat]);
382 cut_results[
cut] =
compute_cut(hOverE, scEt, cuthoel[cat], cuthoe[cat]);
385 cut_results[
cut] =
compute_cut(sigmaee, scEt, cutseel[cat], cutsee[cat]);
388 cut_results[
cut] =
compute_cut(iso_sumoet, scEt, cutIsoSumCorrl[cat], cutIsoSumCorr[cat]);
391 cut_results[
cut] = (iso_sum < cutIsoSum[
cat]);
394 cut_results[
cut] =
compute_cut(fabs(ip), scEt, cutipl[cat], cutip[cat]);
397 cut_results[
cut] = (mishits < cutmishits[
cat]);
400 cut_results[
cut] = (dcotdistcomb < cutdcotdist[
cat]);
406 if (cut_results[0] & cut_results[1] & cut_results[2] & cut_results[3] & cut_results[4])
410 if (cut_results[5] & cut_results[6])
418 if (cut_results[8] & cut_results[9])
437 cut = cut_min + (1/et_min - 1/
et)*(cut_max - cut_min)/(1/et_min - 1/et_max);
461 double eta = electron->
p4().Eta();
465 double e25Max = electron->
e2x5Max();
466 double e15 = electron->
e1x5();
467 double e55 = electron->
e5x5();
468 double e25Maxoe55 = e25Max/e55;
469 double e15oe55 = e15/e55 ;
477 double ecalIsoPed = (electron->
isEB())?
std::max(0.,ecalIso-1.):ecalIso;
484 if (electron->
isEE())
485 sigmaee = sigmaee - 0.02*(fabs(eta) - 2.3);
495 ip = fabs(electron->
gsfTrack()->dxy(bspotPosition));
497 ip = fabs(electron->
gsfTrack()->dxy());
502 ecalIsoPed = (electron->
isEB())?
std::max(0.,ecalIso-1.):ecalIso;
511 if (!vtxH->empty()) {
515 ip = fabs(electron->
gsfTrack()->dxy());
519 std::vector<double>
cut;
521 if (
type_ ==
"robust") {
526 if (electron->
isEB())
532 if ((tkIso > cut[6] || hcalIso2 > cut[11]) ||
533 (electron->
isEB() && ((ecalIso + hcalIso1) > cut[7]+cut[8]*scEt)) ||
534 (electron->
isEE() && (scEt >= 50.) && ((ecalIso + hcalIso1) > cut[7]+cut[8]*(scEt-50))) ||
535 (electron->
isEE() && (scEt < 50.) && ((ecalIso + hcalIso1) > cut[9]+cut[10]*(scEt-50))))
540 if ((tkIso > cut[6]) || (ecalIso > cut[7]) || (hcalIso > cut[8]) || (hcalIso1 > cut[9]) || (hcalIso2 > cut[10]) ||
541 (tkIso/electron->
p4().Pt() > cut[11]) || (ecalIso/electron->
p4().Pt() > cut[12]) || (hcalIso/electron->
p4().Pt() > cut[13]) ||
542 ((tkIso+ecalIso+hcalIso)>cut[14]) || (((tkIso+ecalIso+hcalIso)/ electron->
p4().Pt()) > cut[15]) ||
543 ((tkIso+ecalIsoPed+hcalIso)>cut[16]) || (((tkIso+ecalIsoPed+hcalIso)/ electron->
p4().Pt()) > cut[17]) )
549 if ((hOverE < cut[0]) && (sigmaee < cut[1]) && (fabs(deltaPhiIn) < cut[2]) &&
550 (fabs(deltaEtaIn) < cut[3]) && (e25Maxoe55 > cut[4] && e15oe55 > cut[5]) &&
551 (sigmaee >= cut[18]) && (eOverP > cut[19] && eOverP < cut[20]) )
552 { result = result + 1 ; }
556 if (mishits > cut[22])
563 float dist = fabs(electron->
convDist());
564 float dcot = fabs(electron->
convDcot());
565 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
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
float dr04HcalTowerSumEt() const
const LorentzVector & p4(P4Kind kind) const
float eSuperClusterOverP() const
float dr04HcalDepth1TowerSumEt() const
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 dr03HcalDepth2TowerSumEt() const
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 *)
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 &)
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
float deltaPhiSuperClusterTrackAtVtx() const
double cicSelection(const reco::GsfElectron *, const edm::Event &, const edm::EventSetup &)
float dr03TkSumPt() const
float dr03HcalDepth1TowerSumEt() const
bin
set the eta bin as selection string.
T const * product() const
XYZPointD XYZPoint
point in space with cartesian internal representation
void setup(const edm::ParameterSet &conf) override
et
define resolution functions of each parameter
float dr03EcalRecHitSumEt() const
bool compute_cut(double x, double et, double cut_min, double cut_max, bool gtn=false)
SuperClusterRef superCluster() const override
reference to a SuperCluster
bool trackerDrivenSeed() const
float dr03HcalTowerSumEt() const
const Point & position() const
position
Power< A, B >::type pow(const A &a, const B &b)
float sigmaEtaEta() const
bool ecalDrivenSeed() const