CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GsfElectronMCAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: RecoEgamma/Examples
4 // Class: GsfElectronMCAnalyzer
5 //
13 //
14 // Original Author: Ursula Berthon, Claude Charlot
15 // Created: Mon Mar 27 13:22:06 CEST 2006
16 //
17 //
18 
37 
38 #include "CLHEP/Units/GlobalPhysicalConstants.h"
39 
40 #include "TFile.h"
41 #include "TH1F.h"
42 #include "TH1I.h"
43 #include "TH2F.h"
44 #include "TProfile.h"
45 #include "TTree.h"
46 
47 #include <iostream>
48 #include <vector>
49 
51 public:
52  explicit GsfElectronMCAnalyzer(const edm::ParameterSet &conf);
53 
54  ~GsfElectronMCAnalyzer() override;
55 
56  void beginJob() override;
57  void endJob() override;
58  void analyze(const edm::Event &e, const edm::EventSetup &c) override;
59 
60 private:
64  TFile *histfile_;
65  TTree *tree_;
66  float mcEnergy[10], mcEta[10], mcPhi[10], mcPt[10], mcQ[10];
68  float seedMomentum[10], seedEta[10], seedPhi[10], seedPt[10], seedQ[10];
69 
70  TH1F *h_mcNum;
71  TH1F *h_eleNum;
72  TH1F *h_gamNum;
73 
74  TH1F *h_simEta;
75  TH1F *h_simAbsEta;
76  TH1F *h_simP;
77  TH1F *h_simPt;
78  TH1F *h_simPhi;
79  TH1F *h_simZ;
80  TH2F *h_simPtEta;
81 
88 
94 
136 
139 
146  TH1F *h_ele_Et;
161 
162  TH1F *histNum_;
163 
164  TH1F *histSclEn_;
183  TH1F *histSclEt_;
187  TH1F *histSclEta_;
188  TH1F *histSclPhi_;
189 
191 
222 
239  TH1F *h_ele_chi2;
245 
280 
289  TH1F *h_ele_EoP;
325 
380 
388 
390  TH1F *h_ele_eta;
395 
396  TH1F *h_ele_HoE;
406 
407  TH1F *h_ele_fbrem;
411 
424 
425  TH1F *h_ele_mva;
428 
437 
441  bool readAOD_;
442 
443  double maxPt_;
444  double maxAbsEta_;
445  double deltaR_;
446  std::vector<int> matchingIDs_;
447  std::vector<int> matchingMotherIDs_;
448 
449  // histos limits and binning
450  double etamin;
451  double etamax;
452  double phimin;
453  double phimax;
454  double ptmax;
455  double pmax;
456  double eopmax;
457  double eopmaxsht;
458  double detamin;
459  double detamax;
460  double dphimin;
461  double dphimax;
462  double detamatchmin;
463  double detamatchmax;
464  double dphimatchmin;
465  double dphimatchmax;
466  double fhitsmax;
467  double lhitsmax;
468  double poptruemin;
469  double poptruemax;
470  double meemin;
471  double meemax;
472  double hoemin;
473  double hoemax;
474  int nbineta;
475  int nbinp;
476  int nbinpt;
478  int nbinphi;
479  int nbinp2D;
480  int nbinpt2D;
483  int nbineop;
487  int nbinxyz;
488  int nbindeta;
489  int nbindphi;
495  int nbinmee;
496  int nbinhoe;
497 };
498 
501 
502 using namespace reco;
503 
505  outputFile_ = conf.getParameter<std::string>("outputFile");
506  histfile_ = new TFile(outputFile_.c_str(), "RECREATE");
507  electronCollection_ = conf.getParameter<edm::InputTag>("electronCollection");
508  mcTruthCollection_ = conf.getParameter<edm::InputTag>("mcTruthCollection");
509  readAOD_ = conf.getParameter<bool>("readAOD");
510  maxPt_ = conf.getParameter<double>("MaxPt");
511  maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
512  deltaR_ = conf.getParameter<double>("DeltaR");
513  matchingIDs_ = conf.getParameter<std::vector<int> >("MatchingID");
514  matchingMotherIDs_ = conf.getParameter<std::vector<int> >("MatchingMotherID");
515  edm::ParameterSet pset = conf.getParameter<edm::ParameterSet>("HistosConfigurationMC");
516 
517  etamin = pset.getParameter<double>("Etamin");
518  etamax = pset.getParameter<double>("Etamax");
519  phimin = pset.getParameter<double>("Phimin");
520  phimax = pset.getParameter<double>("Phimax");
521  ptmax = pset.getParameter<double>("Ptmax");
522  pmax = pset.getParameter<double>("Pmax");
523  eopmax = pset.getParameter<double>("Eopmax");
524  eopmaxsht = pset.getParameter<double>("Eopmaxsht");
525  detamin = pset.getParameter<double>("Detamin");
526  detamax = pset.getParameter<double>("Detamax");
527  dphimin = pset.getParameter<double>("Dphimin");
528  dphimax = pset.getParameter<double>("Dphimax");
529  detamatchmin = pset.getParameter<double>("Detamatchmin");
530  detamatchmax = pset.getParameter<double>("Detamatchmax");
531  dphimatchmin = pset.getParameter<double>("Dphimatchmin");
532  dphimatchmax = pset.getParameter<double>("Dphimatchmax");
533  fhitsmax = pset.getParameter<double>("Fhitsmax");
534  lhitsmax = pset.getParameter<double>("Lhitsmax");
535  nbineta = pset.getParameter<int>("Nbineta");
536  nbineta2D = pset.getParameter<int>("Nbineta2D");
537  nbinp = pset.getParameter<int>("Nbinp");
538  nbinpt = pset.getParameter<int>("Nbinpt");
539  nbinp2D = pset.getParameter<int>("Nbinp2D");
540  nbinpt2D = pset.getParameter<int>("Nbinpt2D");
541  nbinpteff = pset.getParameter<int>("Nbinpteff");
542  nbinphi = pset.getParameter<int>("Nbinphi");
543  nbinphi2D = pset.getParameter<int>("Nbinphi2D");
544  nbineop = pset.getParameter<int>("Nbineop");
545  nbineop2D = pset.getParameter<int>("Nbineop2D");
546  nbinfhits = pset.getParameter<int>("Nbinfhits");
547  nbinlhits = pset.getParameter<int>("Nbinlhits");
548  nbinxyz = pset.getParameter<int>("Nbinxyz");
549  nbindeta = pset.getParameter<int>("Nbindeta");
550  nbindphi = pset.getParameter<int>("Nbindphi");
551  nbindetamatch = pset.getParameter<int>("Nbindetamatch");
552  nbindphimatch = pset.getParameter<int>("Nbindphimatch");
553  nbindetamatch2D = pset.getParameter<int>("Nbindetamatch2D");
554  nbindphimatch2D = pset.getParameter<int>("Nbindphimatch2D");
555  nbinpoptrue = pset.getParameter<int>("Nbinpoptrue");
556  poptruemin = pset.getParameter<double>("Poptruemin");
557  poptruemax = pset.getParameter<double>("Poptruemax");
558  nbinmee = pset.getParameter<int>("Nbinmee");
559  meemin = pset.getParameter<double>("Meemin");
560  meemax = pset.getParameter<double>("Meemax");
561  nbinhoe = pset.getParameter<int>("Nbinhoe");
562  hoemin = pset.getParameter<double>("Hoemin");
563  hoemax = pset.getParameter<double>("Hoemax");
564 }
565 
567  histfile_->cd();
568 
569  // mc truth
570  h_mcNum = new TH1F("h_mcNum", "# mc particles", nbinfhits, 0., fhitsmax);
571  h_mcNum->Sumw2();
572  h_eleNum = new TH1F("h_mcNum_ele", "# mc electrons", nbinfhits, 0., fhitsmax);
573  h_eleNum->Sumw2();
574  h_gamNum = new TH1F("h_mcNum_gam", "# mc gammas", nbinfhits, 0., fhitsmax);
575  h_gamNum->Sumw2();
576 
577  // rec event
578  histNum_ = new TH1F("h_recEleNum", "# rec electrons", 20, 0., 20.);
579 
580  // mc
581  h_simEta = new TH1F("h_mc_eta", "gen #eta", nbineta, etamin, etamax);
582  h_simEta->Sumw2();
583  h_simAbsEta = new TH1F("h_mc_abseta", "gen |#eta|", nbineta / 2, 0., etamax);
584  h_simAbsEta->Sumw2();
585  h_simP = new TH1F("h_mc_P", "gen p", nbinp, 0., pmax);
586  h_simP->Sumw2();
587  h_simPt = new TH1F("h_mc_Pt", "gen pt", nbinpteff, 5., ptmax);
588  h_simPt->Sumw2();
589  h_simPhi = new TH1F("h_mc_phi", "gen phi", nbinphi, phimin, phimax);
590  h_simPhi->Sumw2();
591  h_simZ = new TH1F("h_mc_z", "gen z ", nbinxyz, -25, 25);
592  h_simZ->Sumw2();
593  h_simPtEta = new TH2F("h_mc_pteta", "gen pt vs #eta", nbineta2D, etamin, etamax, nbinpt2D, 5., ptmax);
594  h_simPtEta->Sumw2();
595 
596  // all electrons
597  h_ele_EoverP_all = new TH1F("h_ele_EoverP_all", "ele E/P_{vertex}, all reco electrons", nbineop, 0., eopmax);
598  h_ele_EoverP_all->Sumw2();
599  h_ele_EoverP_all_barrel =
600  new TH1F("h_ele_EoverP_all_barrel", "ele E/P_{vertex}, all reco electrons, barrel", nbineop, 0., eopmax);
601  h_ele_EoverP_all_barrel->Sumw2();
602  h_ele_EoverP_all_endcaps =
603  new TH1F("h_ele_EoverP_all_endcaps", "ele E/P_{vertex}, all reco electrons, endcaps", nbineop, 0., eopmax);
604  h_ele_EoverP_all_endcaps->Sumw2();
605  h_ele_EseedOP_all = new TH1F("h_ele_EseedOP_all", "ele E_{seed}/P_{vertex}, all reco electrons", nbineop, 0., eopmax);
606  h_ele_EseedOP_all->Sumw2();
607  h_ele_EseedOP_all_barrel =
608  new TH1F("h_ele_EseedOP_all_barrel", "ele E_{seed}/P_{vertex}, all reco electrons, barrel", nbineop, 0., eopmax);
609  h_ele_EseedOP_all_barrel->Sumw2();
610  h_ele_EseedOP_all_endcaps = new TH1F(
611  "h_ele_EseedOP_all_endcaps", "ele E_{seed}/P_{vertex}, all reco electrons, endcaps", nbineop, 0., eopmax);
612  h_ele_EseedOP_all_endcaps->Sumw2();
613  h_ele_EoPout_all = new TH1F("h_ele_EoPout_all", "ele E_{seed}/P_{out}, all reco electrons", nbineop, 0., eopmax);
614  h_ele_EoPout_all->Sumw2();
615  h_ele_EoPout_all_barrel =
616  new TH1F("h_ele_EoPout_all_barrel", "ele E_{seed}/P_{out}, all reco electrons barrel", nbineop, 0., eopmax);
617  h_ele_EoPout_all_barrel->Sumw2();
618  h_ele_EoPout_all_endcaps =
619  new TH1F("h_ele_EoPout_all_endcaps", "ele E_{seed}/P_{out}, all reco electrons endcaps", nbineop, 0., eopmax);
620  h_ele_EoPout_all_endcaps->Sumw2();
621  h_ele_EeleOPout_all = new TH1F("h_ele_EeleOPout_all", "ele E_{ele}/P_{out}, all reco electrons", nbineop, 0., eopmax);
622  h_ele_EeleOPout_all->Sumw2();
623  h_ele_EeleOPout_all_barrel =
624  new TH1F("h_ele_EeleOPout_all_barrel", "ele E_{ele}/P_{out}, all reco electrons barrel", nbineop, 0., eopmax);
625  h_ele_EeleOPout_all_barrel->Sumw2();
626  h_ele_EeleOPout_all_endcaps =
627  new TH1F("h_ele_EeleOPout_all_endcaps", "ele E_{ele}/P_{out}, all reco electrons endcaps", nbineop, 0., eopmax);
628  h_ele_EeleOPout_all_endcaps->Sumw2();
629  h_ele_dEtaSc_propVtx_all = new TH1F("h_ele_dEtaSc_propVtx_all",
630  "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",
631  nbindetamatch,
632  detamatchmin,
633  detamatchmax);
634  h_ele_dEtaSc_propVtx_all->Sumw2();
635  h_ele_dEtaSc_propVtx_all_barrel = new TH1F("h_ele_dEtaSc_propVtx_all_barrel",
636  "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons barrel",
637  nbindetamatch,
638  detamatchmin,
639  detamatchmax);
640  h_ele_dEtaSc_propVtx_all_barrel->Sumw2();
641  h_ele_dEtaSc_propVtx_all_endcaps = new TH1F("h_ele_dEtaSc_propVtx_all_endcaps",
642  "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons endcaps",
643  nbindetamatch,
644  detamatchmin,
645  detamatchmax);
646  h_ele_dEtaSc_propVtx_all_endcaps->Sumw2();
647  h_ele_dPhiSc_propVtx_all = new TH1F("h_ele_dPhiSc_propVtx_all",
648  "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",
649  nbindphimatch,
650  dphimatchmin,
651  dphimatchmax);
652  h_ele_dPhiSc_propVtx_all->Sumw2();
653  h_ele_dPhiSc_propVtx_all_barrel = new TH1F("h_ele_dPhiSc_propVtx_all_barrel",
654  "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons barrel",
655  nbindphimatch,
656  dphimatchmin,
657  dphimatchmax);
658  h_ele_dPhiSc_propVtx_all_barrel->Sumw2();
659  h_ele_dPhiSc_propVtx_all_endcaps = new TH1F("h_ele_dPhiSc_propVtx_all_endcaps",
660  "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons endcaps",
661  nbindphimatch,
662  dphimatchmin,
663  dphimatchmax);
664  h_ele_dPhiSc_propVtx_all_endcaps->Sumw2();
665  h_ele_dEtaCl_propOut_all = new TH1F("h_ele_dEtaCl_propOut_all",
666  "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",
667  nbindetamatch,
668  detamatchmin,
669  detamatchmax);
670  h_ele_dEtaCl_propOut_all->Sumw2();
671  h_ele_dEtaCl_propOut_all_barrel =
672  new TH1F("h_ele_dEtaCl_propOut_all_barrel",
673  "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons barrel",
674  nbindetamatch,
675  detamatchmin,
676  detamatchmax);
677  h_ele_dEtaCl_propOut_all_barrel->Sumw2();
678  h_ele_dEtaCl_propOut_all_endcaps =
679  new TH1F("h_ele_dEtaCl_propOut_all_endcaps",
680  "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons endcaps",
681  nbindetamatch,
682  detamatchmin,
683  detamatchmax);
684  h_ele_dEtaCl_propOut_all_endcaps->Sumw2();
685  h_ele_dPhiCl_propOut_all = new TH1F("h_ele_dPhiCl_propOut_all",
686  "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",
687  nbindphimatch,
688  dphimatchmin,
689  dphimatchmax);
690  h_ele_dPhiCl_propOut_all->Sumw2();
691  h_ele_dPhiCl_propOut_all_barrel =
692  new TH1F("h_ele_dPhiCl_propOut_all_barrel",
693  "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons barrel",
694  nbindphimatch,
695  dphimatchmin,
696  dphimatchmax);
697  h_ele_dPhiCl_propOut_all_endcaps =
698  new TH1F("h_ele_dPhiCl_propOut_all_endcaps",
699  "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons endcaps",
700  nbindphimatch,
701  dphimatchmin,
702  dphimatchmax);
703  h_ele_dPhiCl_propOut_all_barrel->Sumw2();
704  h_ele_dPhiCl_propOut_all_endcaps->Sumw2();
705  h_ele_HoE_all =
706  new TH1F("h_ele_HoE_all", "ele hadronic energy / em energy, all reco electrons", nbinhoe, hoemin, hoemax);
707  h_ele_HoE_all->Sumw2();
708  h_ele_HoE_all_barrel = new TH1F(
709  "h_ele_HoE_all_barrel", "ele hadronic energy / em energy, all reco electrons barrel", nbinhoe, hoemin, hoemax);
710  h_ele_HoE_all_barrel->Sumw2();
711  h_ele_HoE_all_endcaps = new TH1F(
712  "h_ele_HoE_all_endcaps", "ele hadronic energy / em energy, all reco electrons endcaps", nbinhoe, hoemin, hoemax);
713  h_ele_HoE_all_endcaps->Sumw2();
714  h_ele_vertexPt_all = new TH1F("h_ele_vertexPt_all", "ele p_{T}, all reco electrons", nbinpteff, 5., ptmax);
715  h_ele_vertexPt_all->Sumw2();
716  h_ele_Et_all = new TH1F("h_ele_Et_all", "ele SC E_{T}, all reco electrons", nbinpteff, 5., ptmax);
717  h_ele_Et_all->Sumw2();
718  h_ele_vertexEta_all = new TH1F("h_ele_vertexEta_all", "ele eta, all reco electrons", nbineta, etamin, etamax);
719  h_ele_vertexEta_all->Sumw2();
720  h_ele_TIP_all = new TH1F("h_ele_TIP_all", "ele vertex transverse radius, all reco electrons", 100, 0., 0.2);
721  h_ele_TIP_all->Sumw2();
722  h_ele_TIP_all_barrel =
723  new TH1F("h_ele_TIP_all_barrel", "ele vertex transverse radius, all reco electrons barrel", 100, 0., 0.2);
724  h_ele_TIP_all_barrel->Sumw2();
725  h_ele_TIP_all_endcaps =
726  new TH1F("h_ele_TIP_all_endcaps", "ele vertex transverse radius, all reco electrons endcaps", 100, 0., 0.2);
727  h_ele_TIP_all_endcaps->Sumw2();
728  h_ele_mee_all = new TH1F("h_ele_mee_all", "ele pairs invariant mass, all reco electrons", nbinmee, meemin, meemax);
729  h_ele_mee_all->Sumw2();
730  h_ele_mee_os = new TH1F("h_ele_mee_os", "ele pairs invariant mass, opp. sign", nbinmee, meemin, meemax);
731  h_ele_mee_os->Sumw2();
732  h_ele_mee_os_ebeb =
733  new TH1F("h_ele_mee_os_ebeb", "ele pairs invariant mass, opp. sign, EB-EB", nbinmee, meemin, meemax);
734  h_ele_mee_os_ebeb->Sumw2();
735  h_ele_mee_os_ebee =
736  new TH1F("h_ele_mee_os_ebee", "ele pairs invariant mass, opp. sign, EB-EE", nbinmee, meemin, meemax);
737  h_ele_mee_os_ebee->Sumw2();
738  h_ele_mee_os_eeee =
739  new TH1F("h_ele_mee_os_eeee", "ele pairs invariant mass, opp. sign, EE-EE", nbinmee, meemin, meemax);
740  h_ele_mee_os_eeee->Sumw2();
741  h_ele_mee_os_gg =
742  new TH1F("h_ele_mee_os_gg", "ele pairs invariant mass, opp. sign, good-good", nbinmee, meemin, meemax);
743  h_ele_mee_os_gg->Sumw2();
744  h_ele_mee_os_gb =
745  new TH1F("h_ele_mee_os_gb", "ele pairs invariant mass, opp. sign, good-bad", nbinmee, meemin, meemax);
746  h_ele_mee_os_gb->Sumw2();
747  h_ele_mee_os_bb =
748  new TH1F("h_ele_mee_os_bb", "ele pairs invariant mass, opp. sign, bad-bad", nbinmee, meemin, meemax);
749  h_ele_mee_os_bb->Sumw2();
750 
751  // duplicates
752  h_ele_E2mnE1vsMee_all = new TH2F("h_ele_E2mnE1vsMee_all",
753  "E2 - E1 vs ele pairs invariant mass, all electrons",
754  nbinmee,
755  meemin,
756  meemax,
757  100,
758  -50.,
759  50.);
760  h_ele_E2mnE1vsMee_egeg_all = new TH2F("h_ele_E2mnE1vsMee_egeg_all",
761  "E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons",
762  nbinmee,
763  meemin,
764  meemax,
765  100,
766  -50.,
767  50.);
768 
769  // charge ID
770  h_ele_ChargeMnChargeTrue = new TH1F("h_ele_ChargeMnChargeTrue", "ele charge - gen charge ", 5, -1., 4.);
771  h_ele_ChargeMnChargeTrue->Sumw2();
772  h_ele_simEta_matched_qmisid =
773  new TH1F("h_ele_eta_matched_qmisid", "charge misid vs gen eta", nbineta, etamin, etamax);
774  h_ele_simEta_matched_qmisid->Sumw2();
775  h_ele_simAbsEta_matched_qmisid =
776  new TH1F("h_ele_abseta_matched_qmisid", "charge misid vs gen |eta|", nbineta / 2, 0., etamax);
777  h_ele_simAbsEta_matched_qmisid->Sumw2();
778  h_ele_simPt_matched_qmisid =
779  new TH1F("h_ele_Pt_matched_qmisid", "charge misid vs gen transverse momentum", nbinpteff, 5., ptmax);
780  h_ele_simPt_matched_qmisid->Sumw2();
781  h_ele_simPhi_matched_qmisid =
782  new TH1F("h_ele_phi_matched_qmisid", "charge misid vs gen phi", nbinphi, phimin, phimax);
783  h_ele_simPhi_matched_qmisid->Sumw2();
784  h_ele_simZ_matched_qmisid = new TH1F("h_ele_z_matched_qmisid", "charge misid vs gen z", nbinxyz, -25, 25);
785  h_ele_simZ_matched_qmisid->Sumw2();
786 
787  // matched electrons
788  h_ele_charge = new TH1F("h_ele_charge", "ele charge", 5, -2., 2.);
789  h_ele_charge->Sumw2();
790  h_ele_chargeVsEta = new TH2F("h_ele_chargeVsEta", "ele charge vs eta", nbineta2D, etamin, etamax, 5, -2., 2.);
791  h_ele_chargeVsPhi = new TH2F("h_ele_chargeVsPhi", "ele charge vs phi", nbinphi2D, phimin, phimax, 5, -2., 2.);
792  h_ele_chargeVsPt = new TH2F("h_ele_chargeVsPt", "ele charge vs pt", nbinpt, 0., 100., 5, -2., 2.);
793  h_ele_vertexP = new TH1F("h_ele_vertexP", "ele momentum", nbinp, 0., pmax);
794  h_ele_vertexP->Sumw2();
795  h_ele_vertexPt = new TH1F("h_ele_vertexPt", "ele transverse momentum", nbinpt, 0., ptmax);
796  h_ele_vertexPt->Sumw2();
797  h_ele_Et = new TH1F("h_ele_Et", "ele transverse energy", nbinpt, 0., ptmax);
798  h_ele_Et->Sumw2();
799  h_ele_vertexPtVsEta =
800  new TH2F("h_ele_vertexPtVsEta", "ele transverse momentum vs eta", nbineta2D, etamin, etamax, nbinpt2D, 0., ptmax);
801  h_ele_vertexPtVsPhi =
802  new TH2F("h_ele_vertexPtVsPhi", "ele transverse momentum vs phi", nbinphi2D, phimin, phimax, nbinpt2D, 0., ptmax);
803  h_ele_simPt_matched = new TH1F("h_ele_simPt_matched", "Efficiency vs gen transverse momentum", nbinpteff, 5., ptmax);
804  h_ele_vertexEta = new TH1F("h_ele_vertexEta", "ele momentum eta", nbineta, etamin, etamax);
805  h_ele_vertexEta->Sumw2();
806  h_ele_vertexEtaVsPhi =
807  new TH2F("h_ele_vertexEtaVsPhi", "ele momentum eta vs phi", nbineta2D, etamin, etamax, nbinphi2D, phimin, phimax);
808  h_ele_simAbsEta_matched = new TH1F("h_ele_simAbsEta_matched", "Efficiency vs gen |eta|", nbineta / 2, 0., 2.5);
809  h_ele_simAbsEta_matched->Sumw2();
810  h_ele_simEta_matched = new TH1F("h_ele_simEta_matched", "Efficiency vs gen eta", nbineta, etamin, etamax);
811  h_ele_simEta_matched->Sumw2();
812  h_ele_simPtEta_matched =
813  new TH2F("h_ele_simPtEta_matched", "Efficiency vs pt #eta", nbineta2D, etamin, etamax, nbinpt2D, 5., ptmax);
814  h_ele_simPtEta_matched->Sumw2();
815  h_ele_simPhi_matched = new TH1F("h_ele_simPhi_matched", "Efficiency vs gen phi", nbinphi, phimin, phimax);
816  h_ele_simPhi_matched->Sumw2();
817  h_ele_vertexPhi = new TH1F("h_ele_vertexPhi", "ele momentum #phi", nbinphi, phimin, phimax);
818  h_ele_vertexPhi->Sumw2();
819  h_ele_vertexX = new TH1F("h_ele_vertexX", "ele vertex x", nbinxyz, -0.1, 0.1);
820  h_ele_vertexX->Sumw2();
821  h_ele_vertexY = new TH1F("h_ele_vertexY", "ele vertex y", nbinxyz, -0.1, 0.1);
822  h_ele_vertexY->Sumw2();
823  h_ele_vertexZ = new TH1F("h_ele_vertexZ", "ele vertex z", nbinxyz, -25, 25);
824  h_ele_vertexZ->Sumw2();
825  h_ele_simZ_matched = new TH1F("h_ele_simZ_matched", "Efficiency vs gen vertex z", nbinxyz, -25, 25);
826  h_ele_simZ_matched->Sumw2();
827  h_ele_vertexTIP = new TH1F("h_ele_vertexTIP", "ele transverse impact parameter (wrt gen vtx)", 90, 0., 0.15);
828  h_ele_vertexTIP->Sumw2();
829  h_ele_vertexTIPVsEta = new TH2F("h_ele_vertexTIPVsEta",
830  "ele transverse impact parameter (wrt gen vtx) vs eta",
831  nbineta2D,
832  etamin,
833  etamax,
834  45,
835  0.,
836  0.15);
837  h_ele_vertexTIPVsPhi = new TH2F("h_ele_vertexTIPVsPhi",
838  "ele transverse impact parameter (wrt gen vtx) vs phi",
839  nbinphi2D,
840  phimin,
841  phimax,
842  45,
843  0.,
844  0.15);
845  h_ele_vertexTIPVsPt = new TH2F("h_ele_vertexTIPVsPt",
846  "ele transverse impact parameter (wrt gen vtx) vs transverse momentum",
847  nbinpt2D,
848  0.,
849  ptmax,
850  45,
851  0.,
852  0.15);
853  h_ele_PoPtrue = new TH1F("h_ele_PoPtrue", "ele momentum / gen momentum", nbinpoptrue, poptruemin, poptruemax);
854  h_ele_PoPtrue->Sumw2();
855  h_ele_PtoPttrue = new TH1F(
856  "h_ele_PtoPttrue", "ele transverse momentum / gen transverse momentum", nbinpoptrue, poptruemin, poptruemax);
857  h_ele_PtoPttrue->Sumw2();
858  h_ele_PoPtrueVsEta = new TH2F(
859  "h_ele_PoPtrueVsEta", "ele momentum / gen momentum vs eta", nbineta2D, etamin, etamax, 50, poptruemin, poptruemax);
860  h_ele_PoPtrueVsPhi = new TH2F(
861  "h_ele_PoPtrueVsPhi", "ele momentum / gen momentum vs phi", nbinphi2D, phimin, phimax, 50, poptruemin, poptruemax);
862  h_ele_PoPtrueVsPt = new TH2F(
863  "h_ele_PoPtrueVsPt", "ele momentum / gen momentum vs eta", nbinpt2D, 0., ptmax, 50, poptruemin, poptruemax);
864  h_ele_PoPtrue_barrel =
865  new TH1F("h_ele_PoPtrue_barrel", "ele momentum / gen momentum, barrel", nbinpoptrue, poptruemin, poptruemax);
866  h_ele_PoPtrue_barrel->Sumw2();
867  h_ele_PoPtrue_endcaps =
868  new TH1F("h_ele_PoPtrue_endcaps", "ele momentum / gen momentum, endcaps", nbinpoptrue, poptruemin, poptruemax);
869  h_ele_PoPtrue_endcaps->Sumw2();
870  h_ele_PoPtrue_golden_barrel = new TH1F(
871  "h_ele_PoPtrue_golden_barrel", "ele momentum / gen momentum, golden, barrel", nbinpoptrue, poptruemin, poptruemax);
872  h_ele_PoPtrue_golden_barrel->Sumw2();
873  h_ele_PoPtrue_golden_endcaps = new TH1F("h_ele_PoPtrue_golden_endcaps",
874  "ele momentum / gen momentum, golden, endcaps",
875  nbinpoptrue,
876  poptruemin,
877  poptruemax);
878  h_ele_PoPtrue_golden_endcaps->Sumw2();
879  h_ele_PoPtrue_showering_barrel = new TH1F("h_ele_PoPtrue_showering_barrel",
880  "ele momentum / gen momentum, showering, barrel",
881  nbinpoptrue,
882  poptruemin,
883  poptruemax);
884  h_ele_PoPtrue_showering_barrel->Sumw2();
885  h_ele_PoPtrue_showering_endcaps = new TH1F("h_ele_PoPtrue_showering_endcaps",
886  "ele momentum / gen momentum, showering, endcaps",
887  nbinpoptrue,
888  poptruemin,
889  poptruemax);
890  h_ele_PoPtrue_showering_endcaps->Sumw2();
891  h_ele_PtoPttrue_barrel = new TH1F("h_ele_PtoPttrue_barrel",
892  "ele transverse momentum / gen transverse momentum, barrel",
893  nbinpoptrue,
894  poptruemin,
895  poptruemax);
896  h_ele_PtoPttrue_barrel->Sumw2();
897  h_ele_PtoPttrue_endcaps = new TH1F("h_ele_PtoPttrue_endcaps",
898  "ele transverse momentum / gen transverse momentum, endcaps",
899  nbinpoptrue,
900  poptruemin,
901  poptruemax);
902  h_ele_PtoPttrue_endcaps->Sumw2();
903  h_ele_EtaMnEtaTrue = new TH1F("h_ele_EtaMnEtaTrue", "ele momentum eta - gen eta", nbindeta, detamin, detamax);
904  h_ele_EtaMnEtaTrue->Sumw2();
905  h_ele_EtaMnEtaTrue_barrel =
906  new TH1F("h_ele_EtaMnEtaTrue_barrel", "ele momentum eta - gen eta barrel", nbindeta, detamin, detamax);
907  h_ele_EtaMnEtaTrue_barrel->Sumw2();
908  h_ele_EtaMnEtaTrue_endcaps =
909  new TH1F("h_ele_EtaMnEtaTrue_endcaps", "ele momentum eta - gen eta endcaps", nbindeta, detamin, detamax);
910  h_ele_EtaMnEtaTrue_endcaps->Sumw2();
911  h_ele_EtaMnEtaTrueVsEta = new TH2F("h_ele_EtaMnEtaTrueVsEta",
912  "ele momentum eta - gen eta vs eta",
913  nbineta2D,
914  etamin,
915  etamax,
916  nbindeta / 2,
917  detamin,
918  detamax);
919  h_ele_EtaMnEtaTrueVsPhi = new TH2F("h_ele_EtaMnEtaTrueVsPhi",
920  "ele momentum eta - gen eta vs phi",
921  nbinphi2D,
922  phimin,
923  phimax,
924  nbindeta / 2,
925  detamin,
926  detamax);
927  h_ele_EtaMnEtaTrueVsPt = new TH2F(
928  "h_ele_EtaMnEtaTrueVsPt", "ele momentum eta - gen eta vs pt", nbinpt, 0., ptmax, nbindeta / 2, detamin, detamax);
929  h_ele_PhiMnPhiTrue = new TH1F("h_ele_PhiMnPhiTrue", "ele momentum phi - gen phi", nbindphi, dphimin, dphimax);
930  h_ele_PhiMnPhiTrue->Sumw2();
931  h_ele_PhiMnPhiTrue_barrel =
932  new TH1F("h_ele_PhiMnPhiTrue_barrel", "ele momentum phi - gen phi barrel", nbindphi, dphimin, dphimax);
933  h_ele_PhiMnPhiTrue_barrel->Sumw2();
934  h_ele_PhiMnPhiTrue_endcaps =
935  new TH1F("h_ele_PhiMnPhiTrue_endcaps", "ele momentum phi - gen phi endcaps", nbindphi, dphimin, dphimax);
936  h_ele_PhiMnPhiTrue_endcaps->Sumw2();
937  h_ele_PhiMnPhiTrue2 =
938  new TH1F("h_ele_PhiMnPhiTrue2", "ele momentum phi - gen phi", nbindphimatch2D, dphimatchmin, dphimatchmax);
939  h_ele_PhiMnPhiTrueVsEta = new TH2F("h_ele_PhiMnPhiTrueVsEta",
940  "ele momentum phi - gen phi vs eta",
941  nbineta2D,
942  etamin,
943  etamax,
944  nbindphi / 2,
945  dphimin,
946  dphimax);
947  h_ele_PhiMnPhiTrueVsPhi = new TH2F("h_ele_PhiMnPhiTrueVsPhi",
948  "ele momentum phi - gen phi vs phi",
949  nbinphi2D,
950  phimin,
951  phimax,
952  nbindphi / 2,
953  dphimin,
954  dphimax);
955  h_ele_PhiMnPhiTrueVsPt = new TH2F("h_ele_PhiMnPhiTrueVsPt",
956  "ele momentum phi - gen phi vs pt",
957  nbinpt2D,
958  0.,
959  ptmax,
960  nbindphi / 2,
961  dphimin,
962  dphimax);
963 
964  // matched electron, superclusters
965  histSclEn_ = new TH1F("h_scl_energy", "ele supercluster energy", nbinp, 0., pmax);
966  histSclEn_->Sumw2();
967  histSclEoEtrue_barrel =
968  new TH1F("h_scl_EoEtrue_barrel", "ele supercluster energy / gen energy, barrel", 50, 0.2, 1.2);
969  histSclEoEtrue_barrel->Sumw2();
970  histSclEoEtrue_barrel_eg =
971  new TH1F("h_scl_EoEtrue_barrel_eg", "ele supercluster energy / gen energy, barrel, ecal driven", 50, 0.2, 1.2);
972  histSclEoEtrue_barrel_eg->Sumw2();
973  histSclEoEtrue_barrel_etagap =
974  new TH1F("h_scl_EoEtrue_barrel_etagap", "ele supercluster energy / gen energy, barrel, etagap", 50, 0.2, 1.2);
975  histSclEoEtrue_barrel_etagap->Sumw2();
976  histSclEoEtrue_barrel_phigap =
977  new TH1F("h_scl_EoEtrue_barrel_phigap", "ele supercluster energy / gen energy, barrel, phigap", 50, 0.2, 1.2);
978  histSclEoEtrue_barrel_phigap->Sumw2();
979  histSclEoEtrue_ebeegap =
980  new TH1F("h_scl_EoEtrue_ebeegap", "ele supercluster energy / gen energy, ebeegap", 50, 0.2, 1.2);
981  histSclEoEtrue_ebeegap->Sumw2();
982  histSclEoEtrue_endcaps =
983  new TH1F("h_scl_EoEtrue_endcaps", "ele supercluster energy / gen energy, endcaps", 50, 0.2, 1.2);
984  histSclEoEtrue_endcaps->Sumw2();
985  histSclEoEtrue_endcaps_eg =
986  new TH1F("h_scl_EoEtrue_endcaps_eg", "ele supercluster energy / gen energy, endcaps, ecal driven", 50, 0.2, 1.2);
987  histSclEoEtrue_endcaps_eg->Sumw2();
988  histSclEoEtrue_endcaps_deegap =
989  new TH1F("h_scl_EoEtrue_endcaps_deegap", "ele supercluster energy / gen energy, endcaps, deegap", 50, 0.2, 1.2);
990  histSclEoEtrue_endcaps_deegap->Sumw2();
991  histSclEoEtrue_endcaps_ringgap =
992  new TH1F("h_scl_EoEtrue_endcaps_ringgap", "ele supercluster energy / gen energy, endcaps, ringgap", 50, 0.2, 1.2);
993  histSclEoEtrue_endcaps_ringgap->Sumw2();
994  histSclEoEtrue_barrel_new = new TH1F(
995  "h_scl_EoEtrue_barrel_new", "ele supercluster energy / gen energy, barrel", nbinpoptrue, poptruemin, poptruemax);
996  histSclEoEtrue_barrel_new->Sumw2();
997  histSclEoEtrue_barrel_eg_new = new TH1F("h_scl_EoEtrue_barrel_eg_new",
998  "ele supercluster energy / gen energy, barrel, ecal driven",
999  nbinpoptrue,
1000  poptruemin,
1001  poptruemax);
1002  histSclEoEtrue_barrel_eg_new->Sumw2();
1003  histSclEoEtrue_barrel_etagap_new = new TH1F("h_scl_EoEtrue_barrel_etagap_new",
1004  "ele supercluster energy / gen energy, barrel, etagap",
1005  nbinpoptrue,
1006  poptruemin,
1007  poptruemax);
1008  histSclEoEtrue_barrel_etagap_new->Sumw2();
1009  histSclEoEtrue_barrel_phigap_new = new TH1F("h_scl_EoEtrue_barrel_phigap_new",
1010  "ele supercluster energy / gen energy, barrel, phigap",
1011  nbinpoptrue,
1012  poptruemin,
1013  poptruemax);
1014  histSclEoEtrue_barrel_phigap_new->Sumw2();
1015  histSclEoEtrue_ebeegap_new = new TH1F(
1016  "h_scl_EoEtrue_ebeegap_new", "ele supercluster energy / gen energy, ebeegap", nbinpoptrue, poptruemin, poptruemax);
1017  histSclEoEtrue_ebeegap_new->Sumw2();
1018  histSclEoEtrue_endcaps_new = new TH1F(
1019  "h_scl_EoEtrue_endcaps_new", "ele supercluster energy / gen energy, endcaps", nbinpoptrue, poptruemin, poptruemax);
1020  histSclEoEtrue_endcaps_new->Sumw2();
1021  histSclEoEtrue_endcaps_eg_new = new TH1F("h_scl_EoEtrue_endcaps_eg_new",
1022  "ele supercluster energy / gen energy, endcaps, ecal driven",
1023  nbinpoptrue,
1024  poptruemin,
1025  poptruemax);
1026  histSclEoEtrue_endcaps_eg_new->Sumw2();
1027  histSclEoEtrue_endcaps_deegap_new = new TH1F("h_scl_EoEtrue_endcaps_deegap_new",
1028  "ele supercluster energy / gen energy, endcaps, deegap",
1029  nbinpoptrue,
1030  poptruemin,
1031  poptruemax);
1032  histSclEoEtrue_endcaps_deegap_new->Sumw2();
1033  histSclEoEtrue_endcaps_ringgap_new = new TH1F("h_scl_EoEtrue_endcaps_ringgap_new",
1034  "ele supercluster energy / gen energy, endcaps, ringgap",
1035  nbinpoptrue,
1036  poptruemin,
1037  poptruemax);
1038  histSclEoEtrue_endcaps_ringgap_new->Sumw2();
1039  histSclEt_ = new TH1F("h_scl_et", "ele supercluster transverse energy", nbinpt, 0., ptmax);
1040  histSclEt_->Sumw2();
1041  histSclEtVsEta_ = new TH2F(
1042  "h_scl_etVsEta", "ele supercluster transverse energy vs eta", nbineta2D, etamin, etamax, nbinpt, 0., ptmax);
1043  histSclEtVsPhi_ = new TH2F(
1044  "h_scl_etVsPhi", "ele supercluster transverse energy vs phi", nbinphi2D, phimin, phimax, nbinpt, 0., ptmax);
1045  histSclEtaVsPhi_ =
1046  new TH2F("h_scl_etaVsPhi", "ele supercluster eta vs phi", nbinphi2D, phimin, phimax, nbineta2D, etamin, etamax);
1047  histSclEta_ = new TH1F("h_scl_eta", "ele supercluster eta", nbineta, etamin, etamax);
1048  histSclEta_->Sumw2();
1049  histSclPhi_ = new TH1F("h_scl_phi", "ele supercluster phi", nbinphi, phimin, phimax);
1050  histSclPhi_->Sumw2();
1051 
1052  histSclSigEtaEta_ = new TH1F("h_scl_sigetaeta", "ele supercluster sigma eta eta", 100, 0., 0.05);
1053  histSclSigEtaEta_->Sumw2();
1054  histSclSigEtaEta_barrel_ = new TH1F("h_scl_sigetaeta_barrel", "ele supercluster sigma eta eta barrel", 100, 0., 0.05);
1055  histSclSigEtaEta_barrel_->Sumw2();
1056  histSclSigEtaEta_endcaps_ =
1057  new TH1F("h_scl_sigetaeta_endcaps", "ele supercluster sigma eta eta endcaps", 100, 0., 0.05);
1058  histSclSigEtaEta_endcaps_->Sumw2();
1059  histSclSigIEtaIEta_ = new TH1F("h_scl_sigietaieta", "ele supercluster sigma ieta ieta", 100, 0., 0.05);
1060  histSclSigIEtaIEta_->Sumw2();
1061  histSclSigIEtaIEta_barrel_ =
1062  new TH1F("h_scl_sigietaieta_barrel", "ele supercluster sigma ieta ieta, barrel", 100, 0., 0.05);
1063  histSclSigIEtaIEta_barrel_->Sumw2();
1064  histSclSigIEtaIEta_endcaps_ =
1065  new TH1F("h_scl_sigietaieta_endcaps", "ele supercluster sigma ieta ieta, endcaps", 100, 0., 0.05);
1066  histSclSigIEtaIEta_endcaps_->Sumw2();
1067  histSclE1x5_ = new TH1F("h_scl_E1x5", "ele supercluster energy in 1x5", nbinp, 0., pmax);
1068  histSclE1x5_->Sumw2();
1069  histSclE1x5_barrel_ = new TH1F("h_scl_E1x5_barrel", "ele supercluster energy in 1x5 barrel", nbinp, 0., pmax);
1070  histSclE1x5_barrel_->Sumw2();
1071  histSclE1x5_endcaps_ = new TH1F("h_scl_E1x5_endcaps", "ele supercluster energy in 1x5 endcaps", nbinp, 0., pmax);
1072  histSclE1x5_endcaps_->Sumw2();
1073  histSclE2x5max_ = new TH1F("h_scl_E2x5max", "ele supercluster energy in 2x5 max", nbinp, 0., pmax);
1074  histSclE2x5max_->Sumw2();
1075  histSclE2x5max_barrel_ =
1076  new TH1F("h_scl_E2x5max_barrel", "ele supercluster energy in 2x5 max barrel", nbinp, 0., pmax);
1077  histSclE2x5max_barrel_->Sumw2();
1078  histSclE2x5max_endcaps_ =
1079  new TH1F("h_scl_E2x5max_endcaps", "ele supercluster energy in 2x5 max endcaps", nbinp, 0., pmax);
1080  histSclE2x5max_endcaps_->Sumw2();
1081  histSclE5x5_ = new TH1F("h_scl_E5x5", "ele supercluster energy in 5x5", nbinp, 0., pmax);
1082  histSclE5x5_->Sumw2();
1083  histSclE5x5_barrel_ = new TH1F("h_scl_E5x5_barrel", "ele supercluster energy in 5x5 barrel", nbinp, 0., pmax);
1084  histSclE5x5_barrel_->Sumw2();
1085  histSclE5x5_endcaps_ = new TH1F("h_scl_E5x5_endcaps", "ele supercluster energy in 5x5 endcaps", nbinp, 0., pmax);
1086  histSclE5x5_endcaps_->Sumw2();
1087  histSclSigEtaEta_eg_ = new TH1F("h_scl_sigetaeta_eg", "ele supercluster sigma eta eta, ecal driven", 100, 0., 0.05);
1088  histSclSigEtaEta_eg_->Sumw2();
1089  histSclSigEtaEta_eg_barrel_ =
1090  new TH1F("h_scl_sigetaeta_eg_barrel", "ele supercluster sigma eta eta, ecal driven barrel", 100, 0., 0.05);
1091  histSclSigEtaEta_eg_barrel_->Sumw2();
1092  histSclSigEtaEta_eg_endcaps_ =
1093  new TH1F("h_scl_sigetaeta_eg_endcaps", "ele supercluster sigma eta eta, ecal driven endcaps", 100, 0., 0.05);
1094  histSclSigEtaEta_eg_endcaps_->Sumw2();
1095  histSclSigIEtaIEta_eg_ =
1096  new TH1F("h_scl_sigietaieta_eg", "ele supercluster sigma ieta ieta, ecal driven", 100, 0., 0.05);
1097  histSclSigIEtaIEta_eg_->Sumw2();
1098  histSclSigIEtaIEta_eg_barrel_ =
1099  new TH1F("h_scl_sigietaieta_barrel_eg", "ele supercluster sigma ieta ieta, barrel, ecal driven", 100, 0., 0.05);
1100  histSclSigIEtaIEta_eg_barrel_->Sumw2();
1101  histSclSigIEtaIEta_eg_endcaps_ =
1102  new TH1F("h_scl_sigietaieta_endcaps_eg", "ele supercluster sigma ieta ieta, endcaps, ecal driven", 100, 0., 0.05);
1103  histSclSigIEtaIEta_eg_endcaps_->Sumw2();
1104  histSclE1x5_eg_ = new TH1F("h_scl_E1x5_eg", "ele supercluster energy in 1x5, ecal driven", nbinp, 0., pmax);
1105  histSclE1x5_eg_->Sumw2();
1106  histSclE1x5_eg_barrel_ =
1107  new TH1F("h_scl_E1x5_eg_barrel", "ele supercluster energy in 1x5, ecal driven barrel", nbinp, 0., pmax);
1108  histSclE1x5_eg_barrel_->Sumw2();
1109  histSclE1x5_eg_endcaps_ =
1110  new TH1F("h_scl_E1x5_eg_endcaps", "ele supercluster energy in 1x5, ecal driven endcaps", nbinp, 0., pmax);
1111  histSclE1x5_eg_endcaps_->Sumw2();
1112  histSclE2x5max_eg_ = new TH1F("h_scl_E2x5max_eg", "ele supercluster energy in 2x5 max, ecal driven", nbinp, 0., pmax);
1113  histSclE2x5max_eg_->Sumw2();
1114  histSclE2x5max_eg_barrel_ =
1115  new TH1F("h_scl_E2x5max_eg_barrel", "ele supercluster energy in 2x5 max, ecal driven barrel", nbinp, 0., pmax);
1116  histSclE2x5max_eg_barrel_->Sumw2();
1117  histSclE2x5max_eg_endcaps_ =
1118  new TH1F("h_scl_E2x5max_eg_endcaps", "ele supercluster energy in 2x5 max, ecal driven endcaps", nbinp, 0., pmax);
1119  histSclE2x5max_eg_endcaps_->Sumw2();
1120  histSclE5x5_eg_ = new TH1F("h_scl_E5x5_eg", "ele supercluster energy in 5x5, ecal driven", nbinp, 0., pmax);
1121  histSclE5x5_eg_->Sumw2();
1122  histSclE5x5_eg_barrel_ =
1123  new TH1F("h_scl_E5x5_eg_barrel", "ele supercluster energy in 5x5, ecal driven barrel", nbinp, 0., pmax);
1124  histSclE5x5_eg_barrel_->Sumw2();
1125  histSclE5x5_eg_endcaps_ =
1126  new TH1F("h_scl_E5x5_eg_endcaps", "ele supercluster energy in 5x5, ecal driven endcaps", nbinp, 0., pmax);
1127  histSclE5x5_eg_endcaps_->Sumw2();
1128 
1129  histSclEoEtruePfVsEg =
1130  new TH2F("h_scl_EoEtruePfVsEg", "ele supercluster energy / gen energy pflow vs eg", 75, -0.1, 1.4, 75, -0.1, 1.4);
1131 
1132  // matched electron, gsf tracks
1133  h_ele_ambiguousTracks = new TH1F("h_ele_ambiguousTracks", "ele # ambiguous tracks", 5, 0., 5.);
1134  h_ele_ambiguousTracks->Sumw2();
1135  h_ele_ambiguousTracksVsEta =
1136  new TH2F("h_ele_ambiguousTracksVsEta", "ele # ambiguous tracks vs eta", nbineta2D, etamin, etamax, 5, 0., 5.);
1137  h_ele_ambiguousTracksVsPhi =
1138  new TH2F("h_ele_ambiguousTracksVsPhi", "ele # ambiguous tracks vs phi", nbinphi2D, phimin, phimax, 5, 0., 5.);
1139  h_ele_ambiguousTracksVsPt =
1140  new TH2F("h_ele_ambiguousTracksVsPt", "ele # ambiguous tracks vs pt", nbinpt2D, 0., ptmax, 5, 0., 5.);
1141  h_ele_foundHits = new TH1F("h_ele_foundHits", "ele track # found hits", nbinfhits, 0., fhitsmax);
1142  h_ele_foundHits->Sumw2();
1143  h_ele_foundHits_barrel =
1144  new TH1F("h_ele_foundHits_barrel", "ele track # found hits, barrel", nbinfhits, 0., fhitsmax);
1145  h_ele_foundHits_barrel->Sumw2();
1146  h_ele_foundHits_endcaps =
1147  new TH1F("h_ele_foundHits_endcaps", "ele track # found hits, endcaps", nbinfhits, 0., fhitsmax);
1148  h_ele_foundHits_endcaps->Sumw2();
1149  h_ele_foundHitsVsEta = new TH2F(
1150  "h_ele_foundHitsVsEta", "ele track # found hits vs eta", nbineta2D, etamin, etamax, nbinfhits, 0., fhitsmax);
1151  h_ele_foundHitsVsPhi = new TH2F(
1152  "h_ele_foundHitsVsPhi", "ele track # found hits vs phi", nbinphi2D, phimin, phimax, nbinfhits, 0., fhitsmax);
1153  h_ele_foundHitsVsPt =
1154  new TH2F("h_ele_foundHitsVsPt", "ele track # found hits vs pt", nbinpt2D, 0., ptmax, nbinfhits, 0., fhitsmax);
1155  h_ele_lostHits = new TH1F("h_ele_lostHits", "ele track # lost hits", 5, 0., 5.);
1156  h_ele_lostHits->Sumw2();
1157  h_ele_lostHits_barrel = new TH1F("h_ele_lostHits_barrel", "ele track # lost hits, barrel", 5, 0., 5.);
1158  h_ele_lostHits_barrel->Sumw2();
1159  h_ele_lostHits_endcaps = new TH1F("h_ele_lostHits_endcaps", "ele track # lost hits, endcaps", 5, 0., 5.);
1160  h_ele_lostHits_endcaps->Sumw2();
1161  h_ele_lostHitsVsEta = new TH2F(
1162  "h_ele_lostHitsVsEta", "ele track # lost hits vs eta", nbineta2D, etamin, etamax, nbinlhits, 0., lhitsmax);
1163  h_ele_lostHitsVsPhi = new TH2F(
1164  "h_ele_lostHitsVsPhi", "ele track # lost hits vs eta", nbinphi2D, phimin, phimax, nbinlhits, 0., lhitsmax);
1165  h_ele_lostHitsVsPt =
1166  new TH2F("h_ele_lostHitsVsPt", "ele track # lost hits vs eta", nbinpt2D, 0., ptmax, nbinlhits, 0., lhitsmax);
1167  h_ele_chi2 = new TH1F("h_ele_chi2", "ele track #chi^{2}", 100, 0., 15.);
1168  h_ele_chi2->Sumw2();
1169  h_ele_chi2_barrel = new TH1F("h_ele_chi2_barrel", "ele track #chi^{2}, barrel", 100, 0., 15.);
1170  h_ele_chi2_barrel->Sumw2();
1171  h_ele_chi2_endcaps = new TH1F("h_ele_chi2_endcaps", "ele track #chi^{2}, endcaps", 100, 0., 15.);
1172  h_ele_chi2_endcaps->Sumw2();
1173  h_ele_chi2VsEta = new TH2F("h_ele_chi2VsEta", "ele track #chi^{2} vs eta", nbineta2D, etamin, etamax, 50, 0., 15.);
1174  h_ele_chi2VsPhi = new TH2F("h_ele_chi2VsPhi", "ele track #chi^{2} vs phi", nbinphi2D, phimin, phimax, 50, 0., 15.);
1175  h_ele_chi2VsPt = new TH2F("h_ele_chi2VsPt", "ele track #chi^{2} vs pt", nbinpt2D, 0., ptmax, 50, 0., 15.);
1176  h_ele_PinMnPout = new TH1F("h_ele_PinMnPout", "ele track inner p - outer p, mean of GSF components", nbinp, 0., 200.);
1177  h_ele_PinMnPout->Sumw2();
1178  h_ele_PinMnPout_mode =
1179  new TH1F("h_ele_PinMnPout_mode", "ele track inner p - outer p, mode of GSF components", nbinp, 0., 100.);
1180  h_ele_PinMnPout_mode->Sumw2();
1181  h_ele_PinMnPoutVsEta_mode = new TH2F("h_ele_PinMnPoutVsEta_mode",
1182  "ele track inner p - outer p vs eta, mode of GSF components",
1183  nbineta2D,
1184  etamin,
1185  etamax,
1186  nbinp2D,
1187  0.,
1188  100.);
1189  h_ele_PinMnPoutVsPhi_mode = new TH2F("h_ele_PinMnPoutVsPhi_mode",
1190  "ele track inner p - outer p vs phi, mode of GSF components",
1191  nbinphi2D,
1192  phimin,
1193  phimax,
1194  nbinp2D,
1195  0.,
1196  100.);
1197  h_ele_PinMnPoutVsPt_mode = new TH2F("h_ele_PinMnPoutVsPt_mode",
1198  "ele track inner p - outer p vs pt, mode of GSF components",
1199  nbinpt2D,
1200  0.,
1201  ptmax,
1202  nbinp2D,
1203  0.,
1204  100.);
1205  h_ele_PinMnPoutVsE_mode = new TH2F("h_ele_PinMnPoutVsE_mode",
1206  "ele track inner p - outer p vs E, mode of GSF components",
1207  nbinp2D,
1208  0.,
1209  200.,
1210  nbinp2D,
1211  0.,
1212  100.);
1213  h_ele_PinMnPoutVsChi2_mode = new TH2F("h_ele_PinMnPoutVsChi2_mode",
1214  "ele track inner p - outer p vs track chi2, mode of GSF components",
1215  50,
1216  0.,
1217  20.,
1218  nbinp2D,
1219  0.,
1220  100.);
1221  h_ele_outerP = new TH1F("h_ele_outerP", "ele track outer p, mean of GSF components", nbinp, 0., pmax);
1222  h_ele_outerP->Sumw2();
1223  h_ele_outerP_mode = new TH1F("h_ele_outerP_mode", "ele track outer p, mode of GSF components", nbinp, 0., pmax);
1224  h_ele_outerP_mode->Sumw2();
1225  h_ele_outerPVsEta_mode =
1226  new TH2F("h_ele_outerPVsEta_mode", "ele track outer p vs eta mode", nbineta2D, etamin, etamax, 50, 0., pmax);
1227  h_ele_outerPt = new TH1F("h_ele_outerPt", "ele track outer p_{T}, mean of GSF components", nbinpt, 0., ptmax);
1228  h_ele_outerPt->Sumw2();
1229  h_ele_outerPt_mode =
1230  new TH1F("h_ele_outerPt_mode", "ele track outer p_{T}, mode of GSF components", nbinpt, 0., ptmax);
1231  h_ele_outerPt_mode->Sumw2();
1232  h_ele_outerPtVsEta_mode = new TH2F("h_ele_outerPtVsEta_mode",
1233  "ele track outer p_{T} vs eta, mode of GSF components",
1234  nbineta2D,
1235  etamin,
1236  etamax,
1237  nbinpt2D,
1238  0.,
1239  ptmax);
1240  h_ele_outerPtVsPhi_mode = new TH2F("h_ele_outerPtVsPhi_mode",
1241  "ele track outer p_{T} vs phi, mode of GSF components",
1242  nbinphi2D,
1243  phimin,
1244  phimax,
1245  nbinpt2D,
1246  0.,
1247  ptmax);
1248  h_ele_outerPtVsPt_mode = new TH2F("h_ele_outerPtVsPt_mode",
1249  "ele track outer p_{T} vs pt, mode of GSF components",
1250  nbinpt2D,
1251  0.,
1252  100.,
1253  nbinpt2D,
1254  0.,
1255  ptmax);
1256 
1257  // matched electrons, matching
1258  h_ele_EoP = new TH1F("h_ele_EoP", "ele E/P_{vertex}", nbineop, 0., eopmax);
1259  h_ele_EoP->Sumw2();
1260  h_ele_EoP_eg = new TH1F("h_ele_EoP_eg", "ele E/P_{vertex}, ecal driven", nbineop, 0., eopmax);
1261  h_ele_EoP_eg->Sumw2();
1262  h_ele_EoP_barrel = new TH1F("h_ele_EoP_barrel", "ele E/P_{vertex} barrel", nbineop, 0., eopmax);
1263  h_ele_EoP_barrel->Sumw2();
1264  h_ele_EoP_eg_barrel = new TH1F("h_ele_EoP_eg_barrel", "ele E/P_{vertex}, ecal driven barrel", nbineop, 0., eopmax);
1265  h_ele_EoP_eg_barrel->Sumw2();
1266  h_ele_EoP_endcaps = new TH1F("h_ele_EoP_endcaps", "ele E/P_{vertex} endcaps", nbineop, 0., eopmax);
1267  h_ele_EoP_endcaps->Sumw2();
1268  h_ele_EoP_eg_endcaps = new TH1F("h_ele_EoP_eg_endcaps", "ele E/P_{vertex}, ecal driven endcaps", nbineop, 0., eopmax);
1269  h_ele_EoP_eg_endcaps->Sumw2();
1270  h_ele_EoPVsEta =
1271  new TH2F("h_ele_EoPVsEta", "ele E/P_{vertex} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
1272  h_ele_EoPVsPhi =
1273  new TH2F("h_ele_EoPVsPhi", "ele E/P_{vertex} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
1274  h_ele_EoPVsE = new TH2F("h_ele_EoPVsE", "ele E/P_{vertex} vs E", 50, 0., pmax, 50, 0., 5.);
1275  h_ele_EseedOP = new TH1F("h_ele_EseedOP", "ele E_{seed}/P_{vertex}", nbineop, 0., eopmax);
1276  h_ele_EseedOP->Sumw2();
1277  h_ele_EseedOP_eg = new TH1F("h_ele_EseedOP_eg", "ele E_{seed}/P_{vertex}, ecal driven", nbineop, 0., eopmax);
1278  h_ele_EseedOP_eg->Sumw2();
1279  h_ele_EseedOP_barrel = new TH1F("h_ele_EseedOP_barrel", "ele E_{seed}/P_{vertex} barrel", nbineop, 0., eopmax);
1280  h_ele_EseedOP_barrel->Sumw2();
1281  h_ele_EseedOP_eg_barrel =
1282  new TH1F("h_ele_EseedOP_eg_barrel", "ele E_{seed}/P_{vertex}, ecal driven barrel", nbineop, 0., eopmax);
1283  h_ele_EseedOP_eg_barrel->Sumw2();
1284  h_ele_EseedOP_endcaps = new TH1F("h_ele_EseedOP_endcaps", "ele E_{seed}/P_{vertex} endcaps", nbineop, 0., eopmax);
1285  h_ele_EseedOP_endcaps->Sumw2();
1286  h_ele_EseedOP_eg_endcaps =
1287  new TH1F("h_ele_EseedOP_eg_endcaps", "ele E_{seed}/P_{vertex}, ecal driven, endcaps", nbineop, 0., eopmax);
1288  h_ele_EseedOP_eg_endcaps->Sumw2();
1289  h_ele_EseedOPVsEta = new TH2F(
1290  "h_ele_EseedOPVsEta", "ele E_{seed}/P_{vertex} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
1291  h_ele_EseedOPVsPhi = new TH2F(
1292  "h_ele_EseedOPVsPhi", "ele E_{seed}/P_{vertex} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
1293  h_ele_EseedOPVsE = new TH2F("h_ele_EseedOPVsE", "ele E_{seed}/P_{vertex} vs E", 50, 0., pmax, 50, 0., 5.);
1294  h_ele_EoPout = new TH1F("h_ele_EoPout", "ele E_{seed}/P_{out}", nbineop, 0., eopmax);
1295  h_ele_EoPout->Sumw2();
1296  h_ele_EoPout_eg = new TH1F("h_ele_EoPout_eg", "ele E_{seed}/P_{out}, ecal driven", nbineop, 0., eopmax);
1297  h_ele_EoPout_eg->Sumw2();
1298  h_ele_EoPout_barrel = new TH1F("h_ele_EoPout_barrel", "ele E_{seed}/P_{out} barrel", nbineop, 0., eopmax);
1299  h_ele_EoPout_barrel->Sumw2();
1300  h_ele_EoPout_eg_barrel =
1301  new TH1F("h_ele_EoPout_eg_barrel", "ele E_{seed}/P_{out}, ecal driven, barrel", nbineop, 0., eopmax);
1302  h_ele_EoPout_eg_barrel->Sumw2();
1303  h_ele_EoPout_endcaps = new TH1F("h_ele_EoPout_endcaps", "ele E_{seed}/P_{out} endcaps", nbineop, 0., eopmax);
1304  h_ele_EoPout_endcaps->Sumw2();
1305  h_ele_EoPout_eg_endcaps =
1306  new TH1F("h_ele_EoPout_eg_endcaps", "ele E_{seed}/P_{out}, ecal driven, endcaps", nbineop, 0., eopmax);
1307  h_ele_EoPout_eg_endcaps->Sumw2();
1308  h_ele_EoPoutVsEta =
1309  new TH2F("h_ele_EoPoutVsEta", "ele E_{seed}/P_{out} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
1310  h_ele_EoPoutVsPhi =
1311  new TH2F("h_ele_EoPoutVsPhi", "ele E_{seed}/P_{out} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
1312  h_ele_EoPoutVsE =
1313  new TH2F("h_ele_EoPoutVsE", "ele E_{seed}/P_{out} vs E", nbinp2D, 0., pmax, nbineop2D, 0., eopmaxsht);
1314  h_ele_EeleOPout = new TH1F("h_ele_EeleOPout", "ele E_{ele}/P_{out}", nbineop, 0., eopmax);
1315  h_ele_EeleOPout->Sumw2();
1316  h_ele_EeleOPout_eg = new TH1F("h_ele_EeleOPout_eg", "ele E_{ele}/P_{out}, ecal driven", nbineop, 0., eopmax);
1317  h_ele_EeleOPout_eg->Sumw2();
1318  h_ele_EeleOPout_barrel = new TH1F("h_ele_EeleOPout_barrel", "ele E_{ele}/P_{out} barrel", nbineop, 0., eopmax);
1319  h_ele_EeleOPout_barrel->Sumw2();
1320  h_ele_EeleOPout_eg_barrel =
1321  new TH1F("h_ele_EeleOPout_eg_barrel", "ele E_{ele}/P_{out}, ecal driven, barrel", nbineop, 0., eopmax);
1322  h_ele_EeleOPout_eg_barrel->Sumw2();
1323  h_ele_EeleOPout_endcaps = new TH1F("h_ele_EeleOPout_endcaps", "ele E_{ele}/P_{out} endcaps", nbineop, 0., eopmax);
1324  h_ele_EeleOPout_endcaps->Sumw2();
1325  h_ele_EeleOPout_eg_endcaps =
1326  new TH1F("h_ele_EeleOPout_eg_endcaps", "ele E_{ele}/P_{out}, ecal driven, endcaps", nbineop, 0., eopmax);
1327  h_ele_EeleOPout_eg_endcaps->Sumw2();
1328  h_ele_EeleOPoutVsEta = new TH2F(
1329  "h_ele_EeleOPoutVsEta", "ele E_{ele}/P_{out} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
1330  h_ele_EeleOPoutVsPhi = new TH2F(
1331  "h_ele_EeleOPoutVsPhi", "ele E_{ele}/P_{out} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
1332  h_ele_EeleOPoutVsE =
1333  new TH2F("h_ele_EeleOPoutVsE", "ele E_{ele}/P_{out} vs E", nbinp2D, 0., pmax, nbineop2D, 0., eopmaxsht);
1334  h_ele_dEtaSc_propVtx = new TH1F(
1335  "h_ele_dEtaSc_propVtx", "ele #eta_{sc} - #eta_{tr}, prop from vertex", nbindetamatch, detamatchmin, detamatchmax);
1336  h_ele_dEtaSc_propVtx->Sumw2();
1337  h_ele_dEtaSc_propVtx_eg = new TH1F("h_ele_dEtaSc_propVtx_eg",
1338  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",
1339  nbindetamatch,
1340  detamatchmin,
1341  detamatchmax);
1342  h_ele_dEtaSc_propVtx_eg->Sumw2();
1343  h_ele_dEtaSc_propVtx_barrel = new TH1F("h_ele_dEtaSc_propVtx_barrel",
1344  "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",
1345  nbindetamatch,
1346  detamatchmin,
1347  detamatchmax);
1348  h_ele_dEtaSc_propVtx_barrel->Sumw2();
1349  h_ele_dEtaSc_propVtx_eg_barrel = new TH1F("h_ele_dEtaSc_propVtx_eg_barrel",
1350  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",
1351  nbindetamatch,
1352  detamatchmin,
1353  detamatchmax);
1354  h_ele_dEtaSc_propVtx_eg_barrel->Sumw2();
1355  h_ele_dEtaSc_propVtx_endcaps = new TH1F("h_ele_dEtaSc_propVtx_endcaps",
1356  "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",
1357  nbindetamatch,
1358  detamatchmin,
1359  detamatchmax);
1360  h_ele_dEtaSc_propVtx_endcaps->Sumw2();
1361  h_ele_dEtaSc_propVtx_eg_endcaps = new TH1F("h_ele_dEtaSc_propVtx_eg_endcaps",
1362  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",
1363  nbindetamatch,
1364  detamatchmin,
1365  detamatchmax);
1366  h_ele_dEtaSc_propVtx_eg_endcaps->Sumw2();
1367  h_ele_dEtaScVsEta_propVtx = new TH2F("h_ele_dEtaScVsEta_propVtx",
1368  "ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",
1369  nbineta2D,
1370  etamin,
1371  etamax,
1372  nbindetamatch2D,
1373  detamatchmin,
1374  detamatchmax);
1375  h_ele_dEtaScVsPhi_propVtx = new TH2F("h_ele_dEtaScVsPhi_propVtx",
1376  "ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",
1377  nbinphi2D,
1378  phimin,
1379  phimax,
1380  nbindetamatch2D,
1381  detamatchmin,
1382  detamatchmax);
1383  h_ele_dEtaScVsPt_propVtx = new TH2F("h_ele_dEtaScVsPt_propVtx",
1384  "ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",
1385  nbinpt2D,
1386  0.,
1387  ptmax,
1388  nbindetamatch2D,
1389  detamatchmin,
1390  detamatchmax);
1391  h_ele_dPhiSc_propVtx = new TH1F(
1392  "h_ele_dPhiSc_propVtx", "ele #phi_{sc} - #phi_{tr}, prop from vertex", nbindphimatch, dphimatchmin, dphimatchmax);
1393  h_ele_dPhiSc_propVtx->Sumw2();
1394  h_ele_dPhiSc_propVtx_eg = new TH1F("h_ele_dPhiSc_propVtx_eg",
1395  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",
1396  nbindphimatch,
1397  dphimatchmin,
1398  dphimatchmax);
1399  h_ele_dPhiSc_propVtx_eg->Sumw2();
1400  h_ele_dPhiSc_propVtx_barrel = new TH1F("h_ele_dPhiSc_propVtx_barrel",
1401  "ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",
1402  nbindphimatch,
1403  dphimatchmin,
1404  dphimatchmax);
1405  h_ele_dPhiSc_propVtx_barrel->Sumw2();
1406  h_ele_dPhiSc_propVtx_eg_barrel = new TH1F("h_ele_dPhiSc_propVtx_eg_barrel",
1407  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",
1408  nbindphimatch,
1409  dphimatchmin,
1410  dphimatchmax);
1411  h_ele_dPhiSc_propVtx_eg_barrel->Sumw2();
1412  h_ele_dPhiSc_propVtx_endcaps = new TH1F("h_ele_dPhiSc_propVtx_endcaps",
1413  "ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",
1414  nbindphimatch,
1415  dphimatchmin,
1416  dphimatchmax);
1417  h_ele_dPhiSc_propVtx_endcaps->Sumw2();
1418  h_ele_dPhiSc_propVtx_eg_endcaps = new TH1F("h_ele_dPhiSc_propVtx_eg_endcaps",
1419  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",
1420  nbindphimatch,
1421  dphimatchmin,
1422  dphimatchmax);
1423  h_ele_dPhiSc_propVtx_eg_endcaps->Sumw2();
1424  h_ele_dPhiScVsEta_propVtx = new TH2F("h_ele_dPhiScVsEta_propVtx",
1425  "ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",
1426  nbineta2D,
1427  etamin,
1428  etamax,
1429  nbindphimatch2D,
1430  dphimatchmin,
1431  dphimatchmax);
1432  h_ele_dPhiScVsPhi_propVtx = new TH2F("h_ele_dPhiScVsPhi_propVtx",
1433  "ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",
1434  nbinphi2D,
1435  phimin,
1436  phimax,
1437  nbindphimatch2D,
1438  dphimatchmin,
1439  dphimatchmax);
1440  h_ele_dPhiScVsPt_propVtx = new TH2F("h_ele_dPhiScVsPt_propVtx",
1441  "ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",
1442  nbinpt2D,
1443  0.,
1444  ptmax,
1445  nbindphimatch2D,
1446  dphimatchmin,
1447  dphimatchmax);
1448  h_ele_dEtaCl_propOut = new TH1F("h_ele_dEtaCl_propOut",
1449  "ele #eta_{cl} - #eta_{tr}, prop from outermost",
1450  nbindetamatch,
1451  detamatchmin,
1452  detamatchmax);
1453  h_ele_dEtaCl_propOut->Sumw2();
1454  h_ele_dEtaCl_propOut_eg = new TH1F("h_ele_dEtaCl_propOut_eg",
1455  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",
1456  nbindetamatch,
1457  detamatchmin,
1458  detamatchmax);
1459  h_ele_dEtaCl_propOut_eg->Sumw2();
1460  h_ele_dEtaCl_propOut_barrel = new TH1F("h_ele_dEtaCl_propOut_barrel",
1461  "ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",
1462  nbindetamatch,
1463  detamatchmin,
1464  detamatchmax);
1465  h_ele_dEtaCl_propOut_barrel->Sumw2();
1466  h_ele_dEtaCl_propOut_eg_barrel = new TH1F("h_ele_dEtaCl_propOut_eg_barrel",
1467  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1468  nbindetamatch,
1469  detamatchmin,
1470  detamatchmax);
1471  h_ele_dEtaCl_propOut_eg_barrel->Sumw2();
1472  h_ele_dEtaCl_propOut_endcaps = new TH1F("h_ele_dEtaCl_propOut_endcaps",
1473  "ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",
1474  nbindetamatch,
1475  detamatchmin,
1476  detamatchmax);
1477  h_ele_dEtaCl_propOut_endcaps->Sumw2();
1478  h_ele_dEtaCl_propOut_eg_endcaps = new TH1F("h_ele_dEtaCl_propOut_eg_endcaps",
1479  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1480  nbindetamatch,
1481  detamatchmin,
1482  detamatchmax);
1483  h_ele_dEtaCl_propOut_eg_endcaps->Sumw2();
1484  h_ele_dEtaClVsEta_propOut = new TH2F("h_ele_dEtaClVsEta_propOut",
1485  "ele #eta_{cl} - #eta_{tr} vs eta, prop from out",
1486  nbineta2D,
1487  etamin,
1488  etamax,
1489  nbindetamatch2D,
1490  detamatchmin,
1491  detamatchmax);
1492  h_ele_dEtaClVsPhi_propOut = new TH2F("h_ele_dEtaClVsPhi_propOut",
1493  "ele #eta_{cl} - #eta_{tr} vs phi, prop from out",
1494  nbinphi2D,
1495  phimin,
1496  phimax,
1497  nbindetamatch2D,
1498  detamatchmin,
1499  detamatchmax);
1500  h_ele_dEtaClVsPt_propOut = new TH2F("h_ele_dEtaScVsPt_propOut",
1501  "ele #eta_{cl} - #eta_{tr} vs pt, prop from out",
1502  nbinpt2D,
1503  0.,
1504  ptmax,
1505  nbindetamatch2D,
1506  detamatchmin,
1507  detamatchmax);
1508  h_ele_dPhiCl_propOut = new TH1F("h_ele_dPhiCl_propOut",
1509  "ele #phi_{cl} - #phi_{tr}, prop from outermost",
1510  nbindphimatch,
1511  dphimatchmin,
1512  dphimatchmax);
1513  h_ele_dPhiCl_propOut->Sumw2();
1514  h_ele_dPhiCl_propOut_eg = new TH1F("h_ele_dPhiCl_propOut_eg",
1515  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",
1516  nbindphimatch,
1517  dphimatchmin,
1518  dphimatchmax);
1519  h_ele_dPhiCl_propOut_eg->Sumw2();
1520  h_ele_dPhiCl_propOut_barrel = new TH1F("h_ele_dPhiCl_propOut_barrel",
1521  "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",
1522  nbindphimatch,
1523  dphimatchmin,
1524  dphimatchmax);
1525  h_ele_dPhiCl_propOut_barrel->Sumw2();
1526  h_ele_dPhiCl_propOut_eg_barrel = new TH1F("h_ele_dPhiCl_propOut_eg_barrel",
1527  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1528  nbindphimatch,
1529  dphimatchmin,
1530  dphimatchmax);
1531  h_ele_dPhiCl_propOut_eg_barrel->Sumw2();
1532  h_ele_dPhiCl_propOut_endcaps = new TH1F("h_ele_dPhiCl_propOut_endcaps",
1533  "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",
1534  nbindphimatch,
1535  dphimatchmin,
1536  dphimatchmax);
1537  h_ele_dPhiCl_propOut_endcaps->Sumw2();
1538  h_ele_dPhiCl_propOut_eg_endcaps = new TH1F("h_ele_dPhiCl_propOut_eg_endcaps",
1539  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1540  nbindphimatch,
1541  dphimatchmin,
1542  dphimatchmax);
1543  h_ele_dPhiCl_propOut_eg_endcaps->Sumw2();
1544  h_ele_dPhiClVsEta_propOut = new TH2F("h_ele_dPhiClVsEta_propOut",
1545  "ele #phi_{cl} - #phi_{tr} vs eta, prop from out",
1546  nbineta2D,
1547  etamin,
1548  etamax,
1549  nbindphimatch2D,
1550  dphimatchmin,
1551  dphimatchmax);
1552  h_ele_dPhiClVsPhi_propOut = new TH2F("h_ele_dPhiClVsPhi_propOut",
1553  "ele #phi_{cl} - #phi_{tr} vs phi, prop from out",
1554  nbinphi2D,
1555  phimin,
1556  phimax,
1557  nbindphimatch2D,
1558  dphimatchmin,
1559  dphimatchmax);
1560  h_ele_dPhiClVsPt_propOut = new TH2F("h_ele_dPhiSClsPt_propOut",
1561  "ele #phi_{cl} - #phi_{tr} vs pt, prop from out",
1562  nbinpt2D,
1563  0.,
1564  ptmax,
1565  nbindphimatch2D,
1566  dphimatchmin,
1567  dphimatchmax);
1568  h_ele_dEtaEleCl_propOut = new TH1F("h_ele_dEtaEleCl_propOut",
1569  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",
1570  nbindetamatch,
1571  detamatchmin,
1572  detamatchmax);
1573  h_ele_dEtaEleCl_propOut->Sumw2();
1574  h_ele_dEtaEleCl_propOut_eg = new TH1F("h_ele_dEtaEleCl_propOut_eg",
1575  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",
1576  nbindetamatch,
1577  detamatchmin,
1578  detamatchmax);
1579  h_ele_dEtaEleCl_propOut_eg->Sumw2();
1580  h_ele_dEtaEleCl_propOut_barrel = new TH1F("h_ele_dEtaEleCl_propOut_barrel",
1581  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",
1582  nbindetamatch,
1583  detamatchmin,
1584  detamatchmax);
1585  h_ele_dEtaEleCl_propOut_barrel->Sumw2();
1586  h_ele_dEtaEleCl_propOut_eg_barrel = new TH1F("h_ele_dEtaEleCl_propOut_eg_barrel",
1587  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1588  nbindetamatch,
1589  detamatchmin,
1590  detamatchmax);
1591  h_ele_dEtaEleCl_propOut_eg_barrel->Sumw2();
1592  h_ele_dEtaEleCl_propOut_endcaps = new TH1F("h_ele_dEtaEleCl_propOut_endcaps",
1593  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",
1594  nbindetamatch,
1595  detamatchmin,
1596  detamatchmax);
1597  h_ele_dEtaEleCl_propOut_endcaps->Sumw2();
1598  h_ele_dEtaEleCl_propOut_eg_endcaps =
1599  new TH1F("h_ele_dEtaEleCl_propOut_eg_endcaps",
1600  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1601  nbindetamatch,
1602  detamatchmin,
1603  detamatchmax);
1604  h_ele_dEtaEleCl_propOut_eg_endcaps->Sumw2();
1605  h_ele_dEtaEleClVsEta_propOut = new TH2F("h_ele_dEtaEleClVsEta_propOut",
1606  "ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",
1607  nbineta2D,
1608  etamin,
1609  etamax,
1610  nbindetamatch2D,
1611  detamatchmin,
1612  detamatchmax);
1613  h_ele_dEtaEleClVsPhi_propOut = new TH2F("h_ele_dEtaEleClVsPhi_propOut",
1614  "ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",
1615  nbinphi2D,
1616  phimin,
1617  phimax,
1618  nbindetamatch2D,
1619  detamatchmin,
1620  detamatchmax);
1621  h_ele_dEtaEleClVsPt_propOut = new TH2F("h_ele_dEtaScVsPt_propOut",
1622  "ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",
1623  nbinpt2D,
1624  0.,
1625  ptmax,
1626  nbindetamatch2D,
1627  detamatchmin,
1628  detamatchmax);
1629  h_ele_dPhiEleCl_propOut = new TH1F("h_ele_dPhiEleCl_propOut",
1630  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",
1631  nbindphimatch,
1632  dphimatchmin,
1633  dphimatchmax);
1634  h_ele_dPhiEleCl_propOut->Sumw2();
1635  h_ele_dPhiEleCl_propOut_eg = new TH1F("h_ele_dPhiEleCl_propOut_eg",
1636  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",
1637  nbindphimatch,
1638  dphimatchmin,
1639  dphimatchmax);
1640  h_ele_dPhiEleCl_propOut_eg->Sumw2();
1641  h_ele_dPhiEleCl_propOut_barrel = new TH1F("h_ele_dPhiEleCl_propOut_barrel",
1642  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",
1643  nbindphimatch,
1644  dphimatchmin,
1645  dphimatchmax);
1646  h_ele_dPhiEleCl_propOut_barrel->Sumw2();
1647  h_ele_dPhiEleCl_propOut_eg_barrel = new TH1F("h_ele_dPhiEleCl_propOut_eg_barrel",
1648  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1649  nbindphimatch,
1650  dphimatchmin,
1651  dphimatchmax);
1652  h_ele_dPhiEleCl_propOut_eg_barrel->Sumw2();
1653  h_ele_dPhiEleCl_propOut_endcaps = new TH1F("h_ele_dPhiEleCl_propOut_endcaps",
1654  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",
1655  nbindphimatch,
1656  dphimatchmin,
1657  dphimatchmax);
1658  h_ele_dPhiEleCl_propOut_endcaps->Sumw2();
1659  h_ele_dPhiEleCl_propOut_eg_endcaps =
1660  new TH1F("h_ele_dPhiEleCl_propOut_eg_endcaps",
1661  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1662  nbindphimatch,
1663  dphimatchmin,
1664  dphimatchmax);
1665  h_ele_dPhiEleCl_propOut_eg_endcaps->Sumw2();
1666  h_ele_dPhiEleClVsEta_propOut = new TH2F("h_ele_dPhiEleClVsEta_propOut",
1667  "ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",
1668  nbineta2D,
1669  etamin,
1670  etamax,
1671  nbindphimatch2D,
1672  dphimatchmin,
1673  dphimatchmax);
1674  h_ele_dPhiEleClVsPhi_propOut = new TH2F("h_ele_dPhiEleClVsPhi_propOut",
1675  "ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",
1676  nbinphi2D,
1677  phimin,
1678  phimax,
1679  nbindphimatch2D,
1680  dphimatchmin,
1681  dphimatchmax);
1682  h_ele_dPhiEleClVsPt_propOut = new TH2F("h_ele_dPhiSEleClsPt_propOut",
1683  "ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",
1684  nbinpt2D,
1685  0.,
1686  ptmax,
1687  nbindphimatch2D,
1688  dphimatchmin,
1689  dphimatchmax);
1690 
1691  h_ele_HoE = new TH1F("h_ele_HoE", "ele hadronic energy / em energy", nbinhoe, hoemin, hoemax);
1692  h_ele_HoE->Sumw2();
1693  h_ele_HoE_eg = new TH1F("h_ele_HoE_eg", "ele hadronic energy / em energy, ecal driven", nbinhoe, hoemin, hoemax);
1694  h_ele_HoE_eg->Sumw2();
1695  h_ele_HoE_barrel = new TH1F("h_ele_HoE_barrel", "ele hadronic energy / em energy, barrel", nbinhoe, hoemin, hoemax);
1696  h_ele_HoE_barrel->Sumw2();
1697  h_ele_HoE_eg_barrel =
1698  new TH1F("h_ele_HoE_eg_barrel", "ele hadronic energy / em energy, ecal driven, barrel", nbinhoe, hoemin, hoemax);
1699  h_ele_HoE_eg_barrel->Sumw2();
1700  h_ele_HoE_endcaps =
1701  new TH1F("h_ele_HoE_endcaps", "ele hadronic energy / em energy, endcaps", nbinhoe, hoemin, hoemax);
1702  h_ele_HoE_endcaps->Sumw2();
1703  h_ele_HoE_eg_endcaps = new TH1F(
1704  "h_ele_HoE_eg_endcaps", "ele hadronic energy / em energy, ecal driven, endcaps", nbinhoe, hoemin, hoemax);
1705  h_ele_HoE_eg_endcaps->Sumw2();
1706  h_ele_HoE_fiducial =
1707  new TH1F("h_ele_HoE_fiducial", "ele hadronic energy / em energy, fiducial region", nbinhoe, hoemin, hoemax);
1708  h_ele_HoE_fiducial->Sumw2();
1709  h_ele_HoEVsEta = new TH2F(
1710  "h_ele_HoEVsEta", "ele hadronic energy / em energy vs eta", nbineta, etamin, etamax, nbinhoe, hoemin, hoemax);
1711  h_ele_HoEVsPhi = new TH2F(
1712  "h_ele_HoEVsPhi", "ele hadronic energy / em energy vs phi", nbinphi2D, phimin, phimax, nbinhoe, hoemin, hoemax);
1713  h_ele_HoEVsE =
1714  new TH2F("h_ele_HoEVsE", "ele hadronic energy / em energy vs E", nbinp, 0., 300., nbinhoe, hoemin, hoemax);
1715 
1716  h_ele_seed_dphi2_ = new TH1F("h_ele_seedDphi2", "ele seed dphi 2nd layer", 50, -0.003, +0.003);
1717  h_ele_seed_dphi2_->Sumw2();
1718  h_ele_seed_dphi2VsEta_ =
1719  new TH2F("h_ele_seedDphi2VsEta", "ele seed dphi 2nd layer vs eta", nbineta2D, etamin, etamax, 50, -0.003, +0.003);
1720  h_ele_seed_dphi2VsPt_ =
1721  new TH2F("h_ele_seedDphi2VsPt", "ele seed dphi 2nd layer vs pt", nbinpt2D, 0., ptmax, 50, -0.003, +0.003);
1722  h_ele_seed_drz2_ = new TH1F("h_ele_seedDrz2", "ele seed dr (dz) 2nd layer", 50, -0.03, +0.03);
1723  h_ele_seed_drz2_->Sumw2();
1724  h_ele_seed_drz2VsEta_ =
1725  new TH2F("h_ele_seedDrz2VsEta", "ele seed dr/dz 2nd layer vs eta", nbineta2D, etamin, etamax, 50, -0.03, +0.03);
1726  h_ele_seed_drz2VsPt_ =
1727  new TH2F("h_ele_seedDrz2VsPt", "ele seed dr/dz 2nd layer vs pt", nbinpt2D, 0., ptmax, 50, -0.03, +0.03);
1728  h_ele_seed_subdet2_ = new TH1F("h_ele_seedSubdet2", "ele seed subdet 2nd layer", 10, 0., 10.);
1729  h_ele_seed_subdet2_->Sumw2();
1730 
1731  // classes
1732  h_ele_classes = new TH1F("h_ele_classes", "ele classes", 20, 0.0, 20.);
1733  h_ele_classes->Sumw2();
1734  h_ele_eta = new TH1F("h_ele_eta", "ele electron eta", nbineta / 2, 0.0, etamax);
1735  h_ele_eta->Sumw2();
1736  h_ele_eta_golden = new TH1F("h_ele_eta_golden", "ele electron eta golden", nbineta / 2, 0.0, etamax);
1737  h_ele_eta_golden->Sumw2();
1738  h_ele_eta_bbrem = new TH1F("h_ele_eta_bbrem", "ele electron eta bbrem", nbineta / 2, 0.0, etamax);
1739  h_ele_eta_bbrem->Sumw2();
1740  h_ele_eta_narrow = new TH1F("h_ele_eta_narrow", "ele electron eta narrow", nbineta / 2, 0.0, etamax);
1741  h_ele_eta_narrow->Sumw2();
1742  h_ele_eta_shower = new TH1F("h_ele_eta_show", "ele electron eta showering", nbineta / 2, 0.0, etamax);
1743  h_ele_eta_shower->Sumw2();
1744  h_ele_PinVsPoutGolden_mode = new TH2F("h_ele_PinVsPoutGolden_mode",
1745  "ele track inner p vs outer p vs eta, golden, mode of GSF components",
1746  nbinp2D,
1747  0.,
1748  pmax,
1749  50,
1750  0.,
1751  pmax);
1752  h_ele_PinVsPoutShowering_mode = new TH2F("h_ele_PinVsPoutShowering_mode",
1753  "ele track inner p vs outer p vs eta, showering, mode of GSF components",
1754  nbinp2D,
1755  0.,
1756  pmax,
1757  50,
1758  0.,
1759  pmax);
1760  h_ele_PinVsPoutGolden_mean = new TH2F("h_ele_PinVsPoutGolden_mean",
1761  "ele track inner p vs outer p vs eta, golden, mean of GSF components",
1762  nbinp2D,
1763  0.,
1764  pmax,
1765  50,
1766  0.,
1767  pmax);
1768  h_ele_PinVsPoutShowering_mean = new TH2F("h_ele_PinVsPoutShowering_mean",
1769  "ele track inner p vs outer p vs eta, showering, mean of GSF components",
1770  nbinp2D,
1771  0.,
1772  pmax,
1773  50,
1774  0.,
1775  pmax);
1776  h_ele_PtinVsPtoutGolden_mode = new TH2F("h_ele_PtinVsPtoutGolden_mode",
1777  "ele track inner pt vs outer pt vs eta, golden, mode of GSF components",
1778  nbinpt2D,
1779  0.,
1780  ptmax,
1781  50,
1782  0.,
1783  ptmax);
1784  h_ele_PtinVsPtoutShowering_mode = new TH2F("h_ele_PtinVsPtoutShowering_mode",
1785  "ele track inner pt vs outer pt vs eta, showering, mode of GSF components",
1786  nbinpt2D,
1787  0.,
1788  ptmax,
1789  50,
1790  0.,
1791  ptmax);
1792  h_ele_PtinVsPtoutGolden_mean = new TH2F("h_ele_PtinVsPtoutGolden_mean",
1793  "ele track inner pt vs outer pt vs eta, golden, mean of GSF components",
1794  nbinpt2D,
1795  0.,
1796  ptmax,
1797  50,
1798  0.,
1799  ptmax);
1800  h_ele_PtinVsPtoutShowering_mean = new TH2F("h_ele_PtinVsPtoutShowering_mean",
1801  "ele track inner pt vs outer pt vs eta, showering, mean of GSF components",
1802  nbinpt2D,
1803  0.,
1804  ptmax,
1805  50,
1806  0.,
1807  ptmax);
1808  histSclEoEtrueGolden_barrel = new TH1F("h_scl_EoEtrue_golden_barrel",
1809  "ele supercluster energy / gen energy, golden, barrel",
1810  nbinpoptrue,
1811  poptruemin,
1812  poptruemax);
1813  histSclEoEtrueGolden_barrel->Sumw2();
1814  histSclEoEtrueGolden_endcaps = new TH1F("h_scl_EoEtrue_golden_endcaps",
1815  "ele supercluster energy / gen energy, golden, endcaps",
1816  nbinpoptrue,
1817  poptruemin,
1818  poptruemax);
1819  histSclEoEtrueGolden_endcaps->Sumw2();
1820  histSclEoEtrueShowering_barrel = new TH1F("h_scl_EoEtrue_showering_barrel",
1821  "ele supercluster energy / gen energy, showering, barrel",
1822  nbinpoptrue,
1823  poptruemin,
1824  poptruemax);
1825  histSclEoEtrueShowering_barrel->Sumw2();
1826  histSclEoEtrueShowering_endcaps = new TH1F("h_scl_EoEtrue_showering_endcaps",
1827  "ele supercluster energy / gen energy, showering, endcaps",
1828  nbinpoptrue,
1829  poptruemin,
1830  poptruemax);
1831  histSclEoEtrueShowering_endcaps->Sumw2();
1832 
1833  // isolation
1834  h_ele_tkSumPt_dr03 = new TH1F("h_ele_tkSumPt_dr03", "tk isolation sum, dR=0.3", 100, 0.0, 20.);
1835  h_ele_tkSumPt_dr03->Sumw2();
1836  h_ele_ecalRecHitSumEt_dr03 = new TH1F("h_ele_ecalRecHitSumEt_dr03", "ecal isolation sum, dR=0.3", 100, 0.0, 20.);
1837  h_ele_ecalRecHitSumEt_dr03->Sumw2();
1838  h_ele_hcalDepth1TowerSumEt_dr03 =
1839  new TH1F("h_ele_hcalDepth1TowerSumEt_dr03", "hcal depth1 isolation sum, dR=0.3", 100, 0.0, 20.);
1840  h_ele_hcalDepth1TowerSumEt_dr03->Sumw2();
1841  h_ele_hcalDepth2TowerSumEt_dr03 =
1842  new TH1F("h_ele_hcalDepth2TowerSumEt_dr03", "hcal depth2 isolation sum, dR=0.3", 100, 0.0, 20.);
1843  h_ele_hcalDepth2TowerSumEt_dr03->Sumw2();
1844  h_ele_tkSumPt_dr04 = new TH1F("h_ele_tkSumPt_dr04", "tk isolation sum, dR=0.4", 100, 0.0, 20.);
1845  h_ele_tkSumPt_dr04->Sumw2();
1846  h_ele_ecalRecHitSumEt_dr04 = new TH1F("h_ele_ecalRecHitSumEt_dr04", "ecal isolation sum, dR=0.4", 100, 0.0, 20.);
1847  h_ele_ecalRecHitSumEt_dr04->Sumw2();
1848  h_ele_hcalDepth1TowerSumEt_dr04 =
1849  new TH1F("h_ele_hcalDepth1TowerSumEt_dr04", "hcal depth1 isolation sum, dR=0.4", 100, 0.0, 20.);
1850  h_ele_hcalDepth1TowerSumEt_dr04->Sumw2();
1851  h_ele_hcalDepth2TowerSumEt_dr04 =
1852  new TH1F("h_ele_hcalDepth2TowerSumEt_dr04", "hcal depth2 isolation sum, dR=0.4", 100, 0.0, 20.);
1853  h_ele_hcalDepth2TowerSumEt_dr04->Sumw2();
1854 
1855  // fbrem
1856  h_ele_fbrem = new TH1F("h_ele_fbrem", "ele brem fraction, mode of GSF components", 100, 0., 1.);
1857  h_ele_fbrem->Sumw2();
1858  h_ele_fbrem_eg = new TH1F("h_ele_fbrem_eg", "ele brem fraction, mode of GSF components, ecal driven", 100, 0., 1.);
1859  h_ele_fbrem_eg->Sumw2();
1860  h_ele_fbremVsEta_mode = new TProfile("h_ele_fbremvsEtamode",
1861  "mean ele brem fraction vs eta, mode of GSF components",
1862  nbineta2D,
1863  etamin,
1864  etamax,
1865  0.,
1866  1.);
1867  h_ele_fbremVsEta_mean = new TProfile("h_ele_fbremvsEtamean",
1868  "mean ele brem fraction vs eta, mean of GSF components",
1869  nbineta2D,
1870  etamin,
1871  etamax,
1872  0.,
1873  1.);
1874 
1875  // e/g et pflow electrons
1876  h_ele_mva = new TH1F("h_ele_mva", "ele identification mva", 100, -1., 1.);
1877  h_ele_mva->Sumw2();
1878  h_ele_mva_eg = new TH1F("h_ele_mva_eg", "ele identification mva, ecal driven", 100, -1., 1.);
1879  h_ele_mva_eg->Sumw2();
1880  h_ele_provenance = new TH1F("h_ele_provenance", "ele provenance", 5, -2., 3.);
1881  h_ele_provenance->Sumw2();
1882 
1883  // histos titles
1884  h_mcNum->GetXaxis()->SetTitle("N_{gen}");
1885  h_mcNum->GetYaxis()->SetTitle("Events");
1886  h_eleNum->GetXaxis()->SetTitle("# gen ele");
1887  h_eleNum->GetYaxis()->SetTitle("Events");
1888  h_gamNum->GetXaxis()->SetTitle("N_{gen #gamma}");
1889  h_gamNum->GetYaxis()->SetTitle("Events");
1890  h_simEta->GetXaxis()->SetTitle("#eta");
1891  h_simEta->GetYaxis()->SetTitle("Events");
1892  h_simP->GetXaxis()->SetTitle("p (GeV/c)");
1893  h_simP->GetYaxis()->SetTitle("Events");
1894  h_ele_foundHits->GetXaxis()->SetTitle("N_{hits}");
1895  h_ele_foundHits->GetYaxis()->SetTitle("Events");
1896  h_ele_foundHits_barrel->GetXaxis()->SetTitle("N_{hits}");
1897  h_ele_foundHits_barrel->GetYaxis()->SetTitle("Events");
1898  h_ele_foundHits_endcaps->GetXaxis()->SetTitle("N_{hits}");
1899  h_ele_foundHits_endcaps->GetYaxis()->SetTitle("Events");
1900  h_ele_ambiguousTracks->GetXaxis()->SetTitle("N_{ambiguous tracks}");
1901  h_ele_ambiguousTracks->GetYaxis()->SetTitle("Events");
1902  h_ele_lostHits->GetXaxis()->SetTitle("N_{lost hits}");
1903  h_ele_lostHits->GetYaxis()->SetTitle("Events");
1904  h_ele_lostHits_barrel->GetXaxis()->SetTitle("N_{lost hits}");
1905  h_ele_lostHits_barrel->GetYaxis()->SetTitle("Events");
1906  h_ele_lostHits_endcaps->GetXaxis()->SetTitle("N_{lost hits}");
1907  h_ele_lostHits_endcaps->GetYaxis()->SetTitle("Events");
1908  h_ele_chi2->GetXaxis()->SetTitle("#Chi^{2}");
1909  h_ele_chi2->GetYaxis()->SetTitle("Events");
1910  h_ele_chi2_barrel->GetXaxis()->SetTitle("#Chi^{2}");
1911  h_ele_chi2_barrel->GetYaxis()->SetTitle("Events");
1912  h_ele_chi2_endcaps->GetXaxis()->SetTitle("#Chi^{2}");
1913  h_ele_chi2_endcaps->GetYaxis()->SetTitle("Events");
1914  h_ele_charge->GetXaxis()->SetTitle("charge");
1915  h_ele_charge->GetYaxis()->SetTitle("Events");
1916  h_ele_vertexP->GetXaxis()->SetTitle("p_{vertex} (GeV/c)");
1917  h_ele_vertexP->GetYaxis()->SetTitle("Events");
1918  h_ele_vertexPt->GetXaxis()->SetTitle("p_{T vertex} (GeV/c)");
1919  h_ele_vertexPt->GetYaxis()->SetTitle("Events");
1920  h_ele_Et->GetXaxis()->SetTitle("E_{T} (GeV)");
1921  h_ele_Et->GetYaxis()->SetTitle("Events");
1922  h_ele_Et_all->GetXaxis()->SetTitle("E_{T} (GeV)");
1923  h_ele_Et_all->GetYaxis()->SetTitle("Events");
1924  h_ele_vertexEta->GetXaxis()->SetTitle("#eta");
1925  h_ele_vertexEta->GetYaxis()->SetTitle("Events");
1926  h_ele_vertexPhi->GetXaxis()->SetTitle("#phi (rad)");
1927  h_ele_vertexPhi->GetYaxis()->SetTitle("Events");
1928  h_ele_PoPtrue->GetXaxis()->SetTitle("P/P_{gen}");
1929  h_ele_PoPtrue->GetYaxis()->SetTitle("Events");
1930  h_ele_PoPtrue_barrel->GetXaxis()->SetTitle("P/P_{gen}");
1931  h_ele_PoPtrue_barrel->GetYaxis()->SetTitle("Events");
1932  h_ele_PoPtrue_endcaps->GetXaxis()->SetTitle("P/P_{gen}");
1933  h_ele_PoPtrue_endcaps->GetYaxis()->SetTitle("Events");
1934  h_ele_PoPtrue_golden_barrel->GetXaxis()->SetTitle("P/P_{gen}");
1935  h_ele_PoPtrue_golden_barrel->GetYaxis()->SetTitle("Events");
1936  h_ele_PoPtrue_showering_barrel->GetXaxis()->SetTitle("P/P_{gen}");
1937  h_ele_PoPtrue_showering_barrel->GetYaxis()->SetTitle("Events");
1938  h_ele_PoPtrue_golden_endcaps->GetXaxis()->SetTitle("P/P_{gen}");
1939  h_ele_PoPtrue_golden_endcaps->GetYaxis()->SetTitle("Events");
1940  h_ele_PoPtrue_showering_endcaps->GetXaxis()->SetTitle("P/P_{gen}");
1941  h_ele_PoPtrue_showering_endcaps->GetYaxis()->SetTitle("Events");
1942  h_ele_PtoPttrue->GetXaxis()->SetTitle("P_{T}/P_{T}^{gen}");
1943  h_ele_PtoPttrue->GetYaxis()->SetTitle("Events");
1944  h_ele_PtoPttrue_barrel->GetXaxis()->SetTitle("P_{T}/P_{T}^{gen}");
1945  h_ele_PtoPttrue_barrel->GetYaxis()->SetTitle("Events");
1946  h_ele_PtoPttrue_endcaps->GetXaxis()->SetTitle("P_{T}/P_{T}^{gen}");
1947  h_ele_PtoPttrue_endcaps->GetYaxis()->SetTitle("Events");
1948  histSclEoEtrue_barrel->GetXaxis()->SetTitle("E/E_{gen}");
1949  histSclEoEtrue_barrel->GetYaxis()->SetTitle("Events");
1950  histSclEoEtrue_endcaps->GetXaxis()->SetTitle("E/E_{gen}");
1951  histSclEoEtrue_endcaps->GetYaxis()->SetTitle("Events");
1952  histSclEoEtrueGolden_barrel->GetXaxis()->SetTitle("E/E_{gen}");
1953  histSclEoEtrueGolden_barrel->GetYaxis()->SetTitle("Events");
1954  histSclEoEtrueShowering_barrel->GetXaxis()->SetTitle("E/E_{gen}");
1955  histSclEoEtrueShowering_barrel->GetYaxis()->SetTitle("Events");
1956  histSclEoEtrueGolden_endcaps->GetXaxis()->SetTitle("E/E_{gen}");
1957  histSclEoEtrueGolden_endcaps->GetYaxis()->SetTitle("Events");
1958  histSclEoEtrueShowering_endcaps->GetXaxis()->SetTitle("E/E_{gen}");
1959  histSclEoEtrueShowering_endcaps->GetYaxis()->SetTitle("Events");
1960  histSclEoEtrue_barrel_etagap->GetXaxis()->SetTitle("E/E_{gen}");
1961  histSclEoEtrue_barrel_etagap->GetYaxis()->SetTitle("Events");
1962  histSclEoEtrue_barrel_phigap->GetXaxis()->SetTitle("E/E_{gen}");
1963  histSclEoEtrue_barrel_phigap->GetYaxis()->SetTitle("Events");
1964  histSclEoEtrue_ebeegap->GetXaxis()->SetTitle("E/E_{gen}");
1965  histSclEoEtrue_ebeegap->GetYaxis()->SetTitle("Events");
1966  histSclEoEtrue_endcaps_deegap->GetXaxis()->SetTitle("E/E_{gen}");
1967  histSclEoEtrue_endcaps_deegap->GetYaxis()->SetTitle("Events");
1968  histSclEoEtrue_endcaps_ringgap->GetXaxis()->SetTitle("E/E_{gen}");
1969  histSclEoEtrue_endcaps_ringgap->GetYaxis()->SetTitle("Events");
1970  histSclEoEtrue_barrel_new->GetXaxis()->SetTitle("E/E_{gen}");
1971  histSclEoEtrue_barrel_new->GetYaxis()->SetTitle("Events");
1972  histSclEoEtrue_endcaps_new->GetXaxis()->SetTitle("E/E_{gen}");
1973  histSclEoEtrue_endcaps_new->GetYaxis()->SetTitle("Events");
1974  histSclEoEtrue_barrel_etagap_new->GetXaxis()->SetTitle("E/E_{gen}");
1975  histSclEoEtrue_barrel_etagap_new->GetYaxis()->SetTitle("Events");
1976  histSclEoEtrue_barrel_phigap_new->GetXaxis()->SetTitle("E/E_{gen}");
1977  histSclEoEtrue_barrel_phigap_new->GetYaxis()->SetTitle("Events");
1978  histSclEoEtrue_ebeegap_new->GetXaxis()->SetTitle("E/E_{gen}");
1979  histSclEoEtrue_ebeegap_new->GetYaxis()->SetTitle("Events");
1980  histSclEoEtrue_endcaps_deegap_new->GetXaxis()->SetTitle("E/E_{gen}");
1981  histSclEoEtrue_endcaps_deegap_new->GetYaxis()->SetTitle("Events");
1982  histSclEoEtrue_endcaps_ringgap_new->GetXaxis()->SetTitle("E/E_{gen}");
1983  histSclEoEtrue_endcaps_ringgap_new->GetYaxis()->SetTitle("Events");
1984  histSclSigEtaEta_->GetXaxis()->SetTitle("#sigma_{#eta #eta}");
1985  histSclSigEtaEta_->GetYaxis()->SetTitle("Events");
1986  histSclSigEtaEta_barrel_->GetXaxis()->SetTitle("#sigma_{#eta #eta}");
1987  histSclSigEtaEta_barrel_->GetYaxis()->SetTitle("Events");
1988  histSclSigEtaEta_endcaps_->GetXaxis()->SetTitle("#sigma_{#eta #eta}");
1989  histSclSigEtaEta_endcaps_->GetYaxis()->SetTitle("Events");
1990  histSclSigIEtaIEta_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1991  histSclSigIEtaIEta_->GetYaxis()->SetTitle("Events");
1992  histSclSigIEtaIEta_barrel_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1993  histSclSigIEtaIEta_barrel_->GetYaxis()->SetTitle("Events");
1994  histSclSigIEtaIEta_endcaps_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1995  histSclSigIEtaIEta_endcaps_->GetYaxis()->SetTitle("Events");
1996  histSclE1x5_->GetXaxis()->SetTitle("E1x5 (GeV)");
1997  histSclE1x5_->GetYaxis()->SetTitle("Events");
1998  histSclE1x5_barrel_->GetXaxis()->SetTitle("E1x5 (GeV)");
1999  histSclE1x5_barrel_->GetYaxis()->SetTitle("Events");
2000  histSclE1x5_endcaps_->GetXaxis()->SetTitle("E1x5 (GeV)");
2001  histSclE1x5_endcaps_->GetYaxis()->SetTitle("Events");
2002  histSclE2x5max_->GetXaxis()->SetTitle("E2x5 (GeV)");
2003  histSclE2x5max_->GetYaxis()->SetTitle("Events");
2004  histSclE2x5max_barrel_->GetXaxis()->SetTitle("E2x5 (GeV)");
2005  histSclE2x5max_barrel_->GetYaxis()->SetTitle("Events");
2006  histSclE2x5max_endcaps_->GetXaxis()->SetTitle("E2x5 (GeV)");
2007  histSclE2x5max_endcaps_->GetYaxis()->SetTitle("Events");
2008  histSclE5x5_->GetXaxis()->SetTitle("E5x5 (GeV)");
2009  histSclE5x5_->GetYaxis()->SetTitle("Events");
2010  histSclE5x5_barrel_->GetXaxis()->SetTitle("E5x5 (GeV)");
2011  histSclE5x5_barrel_->GetYaxis()->SetTitle("Events");
2012  histSclE5x5_endcaps_->GetXaxis()->SetTitle("E5x5 (GeV)");
2013  histSclE5x5_endcaps_->GetYaxis()->SetTitle("Events");
2014  histSclEoEtruePfVsEg->GetXaxis()->SetTitle("E/E_{gen} (e/g)");
2015  histSclEoEtruePfVsEg->GetYaxis()->SetTitle("E/E_{gen} (pflow)");
2016  h_ele_ChargeMnChargeTrue->GetXaxis()->SetTitle("q_{rec} - q_{gen}");
2017  h_ele_ChargeMnChargeTrue->GetYaxis()->SetTitle("Events");
2018  h_ele_EtaMnEtaTrue->GetXaxis()->SetTitle("#eta_{rec} - #eta_{gen}");
2019  h_ele_EtaMnEtaTrue->GetYaxis()->SetTitle("Events");
2020  h_ele_EtaMnEtaTrue_barrel->GetXaxis()->SetTitle("#eta_{rec} - #eta_{gen}");
2021  h_ele_EtaMnEtaTrue_barrel->GetYaxis()->SetTitle("Events");
2022  h_ele_EtaMnEtaTrue_endcaps->GetXaxis()->SetTitle("#eta_{rec} - #eta_{gen}");
2023  h_ele_EtaMnEtaTrue_endcaps->GetYaxis()->SetTitle("Events");
2024  h_ele_PhiMnPhiTrue->GetXaxis()->SetTitle("#phi_{rec} - #phi_{gen} (rad)");
2025  h_ele_PhiMnPhiTrue->GetYaxis()->SetTitle("Events");
2026  h_ele_PhiMnPhiTrue_barrel->GetXaxis()->SetTitle("#phi_{rec} - #phi_{gen} (rad)");
2027  h_ele_PhiMnPhiTrue_barrel->GetYaxis()->SetTitle("Events");
2028  h_ele_PhiMnPhiTrue_endcaps->GetXaxis()->SetTitle("#phi_{rec} - #phi_{gen} (rad)");
2029  h_ele_PhiMnPhiTrue_endcaps->GetYaxis()->SetTitle("Events");
2030  h_ele_PinMnPout->GetXaxis()->SetTitle("P_{vertex} - P_{out} (GeV/c)");
2031  h_ele_PinMnPout->GetYaxis()->SetTitle("Events");
2032  h_ele_PinMnPout_mode->GetXaxis()->SetTitle("P_{vertex} - P_{out}, mode of GSF components (GeV/c)");
2033  h_ele_PinMnPout_mode->GetYaxis()->SetTitle("Events");
2034  h_ele_outerP->GetXaxis()->SetTitle("P_{out} (GeV/c)");
2035  h_ele_outerP->GetYaxis()->SetTitle("Events");
2036  h_ele_outerP_mode->GetXaxis()->SetTitle("P_{out} (GeV/c)");
2037  h_ele_outerP_mode->GetYaxis()->SetTitle("Events");
2038  h_ele_outerPt->GetXaxis()->SetTitle("P_{T out} (GeV/c)");
2039  h_ele_outerPt->GetYaxis()->SetTitle("Events");
2040  h_ele_outerPt_mode->GetXaxis()->SetTitle("P_{T out} (GeV/c)");
2041  h_ele_outerPt_mode->GetYaxis()->SetTitle("Events");
2042  h_ele_EoP->GetXaxis()->SetTitle("E/P_{vertex}");
2043  h_ele_EoP->GetYaxis()->SetTitle("Events");
2044  h_ele_EseedOP->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
2045  h_ele_EseedOP->GetYaxis()->SetTitle("Events");
2046  h_ele_EoPout->GetXaxis()->SetTitle("E_{seed}/P_{out}");
2047  h_ele_EoPout->GetYaxis()->SetTitle("Events");
2048  h_ele_EeleOPout->GetXaxis()->SetTitle("E_{ele}/P_{out}");
2049  h_ele_EeleOPout->GetYaxis()->SetTitle("Events");
2050  h_ele_EoP_barrel->GetXaxis()->SetTitle("E/P_{vertex}");
2051  h_ele_EoP_barrel->GetYaxis()->SetTitle("Events");
2052  h_ele_EseedOP_barrel->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
2053  h_ele_EseedOP_barrel->GetYaxis()->SetTitle("Events");
2054  h_ele_EoPout_barrel->GetXaxis()->SetTitle("E_{seed}/P_{out}");
2055  h_ele_EoPout_barrel->GetYaxis()->SetTitle("Events");
2056  h_ele_EeleOPout_barrel->GetXaxis()->SetTitle("E_{ele}/P_{out}");
2057  h_ele_EeleOPout_barrel->GetYaxis()->SetTitle("Events");
2058  h_ele_EoP_endcaps->GetXaxis()->SetTitle("E/P_{vertex}");
2059  h_ele_EoP_endcaps->GetYaxis()->SetTitle("Events");
2060  h_ele_EseedOP_endcaps->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
2061  h_ele_EseedOP_endcaps->GetYaxis()->SetTitle("Events");
2062  h_ele_EoPout_endcaps->GetXaxis()->SetTitle("E_{seed}/P_{out}");
2063  h_ele_EoPout_endcaps->GetYaxis()->SetTitle("Events");
2064  h_ele_EeleOPout_endcaps->GetXaxis()->SetTitle("E_{ele}/P_{out}");
2065  h_ele_EeleOPout_endcaps->GetYaxis()->SetTitle("Events");
2066  h_ele_vertexX->GetXaxis()->SetTitle("x (cm)");
2067  h_ele_vertexX->GetYaxis()->SetTitle("Events");
2068  h_ele_vertexY->GetXaxis()->SetTitle("y (cm)");
2069  h_ele_vertexY->GetYaxis()->SetTitle("Events");
2070  h_ele_vertexZ->GetXaxis()->SetTitle("z (cm)");
2071  h_ele_vertexZ->GetYaxis()->SetTitle("Events");
2072  h_ele_vertexTIP->GetXaxis()->SetTitle("TIP (cm)");
2073  h_ele_vertexTIP->GetYaxis()->SetTitle("Events");
2074  h_ele_TIP_all->GetXaxis()->SetTitle("r_{T} (cm)");
2075  h_ele_TIP_all->GetYaxis()->SetTitle("Events");
2076  h_ele_vertexTIPVsEta->GetYaxis()->SetTitle("TIP (cm)");
2077  h_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
2078  h_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("TIP (cm)");
2079  h_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2080  h_ele_vertexTIPVsPt->GetYaxis()->SetTitle("TIP (cm)");
2081  h_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2082  h_ele_dEtaSc_propVtx->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
2083  h_ele_dEtaSc_propVtx->GetYaxis()->SetTitle("Events");
2084  h_ele_dEtaCl_propOut->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
2085  h_ele_dEtaCl_propOut->GetYaxis()->SetTitle("Events");
2086  h_ele_dEtaEleCl_propOut->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
2087  h_ele_dEtaEleCl_propOut->GetYaxis()->SetTitle("Events");
2088  h_ele_dPhiSc_propVtx->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
2089  h_ele_dPhiSc_propVtx->GetYaxis()->SetTitle("Events");
2090  h_ele_dPhiCl_propOut->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
2091  h_ele_dPhiCl_propOut->GetYaxis()->SetTitle("Events");
2092  h_ele_dPhiEleCl_propOut->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
2093  h_ele_dPhiEleCl_propOut->GetYaxis()->SetTitle("Events");
2094  h_ele_dEtaSc_propVtx_barrel->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
2095  h_ele_dEtaSc_propVtx_barrel->GetYaxis()->SetTitle("Events");
2096  h_ele_dEtaCl_propOut_barrel->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
2097  h_ele_dEtaCl_propOut_barrel->GetYaxis()->SetTitle("Events");
2098  h_ele_dEtaEleCl_propOut_barrel->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
2099  h_ele_dEtaEleCl_propOut_barrel->GetYaxis()->SetTitle("Events");
2100  h_ele_dPhiSc_propVtx_barrel->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
2101  h_ele_dPhiSc_propVtx_barrel->GetYaxis()->SetTitle("Events");
2102  h_ele_dPhiCl_propOut_barrel->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
2103  h_ele_dPhiCl_propOut_barrel->GetYaxis()->SetTitle("Events");
2104  h_ele_dPhiEleCl_propOut_barrel->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
2105  h_ele_dPhiEleCl_propOut_barrel->GetYaxis()->SetTitle("Events");
2106  h_ele_dEtaSc_propVtx_endcaps->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
2107  h_ele_dEtaSc_propVtx_endcaps->GetYaxis()->SetTitle("Events");
2108  h_ele_dEtaCl_propOut_endcaps->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
2109  h_ele_dEtaCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
2110  h_ele_dEtaEleCl_propOut_endcaps->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
2111  h_ele_dEtaEleCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
2112  h_ele_dPhiSc_propVtx_endcaps->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
2113  h_ele_dPhiSc_propVtx_endcaps->GetYaxis()->SetTitle("Events");
2114  h_ele_dPhiCl_propOut_endcaps->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
2115  h_ele_dPhiCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
2116  h_ele_dPhiEleCl_propOut_endcaps->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
2117  h_ele_dPhiEleCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
2118  h_ele_HoE->GetXaxis()->SetTitle("H/E");
2119  h_ele_HoE->GetYaxis()->SetTitle("Events");
2120  h_ele_HoE_barrel->GetXaxis()->SetTitle("H/E");
2121  h_ele_HoE_barrel->GetYaxis()->SetTitle("Events");
2122  h_ele_HoE_endcaps->GetXaxis()->SetTitle("H/E");
2123  h_ele_HoE_endcaps->GetYaxis()->SetTitle("Events");
2124  h_ele_HoE_fiducial->GetXaxis()->SetTitle("H/E");
2125  h_ele_HoE_fiducial->GetYaxis()->SetTitle("Events");
2126  h_ele_fbrem->GetXaxis()->SetTitle("P_{in} - P_{out} / P_{in}");
2127  h_ele_fbrem->GetYaxis()->SetTitle("Events");
2128  h_ele_seed_dphi2_->GetXaxis()->SetTitle("#phi_{hit}-#phi_{pred} (rad)");
2129  h_ele_seed_dphi2_->GetYaxis()->SetTitle("Events");
2130  h_ele_seed_drz2_->GetXaxis()->SetTitle("r(z)_{hit}-r(z)_{pred} (cm)");
2131  h_ele_seed_drz2_->GetYaxis()->SetTitle("Events");
2132  h_ele_seed_subdet2_->GetXaxis()->SetTitle("2nd hit subdet Id");
2133  h_ele_seed_subdet2_->GetYaxis()->SetTitle("Events");
2134  h_ele_classes->GetXaxis()->SetTitle("class Id");
2135  h_ele_classes->GetYaxis()->SetTitle("Events");
2136  h_ele_EoverP_all->GetXaxis()->SetTitle("E/P_{vertex}");
2137  h_ele_EoverP_all->GetYaxis()->SetTitle("Events");
2138  h_ele_EseedOP_all->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
2139  h_ele_EseedOP_all->GetYaxis()->SetTitle("Events");
2140  h_ele_EoPout_all->GetXaxis()->SetTitle("E_{seed}/P_{out}");
2141  h_ele_EoPout_all->GetYaxis()->SetTitle("Events");
2142  h_ele_EeleOPout_all->GetXaxis()->SetTitle("E_{ele}/P_{out}");
2143  h_ele_EeleOPout_all->GetYaxis()->SetTitle("Events");
2144  h_ele_dEtaSc_propVtx_all->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
2145  h_ele_dEtaSc_propVtx_all->GetYaxis()->SetTitle("Events");
2146  h_ele_dPhiSc_propVtx_all->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
2147  h_ele_dPhiSc_propVtx_all->GetYaxis()->SetTitle("Events");
2148  h_ele_dEtaCl_propOut_all->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
2149  h_ele_dEtaCl_propOut_all->GetYaxis()->SetTitle("Events");
2150  h_ele_dPhiCl_propOut_all->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
2151  h_ele_dPhiCl_propOut_all->GetYaxis()->SetTitle("Events");
2152  h_ele_HoE_all->GetXaxis()->SetTitle("H/E");
2153  h_ele_HoE_all->GetYaxis()->SetTitle("Events");
2154  h_ele_mee_all->GetXaxis()->SetTitle("m_{ee} (GeV/c^{2})");
2155  h_ele_mee_all->GetYaxis()->SetTitle("Events");
2156  h_ele_mee_os->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
2157  h_ele_mee_os->GetYaxis()->SetTitle("Events");
2158  h_ele_mee_os_ebeb->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
2159  h_ele_mee_os_ebeb->GetYaxis()->SetTitle("Events");
2160  h_ele_mee_os_ebee->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
2161  h_ele_mee_os_ebee->GetYaxis()->SetTitle("Events");
2162  h_ele_mee_os_eeee->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
2163  h_ele_mee_os_eeee->GetYaxis()->SetTitle("Events");
2164  h_ele_mee_os_gg->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
2165  h_ele_mee_os_gg->GetYaxis()->SetTitle("Events");
2166  h_ele_mee_os_gb->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
2167  h_ele_mee_os_gb->GetYaxis()->SetTitle("Events");
2168  h_ele_mee_os_bb->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
2169  h_ele_mee_os_bb->GetYaxis()->SetTitle("Events");
2170  h_ele_E2mnE1vsMee_all->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
2171  h_ele_E2mnE1vsMee_all->GetYaxis()->SetTitle("E2 - E1 (GeV)");
2172  h_ele_E2mnE1vsMee_egeg_all->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
2173  h_ele_E2mnE1vsMee_egeg_all->GetYaxis()->SetTitle("E2 - E1 (GeV)");
2174  histNum_->GetXaxis()->SetTitle("N_{ele}");
2175  histNum_->GetYaxis()->SetTitle("Events");
2176  h_ele_fbremVsEta_mode->GetXaxis()->SetTitle("#eta");
2177  h_ele_fbremVsEta_mean->GetXaxis()->SetTitle("#eta");
2178 }
2179 
2181  histfile_->cd();
2182 
2183  std::cout << "[GsfElectronMCAnalyzer] efficiency calculation " << std::endl;
2184  // efficiency vs eta
2185  TH1F *h_ele_etaEff = (TH1F *)h_ele_simEta_matched->Clone("h_ele_etaEff");
2186  h_ele_etaEff->Reset();
2187  h_ele_etaEff->Divide(h_ele_simEta_matched, h_simEta, 1, 1, "b");
2188  h_ele_etaEff->Print();
2189  h_ele_etaEff->GetXaxis()->SetTitle("#eta");
2190  h_ele_etaEff->GetYaxis()->SetTitle("Efficiency");
2191 
2192  // efficiency vs z
2193  TH1F *h_ele_zEff = (TH1F *)h_ele_simZ_matched->Clone("h_ele_zEff");
2194  h_ele_zEff->Reset();
2195  h_ele_zEff->Divide(h_ele_simZ_matched, h_simZ, 1, 1, "b");
2196  h_ele_zEff->Print();
2197  h_ele_zEff->GetXaxis()->SetTitle("z (cm)");
2198  h_ele_zEff->GetYaxis()->SetTitle("Efficiency");
2199 
2200  // efficiency vs |eta|
2201  TH1F *h_ele_absetaEff = (TH1F *)h_ele_simAbsEta_matched->Clone("h_ele_absetaEff");
2202  h_ele_absetaEff->Reset();
2203  h_ele_absetaEff->Divide(h_ele_simAbsEta_matched, h_simAbsEta, 1, 1, "b");
2204  h_ele_absetaEff->GetXaxis()->SetTitle("|#eta|");
2205  h_ele_absetaEff->GetYaxis()->SetTitle("Efficiency");
2206 
2207  // efficiency vs pt
2208  TH1F *h_ele_ptEff = (TH1F *)h_ele_simPt_matched->Clone("h_ele_ptEff");
2209  h_ele_ptEff->Reset();
2210  h_ele_ptEff->Divide(h_ele_simPt_matched, h_simPt, 1, 1, "b");
2211  h_ele_ptEff->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2212  h_ele_ptEff->GetYaxis()->SetTitle("Efficiency");
2213 
2214  // efficiency vs phi
2215  TH1F *h_ele_phiEff = (TH1F *)h_ele_simPhi_matched->Clone("h_ele_phiEff");
2216  h_ele_phiEff->Reset();
2217  h_ele_phiEff->Divide(h_ele_simPhi_matched, h_simPhi, 1, 1, "b");
2218  h_ele_phiEff->GetXaxis()->SetTitle("#phi (rad)");
2219  h_ele_phiEff->GetYaxis()->SetTitle("Efficiency");
2220 
2221  // efficiency vs pt eta
2222  TH2F *h_ele_ptEtaEff = (TH2F *)h_ele_simPtEta_matched->Clone("h_ele_ptEtaEff");
2223  h_ele_ptEtaEff->Reset();
2224  h_ele_ptEtaEff->Divide(h_ele_simPtEta_matched, h_simPtEta, 1, 1, "b");
2225  h_ele_ptEtaEff->GetYaxis()->SetTitle("p_{T} (GeV/c)");
2226  h_ele_ptEtaEff->GetXaxis()->SetTitle("#eta");
2227 
2228  std::cout << "[GsfElectronMCAnalyzer] q-misid calculation " << std::endl;
2229  // misid vs eta
2230  TH1F *h_ele_etaQmisid = (TH1F *)h_ele_simEta_matched_qmisid->Clone("h_ele_etaQmisid");
2231  h_ele_etaQmisid->Reset();
2232  h_ele_etaQmisid->Divide(h_ele_simEta_matched_qmisid, h_simEta, 1, 1, "b");
2233  h_ele_etaQmisid->Print();
2234  h_ele_etaQmisid->GetXaxis()->SetTitle("#eta");
2235  h_ele_etaQmisid->GetYaxis()->SetTitle("q misId");
2236 
2237  // misid vs z
2238  TH1F *h_ele_zQmisid = (TH1F *)h_ele_simZ_matched_qmisid->Clone("h_ele_zQmisid");
2239  h_ele_zQmisid->Reset();
2240  h_ele_zQmisid->Divide(h_ele_simZ_matched_qmisid, h_simZ, 1, 1, "b");
2241  h_ele_zQmisid->Print();
2242  h_ele_zQmisid->GetXaxis()->SetTitle("z (cm)");
2243  h_ele_zQmisid->GetYaxis()->SetTitle("q misId");
2244 
2245  // misid vs |eta|
2246  TH1F *h_ele_absetaQmisid = (TH1F *)h_ele_simAbsEta_matched_qmisid->Clone("h_ele_absetaQmisid");
2247  h_ele_absetaQmisid->Reset();
2248  h_ele_absetaQmisid->Divide(h_ele_simAbsEta_matched_qmisid, h_simAbsEta, 1, 1, "b");
2249  h_ele_absetaQmisid->GetXaxis()->SetTitle("|#eta|");
2250  h_ele_absetaQmisid->GetYaxis()->SetTitle("q misId");
2251 
2252  // misid vs pt
2253  TH1F *h_ele_ptQmisid = (TH1F *)h_ele_simPt_matched_qmisid->Clone("h_ele_ptQmisid");
2254  h_ele_ptQmisid->Reset();
2255  h_ele_ptQmisid->Divide(h_ele_simPt_matched_qmisid, h_simPt, 1, 1, "b");
2256  h_ele_ptQmisid->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2257  h_ele_ptQmisid->GetYaxis()->SetTitle("q misId");
2258 
2259  std::cout << "[GsfElectronMCAnalyzer] all reco electrons " << std::endl;
2260  // rec/gen all electrons
2261  TH1F *h_ele_etaEff_all = (TH1F *)h_ele_vertexEta_all->Clone("h_ele_etaEff_all");
2262  h_ele_etaEff_all->Reset();
2263  h_ele_etaEff_all->Divide(h_ele_vertexEta_all, h_simEta, 1, 1, "b");
2264  h_ele_etaEff_all->Print();
2265  h_ele_etaEff_all->GetXaxis()->SetTitle("#eta");
2266  h_ele_etaEff_all->GetYaxis()->SetTitle("N_{rec}/N_{gen}");
2267  TH1F *h_ele_ptEff_all = (TH1F *)h_ele_vertexPt_all->Clone("h_ele_ptEff_all");
2268  h_ele_ptEff_all->Reset();
2269  h_ele_ptEff_all->Divide(h_ele_vertexPt_all, h_simPt, 1, 1, "b");
2270  h_ele_ptEff_all->Print();
2271  h_ele_ptEff_all->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2272  h_ele_ptEff_all->GetYaxis()->SetTitle("N_{rec}/N_{gen}");
2273 
2274  // classes
2275  TH1F *h_ele_eta_goldenFrac = (TH1F *)h_ele_eta_golden->Clone("h_ele_eta_goldenFrac");
2276  h_ele_eta_goldenFrac->Reset();
2277  h_ele_eta_goldenFrac->Divide(h_ele_eta_golden, h_ele_eta, 1, 1, "b");
2278  h_ele_eta_goldenFrac->GetXaxis()->SetTitle("|#eta|");
2279  h_ele_eta_goldenFrac->GetYaxis()->SetTitle("Fraction of electrons");
2280  h_ele_eta_goldenFrac->SetTitle("fraction of golden electrons vs eta");
2281  TH1F *h_ele_eta_bbremFrac = (TH1F *)h_ele_eta_bbrem->Clone("h_ele_eta_bbremFrac");
2282  h_ele_eta_bbremFrac->Reset();
2283  h_ele_eta_bbremFrac->GetXaxis()->SetTitle("|#eta|");
2284  h_ele_eta_bbremFrac->GetYaxis()->SetTitle("Fraction of electrons");
2285  h_ele_eta_bbremFrac->Divide(h_ele_eta_bbrem, h_ele_eta, 1, 1, "b");
2286  h_ele_eta_bbremFrac->SetTitle("fraction of big brem electrons vs eta");
2287  TH1F *h_ele_eta_narrowFrac = (TH1F *)h_ele_eta_narrow->Clone("h_ele_eta_narrowFrac");
2288  h_ele_eta_narrowFrac->Reset();
2289  h_ele_eta_narrowFrac->Divide(h_ele_eta_narrow, h_ele_eta, 1, 1, "b");
2290  h_ele_eta_narrowFrac->GetXaxis()->SetTitle("|#eta|");
2291  h_ele_eta_narrowFrac->GetYaxis()->SetTitle("Fraction of electrons");
2292  h_ele_eta_narrowFrac->SetTitle("fraction of narrow electrons vs eta");
2293  TH1F *h_ele_eta_showerFrac = (TH1F *)h_ele_eta_shower->Clone("h_ele_eta_showerFrac");
2294  h_ele_eta_showerFrac->Reset();
2295  h_ele_eta_showerFrac->Divide(h_ele_eta_shower, h_ele_eta, 1, 1, "b");
2296  h_ele_eta_showerFrac->GetXaxis()->SetTitle("|#eta|");
2297  h_ele_eta_showerFrac->GetYaxis()->SetTitle("Fraction of electrons");
2298  h_ele_eta_showerFrac->SetTitle("fraction of showering electrons vs eta");
2299 
2300  // fbrem
2301  TH1F *h_ele_xOverX0VsEta = new TH1F("h_ele_xOverx0VsEta", "mean X/X_0 vs eta", nbineta / 2, 0.0, 2.5);
2302  for (int ibin = 1; ibin < h_ele_fbremVsEta_mean->GetNbinsX() + 1; ibin++) {
2303  double xOverX0 = 0.;
2304  if (h_ele_fbremVsEta_mean->GetBinContent(ibin) > 0.)
2305  xOverX0 = -log(h_ele_fbremVsEta_mean->GetBinContent(ibin));
2306  h_ele_xOverX0VsEta->SetBinContent(ibin, xOverX0);
2307  }
2308 
2309  //profiles from 2D histos
2310  TProfile *p_ele_PoPtrueVsEta = h_ele_PoPtrueVsEta->ProfileX();
2311  p_ele_PoPtrueVsEta->SetTitle("mean ele momentum / gen momentum vs eta");
2312  p_ele_PoPtrueVsEta->GetXaxis()->SetTitle("#eta");
2313  p_ele_PoPtrueVsEta->GetYaxis()->SetTitle("<P/P_{gen}>");
2314  p_ele_PoPtrueVsEta->Write();
2315  TProfile *p_ele_PoPtrueVsPhi = h_ele_PoPtrueVsPhi->ProfileX();
2316  p_ele_PoPtrueVsPhi->SetTitle("mean ele momentum / gen momentum vs phi");
2317  p_ele_PoPtrueVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2318  p_ele_PoPtrueVsPhi->GetYaxis()->SetTitle("<P/P_{gen}>");
2319  p_ele_PoPtrueVsPhi->Write();
2320  TProfile *p_ele_EoEtruePfVsEg_x = histSclEoEtruePfVsEg->ProfileX();
2321  p_ele_EoEtruePfVsEg_x->SetTitle("mean pflow sc energy / true energy vs e/g sc energy");
2322  p_ele_EoEtruePfVsEg_x->GetXaxis()->SetTitle("E/E_{gen} (e/g)");
2323  p_ele_EoEtruePfVsEg_x->GetYaxis()->SetTitle("<E/E_{gen}> (pflow)");
2324  p_ele_EoEtruePfVsEg_x->Write();
2325  TProfile *p_ele_EoEtruePfVsEg_y = histSclEoEtruePfVsEg->ProfileY();
2326  p_ele_EoEtruePfVsEg_y->SetTitle("mean e/g sc energy / true energy vs pflow sc energy");
2327  p_ele_EoEtruePfVsEg_y->GetXaxis()->SetTitle("E/E_{gen} (pflow)");
2328  p_ele_EoEtruePfVsEg_y->GetYaxis()->SetTitle("<E/E_{gen}> (eg)");
2329  p_ele_EoEtruePfVsEg_y->Write();
2330  TProfile *p_ele_EtaMnEtaTrueVsEta = h_ele_EtaMnEtaTrueVsEta->ProfileX();
2331  p_ele_EtaMnEtaTrueVsEta->SetTitle("mean ele eta - gen eta vs eta");
2332  p_ele_EtaMnEtaTrueVsEta->GetXaxis()->SetTitle("#eta");
2333  p_ele_EtaMnEtaTrueVsEta->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{gen}>");
2334  p_ele_EtaMnEtaTrueVsEta->Write();
2335  TProfile *p_ele_EtaMnEtaTrueVsPhi = h_ele_EtaMnEtaTrueVsPhi->ProfileX();
2336  p_ele_EtaMnEtaTrueVsPhi->SetTitle("mean ele eta - gen eta vs phi");
2337  p_ele_EtaMnEtaTrueVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2338  p_ele_EtaMnEtaTrueVsPhi->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{gen}>");
2339  p_ele_EtaMnEtaTrueVsPhi->Write();
2340  TProfile *p_ele_PhiMnPhiTrueVsEta = h_ele_PhiMnPhiTrueVsEta->ProfileX();
2341  p_ele_PhiMnPhiTrueVsEta->SetTitle("mean ele phi - gen phi vs eta");
2342  p_ele_PhiMnPhiTrueVsEta->GetXaxis()->SetTitle("#eta");
2343  p_ele_PhiMnPhiTrueVsEta->GetYaxis()->SetTitle("<#phi_{rec} - #phi_{gen}> (rad)");
2344  p_ele_PhiMnPhiTrueVsEta->Write();
2345  TProfile *p_ele_PhiMnPhiTrueVsPhi = h_ele_PhiMnPhiTrueVsPhi->ProfileX();
2346  p_ele_PhiMnPhiTrueVsPhi->SetTitle("mean ele phi - gen phi vs phi");
2347  p_ele_PhiMnPhiTrueVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2348  p_ele_PhiMnPhiTrueVsPhi->Write();
2349  TProfile *p_ele_vertexPtVsEta = h_ele_vertexPtVsEta->ProfileX();
2350  p_ele_vertexPtVsEta->SetTitle("mean ele transverse momentum vs eta");
2351  p_ele_vertexPtVsEta->GetXaxis()->SetTitle("#eta");
2352  p_ele_vertexPtVsEta->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
2353  p_ele_vertexPtVsEta->Write();
2354  TProfile *p_ele_vertexPtVsPhi = h_ele_vertexPtVsPhi->ProfileX();
2355  p_ele_vertexPtVsPhi->SetTitle("mean ele transverse momentum vs phi");
2356  p_ele_vertexPtVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2357  p_ele_vertexPtVsPhi->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
2358  p_ele_vertexPtVsPhi->Write();
2359  TProfile *p_ele_EoPVsEta = h_ele_EoPVsEta->ProfileX();
2360  p_ele_EoPVsEta->SetTitle("mean ele E/p vs eta");
2361  p_ele_EoPVsEta->GetXaxis()->SetTitle("#eta");
2362  p_ele_EoPVsEta->GetYaxis()->SetTitle("<E/P_{vertex}>");
2363  p_ele_EoPVsEta->Write();
2364  TProfile *p_ele_EoPVsPhi = h_ele_EoPVsPhi->ProfileX();
2365  p_ele_EoPVsPhi->SetTitle("mean ele E/p vs phi");
2366  p_ele_EoPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2367  p_ele_EoPVsPhi->GetYaxis()->SetTitle("<E/P_{vertex}>");
2368  p_ele_EoPVsPhi->Write();
2369  TProfile *p_ele_EoPoutVsEta = h_ele_EoPoutVsEta->ProfileX();
2370  p_ele_EoPoutVsEta->SetTitle("mean ele E/pout vs eta");
2371  p_ele_EoPoutVsEta->GetXaxis()->SetTitle("#eta");
2372  p_ele_EoPoutVsEta->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
2373  p_ele_EoPoutVsEta->Write();
2374  TProfile *p_ele_EoPoutVsPhi = h_ele_EoPoutVsPhi->ProfileX();
2375  p_ele_EoPoutVsPhi->SetTitle("mean ele E/pout vs phi");
2376  p_ele_EoPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2377  p_ele_EoPoutVsPhi->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
2378  p_ele_EoPoutVsPhi->Write();
2379  TProfile *p_ele_EeleOPoutVsEta = h_ele_EeleOPoutVsEta->ProfileX();
2380  p_ele_EeleOPoutVsEta->SetTitle("mean ele Eele/pout vs eta");
2381  p_ele_EeleOPoutVsEta->GetXaxis()->SetTitle("#eta");
2382  p_ele_EeleOPoutVsEta->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
2383  p_ele_EeleOPoutVsEta->Write();
2384  TProfile *p_ele_EeleOPoutVsPhi = h_ele_EeleOPoutVsPhi->ProfileX();
2385  p_ele_EeleOPoutVsPhi->SetTitle("mean ele Eele/pout vs phi");
2386  p_ele_EeleOPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2387  p_ele_EeleOPoutVsPhi->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
2388  p_ele_EeleOPoutVsPhi->Write();
2389  TProfile *p_ele_HoEVsEta = h_ele_HoEVsEta->ProfileX();
2390  p_ele_HoEVsEta->SetTitle("mean ele H/E vs eta");
2391  p_ele_HoEVsEta->GetXaxis()->SetTitle("#eta");
2392  p_ele_HoEVsEta->GetYaxis()->SetTitle("<H/E>");
2393  p_ele_HoEVsEta->Write();
2394  TProfile *p_ele_HoEVsPhi = h_ele_HoEVsPhi->ProfileX();
2395  p_ele_HoEVsPhi->SetTitle("mean ele H/E vs phi");
2396  p_ele_HoEVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2397  p_ele_HoEVsPhi->GetYaxis()->SetTitle("<H/E>");
2398  p_ele_HoEVsPhi->Write();
2399  TProfile *p_ele_chi2VsEta = h_ele_chi2VsEta->ProfileX();
2400  p_ele_chi2VsEta->SetTitle("mean ele track chi2 vs eta");
2401  p_ele_chi2VsEta->GetXaxis()->SetTitle("#eta");
2402  p_ele_chi2VsEta->GetYaxis()->SetTitle("<#Chi^{2}>");
2403  p_ele_chi2VsEta->Write();
2404  TProfile *p_ele_chi2VsPhi = h_ele_chi2VsPhi->ProfileX();
2405  p_ele_chi2VsPhi->SetTitle("mean ele track chi2 vs phi");
2406  p_ele_chi2VsPhi->GetXaxis()->SetTitle("#phi (rad)");
2407  p_ele_chi2VsPhi->GetYaxis()->SetTitle("<#Chi^{2}>");
2408  p_ele_chi2VsPhi->Write();
2409  TProfile *p_ele_foundHitsVsEta = h_ele_foundHitsVsEta->ProfileX();
2410  p_ele_foundHitsVsEta->SetTitle("mean ele track # found hits vs eta");
2411  p_ele_foundHitsVsEta->GetXaxis()->SetTitle("#eta");
2412  p_ele_foundHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
2413  p_ele_foundHitsVsEta->Write();
2414  TProfile *p_ele_foundHitsVsPhi = h_ele_foundHitsVsPhi->ProfileX();
2415  p_ele_foundHitsVsPhi->SetTitle("mean ele track # found hits vs phi");
2416  p_ele_foundHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2417  p_ele_foundHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
2418  p_ele_foundHitsVsPhi->Write();
2419  TProfile *p_ele_lostHitsVsEta = h_ele_lostHitsVsEta->ProfileX();
2420  p_ele_lostHitsVsEta->SetTitle("mean ele track # lost hits vs eta");
2421  p_ele_lostHitsVsEta->GetXaxis()->SetTitle("#eta");
2422  p_ele_lostHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
2423  p_ele_lostHitsVsEta->Write();
2424  TProfile *p_ele_lostHitsVsPhi = h_ele_lostHitsVsPhi->ProfileX();
2425  p_ele_lostHitsVsPhi->SetTitle("mean ele track # lost hits vs phi");
2426  p_ele_lostHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
2427  p_ele_lostHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
2428  p_ele_lostHitsVsPhi->Write();
2429  TProfile *p_ele_vertexTIPVsEta = h_ele_vertexTIPVsEta->ProfileX();
2430  p_ele_vertexTIPVsEta->SetTitle("mean tip (wrt gen vtx) vs eta");
2431  p_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
2432  p_ele_vertexTIPVsEta->GetYaxis()->SetTitle("<TIP> (cm)");
2433  p_ele_vertexTIPVsEta->Write();
2434  TProfile *p_ele_vertexTIPVsPhi = h_ele_vertexTIPVsPhi->ProfileX();
2435  p_ele_vertexTIPVsPhi->SetTitle("mean tip (wrt gen vtx) vs phi");
2436  p_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi");
2437  p_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("<TIP> (cm)");
2438  p_ele_vertexTIPVsPhi->Write();
2439  TProfile *p_ele_vertexTIPVsPt = h_ele_vertexTIPVsPt->ProfileX();
2440  p_ele_vertexTIPVsPt->SetTitle("mean tip (wrt gen vtx) vs phi");
2441  p_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2442  p_ele_vertexTIPVsPt->GetYaxis()->SetTitle("<TIP> (cm)");
2443  p_ele_vertexTIPVsPt->Write();
2444 
2445  // mc truth
2446  h_mcNum->Write();
2447  h_eleNum->Write();
2448  h_gamNum->Write();
2449 
2450  // rec event
2451  histNum_->Write();
2452 
2453  // mc
2454  h_simEta->Write();
2455  h_simAbsEta->Write();
2456  h_simP->Write();
2457  h_simPt->Write();
2458  h_simZ->Write();
2459  h_simPhi->Write();
2460  h_simPtEta->Write();
2461 
2462  // all electrons
2463  h_ele_EoverP_all->Write();
2464  h_ele_EseedOP_all->Write();
2465  h_ele_EoPout_all->Write();
2466  h_ele_EeleOPout_all->Write();
2467  h_ele_dEtaSc_propVtx_all->Write();
2468  h_ele_dPhiSc_propVtx_all->Write();
2469  h_ele_dEtaCl_propOut_all->Write();
2470  h_ele_dPhiCl_propOut_all->Write();
2471  h_ele_HoE_all->Write();
2472  h_ele_TIP_all->Write();
2473  h_ele_vertexPt_all->Write();
2474  h_ele_Et_all->Write();
2475  h_ele_vertexEta_all->Write();
2476  h_ele_mee_all->Write();
2477  h_ele_mee_os->Write();
2478  h_ele_mee_os_ebeb->Write();
2479  h_ele_mee_os_ebee->Write();
2480  h_ele_mee_os_eeee->Write();
2481  h_ele_mee_os_gg->Write();
2482  h_ele_mee_os_gb->Write();
2483  h_ele_mee_os_bb->Write();
2484  h_ele_E2mnE1vsMee_all->Write();
2485  h_ele_E2mnE1vsMee_egeg_all->Write();
2486 
2487  // charge ID
2488  h_ele_charge->Write();
2489  h_ele_simEta_matched_qmisid->Write();
2490  h_ele_simAbsEta_matched_qmisid->Write();
2491  h_ele_simPt_matched_qmisid->Write();
2492  h_ele_simPhi_matched_qmisid->Write();
2493  h_ele_simZ_matched_qmisid->Write();
2494 
2495  // matched electrons
2496  h_ele_vertexP->Write();
2497  h_ele_vertexPt->Write();
2498  h_ele_Et->Write();
2499  h_ele_vertexPtVsEta->Write();
2500  h_ele_vertexPtVsPhi->Write();
2501  h_ele_simPt_matched->Write();
2502  h_ele_vertexEta->Write();
2503  h_ele_vertexEtaVsPhi->Write();
2504  h_ele_simAbsEta_matched->Write();
2505  h_ele_simEta_matched->Write();
2506  h_ele_simPhi_matched->Write();
2507  h_ele_simPtEta_matched->Write();
2508  h_ele_vertexPhi->Write();
2509  h_ele_vertexX->Write();
2510  h_ele_vertexY->Write();
2511  h_ele_vertexZ->Write();
2512  h_ele_vertexTIP->Write();
2513  h_ele_simZ_matched->Write();
2514  h_ele_vertexTIPVsEta->Write();
2515  h_ele_vertexTIPVsPhi->Write();
2516  h_ele_vertexTIPVsPt->Write();
2517  h_ele_PoPtrue->Write();
2518  h_ele_PoPtrueVsEta->Write();
2519  h_ele_PoPtrueVsPhi->Write();
2520  h_ele_PoPtrueVsPt->Write();
2521  h_ele_PoPtrue_barrel->Write();
2522  h_ele_PoPtrue_endcaps->Write();
2523  h_ele_PoPtrue_golden_barrel->Write();
2524  h_ele_PoPtrue_golden_endcaps->Write();
2525  h_ele_PoPtrue_showering_barrel->Write();
2526  h_ele_PoPtrue_showering_endcaps->Write();
2527  h_ele_PtoPttrue->Write();
2528  h_ele_PtoPttrue_barrel->Write();
2529  h_ele_PtoPttrue_endcaps->Write();
2530  h_ele_ChargeMnChargeTrue->Write();
2531  h_ele_EtaMnEtaTrue->Write();
2532  h_ele_EtaMnEtaTrue_barrel->Write();
2533  h_ele_EtaMnEtaTrue_endcaps->Write();
2534  h_ele_EtaMnEtaTrueVsEta->Write();
2535  h_ele_EtaMnEtaTrueVsPhi->Write();
2536  h_ele_EtaMnEtaTrueVsPt->Write();
2537  h_ele_PhiMnPhiTrue->Write();
2538  h_ele_PhiMnPhiTrue_barrel->Write();
2539  h_ele_PhiMnPhiTrue_endcaps->Write();
2540  h_ele_PhiMnPhiTrue2->Write();
2541  h_ele_PhiMnPhiTrueVsEta->Write();
2542  h_ele_PhiMnPhiTrueVsPhi->Write();
2543  h_ele_PhiMnPhiTrueVsPt->Write();
2544 
2545  // matched electron, superclusters
2546  histSclEn_->Write();
2547  histSclEoEtrue_barrel->Write();
2548  histSclEoEtrue_endcaps->Write();
2549  histSclEoEtrue_barrel_eg->Write();
2550  histSclEoEtrue_endcaps_eg->Write();
2551  histSclEoEtrue_barrel_etagap->Write();
2552  histSclEoEtrue_barrel_phigap->Write();
2553  histSclEoEtrue_ebeegap->Write();
2554  histSclEoEtrue_endcaps->Write();
2555  histSclEoEtrue_endcaps_deegap->Write();
2556  histSclEoEtrue_endcaps_ringgap->Write();
2557  histSclEoEtruePfVsEg->Write();
2558  histSclEoEtrue_barrel_new->Write();
2559  histSclEoEtrue_endcaps_new->Write();
2560  histSclEoEtrue_barrel_eg_new->Write();
2561  histSclEoEtrue_endcaps_eg_new->Write();
2562  histSclEoEtrue_barrel_etagap_new->Write();
2563  histSclEoEtrue_barrel_phigap_new->Write();
2564  histSclEoEtrue_ebeegap_new->Write();
2565  histSclEoEtrue_endcaps_new->Write();
2566  histSclEoEtrue_endcaps_deegap_new->Write();
2567  histSclEoEtrue_endcaps_ringgap_new->Write();
2568  histSclEoEtruePfVsEg->Write();
2569  histSclEt_->Write();
2570  histSclEtVsEta_->Write();
2571  histSclEtVsPhi_->Write();
2572  histSclEtaVsPhi_->Write();
2573  histSclEta_->Write();
2574  histSclPhi_->Write();
2575  histSclSigEtaEta_->Write();
2576  histSclSigEtaEta_barrel_->Write();
2577  histSclSigEtaEta_endcaps_->Write();
2578  histSclSigIEtaIEta_->Write();
2579  histSclSigIEtaIEta_barrel_->Write();
2580  histSclSigIEtaIEta_endcaps_->Write();
2581  histSclE1x5_->Write();
2582  histSclE1x5_barrel_->Write();
2583  histSclE1x5_endcaps_->Write();
2584  histSclE2x5max_->Write();
2585  histSclE2x5max_barrel_->Write();
2586  histSclE2x5max_endcaps_->Write();
2587  histSclE5x5_->Write();
2588  histSclE5x5_barrel_->Write();
2589  histSclE5x5_endcaps_->Write();
2590  histSclSigEtaEta_eg_->Write();
2591  histSclSigEtaEta_eg_barrel_->Write();
2592  histSclSigEtaEta_eg_endcaps_->Write();
2593  histSclSigIEtaIEta_eg_->Write();
2594  histSclSigIEtaIEta_eg_barrel_->Write();
2595  histSclSigIEtaIEta_eg_endcaps_->Write();
2596  histSclE1x5_eg_->Write();
2597  histSclE1x5_eg_barrel_->Write();
2598  histSclE1x5_eg_endcaps_->Write();
2599  histSclE2x5max_eg_->Write();
2600  histSclE2x5max_eg_barrel_->Write();
2601  histSclE2x5max_eg_endcaps_->Write();
2602  histSclE5x5_eg_->Write();
2603  histSclE5x5_eg_barrel_->Write();
2604  histSclE5x5_eg_endcaps_->Write();
2605 
2606  // matched electron, gsf tracks
2607  h_ele_ambiguousTracks->Write();
2608  h_ele_ambiguousTracksVsEta->Write();
2609  h_ele_ambiguousTracksVsPhi->Write();
2610  h_ele_ambiguousTracksVsPt->Write();
2611  h_ele_foundHits->Write();
2612  h_ele_foundHits_barrel->Write();
2613  h_ele_foundHits_endcaps->Write();
2614  h_ele_foundHitsVsEta->Write();
2615  h_ele_foundHitsVsPhi->Write();
2616  h_ele_foundHitsVsPt->Write();
2617  h_ele_lostHits->Write();
2618  h_ele_lostHits_barrel->Write();
2619  h_ele_lostHits_endcaps->Write();
2620  h_ele_lostHitsVsEta->Write();
2621  h_ele_lostHitsVsPhi->Write();
2622  h_ele_lostHitsVsPt->Write();
2623  h_ele_chi2->Write();
2624  h_ele_chi2_barrel->Write();
2625  h_ele_chi2_endcaps->Write();
2626  h_ele_chi2VsEta->Write();
2627  h_ele_chi2VsPhi->Write();
2628  h_ele_chi2VsPt->Write();
2629  h_ele_PinMnPout->Write();
2630  h_ele_PinMnPout_mode->Write();
2631  h_ele_PinMnPoutVsEta_mode->Write();
2632  h_ele_PinMnPoutVsPhi_mode->Write();
2633  h_ele_PinMnPoutVsPt_mode->Write();
2634  h_ele_PinMnPoutVsE_mode->Write();
2635  h_ele_PinMnPoutVsChi2_mode->Write();
2636  h_ele_outerP->Write();
2637  h_ele_outerP_mode->Write();
2638  h_ele_outerPVsEta_mode->Write();
2639  h_ele_outerPt->Write();
2640  h_ele_outerPt_mode->Write();
2641  h_ele_outerPtVsEta_mode->Write();
2642  h_ele_outerPtVsPhi_mode->Write();
2643  h_ele_outerPtVsPt_mode->Write();
2644 
2645  // matched electrons, matching
2646  h_ele_EoP->Write();
2647  h_ele_EoP_eg->Write();
2648  h_ele_EoP_barrel->Write();
2649  h_ele_EoP_eg_barrel->Write();
2650  h_ele_EoP_endcaps->Write();
2651  h_ele_EoP_eg_endcaps->Write();
2652  h_ele_EoPVsEta->Write();
2653  h_ele_EoPVsPhi->Write();
2654  h_ele_EoPVsE->Write();
2655  h_ele_EseedOP->Write();
2656  h_ele_EseedOP_eg->Write();
2657  h_ele_EseedOP_barrel->Write();
2658  h_ele_EseedOP_eg_barrel->Write();
2659  h_ele_EseedOP_endcaps->Write();
2660  h_ele_EseedOP_eg_endcaps->Write();
2661  h_ele_EseedOPVsEta->Write();
2662  h_ele_EseedOPVsPhi->Write();
2663  h_ele_EseedOPVsE->Write();
2664  h_ele_EoPout->Write();
2665  h_ele_EoPout_eg->Write();
2666  h_ele_EoPout_barrel->Write();
2667  h_ele_EoPout_eg_barrel->Write();
2668  h_ele_EoPout_endcaps->Write();
2669  h_ele_EoPout_eg_endcaps->Write();
2670  h_ele_EoPoutVsEta->Write();
2671  h_ele_EoPoutVsPhi->Write();
2672  h_ele_EoPoutVsE->Write();
2673  h_ele_EeleOPout->Write();
2674  h_ele_EeleOPout_eg->Write();
2675  h_ele_EeleOPout_barrel->Write();
2676  h_ele_EeleOPout_eg_barrel->Write();
2677  h_ele_EeleOPout_endcaps->Write();
2678  h_ele_EeleOPout_eg_endcaps->Write();
2679  h_ele_EeleOPoutVsEta->Write();
2680  h_ele_EeleOPoutVsPhi->Write();
2681  h_ele_EeleOPoutVsE->Write();
2682  h_ele_dEtaSc_propVtx->Write();
2683  h_ele_dEtaSc_propVtx_eg->Write();
2684  h_ele_dEtaSc_propVtx_barrel->Write();
2685  h_ele_dEtaSc_propVtx_eg_barrel->Write();
2686  h_ele_dEtaSc_propVtx_endcaps->Write();
2687  h_ele_dEtaSc_propVtx_eg_endcaps->Write();
2688  h_ele_dEtaScVsEta_propVtx->Write();
2689  h_ele_dEtaScVsPhi_propVtx->Write();
2690  h_ele_dEtaScVsPt_propVtx->Write();
2691  h_ele_dPhiSc_propVtx->Write();
2692  h_ele_dPhiSc_propVtx_eg->Write();
2693  h_ele_dPhiSc_propVtx_barrel->Write();
2694  h_ele_dPhiSc_propVtx_eg_barrel->Write();
2695  h_ele_dPhiSc_propVtx_endcaps->Write();
2696  h_ele_dPhiSc_propVtx_eg_endcaps->Write();
2697  h_ele_dPhiScVsEta_propVtx->Write();
2698  h_ele_dPhiScVsPhi_propVtx->Write();
2699  h_ele_dPhiScVsPt_propVtx->Write();
2700  h_ele_dEtaCl_propOut->Write();
2701  h_ele_dEtaCl_propOut_eg->Write();
2702  h_ele_dEtaCl_propOut_barrel->Write();
2703  h_ele_dEtaCl_propOut_eg_barrel->Write();
2704  h_ele_dEtaCl_propOut_endcaps->Write();
2705  h_ele_dEtaCl_propOut_eg_endcaps->Write();
2706  h_ele_dEtaClVsEta_propOut->Write();
2707  h_ele_dEtaClVsPhi_propOut->Write();
2708  h_ele_dEtaClVsPt_propOut->Write();
2709  h_ele_dPhiCl_propOut->Write();
2710  h_ele_dPhiCl_propOut_eg->Write();
2711  h_ele_dPhiCl_propOut_barrel->Write();
2712  h_ele_dPhiCl_propOut_eg_barrel->Write();
2713  h_ele_dPhiCl_propOut_endcaps->Write();
2714  h_ele_dPhiCl_propOut_eg_endcaps->Write();
2715  h_ele_dPhiClVsEta_propOut->Write();
2716  h_ele_dPhiClVsPhi_propOut->Write();
2717  h_ele_dPhiClVsPt_propOut->Write();
2718  h_ele_dEtaEleCl_propOut->Write();
2719  h_ele_dEtaEleCl_propOut_eg->Write();
2720  h_ele_dEtaEleCl_propOut_barrel->Write();
2721  h_ele_dEtaEleCl_propOut_eg_barrel->Write();
2722  h_ele_dEtaEleCl_propOut_endcaps->Write();
2723  h_ele_dEtaEleCl_propOut_eg_endcaps->Write();
2724  h_ele_dEtaEleClVsEta_propOut->Write();
2725  h_ele_dEtaEleClVsPhi_propOut->Write();
2726  h_ele_dEtaEleClVsPt_propOut->Write();
2727  h_ele_dPhiEleCl_propOut->Write();
2728  h_ele_dPhiEleCl_propOut_eg->Write();
2729  h_ele_dPhiEleCl_propOut_barrel->Write();
2730  h_ele_dPhiEleCl_propOut_eg_barrel->Write();
2731  h_ele_dPhiEleCl_propOut_endcaps->Write();
2732  h_ele_dPhiEleCl_propOut_eg_endcaps->Write();
2733  h_ele_dPhiEleClVsEta_propOut->Write();
2734  h_ele_dPhiEleClVsPhi_propOut->Write();
2735  h_ele_dPhiEleClVsPt_propOut->Write();
2736  h_ele_HoE->Write();
2737  h_ele_HoE_eg->Write();
2738  h_ele_HoE_barrel->Write();
2739  h_ele_HoE_eg_barrel->Write();
2740  h_ele_HoE_endcaps->Write();
2741  h_ele_HoE_eg_endcaps->Write();
2742  h_ele_HoE_fiducial->Write();
2743  h_ele_HoEVsEta->Write();
2744  h_ele_HoEVsPhi->Write();
2745  h_ele_HoEVsE->Write();
2746 
2747  h_ele_seed_dphi2_->Write();
2748  h_ele_seed_subdet2_->Write();
2749  TProfile *p_ele_seed_dphi2VsEta_ = h_ele_seed_dphi2VsEta_->ProfileX();
2750  p_ele_seed_dphi2VsEta_->SetTitle("mean ele seed dphi 2nd layer vs eta");
2751  p_ele_seed_dphi2VsEta_->GetXaxis()->SetTitle("#eta");
2752  p_ele_seed_dphi2VsEta_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2753  p_ele_seed_dphi2VsEta_->SetMinimum(-0.004);
2754  p_ele_seed_dphi2VsEta_->SetMaximum(0.004);
2755  p_ele_seed_dphi2VsEta_->Write();
2756  TProfile *p_ele_seed_dphi2VsPt_ = h_ele_seed_dphi2VsPt_->ProfileX();
2757  p_ele_seed_dphi2VsPt_->SetTitle("mean ele seed dphi 2nd layer vs pt");
2758  p_ele_seed_dphi2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2759  p_ele_seed_dphi2VsPt_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2760  p_ele_seed_dphi2VsPt_->SetMinimum(-0.004);
2761  p_ele_seed_dphi2VsPt_->SetMaximum(0.004);
2762  p_ele_seed_dphi2VsPt_->Write();
2763  h_ele_seed_drz2_->Write();
2764  TProfile *p_ele_seed_drz2VsEta_ = h_ele_seed_drz2VsEta_->ProfileX();
2765  p_ele_seed_drz2VsEta_->SetTitle("mean ele seed dr(dz) 2nd layer vs eta");
2766  p_ele_seed_drz2VsEta_->GetXaxis()->SetTitle("#eta");
2767  p_ele_seed_drz2VsEta_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2768  p_ele_seed_drz2VsEta_->SetMinimum(-0.15);
2769  p_ele_seed_drz2VsEta_->SetMaximum(0.15);
2770  p_ele_seed_drz2VsEta_->Write();
2771  TProfile *p_ele_seed_drz2VsPt_ = h_ele_seed_drz2VsPt_->ProfileX();
2772  p_ele_seed_drz2VsPt_->SetTitle("mean ele seed dr(dz) 2nd layer vs pt");
2773  p_ele_seed_drz2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2774  p_ele_seed_drz2VsPt_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2775  p_ele_seed_drz2VsPt_->SetMinimum(-0.15);
2776  p_ele_seed_drz2VsPt_->SetMaximum(0.15);
2777  p_ele_seed_drz2VsPt_->Write();
2778 
2779  // classes
2780  h_ele_classes->Write();
2781  h_ele_eta->Write();
2782  h_ele_eta_golden->Write();
2783  h_ele_eta_bbrem->Write();
2784  h_ele_eta_narrow->Write();
2785  h_ele_eta_shower->Write();
2786  h_ele_PinVsPoutGolden_mode->Write();
2787  h_ele_PinVsPoutShowering_mode->Write();
2788  h_ele_PinVsPoutGolden_mean->Write();
2789  h_ele_PinVsPoutShowering_mean->Write();
2790  h_ele_PtinVsPtoutGolden_mode->Write();
2791  h_ele_PtinVsPtoutShowering_mode->Write();
2792  h_ele_PtinVsPtoutGolden_mean->Write();
2793  h_ele_PtinVsPtoutShowering_mean->Write();
2794  histSclEoEtrueGolden_barrel->Write();
2795  histSclEoEtrueGolden_endcaps->Write();
2796  histSclEoEtrueShowering_barrel->Write();
2797  histSclEoEtrueShowering_endcaps->Write();
2798 
2799  // fbrem
2800  h_ele_fbrem->Write();
2801  h_ele_fbrem_eg->Write();
2802  h_ele_fbremVsEta_mode->GetXaxis()->SetTitle("#eta");
2803  h_ele_fbremVsEta_mode->GetYaxis()->SetTitle("<P_{in} - P_{out} / P_{in}>");
2804  h_ele_fbremVsEta_mode->Write();
2805  h_ele_fbremVsEta_mean->GetXaxis()->SetTitle("#eta");
2806  h_ele_fbremVsEta_mean->GetYaxis()->SetTitle("<P_{in} - P_{out} / P_{in}>");
2807  h_ele_fbremVsEta_mean->Write();
2808  h_ele_eta_goldenFrac->Write();
2809  h_ele_eta_bbremFrac->Write();
2810  h_ele_eta_narrowFrac->Write();
2811  h_ele_eta_showerFrac->Write();
2812  h_ele_xOverX0VsEta->Write();
2813 
2814  // efficiencies
2815  h_ele_etaEff->Write();
2816  h_ele_zEff->Write();
2817  h_ele_phiEff->Write();
2818  h_ele_absetaEff->Write();
2819  h_ele_ptEff->Write();
2820  h_ele_ptEtaEff->Write();
2821  h_ele_etaEff_all->Write();
2822  h_ele_ptEff_all->Write();
2823 
2824  // q misid
2825  h_ele_etaQmisid->Write();
2826  h_ele_zQmisid->Write();
2827  h_ele_absetaQmisid->Write();
2828  h_ele_ptQmisid->Write();
2829 
2830  // e/g et pflow electrons
2831  h_ele_mva->Write();
2832  h_ele_mva_eg->Write();
2833  h_ele_provenance->Write();
2834 
2835  // isolation
2836  h_ele_tkSumPt_dr03->GetXaxis()->SetTitle("TkIsoSum, cone 0.3 (GeV/c)");
2837  h_ele_tkSumPt_dr03->GetYaxis()->SetTitle("Events");
2838  h_ele_tkSumPt_dr03->Write();
2839  h_ele_ecalRecHitSumEt_dr03->GetXaxis()->SetTitle("EcalIsoSum, cone 0.3 (GeV)");
2840  h_ele_ecalRecHitSumEt_dr03->GetYaxis()->SetTitle("Events");
2841  h_ele_ecalRecHitSumEt_dr03->Write();
2842  h_ele_hcalDepth1TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.3 (GeV)");
2843  h_ele_hcalDepth1TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
2844  h_ele_hcalDepth1TowerSumEt_dr03->Write();
2845  h_ele_hcalDepth2TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.3 (GeV)");
2846  h_ele_hcalDepth2TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
2847  h_ele_hcalDepth2TowerSumEt_dr03->Write();
2848  h_ele_tkSumPt_dr04->GetXaxis()->SetTitle("TkIsoSum, cone 0.4 (GeV/c)");
2849  h_ele_tkSumPt_dr04->GetYaxis()->SetTitle("Events");
2850  h_ele_tkSumPt_dr04->Write();
2851  h_ele_ecalRecHitSumEt_dr04->GetXaxis()->SetTitle("EcalIsoSum, cone 0.4 (GeV)");
2852  h_ele_ecalRecHitSumEt_dr04->GetYaxis()->SetTitle("Events");
2853  h_ele_ecalRecHitSumEt_dr04->Write();
2854  h_ele_hcalDepth1TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.4 (GeV)");
2855  h_ele_hcalDepth1TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
2856  h_ele_hcalDepth1TowerSumEt_dr04->Write();
2857  h_ele_hcalDepth2TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.4 (GeV)");
2858  h_ele_hcalDepth2TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
2859  h_ele_hcalDepth2TowerSumEt_dr04->Write();
2860 }
2861 
2863  // do anything here that needs to be done at desctruction time
2864  // (e.g. close files, deallocate resources etc.)
2865  histfile_->Write();
2866  histfile_->Close();
2867 }
2868 
2869 //=========================================================================
2870 // Main method
2871 //=========================================================================
2872 
2874  std::cout << "analyzing new event " << std::endl;
2875  // get electrons
2876 
2878  iEvent.getByLabel(electronCollection_, gsfElectrons);
2879  edm::LogInfo("") << "\n\n =================> Treating event " << iEvent.id() << " Number of electrons "
2880  << gsfElectrons.product()->size();
2881 
2883  iEvent.getByLabel(mcTruthCollection_, genParticles);
2884 
2885  histNum_->Fill((*gsfElectrons).size());
2886 
2887  // all rec electrons
2888  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin(); gsfIter != gsfElectrons->end();
2889  gsfIter++) {
2890  // preselect electrons
2891  if (gsfIter->pt() > maxPt_ || std::abs(gsfIter->eta()) > maxAbsEta_)
2892  continue;
2893  h_ele_EoverP_all->Fill(gsfIter->eSuperClusterOverP());
2894  h_ele_EseedOP_all->Fill(gsfIter->eSeedClusterOverP());
2895  h_ele_EoPout_all->Fill(gsfIter->eSeedClusterOverPout());
2896  h_ele_EeleOPout_all->Fill(gsfIter->eEleClusterOverPout());
2897  h_ele_dEtaSc_propVtx_all->Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx());
2898  h_ele_dPhiSc_propVtx_all->Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx());
2899  h_ele_dEtaCl_propOut_all->Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo());
2900  h_ele_dPhiCl_propOut_all->Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo());
2901  h_ele_HoE_all->Fill(gsfIter->hadronicOverEm());
2902  double d = gsfIter->vertex().x() * gsfIter->vertex().x() + gsfIter->vertex().y() * gsfIter->vertex().y();
2903  h_ele_TIP_all->Fill(sqrt(d));
2904  h_ele_vertexEta_all->Fill(gsfIter->eta());
2905  h_ele_vertexPt_all->Fill(gsfIter->pt());
2906  h_ele_Et_all->Fill(gsfIter->superCluster()->energy() / cosh(gsfIter->superCluster()->eta()));
2907  float enrj1 = gsfIter->superCluster()->energy();
2908  // mee
2909  for (reco::GsfElectronCollection::const_iterator gsfIter2 = gsfIter + 1; gsfIter2 != gsfElectrons->end();
2910  gsfIter2++) {
2911  math::XYZTLorentzVector p12 = (*gsfIter).p4() + (*gsfIter2).p4();
2912  float mee2 = p12.Dot(p12);
2913  float enrj2 = gsfIter2->superCluster()->energy();
2914  h_ele_mee_all->Fill(sqrt(mee2));
2915  h_ele_E2mnE1vsMee_all->Fill(sqrt(mee2), enrj2 - enrj1);
2916  if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
2917  h_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2), enrj2 - enrj1);
2918  if (gsfIter->charge() * gsfIter2->charge() < 0.) {
2919  h_ele_mee_os->Fill(sqrt(mee2));
2920  if (gsfIter->isEB() && gsfIter2->isEB())
2921  h_ele_mee_os_ebeb->Fill(sqrt(mee2));
2922  if ((gsfIter->isEB() && gsfIter2->isEE()) || (gsfIter->isEE() && gsfIter2->isEB()))
2923  h_ele_mee_os_ebee->Fill(sqrt(mee2));
2924  if (gsfIter->isEE() && gsfIter2->isEE())
2925  h_ele_mee_os_eeee->Fill(sqrt(mee2));
2926  if ((gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::GOLDEN) ||
2927  (gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::BIGBREM) ||
2928  //(gsfIter->classification()==GsfElectron::GOLDEN && gsfIter2->classification()==GsfElectron::OLDNARROW) ||
2929  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::GOLDEN) ||
2930  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::BIGBREM)/* ||
2931  (gsfIter->classification()==GsfElectron::BIGBREM && gsfIter2->classification()==GsfElectron::OLDNARROW) ||
2932  (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::GOLDEN) ||
2933  (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::BIGBREM) ||
2934  (gsfIter->classification()==GsfElectron::OLDNARROW && gsfIter2->classification()==GsfElectron::OLDNARROW)*/ )
2935  {
2936  h_ele_mee_os_gg->Fill(sqrt(mee2));
2937  } else if ((gsfIter->classification() == GsfElectron::SHOWERING &&
2938  gsfIter2->classification() == GsfElectron::SHOWERING) ||
2939  (gsfIter->classification() == GsfElectron::SHOWERING && gsfIter2->isGap()) ||
2940  (gsfIter->isGap() && gsfIter2->classification() == GsfElectron::SHOWERING) ||
2941  (gsfIter->isGap() && gsfIter2->isGap())) {
2942  h_ele_mee_os_bb->Fill(sqrt(mee2));
2943  } else {
2944  h_ele_mee_os_gb->Fill(sqrt(mee2));
2945  }
2946  }
2947  }
2948  }
2949 
2950  int mcNum = 0, gamNum = 0, eleNum = 0;
2951  bool matchingID, matchingMotherID;
2952 
2953  // charge mis-ID
2954  for (reco::GenParticleCollection::const_iterator mcIter = genParticles->begin(); mcIter != genParticles->end();
2955  mcIter++) {
2956  // select requested matching gen particle
2957  matchingID = false;
2958  for (unsigned int i = 0; i < matchingIDs_.size(); i++)
2959  if (mcIter->pdgId() == matchingIDs_[i])
2960  matchingID = true;
2961 
2962  if (matchingID) {
2963  // select requested mother matching gen particle
2964  // always include single particle with no mother
2965  const Candidate *mother = mcIter->mother();
2966  matchingMotherID = false;
2967  for (unsigned int i = 0; i < matchingMotherIDs_.size(); i++)
2968  if ((mother == nullptr) || ((mother != nullptr) && mother->pdgId() == matchingMotherIDs_[i]))
2969  matchingMotherID = true;
2970 
2971  if (matchingMotherID) {
2972  if (mcIter->pt() > maxPt_ || std::abs(mcIter->eta()) > maxAbsEta_)
2973  continue;
2974 
2975  // suppress the endcaps
2976  //if (std::abs(mcIter->eta()) > 1.5) continue;
2977  // select central z
2978  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
2979 
2980  // looking for the best matching gsf electron
2981  bool okGsfFound = false;
2982  double gsfOkRatio = 999999.;
2983 
2984  // find best matched electron
2985  reco::GsfElectron bestGsfElectron;
2986  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin();
2987  gsfIter != gsfElectrons->end();
2988  gsfIter++) {
2989  double dphi = gsfIter->phi() - mcIter->phi();
2990  if (std::abs(dphi) > CLHEP::pi)
2991  dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
2992  double deltaR = sqrt(std::pow((gsfIter->eta() - mcIter->eta()), 2) + std::pow(dphi, 2));
2993  if (deltaR < deltaR_) {
2994  double mc_charge = mcIter->pdgId() == 11 ? -1. : 1.;
2995  h_ele_ChargeMnChargeTrue->Fill(std::abs(gsfIter->charge() - mc_charge));
2996  // require here a charge mismatch
2997  if (((mcIter->pdgId() == 11) && (gsfIter->charge() > 0.)) ||
2998  ((mcIter->pdgId() == -11) && (gsfIter->charge() < 0.))) {
2999  double tmpGsfRatio = gsfIter->p() / mcIter->p();
3000  if (std::abs(tmpGsfRatio - 1) < std::abs(gsfOkRatio - 1)) {
3001  gsfOkRatio = tmpGsfRatio;
3002  bestGsfElectron = *gsfIter;
3003  okGsfFound = true;
3004  }
3005  }
3006  }
3007  } // loop over rec ele to look for the best one
3008 
3009  // analysis when the mc track is found
3010  if (okGsfFound) {
3011  // generated distributions for matched electrons
3012  h_ele_simPt_matched_qmisid->Fill(mcIter->pt());
3013  h_ele_simPhi_matched_qmisid->Fill(mcIter->phi());
3014  h_ele_simAbsEta_matched_qmisid->Fill(std::abs(mcIter->eta()));
3015  h_ele_simEta_matched_qmisid->Fill(mcIter->eta());
3016  h_ele_simZ_matched_qmisid->Fill(mcIter->vz());
3017  }
3018  }
3019  }
3020  }
3021 
3022  // association mc-reco
3023  for (reco::GenParticleCollection::const_iterator mcIter = genParticles->begin(); mcIter != genParticles->end();
3024  mcIter++) {
3025  // number of mc particles
3026  mcNum++;
3027 
3028  // counts photons
3029  if (mcIter->pdgId() == 22) {
3030  gamNum++;
3031  }
3032 
3033  // select requested matching gen particle
3034  matchingID = false;
3035  for (unsigned int i = 0; i < matchingIDs_.size(); i++)
3036  if (mcIter->pdgId() == matchingIDs_[i])
3037  matchingID = true;
3038 
3039  if (matchingID) {
3040  // select requested mother matching gen particle
3041  // always include single particle with no mother
3042  const Candidate *mother = mcIter->mother();
3043  matchingMotherID = false;
3044  for (unsigned int i = 0; i < matchingMotherIDs_.size(); i++)
3045  if ((mother == nullptr) || ((mother != nullptr) && mother->pdgId() == matchingMotherIDs_[i]))
3046  matchingMotherID = true;
3047 
3048  if (matchingMotherID) {
3049  if (mcIter->pt() > maxPt_ || std::abs(mcIter->eta()) > maxAbsEta_)
3050  continue;
3051 
3052  // suppress the endcaps
3053  //if (std::abs(mcIter->eta()) > 1.5) continue;
3054  // select central z
3055  //if ( std::abs(mcIter->production_vertex()->position().z())>50.) continue;
3056 
3057  eleNum++;
3058  h_simEta->Fill(mcIter->eta());
3059  h_simAbsEta->Fill(std::abs(mcIter->eta()));
3060  h_simP->Fill(mcIter->p());
3061  h_simPt->Fill(mcIter->pt());
3062  h_simPhi->Fill(mcIter->phi());
3063  h_simZ->Fill(mcIter->vz());
3064  h_simPtEta->Fill(mcIter->eta(), mcIter->pt());
3065 
3066  // looking for the best matching gsf electron
3067  bool okGsfFound = false;
3068  double gsfOkRatio = 999999.;
3069 
3070  // find best matched electron
3071  reco::GsfElectron bestGsfElectron;
3072  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin();
3073  gsfIter != gsfElectrons->end();
3074  gsfIter++) {
3075  double dphi = gsfIter->phi() - mcIter->phi();
3076  if (std::abs(dphi) > CLHEP::pi)
3077  dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
3078  double deltaR = sqrt(std::pow((gsfIter->eta() - mcIter->eta()), 2) + std::pow(dphi, 2));
3079  if (deltaR < deltaR_) {
3080  if (((mcIter->pdgId() == 11) && (gsfIter->charge() < 0.)) ||
3081  ((mcIter->pdgId() == -11) && (gsfIter->charge() > 0.))) {
3082  double tmpGsfRatio = gsfIter->p() / mcIter->p();
3083  if (std::abs(tmpGsfRatio - 1) < std::abs(gsfOkRatio - 1)) {
3084  gsfOkRatio = tmpGsfRatio;
3085  bestGsfElectron = *gsfIter;
3086  okGsfFound = true;
3087  }
3088  }
3089  }
3090  } // loop over rec ele to look for the best one
3091 
3092  // analysis when the mc track is found
3093  if (okGsfFound) {
3094  // electron related distributions
3095  h_ele_charge->Fill(bestGsfElectron.charge());
3096  h_ele_chargeVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.charge());
3097  h_ele_chargeVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.charge());
3098  h_ele_chargeVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.charge());
3099  h_ele_vertexP->Fill(bestGsfElectron.p());
3100  h_ele_vertexPt->Fill(bestGsfElectron.pt());
3101  h_ele_Et->Fill(bestGsfElectron.superCluster()->energy() / cosh(bestGsfElectron.superCluster()->eta()));
3102  h_ele_vertexPtVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.pt());
3103  h_ele_vertexPtVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.pt());
3104  h_ele_vertexEta->Fill(bestGsfElectron.eta());
3105  // generated distributions for matched electrons
3106  h_ele_simPt_matched->Fill(mcIter->pt());
3107  h_ele_simPhi_matched->Fill(mcIter->phi());
3108  h_ele_simAbsEta_matched->Fill(std::abs(mcIter->eta()));
3109  h_ele_simEta_matched->Fill(mcIter->eta());
3110  h_ele_simPtEta_matched->Fill(mcIter->eta(), mcIter->pt());
3111  h_ele_vertexEtaVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta());
3112  h_ele_vertexPhi->Fill(bestGsfElectron.phi());
3113  h_ele_vertexX->Fill(bestGsfElectron.vertex().x());
3114  h_ele_vertexY->Fill(bestGsfElectron.vertex().y());
3115  h_ele_vertexZ->Fill(bestGsfElectron.vertex().z());
3116  h_ele_simZ_matched->Fill(mcIter->vz());
3117  double d = (bestGsfElectron.vertex().x() - mcIter->vx()) * (bestGsfElectron.vertex().x() - mcIter->vx()) +
3118  (bestGsfElectron.vertex().y() - mcIter->vy()) * (bestGsfElectron.vertex().y() - mcIter->vy());
3119  d = sqrt(d);
3120  h_ele_vertexTIP->Fill(d);
3121  h_ele_vertexTIPVsEta->Fill(bestGsfElectron.eta(), d);
3122  h_ele_vertexTIPVsPhi->Fill(bestGsfElectron.phi(), d);
3123  h_ele_vertexTIPVsPt->Fill(bestGsfElectron.pt(), d);
3124  h_ele_EtaMnEtaTrue->Fill(bestGsfElectron.eta() - mcIter->eta());
3125  if (bestGsfElectron.isEB())
3126  h_ele_EtaMnEtaTrue_barrel->Fill(bestGsfElectron.eta() - mcIter->eta());
3127  if (bestGsfElectron.isEE())
3128  h_ele_EtaMnEtaTrue_endcaps->Fill(bestGsfElectron.eta() - mcIter->eta());
3129  h_ele_EtaMnEtaTrueVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eta() - mcIter->eta());
3130  h_ele_EtaMnEtaTrueVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta() - mcIter->eta());
3131  h_ele_EtaMnEtaTrueVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.eta() - mcIter->eta());
3132  h_ele_PhiMnPhiTrue->Fill(bestGsfElectron.phi() - mcIter->phi());
3133  if (bestGsfElectron.isEB())
3134  h_ele_PhiMnPhiTrue_barrel->Fill(bestGsfElectron.phi() - mcIter->phi());
3135  if (bestGsfElectron.isEE())
3136  h_ele_PhiMnPhiTrue_endcaps->Fill(bestGsfElectron.phi() - mcIter->phi());
3137  h_ele_PhiMnPhiTrue2->Fill(bestGsfElectron.phi() - mcIter->phi());
3138  h_ele_PhiMnPhiTrueVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.phi() - mcIter->phi());
3139  h_ele_PhiMnPhiTrueVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.phi() - mcIter->phi());
3140  h_ele_PhiMnPhiTrueVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.phi() - mcIter->phi());
3141  h_ele_PoPtrue->Fill(bestGsfElectron.p() / mcIter->p());
3142  h_ele_PtoPttrue->Fill(bestGsfElectron.pt() / mcIter->pt());
3143  h_ele_PoPtrueVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.p() / mcIter->p());
3144  h_ele_PoPtrueVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.p() / mcIter->p());
3145  h_ele_PoPtrueVsPt->Fill(bestGsfElectron.py(), bestGsfElectron.p() / mcIter->p());
3146  if (bestGsfElectron.isEB())
3147  h_ele_PoPtrue_barrel->Fill(bestGsfElectron.p() / mcIter->p());
3148  if (bestGsfElectron.isEE())
3149  h_ele_PoPtrue_endcaps->Fill(bestGsfElectron.p() / mcIter->p());
3150  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::GOLDEN)
3151  h_ele_PoPtrue_golden_barrel->Fill(bestGsfElectron.p() / mcIter->p());
3152  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::GOLDEN)
3153  h_ele_PoPtrue_golden_endcaps->Fill(bestGsfElectron.p() / mcIter->p());
3154  if (bestGsfElectron.isEB() && bestGsfElectron.classification() == GsfElectron::SHOWERING)
3155  h_ele_PoPtrue_showering_barrel->Fill(bestGsfElectron.p() / mcIter->p());
3156  if (bestGsfElectron.isEE() && bestGsfElectron.classification() == GsfElectron::SHOWERING)
3157  h_ele_PoPtrue_showering_endcaps->Fill(bestGsfElectron.p() / mcIter->p());
3158  if (bestGsfElectron.isEB())
3159  h_ele_PtoPttrue_barrel->Fill(bestGsfElectron.pt() / mcIter->pt());
3160  if (bestGsfElectron.isEE())
3161  h_ele_PtoPttrue_endcaps->Fill(bestGsfElectron.pt() / mcIter->pt());
3162 
3163  // supercluster related distributions
3164  reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
3165  if (!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.trackerDrivenSeed())
3166  sclRef = bestGsfElectron.parentSuperCluster();
3167  histSclEn_->Fill(sclRef->energy());
3168  double R = std::sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
3169  double Rt = std::sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
3170  histSclEt_->Fill(sclRef->energy() * (Rt / R));
3171  histSclEtVsEta_->Fill(sclRef->eta(), sclRef->energy() * (Rt / R));
3172  histSclEtVsPhi_->Fill(sclRef->phi(), sclRef->energy() * (Rt / R));
3173  if (bestGsfElectron.isEB())
3174  histSclEoEtrue_barrel->Fill(sclRef->energy() / mcIter->p());
3175  if (bestGsfElectron.isEE())
3176  histSclEoEtrue_endcaps->Fill(sclRef->energy() / mcIter->p());
3177  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3178  histSclEoEtrue_barrel_eg->Fill(sclRef->energy() / mcIter->p());
3179  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3180  histSclEoEtrue_endcaps_eg->Fill(sclRef->energy() / mcIter->p());
3181  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap())
3182  histSclEoEtrue_barrel_etagap->Fill(sclRef->energy() / mcIter->p());
3183  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap())
3184  histSclEoEtrue_barrel_phigap->Fill(sclRef->energy() / mcIter->p());
3185  if (bestGsfElectron.isEBEEGap())
3186  histSclEoEtrue_ebeegap->Fill(sclRef->energy() / mcIter->p());
3187  //if (bestGsfElectron.isEE()) histSclEoEtrue_endcaps->Fill(sclRef->energy()/mcIter->p());
3188  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap())
3189  histSclEoEtrue_endcaps_deegap->Fill(sclRef->energy() / mcIter->p());
3190  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap())
3191  histSclEoEtrue_endcaps_ringgap->Fill(sclRef->energy() / mcIter->p());
3192  if (bestGsfElectron.isEB())
3193  histSclEoEtrue_barrel_new->Fill(sclRef->energy() / mcIter->p());
3194  if (bestGsfElectron.isEE())
3195  histSclEoEtrue_endcaps_new->Fill(sclRef->energy() / mcIter->p());
3196  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3197  histSclEoEtrue_barrel_eg_new->Fill(sclRef->energy() / mcIter->p());
3198  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3199  histSclEoEtrue_endcaps_eg_new->Fill(sclRef->energy() / mcIter->p());
3200  if (bestGsfElectron.isEB() && bestGsfElectron.isEBEtaGap())
3201  histSclEoEtrue_barrel_etagap_new->Fill(sclRef->energy() / mcIter->p());
3202  if (bestGsfElectron.isEB() && bestGsfElectron.isEBPhiGap())
3203  histSclEoEtrue_barrel_phigap_new->Fill(sclRef->energy() / mcIter->p());
3204  if (bestGsfElectron.isEBEEGap())
3205  histSclEoEtrue_ebeegap_new->Fill(sclRef->energy() / mcIter->p());
3206  //if (bestGsfElectron.isEE()) histSclEoEtrue_endcaps_new->Fill(sclRef->energy()/mcIter->p());
3207  if (bestGsfElectron.isEE() && bestGsfElectron.isEEDeeGap())
3208  histSclEoEtrue_endcaps_deegap_new->Fill(sclRef->energy() / mcIter->p());
3209  if (bestGsfElectron.isEE() && bestGsfElectron.isEERingGap())
3210  histSclEoEtrue_endcaps_ringgap_new->Fill(sclRef->energy() / mcIter->p());
3211  histSclEta_->Fill(sclRef->eta());
3212  histSclEtaVsPhi_->Fill(sclRef->phi(), sclRef->eta());
3213  histSclPhi_->Fill(sclRef->phi());
3214  histSclSigEtaEta_->Fill(bestGsfElectron.scSigmaEtaEta());
3215  if (bestGsfElectron.isEB())
3216  histSclSigEtaEta_barrel_->Fill(bestGsfElectron.scSigmaEtaEta());
3217  if (bestGsfElectron.isEE())
3218  histSclSigEtaEta_endcaps_->Fill(bestGsfElectron.scSigmaEtaEta());
3219  histSclSigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta());
3220  if (bestGsfElectron.isEB())
3221  histSclSigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
3222  if (bestGsfElectron.isEE())
3223  histSclSigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
3224  histSclE1x5_->Fill(bestGsfElectron.scE1x5());
3225  if (bestGsfElectron.isEB())
3226  histSclE1x5_barrel_->Fill(bestGsfElectron.scE1x5());
3227  if (bestGsfElectron.isEE())
3228  histSclE1x5_endcaps_->Fill(bestGsfElectron.scE1x5());
3229  histSclE2x5max_->Fill(bestGsfElectron.scE2x5Max());
3230  if (bestGsfElectron.isEB())
3231  histSclE2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max());
3232  if (bestGsfElectron.isEE())
3233  histSclE2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max());
3234  histSclE5x5_->Fill(bestGsfElectron.scE5x5());
3235  if (bestGsfElectron.isEB())
3236  histSclE5x5_barrel_->Fill(bestGsfElectron.scE5x5());
3237  if (bestGsfElectron.isEE())
3238  histSclE5x5_endcaps_->Fill(bestGsfElectron.scE5x5());
3239  if (bestGsfElectron.ecalDrivenSeed())
3240  histSclSigIEtaIEta_eg_->Fill(bestGsfElectron.scSigmaIEtaIEta());
3241  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3242  histSclSigIEtaIEta_eg_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
3243  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3244  histSclSigIEtaIEta_eg_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
3245  if (bestGsfElectron.ecalDrivenSeed())
3246  histSclE1x5_eg_->Fill(bestGsfElectron.scE1x5());
3247  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3248  histSclE1x5_eg_barrel_->Fill(bestGsfElectron.scE1x5());
3249  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3250  histSclE1x5_eg_endcaps_->Fill(bestGsfElectron.scE1x5());
3251  if (bestGsfElectron.ecalDrivenSeed())
3252  histSclE2x5max_eg_->Fill(bestGsfElectron.scE2x5Max());
3253  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3254  histSclE2x5max_eg_barrel_->Fill(bestGsfElectron.scE2x5Max());
3255  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3256  histSclE2x5max_eg_endcaps_->Fill(bestGsfElectron.scE2x5Max());
3257  if (bestGsfElectron.ecalDrivenSeed())
3258  histSclE5x5_eg_->Fill(bestGsfElectron.scE5x5());
3259  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3260  histSclE5x5_eg_barrel_->Fill(bestGsfElectron.scE5x5());
3261  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3262  histSclE5x5_eg_endcaps_->Fill(bestGsfElectron.scE5x5());
3263  float pfEnergy = 0., egEnergy = 0.;
3264  if (!bestGsfElectron.superCluster().isNull())
3265  egEnergy = bestGsfElectron.superCluster()->energy();
3266  if (!bestGsfElectron.parentSuperCluster().isNull())
3267  pfEnergy = bestGsfElectron.parentSuperCluster()->energy();
3268  histSclEoEtruePfVsEg->Fill(egEnergy / mcIter->p(), pfEnergy / mcIter->p());
3269 
3270  // track related distributions
3271  h_ele_ambiguousTracks->Fill(bestGsfElectron.ambiguousGsfTracksSize());
3272  h_ele_ambiguousTracksVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize());
3273  h_ele_ambiguousTracksVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize());
3274  h_ele_ambiguousTracksVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize());
3275  if (!readAOD_) { // track extra does not exist in AOD
3276  h_ele_foundHits->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits());
3277  if (bestGsfElectron.isEB())
3278  h_ele_foundHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits());
3279  if (bestGsfElectron.isEE())
3280  h_ele_foundHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits());
3281  h_ele_foundHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits());
3282  h_ele_foundHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits());
3283  h_ele_foundHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits());
3284  h_ele_lostHits->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits());
3285  if (bestGsfElectron.isEB())
3286  h_ele_lostHits_barrel->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits());
3287  if (bestGsfElectron.isEE())
3288  h_ele_lostHits_endcaps->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits());
3289  h_ele_lostHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits());
3290  h_ele_lostHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits());
3291  h_ele_lostHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits());
3292  h_ele_chi2->Fill(bestGsfElectron.gsfTrack()->normalizedChi2());
3293  if (bestGsfElectron.isEB())
3294  h_ele_chi2_barrel->Fill(bestGsfElectron.gsfTrack()->normalizedChi2());
3295  if (bestGsfElectron.isEE())
3296  h_ele_chi2_endcaps->Fill(bestGsfElectron.gsfTrack()->normalizedChi2());
3297  h_ele_chi2VsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2());
3298  h_ele_chi2VsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2());
3299  h_ele_chi2VsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2());
3300  }
3301  // from gsf track interface, hence using mean
3302  if (!readAOD_) { // track extra does not exist in AOD
3303  h_ele_PinMnPout->Fill(bestGsfElectron.gsfTrack()->innerMomentum().R() -
3304  bestGsfElectron.gsfTrack()->outerMomentum().R());
3305  h_ele_outerP->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R());
3306  h_ele_outerPt->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho());
3307  }
3308  // from electron interface, hence using mode
3309  h_ele_PinMnPout_mode->Fill(bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
3310  h_ele_PinMnPoutVsEta_mode->Fill(
3311  bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
3312  h_ele_PinMnPoutVsPhi_mode->Fill(
3313  bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
3314  h_ele_PinMnPoutVsPt_mode->Fill(
3315  bestGsfElectron.pt(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
3316  h_ele_PinMnPoutVsE_mode->Fill(
3317  bestGsfElectron.caloEnergy(),
3318  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
3319  if (!readAOD_) // track extra does not exist in AOD
3320  h_ele_PinMnPoutVsChi2_mode->Fill(
3321  bestGsfElectron.gsfTrack()->normalizedChi2(),
3322  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
3323  h_ele_outerP_mode->Fill(bestGsfElectron.trackMomentumOut().R());
3324  h_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().R());
3325  h_ele_outerPt_mode->Fill(bestGsfElectron.trackMomentumOut().Rho());
3326  h_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().Rho());
3327  h_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(), bestGsfElectron.trackMomentumOut().Rho());
3328  h_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(), bestGsfElectron.trackMomentumOut().Rho());
3329 
3330  if (!readAOD_) { // track extra does not exist in AOD
3331  edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
3332  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>();
3333  h_ele_seed_dphi2_->Fill(elseed->dPhiNeg(1));
3334  h_ele_seed_dphi2VsEta_->Fill(bestGsfElectron.eta(), elseed->dPhiNeg(1));
3335  h_ele_seed_dphi2VsPt_->Fill(bestGsfElectron.pt(), elseed->dPhiNeg(1));
3336  h_ele_seed_drz2_->Fill(elseed->dRZNeg(1));
3337  h_ele_seed_drz2VsEta_->Fill(bestGsfElectron.eta(), elseed->dRZNeg(1));
3338  h_ele_seed_drz2VsPt_->Fill(bestGsfElectron.pt(), elseed->dRZNeg(1));
3339  h_ele_seed_subdet2_->Fill(elseed->subDet(1));
3340  }
3341  // match distributions
3342  h_ele_EoP->Fill(bestGsfElectron.eSuperClusterOverP());
3343  if (bestGsfElectron.ecalDrivenSeed())
3344  h_ele_EoP_eg->Fill(bestGsfElectron.eSuperClusterOverP());
3345  if (bestGsfElectron.isEB())
3346  h_ele_EoP_barrel->Fill(bestGsfElectron.eSuperClusterOverP());
3347  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3348  h_ele_EoP_eg_barrel->Fill(bestGsfElectron.eSuperClusterOverP());
3349  if (bestGsfElectron.isEE())
3350  h_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP());
3351  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3352  h_ele_EoP_eg_endcaps->Fill(bestGsfElectron.eSuperClusterOverP());
3353  h_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP());
3354  h_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP());
3355  h_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP());
3356  h_ele_EseedOP->Fill(bestGsfElectron.eSeedClusterOverP());
3357  if (bestGsfElectron.ecalDrivenSeed())
3358  h_ele_EseedOP_eg->Fill(bestGsfElectron.eSeedClusterOverP());
3359  if (bestGsfElectron.isEB())
3360  h_ele_EseedOP_barrel->Fill(bestGsfElectron.eSeedClusterOverP());
3361  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3362  h_ele_EseedOP_eg_barrel->Fill(bestGsfElectron.eSeedClusterOverP());
3363  if (bestGsfElectron.isEE())
3364  h_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP());
3365  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3366  h_ele_EseedOP_eg_endcaps->Fill(bestGsfElectron.eSeedClusterOverP());
3367  h_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP());
3368  h_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP());
3369  h_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP());
3370  h_ele_EoPout->Fill(bestGsfElectron.eSeedClusterOverPout());
3371  if (bestGsfElectron.ecalDrivenSeed())
3372  h_ele_EoPout_eg->Fill(bestGsfElectron.eSeedClusterOverPout());
3373  if (bestGsfElectron.isEB())
3374  h_ele_EoPout_barrel->Fill(bestGsfElectron.eSeedClusterOverPout());
3375  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3376  h_ele_EoPout_eg_barrel->Fill(bestGsfElectron.eSeedClusterOverPout());
3377  if (bestGsfElectron.isEE())
3378  h_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout());
3379  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3380  h_ele_EoPout_eg_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout());
3381  h_ele_EoPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout());
3382  h_ele_EoPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout());
3383  h_ele_EoPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout());
3384  h_ele_EeleOPout->Fill(bestGsfElectron.eEleClusterOverPout());
3385  if (bestGsfElectron.ecalDrivenSeed())
3386  h_ele_EeleOPout_eg->Fill(bestGsfElectron.eEleClusterOverPout());
3387  if (bestGsfElectron.isEB())
3388  h_ele_EeleOPout_barrel->Fill(bestGsfElectron.eEleClusterOverPout());
3389  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3390  h_ele_EeleOPout_eg_barrel->Fill(bestGsfElectron.eEleClusterOverPout());
3391  if (bestGsfElectron.isEE())
3392  h_ele_EeleOPout_endcaps->Fill(bestGsfElectron.eEleClusterOverPout());
3393  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3394  h_ele_EeleOPout_eg_endcaps->Fill(bestGsfElectron.eEleClusterOverPout());
3395  h_ele_EeleOPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout());
3396  h_ele_EeleOPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout());
3397  h_ele_EeleOPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout());
3398  h_ele_dEtaSc_propVtx->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
3399  if (bestGsfElectron.ecalDrivenSeed())
3400  h_ele_dEtaSc_propVtx_eg->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
3401  if (bestGsfElectron.isEB())
3402  h_ele_dEtaSc_propVtx_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
3403  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3404  h_ele_dEtaSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
3405  if (bestGsfElectron.isEE())
3406  h_ele_dEtaSc_propVtx_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
3407  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3408  h_ele_dEtaSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
3409  h_ele_dEtaScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
3410  h_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
3411  h_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
3412  h_ele_dPhiSc_propVtx->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
3413  if (bestGsfElectron.ecalDrivenSeed())
3414  h_ele_dPhiSc_propVtx_eg->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
3415  if (bestGsfElectron.isEB())
3416  h_ele_dPhiSc_propVtx_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
3417  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3418  h_ele_dPhiSc_propVtx_eg_barrel->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
3419  if (bestGsfElectron.isEE())
3420  h_ele_dPhiSc_propVtx_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
3421  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3422  h_ele_dPhiSc_propVtx_eg_endcaps->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
3423  h_ele_dPhiScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
3424  h_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
3425  h_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
3426  h_ele_dEtaCl_propOut->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
3427  if (bestGsfElectron.ecalDrivenSeed())
3428  h_ele_dEtaCl_propOut_eg->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
3429  if (bestGsfElectron.isEB())
3430  h_ele_dEtaCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
3431  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3432  h_ele_dEtaCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
3433  if (bestGsfElectron.isEE())
3434  h_ele_dEtaCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
3435  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3436  h_ele_dEtaCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
3437  h_ele_dEtaClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
3438  h_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
3439  h_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
3440  h_ele_dPhiCl_propOut->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3441  if (bestGsfElectron.ecalDrivenSeed())
3442  h_ele_dPhiCl_propOut_eg->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3443  if (bestGsfElectron.isEB())
3444  h_ele_dPhiCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3445  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3446  h_ele_dPhiCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3447  if (bestGsfElectron.isEE())
3448  h_ele_dPhiCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3449  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3450  h_ele_dPhiCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3451  h_ele_dPhiClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3452  h_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3453  h_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
3454  h_ele_dEtaEleCl_propOut->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3455  if (bestGsfElectron.ecalDrivenSeed())
3456  h_ele_dEtaEleCl_propOut_eg->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3457  if (bestGsfElectron.isEB())
3458  h_ele_dEtaEleCl_propOut_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3459  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3460  h_ele_dEtaEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3461  if (bestGsfElectron.isEE())
3462  h_ele_dEtaEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3463  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3464  h_ele_dEtaEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3465  h_ele_dEtaEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3466  h_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3467  h_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
3468  h_ele_dPhiEleCl_propOut->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3469  if (bestGsfElectron.ecalDrivenSeed())
3470  h_ele_dPhiEleCl_propOut_eg->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3471  if (bestGsfElectron.isEB())
3472  h_ele_dPhiEleCl_propOut_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3473  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3474  h_ele_dPhiEleCl_propOut_eg_barrel->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3475  if (bestGsfElectron.isEE())
3476  h_ele_dPhiEleCl_propOut_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3477  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3478  h_ele_dPhiEleCl_propOut_eg_endcaps->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3479  h_ele_dPhiEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3480  h_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3481  h_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
3482  h_ele_HoE->Fill(bestGsfElectron.hadronicOverEm());
3483  if (bestGsfElectron.ecalDrivenSeed())
3484  h_ele_HoE_eg->Fill(bestGsfElectron.hadronicOverEm());
3485  if (bestGsfElectron.isEB())
3486  h_ele_HoE_barrel->Fill(bestGsfElectron.hadronicOverEm());
3487  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
3488  h_ele_HoE_eg_barrel->Fill(bestGsfElectron.hadronicOverEm());
3489  if (bestGsfElectron.isEE())
3490  h_ele_HoE_endcaps->Fill(bestGsfElectron.hadronicOverEm());
3491  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
3492  h_ele_HoE_eg_endcaps->Fill(bestGsfElectron.hadronicOverEm());
3493  if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap() && !bestGsfElectron.isEBEEGap() &&
3494  !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap())
3495  h_ele_HoE_fiducial->Fill(bestGsfElectron.hadronicOverEm());
3496  h_ele_HoEVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.hadronicOverEm());
3497  h_ele_HoEVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.hadronicOverEm());
3498  h_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.hadronicOverEm());
3499 
3500  //classes
3501  int eleClass = bestGsfElectron.classification();
3502  if (bestGsfElectron.isEE())
3503  eleClass += 10;
3504  h_ele_classes->Fill(eleClass);
3505 
3506  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEB())
3507  histSclEoEtrueGolden_barrel->Fill(sclRef->energy() / mcIter->p());
3508  if (bestGsfElectron.classification() == GsfElectron::GOLDEN && bestGsfElectron.isEE())
3509  histSclEoEtrueGolden_endcaps->Fill(sclRef->energy() / mcIter->p());
3510  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEB())
3511  histSclEoEtrueShowering_barrel->Fill(sclRef->energy() / mcIter->p());
3512  if (bestGsfElectron.classification() == GsfElectron::SHOWERING && bestGsfElectron.isEE())
3513  histSclEoEtrueShowering_endcaps->Fill(sclRef->energy() / mcIter->p());
3514 
3515  //eleClass = eleClass%100; // get rid of barrel/endcap distinction
3516  h_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
3517  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3518  h_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
3519  if (bestGsfElectron.classification() == GsfElectron::BIGBREM)
3520  h_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
3521  //if (bestGsfElectron.classification() == GsfElectron::NARROW) h_ele_eta_narrow ->Fill(std::abs(bestGsfElectron.eta()));
3522  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3523  h_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
3524 
3525  //fbrem
3526  double fbrem_mean = 0.;
3527  if (!readAOD_) // track extra does not exist in AOD
3528  fbrem_mean =
3529  1. - bestGsfElectron.gsfTrack()->outerMomentum().R() / bestGsfElectron.gsfTrack()->innerMomentum().R();
3530  double fbrem_mode = bestGsfElectron.fbrem();
3531  h_ele_fbrem->Fill(fbrem_mode);
3532  if (bestGsfElectron.ecalDrivenSeed())
3533  h_ele_fbrem_eg->Fill(fbrem_mode);
3534  h_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(), fbrem_mode);
3535  if (!readAOD_) // track extra does not exist in AOD
3536  h_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(), fbrem_mean);
3537 
3538  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3539  h_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
3540  bestGsfElectron.trackMomentumAtVtx().R());
3541  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3542  h_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
3543  bestGsfElectron.trackMomentumAtVtx().R());
3544  if (!readAOD_) { // track extra not available in AOD
3545  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3546  h_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
3547  bestGsfElectron.gsfTrack()->innerMomentum().R());
3548  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3549  h_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
3550  bestGsfElectron.gsfTrack()->innerMomentum().R());
3551  }
3552  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3553  h_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
3554  bestGsfElectron.trackMomentumAtVtx().Rho());
3555  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3556  h_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
3557  bestGsfElectron.trackMomentumAtVtx().Rho());
3558  if (!readAOD_) { // track extra not available in AOD
3559  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
3560  h_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
3561  bestGsfElectron.gsfTrack()->innerMomentum().Rho());
3562  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
3563  h_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
3564  bestGsfElectron.gsfTrack()->innerMomentum().Rho());
3565  }
3566 
3567  h_ele_mva->Fill(bestGsfElectron.mva_e_pi());
3568  if (bestGsfElectron.ecalDrivenSeed())
3569  h_ele_mva_eg->Fill(bestGsfElectron.mva_e_pi());
3570  if (bestGsfElectron.ecalDrivenSeed())
3571  h_ele_provenance->Fill(1.);
3572  if (bestGsfElectron.trackerDrivenSeed())
3573  h_ele_provenance->Fill(-1.);
3574  if (bestGsfElectron.trackerDrivenSeed() || bestGsfElectron.ecalDrivenSeed())
3575  h_ele_provenance->Fill(0.);
3576  if (bestGsfElectron.trackerDrivenSeed() && !bestGsfElectron.ecalDrivenSeed())
3577  h_ele_provenance->Fill(-2.);
3578  if (!bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.ecalDrivenSeed())
3579  h_ele_provenance->Fill(2.);
3580 
3581  h_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
3582  h_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
3583  h_ele_hcalDepth1TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalTowerSumEt(1));
3584  h_ele_hcalDepth2TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalTowerSumEt(2));
3585  h_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
3586  h_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
3587  h_ele_hcalDepth1TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalTowerSumEt(1));
3588  h_ele_hcalDepth2TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalTowerSumEt(2));
3589 
3590  } // gsf electron found
3591 
3592  } // mc particle found
3593  }
3594 
3595  } // loop over mc particle
3596 
3597  h_mcNum->Fill(mcNum);
3598  h_eleNum->Fill(eleNum);
3599 }
edm::ESHandle< TrackerGeometry > pDD
static std::vector< std::string > checklist log
const edm::EventSetup & c
float scSigmaEtaEta() const
Definition: GsfElectron.h:495
bool isEBEtaGap() const
Definition: GsfElectron.h:333
virtual SuperClusterRef parentSuperCluster() const
Definition: GsfElectron.h:160
double pt() const final
transverse momentum
float eSuperClusterOverP() const
Definition: GsfElectron.h:221
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
bool isEBEEGap() const
Definition: GsfElectron.h:331
GsfElectronMCAnalyzer(const edm::ParameterSet &conf)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESHandle< MagneticField > theMagField
math::XYZVectorF trackMomentumAtVtx() const
Definition: GsfElectron.h:268
float dr03HcalTowerSumEt(int depth=0) const
Definition: GsfElectron.h:576
float dr04TkSumPt() const
Definition: GsfElectron.h:597
bool isEERingGap() const
Definition: GsfElectron.h:337
void analyze(const edm::Event &e, const edm::EventSetup &c) override
const Point & vertex() const override
vertex position (overwritten by PF...)
float fbrem() const
Definition: GsfElectron.h:809
float scE2x5Max() const
Definition: GsfElectron.h:498
TrajectoryStateTransform transformer_
bool isEEDeeGap() const
Definition: GsfElectron.h:336
bool isEE() const
Definition: GsfElectron.h:329
bool isEB() const
Definition: GsfElectron.h:328
const Double_t pi
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
tuple d
Definition: ztail.py:151
GsfTrackRef gsfTrack() const override
reference to a GsfTrack
Definition: GsfElectron.h:156
float deltaEtaSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:225
int iEvent
Definition: GenABIO.cc:224
double p() const final
magnitude of momentum vector
float hadronicOverEm() const
Definition: GsfElectron.h:500
float eSeedClusterOverP() const
Definition: GsfElectron.h:222
float dr04EcalRecHitSumEt() const
Definition: GsfElectron.h:599
float deltaPhiSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:229
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< int > matchingMotherIDs_
math::XYZVectorF trackMomentumOut() const
Definition: GsfElectron.h:270
float deltaPhiSuperClusterTrackAtVtx() const
Definition: GsfElectron.h:228
float dr03TkSumPt() const
Definition: GsfElectron.h:557
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float eEleClusterOverPout() const
Definition: GsfElectron.h:224
float eSeedClusterOverPout() const
Definition: GsfElectron.h:223
double py() const final
y coordinate of momentum vector
float scSigmaIEtaIEta() const
Definition: GsfElectron.h:496
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
bool isNull() const
Checks for null.
Definition: Ref.h:235
float deltaPhiEleClusterTrackAtCalo() const
Definition: GsfElectron.h:230
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
virtual int pdgId() const =0
PDG identifier.
Log< level::Info, false > LogInfo
T const * product() const
Definition: Handle.h:70
float deltaEtaEleClusterTrackAtCalo() const
Definition: GsfElectron.h:227
Classification classification() const
Definition: GsfElectron.h:805
REF castTo() const
Definition: RefToBase.h:257
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GsfTrackRefVector::size_type ambiguousGsfTracksSize() const
Definition: GsfElectron.h:766
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:559
float mva_e_pi() const
Definition: GsfElectron.h:744
edm::EventID id() const
Definition: EventBase.h:59
float deltaEtaSeedClusterTrackAtCalo() const
Definition: GsfElectron.h:226
bool isEBPhiGap() const
Definition: GsfElectron.h:334
bool trackerDrivenSeed() const
Definition: GsfElectron.h:159
tuple cout
Definition: gather_cfg.py:144
float scE5x5() const
Definition: GsfElectron.h:499
std::vector< int > matchingIDs_
float dr04HcalTowerSumEt(int depth=0) const
Definition: GsfElectron.h:600
double phi() const final
momentum azimuthal angle
float caloEnergy() const
Definition: GsfElectron.h:899
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
SuperClusterRef superCluster() const override
reference to a SuperCluster
Definition: GsfElectron.h:155
int charge() const final
electric charge
float scE1x5() const
Definition: GsfElectron.h:497
bool ecalDrivenSeed() const
Definition: GsfElectron.h:158
double eta() const final
momentum pseudorapidity