39 #include "CLHEP/Units/GlobalPhysicalConstants.h"
417 using namespace reco;
420 : beamSpot_(conf.getParameter<
edm::
InputTag>(
"beamSpot")) {
436 ptmax =
pset.getParameter<
double>(
"Ptmax");
437 pmax =
pset.getParameter<
double>(
"Pmax");
491 if (locJet != std::string::npos) {
492 std::cout <<
"Matching objects are GenJets " << std::endl;
495 std::cout <<
"Didn't recognize input matching objects!! " << std::endl;
499 hlabel =
"h_" + type_ +
"Num";
500 htitle =
"# " + type_ +
"s";
504 histNum_ =
new TH1F(
"h_recEleNum",
"# rec electrons", 20, 0., 20.);
507 hlabel =
"h_matchingObject_eta";
508 htitle = type_ +
" #eta";
510 hlabel =
"h_matchingObject_abseta";
511 htitle = type_ +
" |#eta|";
513 hlabel =
"h_matchingObject_P";
514 htitle = type_ +
" p";
516 hlabel =
"h_matchingObject_Pt";
517 htitle = type_ +
" pt";
519 hlabel =
"h_matchingObject_phi";
520 htitle = type_ +
" phi";
522 hlabel =
"h_matchingObject_z";
523 htitle = type_ +
" z";
532 "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",
537 "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",
542 "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",
547 "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",
551 h_ele_TIP_all =
new TH1F(
"h_ele_TIP_all",
"ele vertex transverse radius, all reco electrons", 100, 0., 0.2);
553 new TH1F(
"h_ele_HoE_all",
"ele hadronic energy / em energy, all reco electrons",
nbinhoe,
hoemin,
hoemax);
563 "E2 - E1 vs ele pairs invariant mass, all electrons",
571 "E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons",
582 new TH1F(
"h_ele_matchingObjectPt_matched",
"Efficiency vs matching jet p_{T}",
nbinpteff, 5.,
ptmax);
585 new TH1F(
"h_ele_matchingObjectAbsEta_matched",
"Efficiency vs matching jet |#eta|",
nbineta / 2, 0., 2.5);
588 new TH1F(
"h_ele_matchingObjectEta_matched",
"Efficiency vs matching jet #eta",
nbineta,
etamin,
etamax);
591 new TH1F(
"h_ele_matchingObjectPhi_matched",
"Efficiency vs matching jet phi",
nbinphi,
phimin,
phimax);
594 new TH1F(
"h_ele_matchingObjectZ_matched",
"Efficiency vs matching jet z",
nbinxyz, -25, 25);
597 h_ele_charge =
new TH1F(
"h_ele_charge",
"ele charge", 5, -2., 2.);
614 h_ele_vertexTIP =
new TH1F(
"h_ele_vertexTIP",
"ele transverse impact parameter (wrt bs)", 90, 0., 0.15);
616 "ele transverse impact parameter (wrt bs) vs eta",
624 "ele transverse impact parameter (wrt bs) vs phi",
632 "h_ele_vertexTIPVsPt",
"ele transverse impact parameter (wrt bs) vs Pt",
nbinpt2D, 0.,
ptmax, 45, 0., 0.15);
634 h_ele_PoPmatchingObject =
new TH1F(
"h_ele_PoPmatchingObject",
"ele momentum / matching jet momentum", 75, 0., 1.5);
636 "ele momentum / matching jet momentum vs eta",
644 "ele momentum / matching jet momentum vs phi",
652 "h_ele_PoPmatchingObjectVsPt",
"ele momentum / matching jet momentum vs eta",
nbinpt2D, 0.,
ptmax, 50, 0., 1.5);
654 new TH1F(
"h_ele_PoPmatchingObject_barrel",
"ele momentum / matching jet momentum, barrel", 75, 0., 1.5);
656 new TH1F(
"h_ele_PoPmatchingObject_endcaps",
"ele momentum / matching jet momentum, endcaps", 75, 0., 1.5);
659 new TH1F(
"h_ele_EtaMnEtamatchingObject",
"ele momentum eta - matching jet eta",
nbindeta,
detamin,
detamax);
661 "ele momentum eta - matching jet eta vs eta",
669 "ele momentum eta - matching jet eta vs phi",
677 "ele momentum eta - matching jet eta vs pt",
685 new TH1F(
"h_ele_PhiMnPhimatchingObject",
"ele momentum phi - matching jet phi",
nbindphi,
dphimin,
dphimax);
687 "ele momentum phi - matching jet phi",
692 "ele momentum phi - matching SC phi vs eta",
700 "ele momentum phi - matching SC phi vs phi",
708 "ele momentum phi - matching SC phi vs pt",
719 new TH1F(
"h_scl_EoEmatchingObject_barrel",
"ele supercluster energy / matching jet energy, barrel", 50, 0.2, 1.2);
721 "h_scl_EoEmatchingObject_endcaps",
"ele supercluster energy / matching jet energy, endcaps", 50, 0.2, 1.2);
732 histSclSigIEtaIEta_ =
new TH1F(
"h_scl_sigietaieta",
"ele supercluster sigma ieta ieta", 100, 0., 0.05);
734 new TH1F(
"h_scl_sigietaieta_barrel",
"ele supercluster sigma ieta ieta, barrel", 100, 0., 0.05);
736 new TH1F(
"h_scl_sigietaieta_endcaps",
"ele supercluster sigma ieta ieta, endcaps", 100, 0., 0.05);
742 new TH1F(
"h_scl_E2x5max_barrel",
"ele supercluster energy in 2x5 max barrel",
nbinp, 0.,
pmax);
744 new TH1F(
"h_scl_E2x5max_endcaps",
"ele supercluster energy in 2x5 max endcaps",
nbinp, 0.,
pmax);
752 new TH2F(
"h_ele_ambiguousTracksVsEta",
"ele # ambiguous tracks vs eta",
nbineta2D,
etamin,
etamax, 5, 0., 5.);
754 new TH2F(
"h_ele_ambiguousTracksVsPhi",
"ele # ambiguous tracks vs phi",
nbinphi2D,
phimin,
phimax, 5, 0., 5.);
756 new TH2F(
"h_ele_ambiguousTracksVsPt",
"ele # ambiguous tracks vs pt",
nbinpt2D, 0.,
ptmax, 5, 0., 5.);
764 h_ele_lostHits =
new TH1F(
"h_ele_lostHits",
"ele track # lost hits", 5, 0., 5.);
771 h_ele_chi2 =
new TH1F(
"h_ele_chi2",
"ele track #chi^{2}", 100, 0., 15.);
775 h_ele_PinMnPout =
new TH1F(
"h_ele_PinMnPout",
"ele track inner p - outer p, mean",
nbinp, 0., 200.);
778 "ele track inner p - outer p vs eta, mode",
786 "ele track inner p - outer p vs phi, mode",
794 "h_ele_PinMnPoutVsPt_mode",
"ele track inner p - outer p vs pt, mode",
nbinpt2D, 0.,
ptmax,
nbinp2D, 0., 100.);
796 "h_ele_PinMnPoutVsE_mode",
"ele track inner p - outer p vs E, mode",
nbinp2D, 0., 200.,
nbinp2D, 0., 100.);
798 "h_ele_PinMnPoutVsChi2_mode",
"ele track inner p - outer p vs track chi2, mode", 50, 0., 20.,
nbinp2D, 0., 100.);
810 new TH2F(
"h_ele_outerPtVsPt_mode",
"ele track outer p_{T} vs pt, mode",
nbinpt2D, 0., 100.,
nbinpt2D, 0.,
ptmax);
829 h_ele_EoPVsE =
new TH2F(
"h_ele_EoPVsE",
"ele E/P_{vertex} vs E", 50, 0.,
pmax, 50, 0., 5.);
837 new TH1F(
"h_ele_EseedOP_eg_barrel",
"ele E_{seed}/P_{vertex}, ecal driven barrel",
nbineop, 0.,
eopmax);
842 new TH1F(
"h_ele_EseedOP_eg_endcaps",
"ele E_{seed}/P_{vertex}, ecal driven, endcaps",
nbineop, 0.,
eopmax);
848 h_ele_EseedOPVsE =
new TH2F(
"h_ele_EseedOPVsE",
"ele E_{seed}/P_{vertex} vs E", 50, 0.,
pmax, 50, 0., 5.);
856 new TH1F(
"h_ele_EoPout_eg_barrel",
"ele E_{seed}/P_{out}, ecal driven, barrel",
nbineop, 0.,
eopmax);
861 new TH1F(
"h_ele_EoPout_eg_endcaps",
"ele E_{seed}/P_{out}, ecal driven, endcaps",
nbineop, 0.,
eopmax);
875 new TH1F(
"h_ele_EeleOPout_eg_barrel",
"ele E_{ele}/P_{out}, ecal driven, barrel",
nbineop, 0.,
eopmax);
880 new TH1F(
"h_ele_EeleOPout_eg_endcaps",
"ele E_{ele}/P_{out}, ecal driven, endcaps",
nbineop, 0.,
eopmax);
892 "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",
898 "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",
904 "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",
910 "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",
916 "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",
922 "ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",
930 "ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",
938 "ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",
949 "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",
955 "ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",
961 "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",
967 "ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",
973 "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",
979 "ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",
987 "ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",
995 "ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",
1003 "ele #eta_{cl} - #eta_{tr}, prop from outermost",
1009 "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",
1015 "ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",
1021 "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1027 "ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",
1033 "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1039 "ele #eta_{cl} - #eta_{tr} vs eta, prop from out",
1047 "ele #eta_{cl} - #eta_{tr} vs phi, prop from out",
1055 "ele #eta_{cl} - #eta_{tr} vs pt, prop from out",
1063 "ele #phi_{cl} - #phi_{tr}, prop from outermost",
1069 "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",
1075 "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",
1081 "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1087 "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",
1093 "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1099 "ele #phi_{cl} - #phi_{tr} vs eta, prop from out",
1107 "ele #phi_{cl} - #phi_{tr} vs phi, prop from out",
1115 "ele #phi_{cl} - #phi_{tr} vs pt, prop from out",
1123 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",
1129 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",
1135 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",
1141 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1147 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",
1153 new TH1F(
"h_ele_dEtaEleCl_propOut_eg_endcaps",
1154 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1160 "ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",
1168 "ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",
1176 "ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",
1184 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",
1190 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",
1196 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",
1202 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1208 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",
1214 new TH1F(
"h_ele_dPhiEleCl_propOut_eg_endcaps",
1215 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1221 "ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",
1229 "ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",
1237 "ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",
1252 new TH1F(
"h_ele_HoE_eg_barrel",
"ele hadronic energy / em energy, ecal driven, barrel",
nbinhoe,
hoemin,
hoemax);
1255 new TH1F(
"h_ele_HoE_endcaps",
"ele hadronic energy / em energy, endcaps",
nbinhoe,
hoemin,
hoemax);
1258 "h_ele_HoE_eg_endcaps",
"ele hadronic energy / em energy, ecal driven, endcaps",
nbinhoe,
hoemin,
hoemax);
1268 h_ele_seed_dphi2_ =
new TH1F(
"h_ele_seedDphi2",
"ele seed dphi 2nd layer", 50, -0.003, +0.003);
1270 new TH2F(
"h_ele_seedDphi2VsEta",
"ele seed dphi 2nd layer vs eta",
nbineta2D,
etamin,
etamax, 50, -0.003, +0.003);
1272 new TH2F(
"h_ele_seedDphi2VsPt",
"ele seed dphi 2nd layer vs pt",
nbinpt2D, 0.,
ptmax, 50, -0.003, +0.003);
1273 h_ele_seed_drz2_ =
new TH1F(
"h_ele_seedDrz2",
"ele seed dr/dz 2nd layer", 50, -0.03, +0.03);
1275 new TH2F(
"h_ele_seedDrz2VsEta",
"ele seed dr/dz 2nd layer vs eta",
nbineta2D,
etamin,
etamax, 50, -0.03, +0.03);
1277 new TH2F(
"h_ele_seedDrz2VsPt",
"ele seed dr/dz 2nd layer vs pt",
nbinpt2D, 0.,
ptmax, 50, -0.03, +0.03);
1278 h_ele_seed_subdet2_ =
new TH1F(
"h_ele_seedSubdet2",
"ele seed subdet 2nd layer", 10, 0., 10.);
1281 h_ele_classes =
new TH1F(
"h_ele_classes",
"electron classes", 20, 0.0, 20.);
1288 "h_ele_PinVsPoutGolden_mode",
"ele track inner p vs outer p, golden, mode",
nbinp2D, 0.,
pmax, 50, 0.,
pmax);
1290 "ele track inner p vs outer p vs eta, showering, mode",
1298 "h_ele_PinVsPoutGolden_mean",
"ele track inner p vs outer p, golden, mean",
nbinp2D, 0.,
pmax, 50, 0.,
pmax);
1300 "h_ele_PinVsPoutShowering_mean",
"ele track inner p vs outer p, showering, mean",
nbinp2D, 0.,
pmax, 50, 0.,
pmax);
1302 "ele track inner pt vs outer pt, golden, mode",
1310 "ele track inner pt vs outer pt, showering, mode",
1318 "ele track inner pt vs outer pt, golden, mean",
1326 "ele track inner pt vs outer pt, showering, mean",
1334 "h_scl_EoEmatchingObject golden, barrel",
"ele SC energy over matching jet energy, golden, barrel", 100, 0.2, 1.2);
1336 "ele SC energy over matching jet energy, golden, endcaps",
1341 "ele SC energy over matching jet energy, showering, barrel",
1346 "ele SC energy over matching jet energy, showering, endcaps",
1352 h_ele_tkSumPt_dr03 =
new TH1F(
"h_ele_tkSumPt_dr03",
"tk isolation sum, dR=0.3", 100, 0.0, 20.);
1355 new TH1F(
"h_ele_hcalDepth1TowerSumEt_dr03",
"hcal depth1 isolation sum, dR=0.3", 100, 0.0, 20.);
1357 new TH1F(
"h_ele_hcalDepth2TowerSumEt_dr03",
"hcal depth2 isolation sum, dR=0.3", 100, 0.0, 20.);
1358 h_ele_tkSumPt_dr04 =
new TH1F(
"h_ele_tkSumPt_dr04",
"hcal isolation sum", 100, 0.0, 20.);
1361 new TH1F(
"h_ele_hcalDepth1TowerSumEt_dr04",
"hcal depth1 isolation sum, dR=0.4", 100, 0.0, 20.);
1363 new TH1F(
"h_ele_hcalDepth2TowerSumEt_dr04",
"hcal depth2 isolation sum, dR=0.4", 100, 0.0, 20.);
1366 h_ele_fbrem =
new TH1F(
"h_ele_fbrem",
"ele brem fraction, mode", 100, 0., 1.);
1368 new TProfile(
"h_ele_fbremvsEtamode",
"mean ele brem fraction vs eta, mode",
nbineta2D,
etamin,
etamax, 0., 1.);
1370 new TProfile(
"h_ele_fbremvsEtamean",
"mean ele brem fraction vs eta, mean",
nbineta2D,
etamin,
etamax, 0., 1.);
1373 h_ele_mva =
new TH1F(
"h_ele_mva",
"ele mva", 100, -1., 1.);
1374 h_ele_provenance =
new TH1F(
"h_ele_provenance",
"ele provenance", 5, -2., 3.);
1389 h_ele_chi2->GetXaxis()->SetTitle(
"#Chi^{2}");
1435 h_ele_PinMnPout->GetXaxis()->SetTitle(
"P_{vertex} - P_{out} (GeV/c)");
1447 h_ele_EoP->GetXaxis()->SetTitle(
"E/P_{vertex}");
1448 h_ele_EoP->GetYaxis()->SetTitle(
"Events");
1451 h_ele_EoPout->GetXaxis()->SetTitle(
"E_{seed}/P_{out}");
1525 h_ele_HoE->GetYaxis()->SetTitle(
"Events");
1532 h_ele_fbrem->GetXaxis()->SetTitle(
"P_{in} - P_{out} / P_{in}");
1562 h_ele_mee_os->GetXaxis()->SetTitle(
"m_{e^{+}e^{-}} (GeV/c^{2})");
1568 histNum_->GetXaxis()->SetTitle(
"N_{ele}");
1569 histNum_->GetYaxis()->SetTitle(
"Events");
1576 std::cout <<
"efficiency calculation " << std::endl;
1579 h_ele_etaEff->Reset();
1581 h_ele_etaEff->Print();
1582 h_ele_etaEff->GetXaxis()->SetTitle(
"#eta");
1583 h_ele_etaEff->GetYaxis()->SetTitle(
"Efficiency");
1587 h_ele_zEff->Reset();
1589 h_ele_zEff->Print();
1590 h_ele_zEff->GetXaxis()->SetTitle(
"z (cm)");
1591 h_ele_zEff->GetYaxis()->SetTitle(
"Efficiency");
1595 h_ele_absetaEff->Reset();
1597 h_ele_absetaEff->GetXaxis()->SetTitle(
"|#eta|");
1598 h_ele_absetaEff->GetYaxis()->SetTitle(
"Efficiency");
1602 h_ele_ptEff->Reset();
1604 h_ele_ptEff->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
1605 h_ele_ptEff->GetYaxis()->SetTitle(
"Efficiency");
1609 h_ele_phiEff->Reset();
1611 h_ele_phiEff->GetXaxis()->SetTitle(
"#phi (rad)");
1612 h_ele_phiEff->GetYaxis()->SetTitle(
"Efficiency");
1616 h_ele_etaEff_all->Reset();
1618 h_ele_etaEff_all->Print();
1619 h_ele_etaEff_all->GetXaxis()->SetTitle(
"#eta");
1620 h_ele_etaEff_all->GetYaxis()->SetTitle(
"N_{rec}/N_{matching jet}");
1623 h_ele_ptEff_all->Reset();
1625 h_ele_ptEff_all->Print();
1626 h_ele_ptEff_all->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
1627 h_ele_ptEff_all->GetYaxis()->SetTitle(
"N_{rec}/N_{matching gen jet}");
1630 TH1F *h_ele_eta_goldenFrac = (TH1F *)
h_ele_eta_golden->Clone(
"h_ele_eta_goldenFrac");
1631 h_ele_eta_goldenFrac->Reset();
1632 h_ele_eta_goldenFrac->GetXaxis()->SetTitle(
"|#eta|");
1633 h_ele_eta_goldenFrac->GetYaxis()->SetTitle(
"Fraction of electrons");
1635 h_ele_eta_goldenFrac->SetTitle(
"fraction of golden electrons vs eta");
1636 TH1F *h_ele_eta_bbremFrac = (TH1F *)
h_ele_eta_bbrem->Clone(
"h_ele_eta_bbremFrac");
1637 h_ele_eta_bbremFrac->Reset();
1639 h_ele_eta_bbremFrac->GetXaxis()->SetTitle(
"|#eta|");
1640 h_ele_eta_bbremFrac->GetYaxis()->SetTitle(
"Fraction of electrons");
1641 h_ele_eta_bbremFrac->SetTitle(
"fraction of big brem electrons vs eta");
1642 TH1F *h_ele_eta_narrowFrac = (TH1F *)
h_ele_eta_narrow->Clone(
"h_ele_eta_narrowFrac");
1643 h_ele_eta_narrowFrac->Reset();
1645 h_ele_eta_narrowFrac->GetXaxis()->SetTitle(
"|#eta|");
1646 h_ele_eta_narrowFrac->GetYaxis()->SetTitle(
"Fraction of electrons");
1647 h_ele_eta_narrowFrac->SetTitle(
"fraction of narrow electrons vs eta");
1648 TH1F *h_ele_eta_showerFrac = (TH1F *)
h_ele_eta_shower->Clone(
"h_ele_eta_showerFrac");
1649 h_ele_eta_showerFrac->Reset();
1651 h_ele_eta_showerFrac->GetXaxis()->SetTitle(
"|#eta|");
1652 h_ele_eta_showerFrac->GetYaxis()->SetTitle(
"Fraction of electrons");
1653 h_ele_eta_showerFrac->SetTitle(
"fraction of showering electrons vs eta");
1656 TH1F *h_ele_xOverX0VsEta =
new TH1F(
"h_ele_xOverx0VsEta",
"mean X/X_0 vs eta",
nbineta / 2, 0.0, 2.5);
1658 double xOverX0 = 0.;
1661 h_ele_xOverX0VsEta->SetBinContent(ibin, xOverX0);
1666 p_ele_PoPmatchingObjectVsEta->SetTitle(
"mean ele momentum / matching SC energy vs eta");
1667 p_ele_PoPmatchingObjectVsEta->GetXaxis()->SetTitle(
"#eta");
1668 p_ele_PoPmatchingObjectVsEta->GetYaxis()->SetTitle(
"<P/E_{matching gen jet}>");
1669 p_ele_PoPmatchingObjectVsEta->Write();
1671 p_ele_PoPmatchingObjectVsPhi->SetTitle(
"mean ele momentum / gen momentum vs phi");
1672 p_ele_PoPmatchingObjectVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1673 p_ele_PoPmatchingObjectVsPhi->GetYaxis()->SetTitle(
"<P/E_{matching gen jet}>");
1674 p_ele_PoPmatchingObjectVsPhi->Write();
1676 p_ele_EtaMnEtamatchingObjectVsEta->GetXaxis()->SetTitle(
"#eta");
1677 p_ele_EtaMnEtamatchingObjectVsEta->GetYaxis()->SetTitle(
"<#eta_{rec} - #eta_{matching gen jet}>");
1678 p_ele_EtaMnEtamatchingObjectVsEta->Write();
1680 p_ele_EtaMnEtamatchingObjectVsPhi->GetXaxis()->SetTitle(
"#phi");
1681 p_ele_EtaMnEtamatchingObjectVsPhi->GetYaxis()->SetTitle(
"<#eta_{rec} - #eta_{matching gen jet}>");
1682 p_ele_EtaMnEtamatchingObjectVsPhi->Write();
1684 p_ele_PhiMnPhimatchingObjectVsEta->GetXaxis()->SetTitle(
"#eta");
1685 p_ele_PhiMnPhimatchingObjectVsEta->GetYaxis()->SetTitle(
"<#phi_{rec} - #phi_{matching gen jet}> (rad)");
1686 p_ele_PhiMnPhimatchingObjectVsEta->Write();
1688 p_ele_PhiMnPhimatchingObjectVsPhi->GetXaxis()->SetTitle(
"#phi");
1689 p_ele_PhiMnPhimatchingObjectVsPhi->GetYaxis()->SetTitle(
"<#phi_{rec} - #phi_{matching gen jet}> (rad)");
1690 p_ele_PhiMnPhimatchingObjectVsPhi->Write();
1692 p_ele_vertexPtVsEta->GetXaxis()->SetTitle(
"#eta");
1693 p_ele_vertexPtVsEta->GetYaxis()->SetTitle(
"<p_{T}> (GeV/c)");
1694 p_ele_vertexPtVsEta->Write();
1696 p_ele_vertexPtVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1697 p_ele_vertexPtVsPhi->GetYaxis()->SetTitle(
"<p_{T}> (GeV/c)");
1698 p_ele_vertexPtVsPhi->Write();
1700 p_ele_EoPVsEta->GetXaxis()->SetTitle(
"#eta");
1701 p_ele_EoPVsEta->GetYaxis()->SetTitle(
"<E/P_{vertex}>");
1702 p_ele_EoPVsEta->Write();
1704 p_ele_EoPVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1705 p_ele_EoPVsPhi->GetYaxis()->SetTitle(
"<E/P_{vertex}>");
1706 p_ele_EoPVsPhi->Write();
1708 p_ele_EoPoutVsEta->GetXaxis()->SetTitle(
"#eta");
1709 p_ele_EoPoutVsEta->GetYaxis()->SetTitle(
"<E_{seed}/P_{out}>");
1710 p_ele_EoPoutVsEta->Write();
1712 p_ele_EoPoutVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1713 p_ele_EoPoutVsPhi->GetYaxis()->SetTitle(
"<E_{seed}/P_{out}>");
1714 p_ele_EoPoutVsPhi->Write();
1716 p_ele_EeleOPoutVsEta->SetTitle(
"mean ele Eele/pout vs eta");
1717 p_ele_EeleOPoutVsEta->GetXaxis()->SetTitle(
"#eta");
1718 p_ele_EeleOPoutVsEta->GetYaxis()->SetTitle(
"<E_{ele}/P_{out}>");
1719 p_ele_EeleOPoutVsEta->Write();
1721 p_ele_EeleOPoutVsPhi->SetTitle(
"mean ele Eele/pout vs phi");
1722 p_ele_EeleOPoutVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1723 p_ele_EeleOPoutVsPhi->GetYaxis()->SetTitle(
"<E_{ele}/P_{out}>");
1724 p_ele_EeleOPoutVsPhi->Write();
1726 p_ele_HoEVsEta->GetXaxis()->SetTitle(
"#eta");
1727 p_ele_HoEVsEta->GetYaxis()->SetTitle(
"<H/E>");
1728 p_ele_HoEVsEta->Write();
1730 p_ele_HoEVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1731 p_ele_HoEVsPhi->GetYaxis()->SetTitle(
"<H/E>");
1732 p_ele_HoEVsPhi->Write();
1734 p_ele_chi2VsEta->GetXaxis()->SetTitle(
"#eta");
1735 p_ele_chi2VsEta->GetYaxis()->SetTitle(
"<#Chi^{2}>");
1736 p_ele_chi2VsEta->Write();
1738 p_ele_chi2VsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1739 p_ele_chi2VsPhi->GetYaxis()->SetTitle(
"<#Chi^{2}>");
1740 p_ele_chi2VsPhi->Write();
1742 p_ele_foundHitsVsEta->GetXaxis()->SetTitle(
"#eta");
1743 p_ele_foundHitsVsEta->GetYaxis()->SetTitle(
"<N_{hits}>");
1744 p_ele_foundHitsVsEta->Write();
1746 p_ele_foundHitsVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1747 p_ele_foundHitsVsPhi->GetYaxis()->SetTitle(
"<N_{hits}>");
1748 p_ele_foundHitsVsPhi->Write();
1750 p_ele_lostHitsVsEta->GetXaxis()->SetTitle(
"#eta");
1751 p_ele_lostHitsVsEta->GetYaxis()->SetTitle(
"<N_{hits}>");
1752 p_ele_lostHitsVsEta->Write();
1754 p_ele_lostHitsVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1755 p_ele_lostHitsVsPhi->GetYaxis()->SetTitle(
"<N_{hits}>");
1756 p_ele_lostHitsVsPhi->Write();
1758 p_ele_vertexTIPVsEta->SetTitle(
"mean tip (wrt gen vtx) vs eta");
1759 p_ele_vertexTIPVsEta->GetXaxis()->SetTitle(
"#eta");
1760 p_ele_vertexTIPVsEta->GetYaxis()->SetTitle(
"<TIP> (cm)");
1761 p_ele_vertexTIPVsEta->Write();
1763 p_ele_vertexTIPVsPhi->SetTitle(
"mean tip (wrt gen vtx) vs phi");
1764 p_ele_vertexTIPVsPhi->GetXaxis()->SetTitle(
"#phi");
1765 p_ele_vertexTIPVsPhi->GetYaxis()->SetTitle(
"<TIP> (cm)");
1766 p_ele_vertexTIPVsPhi->Write();
1768 p_ele_vertexTIPVsPt->SetTitle(
"mean tip (wrt gen vtx) vs phi");
1769 p_ele_vertexTIPVsPt->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
1770 p_ele_vertexTIPVsPt->GetYaxis()->SetTitle(
"<TIP> (cm)");
1771 p_ele_vertexTIPVsPt->Write();
2008 p_ele_seed_dphi2VsEta_->SetTitle(
"mean ele seed dphi 2nd layer vs eta");
2009 p_ele_seed_dphi2VsEta_->GetXaxis()->SetTitle(
"#eta");
2010 p_ele_seed_dphi2VsEta_->GetYaxis()->SetTitle(
"<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2011 p_ele_seed_dphi2VsEta_->SetMinimum(-0.004);
2012 p_ele_seed_dphi2VsEta_->SetMaximum(0.004);
2013 p_ele_seed_dphi2VsEta_->Write();
2015 p_ele_seed_dphi2VsPt_->SetTitle(
"mean ele seed dphi 2nd layer vs pt");
2016 p_ele_seed_dphi2VsPt_->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
2017 p_ele_seed_dphi2VsPt_->GetYaxis()->SetTitle(
"<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2018 p_ele_seed_dphi2VsPt_->SetMinimum(-0.004);
2019 p_ele_seed_dphi2VsPt_->SetMaximum(0.004);
2020 p_ele_seed_dphi2VsPt_->Write();
2023 p_ele_seed_drz2VsEta_->SetTitle(
"mean ele seed dr(dz) 2nd layer vs eta");
2024 p_ele_seed_drz2VsEta_->GetXaxis()->SetTitle(
"#eta");
2025 p_ele_seed_drz2VsEta_->GetYaxis()->SetTitle(
"<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2026 p_ele_seed_drz2VsEta_->SetMinimum(-0.15);
2027 p_ele_seed_drz2VsEta_->SetMaximum(0.15);
2028 p_ele_seed_drz2VsEta_->Write();
2030 p_ele_seed_drz2VsPt_->SetTitle(
"mean ele seed dr(dz) 2nd layer vs pt");
2031 p_ele_seed_drz2VsPt_->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
2032 p_ele_seed_drz2VsPt_->GetYaxis()->SetTitle(
"<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2033 p_ele_seed_drz2VsPt_->SetMinimum(-0.15);
2034 p_ele_seed_drz2VsPt_->SetMaximum(0.15);
2035 p_ele_seed_drz2VsPt_->Write();
2061 h_ele_etaEff->Write();
2062 h_ele_zEff->Write();
2063 h_ele_phiEff->Write();
2064 h_ele_absetaEff->Write();
2065 h_ele_ptEff->Write();
2066 h_ele_etaEff_all->Write();
2067 h_ele_ptEff_all->Write();
2068 h_ele_eta_goldenFrac->Write();
2069 h_ele_eta_bbremFrac->Write();
2070 h_ele_eta_narrowFrac->Write();
2071 h_ele_eta_showerFrac->Write();
2072 h_ele_xOverX0VsEta->Write();
2106 std::cout <<
"analyzing new event " << std::endl;
2111 edm::LogInfo(
"") <<
"\n\n =================> Treating event " <<
iEvent.id() <<
" Number of electrons "
2123 histNum_->Fill((*gsfElectrons).size());
2140 double d = gsfIter->vertex().x() * gsfIter->vertex().x() + gsfIter->vertex().y() * gsfIter->vertex().y();
2144 float enrj1 = gsfIter->superCluster()->energy();
2146 for (reco::GsfElectronCollection::const_iterator gsfIter2 = gsfIter + 1; gsfIter2 !=
gsfElectrons->end();
2149 float mee2 = p12.Dot(p12);
2151 float enrj2 = gsfIter2->superCluster()->energy();
2153 if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
2155 if (gsfIter->charge() * gsfIter2->charge() < 0.)
2161 int matchingObjectNum = 0;
2163 for (reco::GenJetCollection::const_iterator moIter =
genJets->begin(); moIter !=
genJets->end(); ++moIter) {
2165 matchingObjectNum++;
2183 bool okGsfFound =
false;
2184 double gsfOkRatio = 999999.;
2190 double dphi = gsfIter->
phi() - moIter->phi();
2192 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
2197 double tmpGsfRatio = gsfIter->p() / moIter->energy();
2199 gsfOkRatio = tmpGsfRatio;
2200 bestGsfElectron = *gsfIter;
2231 (bestGsfElectron.
vertex().x() -
bs.position().x()) * (bestGsfElectron.
vertex().x() -
bs.position().x()) +
2232 (bestGsfElectron.
vertex().y() -
bs.position().y()) * (bestGsfElectron.
vertex().y() -
bs.position().y());
2251 if (bestGsfElectron.
isEB())
2253 if (bestGsfElectron.
isEE())
2261 double R =
std::sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
2262 double Rt =
std::sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
2266 if (bestGsfElectron.
isEB())
2268 if (bestGsfElectron.
isEE())
2274 if (bestGsfElectron.
isEB())
2276 if (bestGsfElectron.
isEE())
2279 if (bestGsfElectron.
isEB())
2281 if (bestGsfElectron.
isEE())
2284 if (bestGsfElectron.
isEB())
2286 if (bestGsfElectron.
isEE())
2289 if (bestGsfElectron.
isEB())
2291 if (bestGsfElectron.
isEE())
2316 bestGsfElectron.
gsfTrack()->outerMomentum().R());
2332 bestGsfElectron.
gsfTrack()->normalizedChi2(),
2356 if (bestGsfElectron.
isEB())
2360 if (bestGsfElectron.
isEE())
2370 if (bestGsfElectron.
isEB())
2374 if (bestGsfElectron.
isEE())
2384 if (bestGsfElectron.
isEB())
2388 if (bestGsfElectron.
isEE())
2398 if (bestGsfElectron.
isEB())
2402 if (bestGsfElectron.
isEE())
2412 if (bestGsfElectron.
isEB())
2416 if (bestGsfElectron.
isEE())
2426 if (bestGsfElectron.
isEB())
2430 if (bestGsfElectron.
isEE())
2440 if (bestGsfElectron.
isEB())
2444 if (bestGsfElectron.
isEE())
2454 if (bestGsfElectron.
isEB())
2458 if (bestGsfElectron.
isEE())
2468 if (bestGsfElectron.
isEB())
2472 if (bestGsfElectron.
isEE())
2482 if (bestGsfElectron.
isEB())
2486 if (bestGsfElectron.
isEE())
2496 if (bestGsfElectron.
isEB())
2500 if (bestGsfElectron.
isEE())
2513 if (bestGsfElectron.
isEE())
2527 double fbrem_mean = 0.;
2530 1. - bestGsfElectron.
gsfTrack()->outerMomentum().R() / bestGsfElectron.
gsfTrack()->innerMomentum().R();
2531 double fbrem_mode = bestGsfElectron.
fbrem();
2546 bestGsfElectron.
gsfTrack()->innerMomentum().R());
2550 bestGsfElectron.
gsfTrack()->innerMomentum().R());
2560 bestGsfElectron.
gsfTrack()->innerMomentum().Rho());
2564 bestGsfElectron.
gsfTrack()->innerMomentum().Rho());