39 #include "CLHEP/Units/GlobalPhysicalConstants.h"
418 using namespace reco;
421 : beamSpot_(conf.getParameter<
edm::
InputTag>(
"beamSpot")) {
437 ptmax =
pset.getParameter<
double>(
"Ptmax");
438 pmax =
pset.getParameter<
double>(
"Pmax");
492 if (locJet != std::string::npos) {
493 std::cout <<
"Matching objects are GenJets " << std::endl;
496 std::cout <<
"Didn't recognize input matching objects!! " << std::endl;
500 hlabel =
"h_" + type_ +
"Num";
501 htitle =
"# " + type_ +
"s";
505 histNum_ =
new TH1F(
"h_recEleNum",
"# rec electrons", 20, 0., 20.);
508 hlabel =
"h_matchingObject_eta";
509 htitle = type_ +
" #eta";
511 hlabel =
"h_matchingObject_abseta";
512 htitle = type_ +
" |#eta|";
514 hlabel =
"h_matchingObject_P";
515 htitle = type_ +
" p";
517 hlabel =
"h_matchingObject_Pt";
518 htitle = type_ +
" pt";
520 hlabel =
"h_matchingObject_phi";
521 htitle = type_ +
" phi";
523 hlabel =
"h_matchingObject_z";
524 htitle = type_ +
" z";
533 "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",
538 "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",
543 "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",
548 "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",
552 h_ele_TIP_all =
new TH1F(
"h_ele_TIP_all",
"ele vertex transverse radius, all reco electrons", 100, 0., 0.2);
554 new TH1F(
"h_ele_HoE_all",
"ele hadronic energy / em energy, all reco electrons",
nbinhoe,
hoemin,
hoemax);
564 "E2 - E1 vs ele pairs invariant mass, all electrons",
572 "E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons",
583 new TH1F(
"h_ele_matchingObjectPt_matched",
"Efficiency vs matching jet p_{T}",
nbinpteff, 5.,
ptmax);
586 new TH1F(
"h_ele_matchingObjectAbsEta_matched",
"Efficiency vs matching jet |#eta|",
nbineta / 2, 0., 2.5);
589 new TH1F(
"h_ele_matchingObjectEta_matched",
"Efficiency vs matching jet #eta",
nbineta,
etamin,
etamax);
592 new TH1F(
"h_ele_matchingObjectPhi_matched",
"Efficiency vs matching jet phi",
nbinphi,
phimin,
phimax);
595 new TH1F(
"h_ele_matchingObjectZ_matched",
"Efficiency vs matching jet z",
nbinxyz, -25, 25);
598 h_ele_charge =
new TH1F(
"h_ele_charge",
"ele charge", 5, -2., 2.);
615 h_ele_vertexTIP =
new TH1F(
"h_ele_vertexTIP",
"ele transverse impact parameter (wrt bs)", 90, 0., 0.15);
617 "ele transverse impact parameter (wrt bs) vs eta",
625 "ele transverse impact parameter (wrt bs) vs phi",
633 "h_ele_vertexTIPVsPt",
"ele transverse impact parameter (wrt bs) vs Pt",
nbinpt2D, 0.,
ptmax, 45, 0., 0.15);
635 h_ele_PoPmatchingObject =
new TH1F(
"h_ele_PoPmatchingObject",
"ele momentum / matching jet momentum", 75, 0., 1.5);
637 "ele momentum / matching jet momentum vs eta",
645 "ele momentum / matching jet momentum vs phi",
653 "h_ele_PoPmatchingObjectVsPt",
"ele momentum / matching jet momentum vs eta",
nbinpt2D, 0.,
ptmax, 50, 0., 1.5);
655 new TH1F(
"h_ele_PoPmatchingObject_barrel",
"ele momentum / matching jet momentum, barrel", 75, 0., 1.5);
657 new TH1F(
"h_ele_PoPmatchingObject_endcaps",
"ele momentum / matching jet momentum, endcaps", 75, 0., 1.5);
660 new TH1F(
"h_ele_EtaMnEtamatchingObject",
"ele momentum eta - matching jet eta",
nbindeta,
detamin,
detamax);
662 "ele momentum eta - matching jet eta vs eta",
670 "ele momentum eta - matching jet eta vs phi",
678 "ele momentum eta - matching jet eta vs pt",
686 new TH1F(
"h_ele_PhiMnPhimatchingObject",
"ele momentum phi - matching jet phi",
nbindphi,
dphimin,
dphimax);
688 "ele momentum phi - matching jet phi",
693 "ele momentum phi - matching SC phi vs eta",
701 "ele momentum phi - matching SC phi vs phi",
709 "ele momentum phi - matching SC phi vs pt",
720 new TH1F(
"h_scl_EoEmatchingObject_barrel",
"ele supercluster energy / matching jet energy, barrel", 50, 0.2, 1.2);
722 "h_scl_EoEmatchingObject_endcaps",
"ele supercluster energy / matching jet energy, endcaps", 50, 0.2, 1.2);
733 histSclSigIEtaIEta_ =
new TH1F(
"h_scl_sigietaieta",
"ele supercluster sigma ieta ieta", 100, 0., 0.05);
735 new TH1F(
"h_scl_sigietaieta_barrel",
"ele supercluster sigma ieta ieta, barrel", 100, 0., 0.05);
737 new TH1F(
"h_scl_sigietaieta_endcaps",
"ele supercluster sigma ieta ieta, endcaps", 100, 0., 0.05);
743 new TH1F(
"h_scl_E2x5max_barrel",
"ele supercluster energy in 2x5 max barrel",
nbinp, 0.,
pmax);
745 new TH1F(
"h_scl_E2x5max_endcaps",
"ele supercluster energy in 2x5 max endcaps",
nbinp, 0.,
pmax);
753 new TH2F(
"h_ele_ambiguousTracksVsEta",
"ele # ambiguous tracks vs eta",
nbineta2D,
etamin,
etamax, 5, 0., 5.);
755 new TH2F(
"h_ele_ambiguousTracksVsPhi",
"ele # ambiguous tracks vs phi",
nbinphi2D,
phimin,
phimax, 5, 0., 5.);
757 new TH2F(
"h_ele_ambiguousTracksVsPt",
"ele # ambiguous tracks vs pt",
nbinpt2D, 0.,
ptmax, 5, 0., 5.);
765 h_ele_lostHits =
new TH1F(
"h_ele_lostHits",
"ele track # lost hits", 5, 0., 5.);
772 h_ele_chi2 =
new TH1F(
"h_ele_chi2",
"ele track #chi^{2}", 100, 0., 15.);
776 h_ele_PinMnPout =
new TH1F(
"h_ele_PinMnPout",
"ele track inner p - outer p, mean",
nbinp, 0., 200.);
779 "ele track inner p - outer p vs eta, mode",
787 "ele track inner p - outer p vs phi, mode",
795 "h_ele_PinMnPoutVsPt_mode",
"ele track inner p - outer p vs pt, mode",
nbinpt2D, 0.,
ptmax,
nbinp2D, 0., 100.);
797 "h_ele_PinMnPoutVsE_mode",
"ele track inner p - outer p vs E, mode",
nbinp2D, 0., 200.,
nbinp2D, 0., 100.);
799 "h_ele_PinMnPoutVsChi2_mode",
"ele track inner p - outer p vs track chi2, mode", 50, 0., 20.,
nbinp2D, 0., 100.);
811 new TH2F(
"h_ele_outerPtVsPt_mode",
"ele track outer p_{T} vs pt, mode",
nbinpt2D, 0., 100.,
nbinpt2D, 0.,
ptmax);
830 h_ele_EoPVsE =
new TH2F(
"h_ele_EoPVsE",
"ele E/P_{vertex} vs E", 50, 0.,
pmax, 50, 0., 5.);
838 new TH1F(
"h_ele_EseedOP_eg_barrel",
"ele E_{seed}/P_{vertex}, ecal driven barrel",
nbineop, 0.,
eopmax);
843 new TH1F(
"h_ele_EseedOP_eg_endcaps",
"ele E_{seed}/P_{vertex}, ecal driven, endcaps",
nbineop, 0.,
eopmax);
849 h_ele_EseedOPVsE =
new TH2F(
"h_ele_EseedOPVsE",
"ele E_{seed}/P_{vertex} vs E", 50, 0.,
pmax, 50, 0., 5.);
857 new TH1F(
"h_ele_EoPout_eg_barrel",
"ele E_{seed}/P_{out}, ecal driven, barrel",
nbineop, 0.,
eopmax);
862 new TH1F(
"h_ele_EoPout_eg_endcaps",
"ele E_{seed}/P_{out}, ecal driven, endcaps",
nbineop, 0.,
eopmax);
876 new TH1F(
"h_ele_EeleOPout_eg_barrel",
"ele E_{ele}/P_{out}, ecal driven, barrel",
nbineop, 0.,
eopmax);
881 new TH1F(
"h_ele_EeleOPout_eg_endcaps",
"ele E_{ele}/P_{out}, ecal driven, endcaps",
nbineop, 0.,
eopmax);
893 "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",
899 "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",
905 "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",
911 "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",
917 "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",
923 "ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",
931 "ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",
939 "ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",
950 "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",
956 "ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",
962 "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",
968 "ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",
974 "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",
980 "ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",
988 "ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",
996 "ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",
1004 "ele #eta_{cl} - #eta_{tr}, prop from outermost",
1010 "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",
1016 "ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",
1022 "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1028 "ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",
1034 "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1040 "ele #eta_{cl} - #eta_{tr} vs eta, prop from out",
1048 "ele #eta_{cl} - #eta_{tr} vs phi, prop from out",
1056 "ele #eta_{cl} - #eta_{tr} vs pt, prop from out",
1064 "ele #phi_{cl} - #phi_{tr}, prop from outermost",
1070 "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",
1076 "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",
1082 "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1088 "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",
1094 "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1100 "ele #phi_{cl} - #phi_{tr} vs eta, prop from out",
1108 "ele #phi_{cl} - #phi_{tr} vs phi, prop from out",
1116 "ele #phi_{cl} - #phi_{tr} vs pt, prop from out",
1124 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",
1130 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",
1136 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",
1142 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1148 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",
1154 new TH1F(
"h_ele_dEtaEleCl_propOut_eg_endcaps",
1155 "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1161 "ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",
1169 "ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",
1177 "ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",
1185 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",
1191 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",
1197 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",
1203 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1209 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",
1215 new TH1F(
"h_ele_dPhiEleCl_propOut_eg_endcaps",
1216 "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1222 "ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",
1230 "ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",
1238 "ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",
1253 new TH1F(
"h_ele_HoE_eg_barrel",
"ele hadronic energy / em energy, ecal driven, barrel",
nbinhoe,
hoemin,
hoemax);
1256 new TH1F(
"h_ele_HoE_endcaps",
"ele hadronic energy / em energy, endcaps",
nbinhoe,
hoemin,
hoemax);
1259 "h_ele_HoE_eg_endcaps",
"ele hadronic energy / em energy, ecal driven, endcaps",
nbinhoe,
hoemin,
hoemax);
1269 h_ele_seed_dphi2_ =
new TH1F(
"h_ele_seedDphi2",
"ele seed dphi 2nd layer", 50, -0.003, +0.003);
1271 new TH2F(
"h_ele_seedDphi2VsEta",
"ele seed dphi 2nd layer vs eta",
nbineta2D,
etamin,
etamax, 50, -0.003, +0.003);
1273 new TH2F(
"h_ele_seedDphi2VsPt",
"ele seed dphi 2nd layer vs pt",
nbinpt2D, 0.,
ptmax, 50, -0.003, +0.003);
1274 h_ele_seed_drz2_ =
new TH1F(
"h_ele_seedDrz2",
"ele seed dr/dz 2nd layer", 50, -0.03, +0.03);
1276 new TH2F(
"h_ele_seedDrz2VsEta",
"ele seed dr/dz 2nd layer vs eta",
nbineta2D,
etamin,
etamax, 50, -0.03, +0.03);
1278 new TH2F(
"h_ele_seedDrz2VsPt",
"ele seed dr/dz 2nd layer vs pt",
nbinpt2D, 0.,
ptmax, 50, -0.03, +0.03);
1279 h_ele_seed_subdet2_ =
new TH1F(
"h_ele_seedSubdet2",
"ele seed subdet 2nd layer", 10, 0., 10.);
1282 h_ele_classes =
new TH1F(
"h_ele_classes",
"electron classes", 20, 0.0, 20.);
1289 "h_ele_PinVsPoutGolden_mode",
"ele track inner p vs outer p, golden, mode",
nbinp2D, 0.,
pmax, 50, 0.,
pmax);
1291 "ele track inner p vs outer p vs eta, showering, mode",
1299 "h_ele_PinVsPoutGolden_mean",
"ele track inner p vs outer p, golden, mean",
nbinp2D, 0.,
pmax, 50, 0.,
pmax);
1301 "h_ele_PinVsPoutShowering_mean",
"ele track inner p vs outer p, showering, mean",
nbinp2D, 0.,
pmax, 50, 0.,
pmax);
1303 "ele track inner pt vs outer pt, golden, mode",
1311 "ele track inner pt vs outer pt, showering, mode",
1319 "ele track inner pt vs outer pt, golden, mean",
1327 "ele track inner pt vs outer pt, showering, mean",
1335 "h_scl_EoEmatchingObject golden, barrel",
"ele SC energy over matching jet energy, golden, barrel", 100, 0.2, 1.2);
1337 "ele SC energy over matching jet energy, golden, endcaps",
1342 "ele SC energy over matching jet energy, showering, barrel",
1347 "ele SC energy over matching jet energy, showering, endcaps",
1353 h_ele_tkSumPt_dr03 =
new TH1F(
"h_ele_tkSumPt_dr03",
"tk isolation sum, dR=0.3", 100, 0.0, 20.);
1356 new TH1F(
"h_ele_hcalDepth1TowerSumEt_dr03",
"hcal depth1 isolation sum, dR=0.3", 100, 0.0, 20.);
1358 new TH1F(
"h_ele_hcalDepth2TowerSumEt_dr03",
"hcal depth2 isolation sum, dR=0.3", 100, 0.0, 20.);
1359 h_ele_tkSumPt_dr04 =
new TH1F(
"h_ele_tkSumPt_dr04",
"hcal isolation sum", 100, 0.0, 20.);
1362 new TH1F(
"h_ele_hcalDepth1TowerSumEt_dr04",
"hcal depth1 isolation sum, dR=0.4", 100, 0.0, 20.);
1364 new TH1F(
"h_ele_hcalDepth2TowerSumEt_dr04",
"hcal depth2 isolation sum, dR=0.4", 100, 0.0, 20.);
1367 h_ele_fbrem =
new TH1F(
"h_ele_fbrem",
"ele brem fraction, mode", 100, 0., 1.);
1369 new TProfile(
"h_ele_fbremvsEtamode",
"mean ele brem fraction vs eta, mode",
nbineta2D,
etamin,
etamax, 0., 1.);
1371 new TProfile(
"h_ele_fbremvsEtamean",
"mean ele brem fraction vs eta, mean",
nbineta2D,
etamin,
etamax, 0., 1.);
1374 h_ele_mva =
new TH1F(
"h_ele_mva",
"ele mva", 100, -1., 1.);
1375 h_ele_provenance =
new TH1F(
"h_ele_provenance",
"ele provenance", 5, -2., 3.);
1390 h_ele_chi2->GetXaxis()->SetTitle(
"#Chi^{2}");
1436 h_ele_PinMnPout->GetXaxis()->SetTitle(
"P_{vertex} - P_{out} (GeV/c)");
1448 h_ele_EoP->GetXaxis()->SetTitle(
"E/P_{vertex}");
1449 h_ele_EoP->GetYaxis()->SetTitle(
"Events");
1452 h_ele_EoPout->GetXaxis()->SetTitle(
"E_{seed}/P_{out}");
1526 h_ele_HoE->GetYaxis()->SetTitle(
"Events");
1533 h_ele_fbrem->GetXaxis()->SetTitle(
"P_{in} - P_{out} / P_{in}");
1563 h_ele_mee_os->GetXaxis()->SetTitle(
"m_{e^{+}e^{-}} (GeV/c^{2})");
1569 histNum_->GetXaxis()->SetTitle(
"N_{ele}");
1570 histNum_->GetYaxis()->SetTitle(
"Events");
1577 std::cout <<
"efficiency calculation " << std::endl;
1580 h_ele_etaEff->Reset();
1582 h_ele_etaEff->Print();
1583 h_ele_etaEff->GetXaxis()->SetTitle(
"#eta");
1584 h_ele_etaEff->GetYaxis()->SetTitle(
"Efficiency");
1588 h_ele_zEff->Reset();
1590 h_ele_zEff->Print();
1591 h_ele_zEff->GetXaxis()->SetTitle(
"z (cm)");
1592 h_ele_zEff->GetYaxis()->SetTitle(
"Efficiency");
1596 h_ele_absetaEff->Reset();
1598 h_ele_absetaEff->GetXaxis()->SetTitle(
"|#eta|");
1599 h_ele_absetaEff->GetYaxis()->SetTitle(
"Efficiency");
1603 h_ele_ptEff->Reset();
1605 h_ele_ptEff->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
1606 h_ele_ptEff->GetYaxis()->SetTitle(
"Efficiency");
1610 h_ele_phiEff->Reset();
1612 h_ele_phiEff->GetXaxis()->SetTitle(
"#phi (rad)");
1613 h_ele_phiEff->GetYaxis()->SetTitle(
"Efficiency");
1617 h_ele_etaEff_all->Reset();
1619 h_ele_etaEff_all->Print();
1620 h_ele_etaEff_all->GetXaxis()->SetTitle(
"#eta");
1621 h_ele_etaEff_all->GetYaxis()->SetTitle(
"N_{rec}/N_{matching jet}");
1624 h_ele_ptEff_all->Reset();
1626 h_ele_ptEff_all->Print();
1627 h_ele_ptEff_all->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
1628 h_ele_ptEff_all->GetYaxis()->SetTitle(
"N_{rec}/N_{matching gen jet}");
1631 TH1F *h_ele_eta_goldenFrac = (TH1F *)
h_ele_eta_golden->Clone(
"h_ele_eta_goldenFrac");
1632 h_ele_eta_goldenFrac->Reset();
1633 h_ele_eta_goldenFrac->GetXaxis()->SetTitle(
"|#eta|");
1634 h_ele_eta_goldenFrac->GetYaxis()->SetTitle(
"Fraction of electrons");
1636 h_ele_eta_goldenFrac->SetTitle(
"fraction of golden electrons vs eta");
1637 TH1F *h_ele_eta_bbremFrac = (TH1F *)
h_ele_eta_bbrem->Clone(
"h_ele_eta_bbremFrac");
1638 h_ele_eta_bbremFrac->Reset();
1640 h_ele_eta_bbremFrac->GetXaxis()->SetTitle(
"|#eta|");
1641 h_ele_eta_bbremFrac->GetYaxis()->SetTitle(
"Fraction of electrons");
1642 h_ele_eta_bbremFrac->SetTitle(
"fraction of big brem electrons vs eta");
1643 TH1F *h_ele_eta_narrowFrac = (TH1F *)
h_ele_eta_narrow->Clone(
"h_ele_eta_narrowFrac");
1644 h_ele_eta_narrowFrac->Reset();
1646 h_ele_eta_narrowFrac->GetXaxis()->SetTitle(
"|#eta|");
1647 h_ele_eta_narrowFrac->GetYaxis()->SetTitle(
"Fraction of electrons");
1648 h_ele_eta_narrowFrac->SetTitle(
"fraction of narrow electrons vs eta");
1649 TH1F *h_ele_eta_showerFrac = (TH1F *)
h_ele_eta_shower->Clone(
"h_ele_eta_showerFrac");
1650 h_ele_eta_showerFrac->Reset();
1652 h_ele_eta_showerFrac->GetXaxis()->SetTitle(
"|#eta|");
1653 h_ele_eta_showerFrac->GetYaxis()->SetTitle(
"Fraction of electrons");
1654 h_ele_eta_showerFrac->SetTitle(
"fraction of showering electrons vs eta");
1657 TH1F *h_ele_xOverX0VsEta =
new TH1F(
"h_ele_xOverx0VsEta",
"mean X/X_0 vs eta",
nbineta / 2, 0.0, 2.5);
1659 double xOverX0 = 0.;
1662 h_ele_xOverX0VsEta->SetBinContent(ibin, xOverX0);
1667 p_ele_PoPmatchingObjectVsEta->SetTitle(
"mean ele momentum / matching SC energy vs eta");
1668 p_ele_PoPmatchingObjectVsEta->GetXaxis()->SetTitle(
"#eta");
1669 p_ele_PoPmatchingObjectVsEta->GetYaxis()->SetTitle(
"<P/E_{matching gen jet}>");
1670 p_ele_PoPmatchingObjectVsEta->Write();
1672 p_ele_PoPmatchingObjectVsPhi->SetTitle(
"mean ele momentum / gen momentum vs phi");
1673 p_ele_PoPmatchingObjectVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1674 p_ele_PoPmatchingObjectVsPhi->GetYaxis()->SetTitle(
"<P/E_{matching gen jet}>");
1675 p_ele_PoPmatchingObjectVsPhi->Write();
1677 p_ele_EtaMnEtamatchingObjectVsEta->GetXaxis()->SetTitle(
"#eta");
1678 p_ele_EtaMnEtamatchingObjectVsEta->GetYaxis()->SetTitle(
"<#eta_{rec} - #eta_{matching gen jet}>");
1679 p_ele_EtaMnEtamatchingObjectVsEta->Write();
1681 p_ele_EtaMnEtamatchingObjectVsPhi->GetXaxis()->SetTitle(
"#phi");
1682 p_ele_EtaMnEtamatchingObjectVsPhi->GetYaxis()->SetTitle(
"<#eta_{rec} - #eta_{matching gen jet}>");
1683 p_ele_EtaMnEtamatchingObjectVsPhi->Write();
1685 p_ele_PhiMnPhimatchingObjectVsEta->GetXaxis()->SetTitle(
"#eta");
1686 p_ele_PhiMnPhimatchingObjectVsEta->GetYaxis()->SetTitle(
"<#phi_{rec} - #phi_{matching gen jet}> (rad)");
1687 p_ele_PhiMnPhimatchingObjectVsEta->Write();
1689 p_ele_PhiMnPhimatchingObjectVsPhi->GetXaxis()->SetTitle(
"#phi");
1690 p_ele_PhiMnPhimatchingObjectVsPhi->GetYaxis()->SetTitle(
"<#phi_{rec} - #phi_{matching gen jet}> (rad)");
1691 p_ele_PhiMnPhimatchingObjectVsPhi->Write();
1693 p_ele_vertexPtVsEta->GetXaxis()->SetTitle(
"#eta");
1694 p_ele_vertexPtVsEta->GetYaxis()->SetTitle(
"<p_{T}> (GeV/c)");
1695 p_ele_vertexPtVsEta->Write();
1697 p_ele_vertexPtVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1698 p_ele_vertexPtVsPhi->GetYaxis()->SetTitle(
"<p_{T}> (GeV/c)");
1699 p_ele_vertexPtVsPhi->Write();
1701 p_ele_EoPVsEta->GetXaxis()->SetTitle(
"#eta");
1702 p_ele_EoPVsEta->GetYaxis()->SetTitle(
"<E/P_{vertex}>");
1703 p_ele_EoPVsEta->Write();
1705 p_ele_EoPVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1706 p_ele_EoPVsPhi->GetYaxis()->SetTitle(
"<E/P_{vertex}>");
1707 p_ele_EoPVsPhi->Write();
1709 p_ele_EoPoutVsEta->GetXaxis()->SetTitle(
"#eta");
1710 p_ele_EoPoutVsEta->GetYaxis()->SetTitle(
"<E_{seed}/P_{out}>");
1711 p_ele_EoPoutVsEta->Write();
1713 p_ele_EoPoutVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1714 p_ele_EoPoutVsPhi->GetYaxis()->SetTitle(
"<E_{seed}/P_{out}>");
1715 p_ele_EoPoutVsPhi->Write();
1717 p_ele_EeleOPoutVsEta->SetTitle(
"mean ele Eele/pout vs eta");
1718 p_ele_EeleOPoutVsEta->GetXaxis()->SetTitle(
"#eta");
1719 p_ele_EeleOPoutVsEta->GetYaxis()->SetTitle(
"<E_{ele}/P_{out}>");
1720 p_ele_EeleOPoutVsEta->Write();
1722 p_ele_EeleOPoutVsPhi->SetTitle(
"mean ele Eele/pout vs phi");
1723 p_ele_EeleOPoutVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1724 p_ele_EeleOPoutVsPhi->GetYaxis()->SetTitle(
"<E_{ele}/P_{out}>");
1725 p_ele_EeleOPoutVsPhi->Write();
1727 p_ele_HoEVsEta->GetXaxis()->SetTitle(
"#eta");
1728 p_ele_HoEVsEta->GetYaxis()->SetTitle(
"<H/E>");
1729 p_ele_HoEVsEta->Write();
1731 p_ele_HoEVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1732 p_ele_HoEVsPhi->GetYaxis()->SetTitle(
"<H/E>");
1733 p_ele_HoEVsPhi->Write();
1735 p_ele_chi2VsEta->GetXaxis()->SetTitle(
"#eta");
1736 p_ele_chi2VsEta->GetYaxis()->SetTitle(
"<#Chi^{2}>");
1737 p_ele_chi2VsEta->Write();
1739 p_ele_chi2VsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1740 p_ele_chi2VsPhi->GetYaxis()->SetTitle(
"<#Chi^{2}>");
1741 p_ele_chi2VsPhi->Write();
1743 p_ele_foundHitsVsEta->GetXaxis()->SetTitle(
"#eta");
1744 p_ele_foundHitsVsEta->GetYaxis()->SetTitle(
"<N_{hits}>");
1745 p_ele_foundHitsVsEta->Write();
1747 p_ele_foundHitsVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1748 p_ele_foundHitsVsPhi->GetYaxis()->SetTitle(
"<N_{hits}>");
1749 p_ele_foundHitsVsPhi->Write();
1751 p_ele_lostHitsVsEta->GetXaxis()->SetTitle(
"#eta");
1752 p_ele_lostHitsVsEta->GetYaxis()->SetTitle(
"<N_{hits}>");
1753 p_ele_lostHitsVsEta->Write();
1755 p_ele_lostHitsVsPhi->GetXaxis()->SetTitle(
"#phi (rad)");
1756 p_ele_lostHitsVsPhi->GetYaxis()->SetTitle(
"<N_{hits}>");
1757 p_ele_lostHitsVsPhi->Write();
1759 p_ele_vertexTIPVsEta->SetTitle(
"mean tip (wrt gen vtx) vs eta");
1760 p_ele_vertexTIPVsEta->GetXaxis()->SetTitle(
"#eta");
1761 p_ele_vertexTIPVsEta->GetYaxis()->SetTitle(
"<TIP> (cm)");
1762 p_ele_vertexTIPVsEta->Write();
1764 p_ele_vertexTIPVsPhi->SetTitle(
"mean tip (wrt gen vtx) vs phi");
1765 p_ele_vertexTIPVsPhi->GetXaxis()->SetTitle(
"#phi");
1766 p_ele_vertexTIPVsPhi->GetYaxis()->SetTitle(
"<TIP> (cm)");
1767 p_ele_vertexTIPVsPhi->Write();
1769 p_ele_vertexTIPVsPt->SetTitle(
"mean tip (wrt gen vtx) vs phi");
1770 p_ele_vertexTIPVsPt->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
1771 p_ele_vertexTIPVsPt->GetYaxis()->SetTitle(
"<TIP> (cm)");
1772 p_ele_vertexTIPVsPt->Write();
2009 p_ele_seed_dphi2VsEta_->SetTitle(
"mean ele seed dphi 2nd layer vs eta");
2010 p_ele_seed_dphi2VsEta_->GetXaxis()->SetTitle(
"#eta");
2011 p_ele_seed_dphi2VsEta_->GetYaxis()->SetTitle(
"<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2012 p_ele_seed_dphi2VsEta_->SetMinimum(-0.004);
2013 p_ele_seed_dphi2VsEta_->SetMaximum(0.004);
2014 p_ele_seed_dphi2VsEta_->Write();
2016 p_ele_seed_dphi2VsPt_->SetTitle(
"mean ele seed dphi 2nd layer vs pt");
2017 p_ele_seed_dphi2VsPt_->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
2018 p_ele_seed_dphi2VsPt_->GetYaxis()->SetTitle(
"<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2019 p_ele_seed_dphi2VsPt_->SetMinimum(-0.004);
2020 p_ele_seed_dphi2VsPt_->SetMaximum(0.004);
2021 p_ele_seed_dphi2VsPt_->Write();
2024 p_ele_seed_drz2VsEta_->SetTitle(
"mean ele seed dr(dz) 2nd layer vs eta");
2025 p_ele_seed_drz2VsEta_->GetXaxis()->SetTitle(
"#eta");
2026 p_ele_seed_drz2VsEta_->GetYaxis()->SetTitle(
"<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2027 p_ele_seed_drz2VsEta_->SetMinimum(-0.15);
2028 p_ele_seed_drz2VsEta_->SetMaximum(0.15);
2029 p_ele_seed_drz2VsEta_->Write();
2031 p_ele_seed_drz2VsPt_->SetTitle(
"mean ele seed dr(dz) 2nd layer vs pt");
2032 p_ele_seed_drz2VsPt_->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
2033 p_ele_seed_drz2VsPt_->GetYaxis()->SetTitle(
"<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2034 p_ele_seed_drz2VsPt_->SetMinimum(-0.15);
2035 p_ele_seed_drz2VsPt_->SetMaximum(0.15);
2036 p_ele_seed_drz2VsPt_->Write();
2062 h_ele_etaEff->Write();
2063 h_ele_zEff->Write();
2064 h_ele_phiEff->Write();
2065 h_ele_absetaEff->Write();
2066 h_ele_ptEff->Write();
2067 h_ele_etaEff_all->Write();
2068 h_ele_ptEff_all->Write();
2069 h_ele_eta_goldenFrac->Write();
2070 h_ele_eta_bbremFrac->Write();
2071 h_ele_eta_narrowFrac->Write();
2072 h_ele_eta_showerFrac->Write();
2073 h_ele_xOverX0VsEta->Write();
2107 std::cout <<
"analyzing new event " << std::endl;
2112 edm::LogInfo(
"") <<
"\n\n =================> Treating event " <<
iEvent.id() <<
" Number of electrons "
2124 histNum_->Fill((*gsfElectrons).size());
2141 double d = gsfIter->vertex().x() * gsfIter->vertex().x() + gsfIter->vertex().y() * gsfIter->vertex().y();
2145 float enrj1 = gsfIter->superCluster()->energy();
2147 for (reco::GsfElectronCollection::const_iterator gsfIter2 = gsfIter + 1; gsfIter2 !=
gsfElectrons->end();
2150 float mee2 = p12.Dot(p12);
2152 float enrj2 = gsfIter2->superCluster()->energy();
2154 if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
2156 if (gsfIter->charge() * gsfIter2->charge() < 0.)
2162 int matchingObjectNum = 0;
2164 for (reco::GenJetCollection::const_iterator moIter =
genJets->begin(); moIter !=
genJets->end(); ++moIter) {
2166 matchingObjectNum++;
2184 bool okGsfFound =
false;
2185 double gsfOkRatio = 999999.;
2191 double dphi = gsfIter->
phi() - moIter->phi();
2193 dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
2198 double tmpGsfRatio = gsfIter->p() / moIter->energy();
2200 gsfOkRatio = tmpGsfRatio;
2201 bestGsfElectron = *gsfIter;
2232 (bestGsfElectron.
vertex().x() -
bs.position().x()) * (bestGsfElectron.
vertex().x() -
bs.position().x()) +
2233 (bestGsfElectron.
vertex().y() -
bs.position().y()) * (bestGsfElectron.
vertex().y() -
bs.position().y());
2252 if (bestGsfElectron.
isEB())
2254 if (bestGsfElectron.
isEE())
2262 double R = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
2263 double Rt = TMath::Sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
2267 if (bestGsfElectron.
isEB())
2269 if (bestGsfElectron.
isEE())
2275 if (bestGsfElectron.
isEB())
2277 if (bestGsfElectron.
isEE())
2280 if (bestGsfElectron.
isEB())
2282 if (bestGsfElectron.
isEE())
2285 if (bestGsfElectron.
isEB())
2287 if (bestGsfElectron.
isEE())
2290 if (bestGsfElectron.
isEB())
2292 if (bestGsfElectron.
isEE())
2317 bestGsfElectron.
gsfTrack()->outerMomentum().R());
2333 bestGsfElectron.
gsfTrack()->normalizedChi2(),
2357 if (bestGsfElectron.
isEB())
2361 if (bestGsfElectron.
isEE())
2371 if (bestGsfElectron.
isEB())
2375 if (bestGsfElectron.
isEE())
2385 if (bestGsfElectron.
isEB())
2389 if (bestGsfElectron.
isEE())
2399 if (bestGsfElectron.
isEB())
2403 if (bestGsfElectron.
isEE())
2413 if (bestGsfElectron.
isEB())
2417 if (bestGsfElectron.
isEE())
2427 if (bestGsfElectron.
isEB())
2431 if (bestGsfElectron.
isEE())
2441 if (bestGsfElectron.
isEB())
2445 if (bestGsfElectron.
isEE())
2455 if (bestGsfElectron.
isEB())
2459 if (bestGsfElectron.
isEE())
2469 if (bestGsfElectron.
isEB())
2473 if (bestGsfElectron.
isEE())
2483 if (bestGsfElectron.
isEB())
2487 if (bestGsfElectron.
isEE())
2497 if (bestGsfElectron.
isEB())
2501 if (bestGsfElectron.
isEE())
2514 if (bestGsfElectron.
isEE())
2528 double fbrem_mean = 0.;
2531 1. - bestGsfElectron.
gsfTrack()->outerMomentum().R() / bestGsfElectron.
gsfTrack()->innerMomentum().R();
2532 double fbrem_mode = bestGsfElectron.
fbrem();
2547 bestGsfElectron.
gsfTrack()->innerMomentum().R());
2551 bestGsfElectron.
gsfTrack()->innerMomentum().R());
2561 bestGsfElectron.
gsfTrack()->innerMomentum().Rho());
2565 bestGsfElectron.
gsfTrack()->innerMomentum().Rho());