20 #include "CLHEP/Units/GlobalPhysicalConstants.h"
165 iBooker,
"vertexPt_barrel",
"ele transverse momentum in barrel",
nbinpt, 0.,
ptmax,
"p_{T vertex} (GeV/c)");
167 iBooker,
"vertexPt_endcaps",
"ele transverse momentum in endcaps",
nbinpt, 0.,
ptmax,
"p_{T vertex} (GeV/c)");
171 "ele momentum #eta vs #phi",
181 iBooker,
"vertexXvsY",
"ele vertex x vs y",
nbinxyz2D, -0.1, 0.1,
nbinxyz2D, -0.1, 0.1,
"x (cm)",
"y (cm)");
188 h1_chi2 =
bookH1(iBooker,
"chi2",
"ele track #chi^{2}", 100, 0., 15.,
"#Chi^{2}");
190 iBooker,
"chi2VsEta",
"ele track #chi^{2} vs #eta",
nbineta2D,
etamin,
etamax, 0., 15.,
"#eta",
"<#chi^{2}>");
193 "ele track #chi^{2} vs #phi",
204 "ele track # found hits vs #eta",
214 "ele track # found hits vs #phi",
222 h1_lostHits =
bookH1(iBooker,
"lostHits",
"ele track # lost hits", 5, 0., 5.,
"N_{lost hits}");
225 "ele track # lost hits vs #eta",
235 "ele track # lost hits vs #eta",
249 "ele E/P_{vertex} vs #phi",
258 bookH1(iBooker,
"EeleOPout_barrel",
"ele E_{ele}/P_{out} in barrel",
nbineop, 0.,
eopmax,
"E_{ele}/P_{out}");
260 bookH1(iBooker,
"EeleOPout_endcaps",
"ele E_{ele}/P_{out} in endcaps",
nbineop, 0.,
eopmax,
"E_{ele}/P_{out}");
262 "dEtaSc_propVtx_barrel",
263 "ele #eta_{sc} - #eta_{tr}, prop from vertex, in barrel",
267 "#eta_{sc} - #eta_{tr}");
269 "dEtaSc_propVtx_endcapsPos",
270 "ele #eta_{sc} - #eta_{tr}, prop from vertex, in positive endcap",
274 "#eta_{sc} - #eta_{tr}");
276 "dEtaSc_propVtx_endcapsNeg",
277 "ele #eta_{sc} - #eta_{tr}, prop from vertex, in negative endcap",
281 "#eta_{sc} - #eta_{tr}");
283 "dEtaSc_propVtxVsPhi",
284 "ele #eta_{sc} - #eta_{tr}, prop from vertex vs #phi",
291 "<#eta_{sc} - #eta_{tr}>");
293 "dEtaEleCl_propOut_barrel",
294 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, in barrel",
298 "#eta_{elecl} - #eta_{tr}");
300 "dEtaEleCl_propOut_endcapsPos",
301 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, in positive endcap",
305 "#eta_{elecl} - #eta_{tr}");
307 "dEtaEleCl_propOut_endcapsNeg",
308 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, in negative endcap",
312 "#eta_{elecl} - #eta_{tr}");
314 "dPhiSc_propVtx_barrel",
315 "ele #phi_{sc} - #phi_{tr}, prop from vertex, in barrel",
319 "#phi_{sc} - #phi_{tr} (rad)");
321 "dPhiSc_propVtx_endcapsPos",
322 "ele #phi_{sc} - #phi_{tr}, prop from vertex, in positive endcap",
326 "#phi_{sc} - #phi_{tr} (rad)");
328 "dPhiSc_propVtx_endcapsNeg",
329 "ele #phi_{sc} - #phi_{tr}, prop from vertex, in negative endcap",
333 "#phi_{sc} - #phi_{tr} (rad)");
335 "dPhiSc_propVtxVsPhi",
336 "ele #phi_{sc} - #phi_{tr}, prop from vertex vs #phi",
343 "<#phi_{sc} - #phi_{tr}> (rad)");
345 "dPhiEleCl_propOut_barrel",
346 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, in barrel",
350 "#phi_{elecl} - #phi_{tr} (rad)");
352 "dPhiEleCl_propOut_endcapsPos",
353 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, in positive endcap",
357 "#phi_{elecl} - #phi_{tr} (rad)");
359 "dPhiEleCl_propOut_endcapsNeg",
360 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, in negative endcap",
364 "#phi_{elecl} - #phi_{tr} (rad)");
367 "ele hadronic energy / em energy, in barrel",
376 "ele hadronic energy / em energy, in endcaps",
385 "ele hadronic energy / em energy vs #phi",
395 bookH1(iBooker,
"sclSigEtaEta_barrel",
"ele sigma eta eta in barrel", 100, 0., 0.05,
"sietaieta");
397 bookH1(iBooker,
"sclSigEtaEta_endcaps",
"ele sigma eta eta in endcaps", 100, 0., 0.05,
"sietaieta");
399 bookH1(iBooker,
"sigIEtaIEta5x5_barrel",
"ele sigma ieta ieta 5x5 in barrel", 100, 0., 0.05,
"sietaieta5x5");
401 bookH1(iBooker,
"sigIEtaIEta5x5_endcaps",
"ele sigma ieta ieta 5x5 in endcaps", 100, 0., 0.05,
"sietaieta5x5");
404 h1_fbrem =
bookH1(iBooker,
"fbrem",
"ele brem fraction", 100, 0., 1.,
"P_{in} - P_{out} / P_{in}");
407 "ele brem fraction vs #eta",
414 "<P_{in} - P_{out} / P_{in}>");
417 "ele brem fraction vs #phi",
424 "<P_{in} - P_{out} / P_{in}>");
425 h1_classes =
bookH1(iBooker,
"classes",
"ele electron classes", 10, 0.0, 10.);
428 h1_mva =
bookH1(iBooker,
"mva",
"ele identification mva", 100, -1., 1.,
"mva");
433 iBooker,
"tkSumPt_dr03",
"tk isolation sum, dR=0.3", 100, 0.0, 20.,
"TkIsoSum (GeV/c)",
"Events",
"ELE_LOGY E1 P");
435 "ecalRecHitSumEt_dr03",
436 "ecal isolation sum, dR=0.3",
444 "hcalTowerSumEt_dr03",
445 "hcal isolation sum, dR=0.3",
456 "Charged PF candidate sum, dR=0.3",
460 "PF charged (GeV/c)",
465 "Neutral EM PF candidate sum, dR=0.3",
469 "PF neutral EM (GeV)",
474 "Neutral Had PF candidate sum, dR=0.3",
478 "PF neutral Had (GeV)",
487 "ele pairs invariant mass, opposite sign",
491 "m_{e^{+}e^{-}} (GeV/c^{2})");
494 "ele pairs invariant mass, opposite sign, barrel-barrel",
498 "m_{e^{+}e^{-}} (GeV/c^{2})");
501 "ele pairs invariant mass, opposite sign, endcap-endcap",
505 "m_{e^{+}e^{-}} (GeV/c^{2})");
508 "ele pairs invariant mass, opposite sign, barrel-endcap",
512 "m_{e^{+}e^{-}} (GeV/c^{2})");
522 if (std::string::npos !=
std::string(
l.module).find(
"SuperCluster", 0)) {
523 matchingObjectType =
"SC";
525 if (matchingObjectType.empty()) {
526 edm::LogError(
"ElectronMcFakeValidator::beginJob") <<
"Unknown matching object type !";
528 edm::LogInfo(
"ElectronMcFakeValidator::beginJob") <<
"Matching object type: " << matchingObjectType;
533 iBooker,
"matchingObject_Eta", matchingObjectType +
" #eta",
nbineta,
etamin,
etamax,
"#eta_{SC}");
536 iBooker,
"matchingObject_Pt", matchingObjectType +
" pt",
nbinpteff, 5.,
ptmax,
"pt_{SC} (GeV/c)");
538 iBooker,
"matchingObject_Phi", matchingObjectType +
" #phi",
nbinphi,
phimin,
phimax,
"#phi (rad)");
541 iBooker,
"matchedObject_Eta",
"Efficiency vs matching SC #eta",
nbineta,
etamin,
etamax,
"#eta_{SC}");
543 iBooker,
"matchedObject_Pt",
"Efficiency vs matching SC E_{T}",
nbinpteff, 5.,
ptmax,
"pt_{SC} (GeV/c)");
545 iBooker,
"matchedObject_Phi",
"Efficiency vs matching SC #phi",
nbinphi,
phimin,
phimax,
"#phi (rad)");
571 <<
" from event " << ievt <<
" in run " << irun <<
" and lumiblock " << ils;
575 reco::GsfElectronCollection::const_iterator gsfIter;
578 double vertexTIP = (gsfIter->vertex().x() -
bs.position().x()) * (gsfIter->vertex().x() -
bs.position().x()) +
579 (gsfIter->vertex().y() -
bs.position().y()) * (gsfIter->vertex().y() -
bs.position().y());
580 vertexTIP =
sqrt(vertexTIP);
587 reco::GsfElectronCollection::const_iterator gsfIter2;
588 for (gsfIter2 = gsfIter + 1; gsfIter2 !=
gsfElectrons->end(); gsfIter2++) {
593 if (((gsfIter->charge()) * (gsfIter2->charge())) < 0.) {
595 if (gsfIter->isEB() && gsfIter2->isEB())
597 else if (gsfIter->isEE() && gsfIter2->isEE())
617 double R = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
618 double Rt = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
629 h1_chi2->
Fill(gsfIter->gsfTrack()->normalizedChi2());
635 if (gsfIter->isEB()) {
646 if (gsfIter->isEE()) {
649 if (gsfIter->eta() > 0) {
673 int eleClass = gsfIter->classification();
680 if (gsfIter->ecalDrivenSeed())
682 if (gsfIter->trackerDrivenSeed())
684 if (gsfIter->trackerDrivenSeed() || gsfIter->ecalDrivenSeed())
686 if (gsfIter->trackerDrivenSeed() && !gsfIter->ecalDrivenSeed())
688 if (!gsfIter->trackerDrivenSeed() && gsfIter->ecalDrivenSeed())
704 int matchingObjectNum = 0;
705 reco::SuperClusterCollection::const_iterator moIter;
706 for (moIter = recoClusters->begin(); moIter != recoClusters->end(); moIter++) {
720 bool okGsfFound =
false;
721 double gsfOkRatio = 999999999.;
723 reco::GsfElectronCollection::const_iterator gsfIter;
725 double vertexTIP = (gsfIter->vertex().x() -
bs.position().x()) * (gsfIter->vertex().x() -
bs.position().x()) +
726 (gsfIter->vertex().y() -
bs.position().y()) * (gsfIter->vertex().y() -
bs.position().y());
727 vertexTIP =
sqrt(vertexTIP);
735 double dphi = gsfIter->phi() - moIter->phi();
737 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
739 double deltaR =
sqrt(
pow((moIter->eta() - gsfIter->eta()), 2) +
pow(dphi, 2));
741 double tmpGsfRatio = gsfIter->p() / moIter->energy();
743 gsfOkRatio = tmpGsfRatio;
744 bestGsfElectron = *gsfIter;
764 float mee2 = p12.Dot(p12);
765 float invMass = mee2 > 0. ?
sqrt(mee2) : 0;
784 if (gsfIter->pt() <
minPt_)
787 if (gsfIter->isEB() &&
isEE_)
789 if (gsfIter->isEE() &&
isEB_)
803 if (gsfIter->superCluster()->energy() / cosh(gsfIter->superCluster()->eta()) <
minEt_)