CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GsfElectronMCFakeAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: RecoEgamma/Examples
4 // Class: GsfElectronMCFakeAnalyzer
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 
50 public:
51  explicit GsfElectronMCFakeAnalyzer(const edm::ParameterSet &conf);
52 
53  ~GsfElectronMCFakeAnalyzer() override;
54 
55  void beginJob() override;
56  void endJob() override;
57  void analyze(const edm::Event &e, const edm::EventSetup &c) override;
58 
59 private:
63  bool readAOD_;
65 
67 
68  float mcEnergy[10], mcEta[10], mcPhi[10], mcPt[10], mcQ[10];
70  float seedMomentum[10], seedEta[10], seedPhi[10], seedPt[10], seedQ[10];
71 
72  double maxPt_;
73  double maxAbsEta_;
74  double deltaR_;
75 
76  TFile *histfile_;
77  TTree *tree_;
78 
79  // histos limits and binning
80 
81  int nbinxyz;
82  int nbinp;
83  int nbinp2D;
84  double pmax;
85  int nbinpt;
86  int nbinpt2D;
87  int nbinpteff;
88  double ptmax;
89  int nbinfhits;
90  double fhitsmax;
91  int nbinlhits;
92  double lhitsmax;
93  int nbineta;
94  int nbineta2D;
95  double etamin;
96  double etamax;
97  int nbindeta;
98  double detamin;
99  double detamax;
102  double detamatchmin;
103  double detamatchmax;
104  int nbinphi;
106  double phimin;
107  double phimax;
108  int nbindphi;
109  double dphimin;
110  double dphimax;
113  double dphimatchmin;
114  double dphimatchmax;
115  int nbineop;
117  double eopmax;
118  double eopmaxsht;
119  int nbinmee;
120  double meemin;
121  double meemax;
122  int nbinhoe;
123  double hoemin;
124  double hoemax;
125 
126  // histos
127 
129 
136 
151 
154 
160 
180 
181  TH1F *histNum_;
182 
183  TH1F *histSclEn_;
186  TH1F *histSclEt_;
190  TH1F *histSclEta_;
191  TH1F *histSclPhi_;
207 
224  TH1F *h_ele_chi2;
230 
246 
254 
263  TH1F *h_ele_EoP;
299 
354 
362 
364  TH1F *h_ele_eta;
369 
370  TH1F *h_ele_HoE;
380 
381  TH1F *h_ele_fbrem;
384 
397 
398  TH1F *h_ele_mva;
400 
409 };
410 
413 
414 using namespace reco;
415 
417  : beamSpot_(conf.getParameter<edm::InputTag>("beamSpot")) {
418  outputFile_ = conf.getParameter<std::string>("outputFile");
419  histfile_ = new TFile(outputFile_.c_str(), "RECREATE");
420  electronCollection_ = conf.getParameter<edm::InputTag>("electronCollection");
421  matchingObjectCollection_ = conf.getParameter<edm::InputTag>("matchingObjectCollection");
422  readAOD_ = conf.getParameter<bool>("readAOD");
423  maxPt_ = conf.getParameter<double>("MaxPt");
424  maxAbsEta_ = conf.getParameter<double>("MaxAbsEta");
425  deltaR_ = conf.getParameter<double>("DeltaR");
426 
427  edm::ParameterSet pset = conf.getParameter<edm::ParameterSet>("HistosConfigurationFake");
428 
429  etamin = pset.getParameter<double>("Etamin");
430  etamax = pset.getParameter<double>("Etamax");
431  phimin = pset.getParameter<double>("Phimin");
432  phimax = pset.getParameter<double>("Phimax");
433  ptmax = pset.getParameter<double>("Ptmax");
434  pmax = pset.getParameter<double>("Pmax");
435  eopmax = pset.getParameter<double>("Eopmax");
436  eopmaxsht = pset.getParameter<double>("Eopmaxsht");
437  detamin = pset.getParameter<double>("Detamin");
438  detamax = pset.getParameter<double>("Detamax");
439  dphimin = pset.getParameter<double>("Dphimin");
440  dphimax = pset.getParameter<double>("Dphimax");
441  detamatchmin = pset.getParameter<double>("Detamatchmin");
442  detamatchmax = pset.getParameter<double>("Detamatchmax");
443  dphimatchmin = pset.getParameter<double>("Dphimatchmin");
444  dphimatchmax = pset.getParameter<double>("Dphimatchmax");
445  fhitsmax = pset.getParameter<double>("Fhitsmax");
446  lhitsmax = pset.getParameter<double>("Lhitsmax");
447  nbineta = pset.getParameter<int>("Nbineta");
448  nbineta2D = pset.getParameter<int>("Nbineta2D");
449  nbinp = pset.getParameter<int>("Nbinp");
450  nbinpt = pset.getParameter<int>("Nbinpt");
451  nbinp2D = pset.getParameter<int>("Nbinp2D");
452  nbinpt2D = pset.getParameter<int>("Nbinpt2D");
453  nbinpteff = pset.getParameter<int>("Nbinpteff");
454  nbinphi = pset.getParameter<int>("Nbinphi");
455  nbinphi2D = pset.getParameter<int>("Nbinphi2D");
456  nbineop = pset.getParameter<int>("Nbineop");
457  nbineop2D = pset.getParameter<int>("Nbineop2D");
458  nbinfhits = pset.getParameter<int>("Nbinfhits");
459  nbinlhits = pset.getParameter<int>("Nbinlhits");
460  nbinxyz = pset.getParameter<int>("Nbinxyz");
461  nbindeta = pset.getParameter<int>("Nbindeta");
462  nbindphi = pset.getParameter<int>("Nbindphi");
463  nbindetamatch = pset.getParameter<int>("Nbindetamatch");
464  nbindphimatch = pset.getParameter<int>("Nbindphimatch");
465  nbindetamatch2D = pset.getParameter<int>("Nbindetamatch2D");
466  nbindphimatch2D = pset.getParameter<int>("Nbindphimatch2D");
467  nbinmee = pset.getParameter<int>("Nbinmee");
468  meemin = pset.getParameter<double>("Meemin");
469  meemax = pset.getParameter<double>("Meemax");
470  nbinhoe = pset.getParameter<int>("Nbinhoe");
471  hoemin = pset.getParameter<double>("Hoemin");
472  hoemax = pset.getParameter<double>("Hoemax");
473 }
474 
476  // do anything here that needs to be done at desctruction time
477  // (e.g. close files, deallocate resources etc.)
478  histfile_->Write();
479  histfile_->Close();
480 }
481 
483  histfile_->cd();
484 
485  // matching object
486  std::string::size_type locJet = matchingObjectCollection_.label().find("ak4GenJets", 0);
487  std::string type_;
488  if (locJet != std::string::npos) {
489  std::cout << "Matching objects are GenJets " << std::endl;
490  type_ = "GenJet";
491  } else {
492  std::cout << "Didn't recognize input matching objects!! " << std::endl;
493  }
494 
495  std::string htitle, hlabel;
496  hlabel = "h_" + type_ + "Num";
497  htitle = "# " + type_ + "s";
498  h_matchingObjectNum = new TH1F(hlabel.c_str(), htitle.c_str(), nbinfhits, 0., fhitsmax);
499 
500  // rec event
501  histNum_ = new TH1F("h_recEleNum", "# rec electrons", 20, 0., 20.);
502 
503  // matching object distributions
504  hlabel = "h_matchingObject_eta";
505  htitle = type_ + " #eta";
506  h_matchingObjectEta = new TH1F(hlabel.c_str(), htitle.c_str(), nbineta, etamin, etamax);
507  hlabel = "h_matchingObject_abseta";
508  htitle = type_ + " |#eta|";
509  h_matchingObjectAbsEta = new TH1F(hlabel.c_str(), htitle.c_str(), nbineta / 2, 0., etamax);
510  hlabel = "h_matchingObject_P";
511  htitle = type_ + " p";
512  h_matchingObjectP = new TH1F(hlabel.c_str(), htitle.c_str(), nbinp, 0., pmax);
513  hlabel = "h_matchingObject_Pt";
514  htitle = type_ + " pt";
515  h_matchingObjectPt = new TH1F(hlabel.c_str(), htitle.c_str(), nbinpteff, 5., ptmax);
516  hlabel = "h_matchingObject_phi";
517  htitle = type_ + " phi";
518  h_matchingObjectPhi = new TH1F(hlabel.c_str(), htitle.c_str(), nbinphi, phimin, phimax);
519  hlabel = "h_matchingObject_z";
520  htitle = type_ + " z";
521  h_matchingObjectZ = new TH1F(hlabel.c_str(), htitle.c_str(), nbinxyz, -25, 25);
522 
523  // all electrons
524  h_ele_EoverP_all = new TH1F("h_ele_EoverP_all", "ele E/P_{vertex}, all reco electrons", nbineop, 0., eopmax);
525  h_ele_EseedOP_all = new TH1F("h_ele_EseedOP_all", "ele E_{seed}/P_{vertex}, all reco electrons", nbineop, 0., eopmax);
526  h_ele_EoPout_all = new TH1F("h_ele_EoPout_all", "ele E_{seed}/P_{out}, all reco electrons", nbineop, 0., eopmax);
527  h_ele_EeleOPout_all = new TH1F("h_ele_EeleOPout_all", "ele E_{ele}/P_{out}, all reco electrons", nbineop, 0., eopmax);
528  h_ele_dEtaSc_propVtx_all = new TH1F("h_ele_dEtaSc_propVtx_all",
529  "ele #eta_{sc} - #eta_{tr}, prop from vertex, all reco electrons",
531  detamatchmin,
532  detamatchmax);
533  h_ele_dPhiSc_propVtx_all = new TH1F("h_ele_dPhiSc_propVtx_all",
534  "ele #phi_{sc} - #phi_{tr}, prop from vertex, all reco electrons",
536  dphimatchmin,
537  dphimatchmax);
538  h_ele_dEtaCl_propOut_all = new TH1F("h_ele_dEtaCl_propOut_all",
539  "ele #eta_{cl} - #eta_{tr}, prop from outermost, all reco electrons",
541  detamatchmin,
542  detamatchmax);
543  h_ele_dPhiCl_propOut_all = new TH1F("h_ele_dPhiCl_propOut_all",
544  "ele #phi_{cl} - #phi_{tr}, prop from outermost, all reco electrons",
546  dphimatchmin,
547  dphimatchmax);
548  h_ele_TIP_all = new TH1F("h_ele_TIP_all", "ele vertex transverse radius, all reco electrons", 100, 0., 0.2);
549  h_ele_HoE_all =
550  new TH1F("h_ele_HoE_all", "ele hadronic energy / em energy, all reco electrons", nbinhoe, hoemin, hoemax);
551  h_ele_vertexEta_all = new TH1F("h_ele_vertexEta_all", "ele eta, all reco electrons", nbineta, etamin, etamax);
552  h_ele_vertexEta_all->Sumw2();
553  h_ele_vertexPt_all = new TH1F("h_ele_vertexPt_all", "ele p_{T}, all reco electrons", nbinpteff, 5., ptmax);
554  h_ele_vertexPt_all->Sumw2();
555  h_ele_mee_all = new TH1F("h_ele_mee_all", "ele pairs invariant mass, all reco electrons", nbinmee, meemin, meemax);
556  h_ele_mee_os = new TH1F("h_ele_mee_os", "ele pairs invariant mass, opp. sign", nbinmee, meemin, meemax);
557 
558  // duplicates
559  h_ele_E2mnE1vsMee_all = new TH2F("h_ele_E2mnE1vsMee_all",
560  "E2 - E1 vs ele pairs invariant mass, all electrons",
561  nbinmee,
562  meemin,
563  meemax,
564  100,
565  -50.,
566  50.);
567  h_ele_E2mnE1vsMee_egeg_all = new TH2F("h_ele_E2mnE1vsMee_egeg_all",
568  "E2 - E1 vs ele pairs invariant mass, ecal driven pairs, all electrons",
569  nbinmee,
570  meemin,
571  meemax,
572  100,
573  -50.,
574  50.);
575 
576  // matched electrons
577 
579  new TH1F("h_ele_matchingObjectPt_matched", "Efficiency vs matching jet p_{T}", nbinpteff, 5., ptmax);
582  new TH1F("h_ele_matchingObjectAbsEta_matched", "Efficiency vs matching jet |#eta|", nbineta / 2, 0., 2.5);
585  new TH1F("h_ele_matchingObjectEta_matched", "Efficiency vs matching jet #eta", nbineta, etamin, etamax);
588  new TH1F("h_ele_matchingObjectPhi_matched", "Efficiency vs matching jet phi", nbinphi, phimin, phimax);
591  new TH1F("h_ele_matchingObjectZ_matched", "Efficiency vs matching jet z", nbinxyz, -25, 25);
593 
594  h_ele_charge = new TH1F("h_ele_charge", "ele charge", 5, -2., 2.);
595  h_ele_chargeVsEta = new TH2F("h_ele_chargeVsEta", "ele charge vs eta", nbineta2D, etamin, etamax, 5, -2., 2.);
596  h_ele_chargeVsPhi = new TH2F("h_ele_chargeVsPhi", "ele charge vs phi", nbinphi2D, phimin, phimax, 5, -2., 2.);
597  h_ele_chargeVsPt = new TH2F("h_ele_chargeVsPt", "ele charge vs pt", nbinpt, 0., 100., 5, -2., 2.);
598  h_ele_vertexP = new TH1F("h_ele_vertexP", "ele momentum", nbinp, 0., pmax);
599  h_ele_vertexPt = new TH1F("h_ele_vertexPt", "ele transverse momentum", nbinpt, 0., ptmax);
601  new TH2F("h_ele_vertexPtVsEta", "ele transverse momentum vs eta", nbineta2D, etamin, etamax, nbinpt2D, 0., ptmax);
603  new TH2F("h_ele_vertexPtVsPhi", "ele transverse momentum vs phi", nbinphi2D, phimin, phimax, nbinpt2D, 0., ptmax);
604  h_ele_vertexEta = new TH1F("h_ele_vertexEta", "ele momentum eta", nbineta, etamin, etamax);
606  new TH2F("h_ele_vertexEtaVsPhi", "ele momentum eta vs phi", nbineta2D, etamin, etamax, nbinphi2D, phimin, phimax);
607  h_ele_vertexPhi = new TH1F("h_ele_vertexPhi", "ele momentum #phi", nbinphi, phimin, phimax);
608  h_ele_vertexX = new TH1F("h_ele_vertexX", "ele vertex x", nbinxyz, -0.1, 0.1);
609  h_ele_vertexY = new TH1F("h_ele_vertexY", "ele vertex y", nbinxyz, -0.1, 0.1);
610  h_ele_vertexZ = new TH1F("h_ele_vertexZ", "ele vertex z", nbinxyz, -25, 25);
611  h_ele_vertexTIP = new TH1F("h_ele_vertexTIP", "ele transverse impact parameter (wrt bs)", 90, 0., 0.15);
612  h_ele_vertexTIPVsEta = new TH2F("h_ele_vertexTIPVsEta",
613  "ele transverse impact parameter (wrt bs) vs eta",
614  nbineta2D,
615  etamin,
616  etamax,
617  45,
618  0.,
619  0.15);
620  h_ele_vertexTIPVsPhi = new TH2F("h_ele_vertexTIPVsPhi",
621  "ele transverse impact parameter (wrt bs) vs phi",
622  nbinphi2D,
623  phimin,
624  phimax,
625  45,
626  0.,
627  0.15);
628  h_ele_vertexTIPVsPt = new TH2F(
629  "h_ele_vertexTIPVsPt", "ele transverse impact parameter (wrt bs) vs Pt", nbinpt2D, 0., ptmax, 45, 0., 0.15);
630 
631  h_ele_PoPmatchingObject = new TH1F("h_ele_PoPmatchingObject", "ele momentum / matching jet momentum", 75, 0., 1.5);
632  h_ele_PoPmatchingObjectVsEta = new TH2F("h_ele_PoPmatchingObjectVsEta",
633  "ele momentum / matching jet momentum vs eta",
634  nbineta2D,
635  etamin,
636  etamax,
637  50,
638  0.,
639  1.5);
640  h_ele_PoPmatchingObjectVsPhi = new TH2F("h_ele_PoPmatchingObjectVsPhi",
641  "ele momentum / matching jet momentum vs phi",
642  nbinphi2D,
643  phimin,
644  phimax,
645  50,
646  0.,
647  1.5);
648  h_ele_PoPmatchingObjectVsPt = new TH2F(
649  "h_ele_PoPmatchingObjectVsPt", "ele momentum / matching jet momentum vs eta", nbinpt2D, 0., ptmax, 50, 0., 1.5);
651  new TH1F("h_ele_PoPmatchingObject_barrel", "ele momentum / matching jet momentum, barrel", 75, 0., 1.5);
653  new TH1F("h_ele_PoPmatchingObject_endcaps", "ele momentum / matching jet momentum, endcaps", 75, 0., 1.5);
654 
656  new TH1F("h_ele_EtaMnEtamatchingObject", "ele momentum eta - matching jet eta", nbindeta, detamin, detamax);
657  h_ele_EtaMnEtamatchingObjectVsEta = new TH2F("h_ele_EtaMnEtamatchingObjectVsEta",
658  "ele momentum eta - matching jet eta vs eta",
659  nbineta2D,
660  etamin,
661  etamax,
662  nbindeta / 2,
663  detamin,
664  detamax);
665  h_ele_EtaMnEtamatchingObjectVsPhi = new TH2F("h_ele_EtaMnEtamatchingObjectVsPhi",
666  "ele momentum eta - matching jet eta vs phi",
667  nbinphi2D,
668  phimin,
669  phimax,
670  nbindeta / 2,
671  detamin,
672  detamax);
673  h_ele_EtaMnEtamatchingObjectVsPt = new TH2F("h_ele_EtaMnEtamatchingObjectVsPt",
674  "ele momentum eta - matching jet eta vs pt",
675  nbinpt,
676  0.,
677  ptmax,
678  nbindeta / 2,
679  detamin,
680  detamax);
682  new TH1F("h_ele_PhiMnPhimatchingObject", "ele momentum phi - matching jet phi", nbindphi, dphimin, dphimax);
683  h_ele_PhiMnPhimatchingObject2 = new TH1F("h_ele_PhiMnPhimatchingObject2",
684  "ele momentum phi - matching jet phi",
686  dphimatchmin,
687  dphimatchmax);
688  h_ele_PhiMnPhimatchingObjectVsEta = new TH2F("h_ele_PhiMnPhimatchingObjectVsEta",
689  "ele momentum phi - matching SC phi vs eta",
690  nbineta2D,
691  etamin,
692  etamax,
693  nbindphi / 2,
694  dphimin,
695  dphimax);
696  h_ele_PhiMnPhimatchingObjectVsPhi = new TH2F("h_ele_PhiMnPhimatchingObjectVsPhi",
697  "ele momentum phi - matching SC phi vs phi",
698  nbinphi2D,
699  phimin,
700  phimax,
701  nbindphi / 2,
702  dphimin,
703  dphimax);
704  h_ele_PhiMnPhimatchingObjectVsPt = new TH2F("h_ele_PhiMnPhimatchingObjectVsPt",
705  "ele momentum phi - matching SC phi vs pt",
706  nbinpt2D,
707  0.,
708  ptmax,
709  nbindphi / 2,
710  dphimin,
711  dphimax);
712 
713  // matched electron, superclusters
714  histSclEn_ = new TH1F("h_scl_energy", "ele supercluster energy", nbinp, 0., pmax);
716  new TH1F("h_scl_EoEmatchingObject_barrel", "ele supercluster energy / matching jet energy, barrel", 50, 0.2, 1.2);
718  "h_scl_EoEmatchingObject_endcaps", "ele supercluster energy / matching jet energy, endcaps", 50, 0.2, 1.2);
719  histSclEt_ = new TH1F("h_scl_et", "ele supercluster transverse energy", nbinpt, 0., ptmax);
720  histSclEtVsEta_ = new TH2F(
721  "h_scl_etVsEta", "ele supercluster transverse energy vs eta", nbineta2D, etamin, etamax, nbinpt, 0., ptmax);
722  histSclEtVsPhi_ = new TH2F(
723  "h_scl_etVsPhi", "ele supercluster transverse energy vs phi", nbinphi2D, phimin, phimax, nbinpt, 0., ptmax);
725  new TH2F("h_scl_etaVsPhi", "ele supercluster eta vs phi", nbinphi2D, phimin, phimax, nbineta2D, etamin, etamax);
726  histSclEta_ = new TH1F("h_scl_eta", "ele supercluster eta", nbineta, etamin, etamax);
727  histSclPhi_ = new TH1F("h_scl_phi", "ele supercluster phi", nbinphi, phimin, phimax);
728 
729  histSclSigIEtaIEta_ = new TH1F("h_scl_sigietaieta", "ele supercluster sigma ieta ieta", 100, 0., 0.05);
731  new TH1F("h_scl_sigietaieta_barrel", "ele supercluster sigma ieta ieta, barrel", 100, 0., 0.05);
733  new TH1F("h_scl_sigietaieta_endcaps", "ele supercluster sigma ieta ieta, endcaps", 100, 0., 0.05);
734  histSclE1x5_ = new TH1F("h_scl_E1x5", "ele supercluster energy in 1x5", nbinp, 0., pmax);
735  histSclE1x5_barrel_ = new TH1F("h_scl_E1x5_barrel", "ele supercluster energy in 1x5 barrel", nbinp, 0., pmax);
736  histSclE1x5_endcaps_ = new TH1F("h_scl_E1x5_endcaps", "ele supercluster energy in 1x5 endcaps", nbinp, 0., pmax);
737  histSclE2x5max_ = new TH1F("h_scl_E2x5max", "ele supercluster energy in 2x5 max", nbinp, 0., pmax);
739  new TH1F("h_scl_E2x5max_barrel", "ele supercluster energy in 2x5 max barrel", nbinp, 0., pmax);
741  new TH1F("h_scl_E2x5max_endcaps", "ele supercluster energy in 2x5 max endcaps", nbinp, 0., pmax);
742  histSclE5x5_ = new TH1F("h_scl_E5x5", "ele supercluster energy in 5x5", nbinp, 0., pmax);
743  histSclE5x5_barrel_ = new TH1F("h_scl_E5x5_barrel", "ele supercluster energy in 5x5 barrel", nbinp, 0., pmax);
744  histSclE5x5_endcaps_ = new TH1F("h_scl_E5x5_endcaps", "ele supercluster energy in 5x5 endcaps", nbinp, 0., pmax);
745 
746  // matched electron, gsf tracks
747  h_ele_ambiguousTracks = new TH1F("h_ele_ambiguousTracks", "ele # ambiguous tracks", 5, 0., 5.);
749  new TH2F("h_ele_ambiguousTracksVsEta", "ele # ambiguous tracks vs eta", nbineta2D, etamin, etamax, 5, 0., 5.);
751  new TH2F("h_ele_ambiguousTracksVsPhi", "ele # ambiguous tracks vs phi", nbinphi2D, phimin, phimax, 5, 0., 5.);
753  new TH2F("h_ele_ambiguousTracksVsPt", "ele # ambiguous tracks vs pt", nbinpt2D, 0., ptmax, 5, 0., 5.);
754  h_ele_foundHits = new TH1F("h_ele_foundHits", "ele track # found hits", nbinfhits, 0., fhitsmax);
755  h_ele_foundHitsVsEta = new TH2F(
756  "h_ele_foundHitsVsEta", "ele track # found hits vs eta", nbineta2D, etamin, etamax, nbinfhits, 0., fhitsmax);
757  h_ele_foundHitsVsPhi = new TH2F(
758  "h_ele_foundHitsVsPhi", "ele track # found hits vs phi", nbinphi2D, phimin, phimax, nbinfhits, 0., fhitsmax);
760  new TH2F("h_ele_foundHitsVsPt", "ele track # found hits vs pt", nbinpt2D, 0., ptmax, nbinfhits, 0., fhitsmax);
761  h_ele_lostHits = new TH1F("h_ele_lostHits", "ele track # lost hits", 5, 0., 5.);
762  h_ele_lostHitsVsEta = new TH2F(
763  "h_ele_lostHitsVsEta", "ele track # lost hits vs eta", nbineta2D, etamin, etamax, nbinlhits, 0., lhitsmax);
764  h_ele_lostHitsVsPhi = new TH2F(
765  "h_ele_lostHitsVsPhi", "ele track # lost hits vs eta", nbinphi2D, phimin, phimax, nbinlhits, 0., lhitsmax);
767  new TH2F("h_ele_lostHitsVsPt", "ele track # lost hits vs eta", nbinpt2D, 0., ptmax, nbinlhits, 0., lhitsmax);
768  h_ele_chi2 = new TH1F("h_ele_chi2", "ele track #chi^{2}", 100, 0., 15.);
769  h_ele_chi2VsEta = new TH2F("h_ele_chi2VsEta", "ele track #chi^{2} vs eta", nbineta2D, etamin, etamax, 50, 0., 15.);
770  h_ele_chi2VsPhi = new TH2F("h_ele_chi2VsPhi", "ele track #chi^{2} vs phi", nbinphi2D, phimin, phimax, 50, 0., 15.);
771  h_ele_chi2VsPt = new TH2F("h_ele_chi2VsPt", "ele track #chi^{2} vs pt", nbinpt2D, 0., ptmax, 50, 0., 15.);
772  h_ele_PinMnPout = new TH1F("h_ele_PinMnPout", "ele track inner p - outer p, mean", nbinp, 0., 200.);
773  h_ele_PinMnPout_mode = new TH1F("h_ele_PinMnPout_mode", "ele track inner p - outer p, mode", nbinp, 0., 100.);
774  h_ele_PinMnPoutVsEta_mode = new TH2F("h_ele_PinMnPoutVsEta_mode",
775  "ele track inner p - outer p vs eta, mode",
776  nbineta2D,
777  etamin,
778  etamax,
779  nbinp2D,
780  0.,
781  100.);
782  h_ele_PinMnPoutVsPhi_mode = new TH2F("h_ele_PinMnPoutVsPhi_mode",
783  "ele track inner p - outer p vs phi, mode",
784  nbinphi2D,
785  phimin,
786  phimax,
787  nbinp2D,
788  0.,
789  100.);
790  h_ele_PinMnPoutVsPt_mode = new TH2F(
791  "h_ele_PinMnPoutVsPt_mode", "ele track inner p - outer p vs pt, mode", nbinpt2D, 0., ptmax, nbinp2D, 0., 100.);
792  h_ele_PinMnPoutVsE_mode = new TH2F(
793  "h_ele_PinMnPoutVsE_mode", "ele track inner p - outer p vs E, mode", nbinp2D, 0., 200., nbinp2D, 0., 100.);
794  h_ele_PinMnPoutVsChi2_mode = new TH2F(
795  "h_ele_PinMnPoutVsChi2_mode", "ele track inner p - outer p vs track chi2, mode", 50, 0., 20., nbinp2D, 0., 100.);
796  h_ele_outerP = new TH1F("h_ele_outerP", "ele track outer p, mean", nbinp, 0., pmax);
797  h_ele_outerP_mode = new TH1F("h_ele_outerP_mode", "ele track outer p, mode", nbinp, 0., pmax);
799  new TH2F("h_ele_outerPVsEta_mode", "ele track outer p vs eta mode", nbineta2D, etamin, etamax, 50, 0., pmax);
800  h_ele_outerPt = new TH1F("h_ele_outerPt", "ele track outer p_{T}, mean", nbinpt, 0., ptmax);
801  h_ele_outerPt_mode = new TH1F("h_ele_outerPt_mode", "ele track outer p_{T}, mode", nbinpt, 0., ptmax);
802  h_ele_outerPtVsEta_mode = new TH2F(
803  "h_ele_outerPtVsEta_mode", "ele track outer p_{T} vs eta, mode", nbineta2D, etamin, etamax, nbinpt2D, 0., ptmax);
804  h_ele_outerPtVsPhi_mode = new TH2F(
805  "h_ele_outerPtVsPhi_mode", "ele track outer p_{T} vs phi, mode", nbinphi2D, phimin, phimax, nbinpt2D, 0., ptmax);
807  new TH2F("h_ele_outerPtVsPt_mode", "ele track outer p_{T} vs pt, mode", nbinpt2D, 0., 100., nbinpt2D, 0., ptmax);
808 
809  // matched electrons,cluster-track matching
810  h_ele_EoP = new TH1F("h_ele_EoP", "ele E/P_{vertex}", nbineop, 0., eopmax);
811  h_ele_EoP->Sumw2();
812  h_ele_EoP_eg = new TH1F("h_ele_EoP_eg", "ele E/P_{vertex}, ecal driven", nbineop, 0., eopmax);
813  h_ele_EoP_eg->Sumw2();
814  h_ele_EoP_barrel = new TH1F("h_ele_EoP_barrel", "ele E/P_{vertex} barrel", nbineop, 0., eopmax);
815  h_ele_EoP_barrel->Sumw2();
816  h_ele_EoP_eg_barrel = new TH1F("h_ele_EoP_eg_barrel", "ele E/P_{vertex}, ecal driven barrel", nbineop, 0., eopmax);
817  h_ele_EoP_eg_barrel->Sumw2();
818  h_ele_EoP_endcaps = new TH1F("h_ele_EoP_endcaps", "ele E/P_{vertex} endcaps", nbineop, 0., eopmax);
819  h_ele_EoP_endcaps->Sumw2();
820  h_ele_EoP_eg_endcaps = new TH1F("h_ele_EoP_eg_endcaps", "ele E/P_{vertex}, ecal driven endcaps", nbineop, 0., eopmax);
821  h_ele_EoP_eg_endcaps->Sumw2();
823  new TH2F("h_ele_EoPVsEta", "ele E/P_{vertex} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
825  new TH2F("h_ele_EoPVsPhi", "ele E/P_{vertex} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
826  h_ele_EoPVsE = new TH2F("h_ele_EoPVsE", "ele E/P_{vertex} vs E", 50, 0., pmax, 50, 0., 5.);
827  h_ele_EseedOP = new TH1F("h_ele_EseedOP", "ele E_{seed}/P_{vertex}", nbineop, 0., eopmax);
828  h_ele_EseedOP->Sumw2();
829  h_ele_EseedOP_eg = new TH1F("h_ele_EseedOP_eg", "ele E_{seed}/P_{vertex}, ecal driven", nbineop, 0., eopmax);
830  h_ele_EseedOP_eg->Sumw2();
831  h_ele_EseedOP_barrel = new TH1F("h_ele_EseedOP_barrel", "ele E_{seed}/P_{vertex} barrel", nbineop, 0., eopmax);
832  h_ele_EseedOP_barrel->Sumw2();
834  new TH1F("h_ele_EseedOP_eg_barrel", "ele E_{seed}/P_{vertex}, ecal driven barrel", nbineop, 0., eopmax);
835  h_ele_EseedOP_eg_barrel->Sumw2();
836  h_ele_EseedOP_endcaps = new TH1F("h_ele_EseedOP_endcaps", "ele E_{seed}/P_{vertex} endcaps", nbineop, 0., eopmax);
837  h_ele_EseedOP_endcaps->Sumw2();
839  new TH1F("h_ele_EseedOP_eg_endcaps", "ele E_{seed}/P_{vertex}, ecal driven, endcaps", nbineop, 0., eopmax);
840  h_ele_EseedOP_eg_endcaps->Sumw2();
841  h_ele_EseedOPVsEta = new TH2F(
842  "h_ele_EseedOPVsEta", "ele E_{seed}/P_{vertex} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
843  h_ele_EseedOPVsPhi = new TH2F(
844  "h_ele_EseedOPVsPhi", "ele E_{seed}/P_{vertex} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
845  h_ele_EseedOPVsE = new TH2F("h_ele_EseedOPVsE", "ele E_{seed}/P_{vertex} vs E", 50, 0., pmax, 50, 0., 5.);
846  h_ele_EoPout = new TH1F("h_ele_EoPout", "ele E_{seed}/P_{out}", nbineop, 0., eopmax);
847  h_ele_EoPout->Sumw2();
848  h_ele_EoPout_eg = new TH1F("h_ele_EoPout_eg", "ele E_{seed}/P_{out}, ecal driven", nbineop, 0., eopmax);
849  h_ele_EoPout_eg->Sumw2();
850  h_ele_EoPout_barrel = new TH1F("h_ele_EoPout_barrel", "ele E_{seed}/P_{out} barrel", nbineop, 0., eopmax);
851  h_ele_EoPout_barrel->Sumw2();
853  new TH1F("h_ele_EoPout_eg_barrel", "ele E_{seed}/P_{out}, ecal driven, barrel", nbineop, 0., eopmax);
854  h_ele_EoPout_eg_barrel->Sumw2();
855  h_ele_EoPout_endcaps = new TH1F("h_ele_EoPout_endcaps", "ele E_{seed}/P_{out} endcaps", nbineop, 0., eopmax);
856  h_ele_EoPout_endcaps->Sumw2();
858  new TH1F("h_ele_EoPout_eg_endcaps", "ele E_{seed}/P_{out}, ecal driven, endcaps", nbineop, 0., eopmax);
859  h_ele_EoPout_eg_endcaps->Sumw2();
861  new TH2F("h_ele_EoPoutVsEta", "ele E/P_{out} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
863  new TH2F("h_ele_EoPoutVsPhi", "ele E/P_{out} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
864  h_ele_EoPoutVsE = new TH2F("h_ele_EoPoutVsE", "ele E/P_{out} vs E", nbinp2D, 0., pmax, nbineop2D, 0., eopmaxsht);
865  h_ele_EeleOPout = new TH1F("h_ele_EeleOPout", "ele E_{ele}/P_{out}", nbineop, 0., eopmax);
866  h_ele_EeleOPout->Sumw2();
867  h_ele_EeleOPout_eg = new TH1F("h_ele_EeleOPout_eg", "ele E_{ele}/P_{out}, ecal driven", nbineop, 0., eopmax);
868  h_ele_EeleOPout_eg->Sumw2();
869  h_ele_EeleOPout_barrel = new TH1F("h_ele_EeleOPout_barrel", "ele E_{ele}/P_{out} barrel", nbineop, 0., eopmax);
870  h_ele_EeleOPout_barrel->Sumw2();
872  new TH1F("h_ele_EeleOPout_eg_barrel", "ele E_{ele}/P_{out}, ecal driven, barrel", nbineop, 0., eopmax);
873  h_ele_EeleOPout_eg_barrel->Sumw2();
874  h_ele_EeleOPout_endcaps = new TH1F("h_ele_EeleOPout_endcaps", "ele E_{ele}/P_{out} endcaps", nbineop, 0., eopmax);
875  h_ele_EeleOPout_endcaps->Sumw2();
877  new TH1F("h_ele_EeleOPout_eg_endcaps", "ele E_{ele}/P_{out}, ecal driven, endcaps", nbineop, 0., eopmax);
879  h_ele_EeleOPoutVsEta = new TH2F(
880  "h_ele_EeleOPoutVsEta", "ele E_{ele}/P_{out} vs eta", nbineta2D, etamin, etamax, nbineop2D, 0., eopmaxsht);
881  h_ele_EeleOPoutVsPhi = new TH2F(
882  "h_ele_EeleOPoutVsPhi", "ele E_{ele}/P_{out} vs phi", nbinphi2D, phimin, phimax, nbineop2D, 0., eopmaxsht);
884  new TH2F("h_ele_EeleOPoutVsE", "ele E_{ele}/P_{out} vs E", nbinp2D, 0., pmax, nbineop2D, 0., eopmaxsht);
885  h_ele_dEtaSc_propVtx = new TH1F(
886  "h_ele_dEtaSc_propVtx", "ele #eta_{sc} - #eta_{tr}, prop from vertex", nbindetamatch, detamatchmin, detamatchmax);
887  h_ele_dEtaSc_propVtx->Sumw2();
888  h_ele_dEtaSc_propVtx_eg = new TH1F("h_ele_dEtaSc_propVtx_eg",
889  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven",
891  detamatchmin,
892  detamatchmax);
893  h_ele_dEtaSc_propVtx_eg->Sumw2();
894  h_ele_dEtaSc_propVtx_barrel = new TH1F("h_ele_dEtaSc_propVtx_barrel",
895  "ele #eta_{sc} - #eta_{tr}, prop from vertex, barrel",
897  detamatchmin,
898  detamatchmax);
900  h_ele_dEtaSc_propVtx_eg_barrel = new TH1F("h_ele_dEtaSc_propVtx_eg_barrel",
901  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, barrel",
903  detamatchmin,
904  detamatchmax);
906  h_ele_dEtaSc_propVtx_endcaps = new TH1F("h_ele_dEtaSc_propVtx_endcaps",
907  "ele #eta_{sc} - #eta_{tr}, prop from vertex, endcaps",
909  detamatchmin,
910  detamatchmax);
912  h_ele_dEtaSc_propVtx_eg_endcaps = new TH1F("h_ele_dEtaSc_propVtx_eg_endcaps",
913  "ele #eta_{sc} - #eta_{tr}, prop from vertex, ecal driven, endcaps",
915  detamatchmin,
916  detamatchmax);
918  h_ele_dEtaScVsEta_propVtx = new TH2F("h_ele_dEtaScVsEta_propVtx",
919  "ele #eta_{sc} - #eta_{tr} vs eta, prop from vertex",
920  nbineta2D,
921  etamin,
922  etamax,
924  detamatchmin,
925  detamatchmax);
926  h_ele_dEtaScVsPhi_propVtx = new TH2F("h_ele_dEtaScVsPhi_propVtx",
927  "ele #eta_{sc} - #eta_{tr} vs phi, prop from vertex",
928  nbinphi2D,
929  phimin,
930  phimax,
932  detamatchmin,
933  detamatchmax);
934  h_ele_dEtaScVsPt_propVtx = new TH2F("h_ele_dEtaScVsPt_propVtx",
935  "ele #eta_{sc} - #eta_{tr} vs pt, prop from vertex",
936  nbinpt2D,
937  0.,
938  ptmax,
940  detamatchmin,
941  detamatchmax);
942  h_ele_dPhiSc_propVtx = new TH1F(
943  "h_ele_dPhiSc_propVtx", "ele #phi_{sc} - #phi_{tr}, prop from vertex", nbindphimatch, dphimatchmin, dphimatchmax);
944  h_ele_dPhiSc_propVtx->Sumw2();
945  h_ele_dPhiSc_propVtx_eg = new TH1F("h_ele_dPhiSc_propVtx_eg",
946  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven",
948  dphimatchmin,
949  dphimatchmax);
950  h_ele_dPhiSc_propVtx_eg->Sumw2();
951  h_ele_dPhiSc_propVtx_barrel = new TH1F("h_ele_dPhiSc_propVtx_barrel",
952  "ele #phi_{sc} - #phi_{tr}, prop from vertex, barrel",
954  dphimatchmin,
955  dphimatchmax);
957  h_ele_dPhiSc_propVtx_eg_barrel = new TH1F("h_ele_dPhiSc_propVtx_eg_barrel",
958  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, barrel",
960  dphimatchmin,
961  dphimatchmax);
963  h_ele_dPhiSc_propVtx_endcaps = new TH1F("h_ele_dPhiSc_propVtx_endcaps",
964  "ele #phi_{sc} - #phi_{tr}, prop from vertex, endcaps",
966  dphimatchmin,
967  dphimatchmax);
969  h_ele_dPhiSc_propVtx_eg_endcaps = new TH1F("h_ele_dPhiSc_propVtx_eg_endcaps",
970  "ele #phi_{sc} - #phi_{tr}, prop from vertex, ecal driven, endcaps",
972  dphimatchmin,
973  dphimatchmax);
975  h_ele_dPhiScVsEta_propVtx = new TH2F("h_ele_dPhiScVsEta_propVtx",
976  "ele #phi_{sc} - #phi_{tr} vs eta, prop from vertex",
977  nbineta2D,
978  etamin,
979  etamax,
981  dphimatchmin,
982  dphimatchmax);
983  h_ele_dPhiScVsPhi_propVtx = new TH2F("h_ele_dPhiScVsPhi_propVtx",
984  "ele #phi_{sc} - #phi_{tr} vs phi, prop from vertex",
985  nbinphi2D,
986  phimin,
987  phimax,
989  dphimatchmin,
990  dphimatchmax);
991  h_ele_dPhiScVsPt_propVtx = new TH2F("h_ele_dPhiScVsPt_propVtx",
992  "ele #phi_{sc} - #phi_{tr} vs pt, prop from vertex",
993  nbinpt2D,
994  0.,
995  ptmax,
997  dphimatchmin,
998  dphimatchmax);
999  h_ele_dEtaCl_propOut = new TH1F("h_ele_dEtaCl_propOut",
1000  "ele #eta_{cl} - #eta_{tr}, prop from outermost",
1001  nbindetamatch,
1002  detamatchmin,
1003  detamatchmax);
1004  h_ele_dEtaCl_propOut->Sumw2();
1005  h_ele_dEtaCl_propOut_eg = new TH1F("h_ele_dEtaCl_propOut_eg",
1006  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven",
1007  nbindetamatch,
1008  detamatchmin,
1009  detamatchmax);
1010  h_ele_dEtaCl_propOut_eg->Sumw2();
1011  h_ele_dEtaCl_propOut_barrel = new TH1F("h_ele_dEtaCl_propOut_barrel",
1012  "ele #eta_{cl} - #eta_{tr}, prop from outermost, barrel",
1013  nbindetamatch,
1014  detamatchmin,
1015  detamatchmax);
1016  h_ele_dEtaCl_propOut_barrel->Sumw2();
1017  h_ele_dEtaCl_propOut_eg_barrel = new TH1F("h_ele_dEtaCl_propOut_eg_barrel",
1018  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1019  nbindetamatch,
1020  detamatchmin,
1021  detamatchmax);
1023  h_ele_dEtaCl_propOut_endcaps = new TH1F("h_ele_dEtaCl_propOut_endcaps",
1024  "ele #eta_{cl} - #eta_{tr}, prop from outermost, endcaps",
1025  nbindetamatch,
1026  detamatchmin,
1027  detamatchmax);
1029  h_ele_dEtaCl_propOut_eg_endcaps = new TH1F("h_ele_dEtaCl_propOut_eg_endcaps",
1030  "ele #eta_{cl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1031  nbindetamatch,
1032  detamatchmin,
1033  detamatchmax);
1035  h_ele_dEtaClVsEta_propOut = new TH2F("h_ele_dEtaClVsEta_propOut",
1036  "ele #eta_{cl} - #eta_{tr} vs eta, prop from out",
1037  nbineta2D,
1038  etamin,
1039  etamax,
1041  detamatchmin,
1042  detamatchmax);
1043  h_ele_dEtaClVsPhi_propOut = new TH2F("h_ele_dEtaClVsPhi_propOut",
1044  "ele #eta_{cl} - #eta_{tr} vs phi, prop from out",
1045  nbinphi2D,
1046  phimin,
1047  phimax,
1049  detamatchmin,
1050  detamatchmax);
1051  h_ele_dEtaClVsPt_propOut = new TH2F("h_ele_dEtaScVsPt_propOut",
1052  "ele #eta_{cl} - #eta_{tr} vs pt, prop from out",
1053  nbinpt2D,
1054  0.,
1055  ptmax,
1057  detamatchmin,
1058  detamatchmax);
1059  h_ele_dPhiCl_propOut = new TH1F("h_ele_dPhiCl_propOut",
1060  "ele #phi_{cl} - #phi_{tr}, prop from outermost",
1061  nbindphimatch,
1062  dphimatchmin,
1063  dphimatchmax);
1064  h_ele_dPhiCl_propOut->Sumw2();
1065  h_ele_dPhiCl_propOut_eg = new TH1F("h_ele_dPhiCl_propOut_eg",
1066  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven",
1067  nbindphimatch,
1068  dphimatchmin,
1069  dphimatchmax);
1070  h_ele_dPhiCl_propOut_eg->Sumw2();
1071  h_ele_dPhiCl_propOut_barrel = new TH1F("h_ele_dPhiCl_propOut_barrel",
1072  "ele #phi_{cl} - #phi_{tr}, prop from outermost, barrel",
1073  nbindphimatch,
1074  dphimatchmin,
1075  dphimatchmax);
1076  h_ele_dPhiCl_propOut_barrel->Sumw2();
1077  h_ele_dPhiCl_propOut_eg_barrel = new TH1F("h_ele_dPhiCl_propOut_eg_barrel",
1078  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1079  nbindphimatch,
1080  dphimatchmin,
1081  dphimatchmax);
1083  h_ele_dPhiCl_propOut_endcaps = new TH1F("h_ele_dPhiCl_propOut_endcaps",
1084  "ele #phi_{cl} - #phi_{tr}, prop from outermost, endcaps",
1085  nbindphimatch,
1086  dphimatchmin,
1087  dphimatchmax);
1089  h_ele_dPhiCl_propOut_eg_endcaps = new TH1F("h_ele_dPhiCl_propOut_eg_endcaps",
1090  "ele #phi_{cl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1091  nbindphimatch,
1092  dphimatchmin,
1093  dphimatchmax);
1095  h_ele_dPhiClVsEta_propOut = new TH2F("h_ele_dPhiClVsEta_propOut",
1096  "ele #phi_{cl} - #phi_{tr} vs eta, prop from out",
1097  nbineta2D,
1098  etamin,
1099  etamax,
1101  dphimatchmin,
1102  dphimatchmax);
1103  h_ele_dPhiClVsPhi_propOut = new TH2F("h_ele_dPhiClVsPhi_propOut",
1104  "ele #phi_{cl} - #phi_{tr} vs phi, prop from out",
1105  nbinphi2D,
1106  phimin,
1107  phimax,
1109  dphimatchmin,
1110  dphimatchmax);
1111  h_ele_dPhiClVsPt_propOut = new TH2F("h_ele_dPhiSClsPt_propOut",
1112  "ele #phi_{cl} - #phi_{tr} vs pt, prop from out",
1113  nbinpt2D,
1114  0.,
1115  ptmax,
1117  dphimatchmin,
1118  dphimatchmax);
1119  h_ele_dEtaEleCl_propOut = new TH1F("h_ele_dEtaEleCl_propOut",
1120  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost",
1121  nbindetamatch,
1122  detamatchmin,
1123  detamatchmax);
1124  h_ele_dEtaEleCl_propOut->Sumw2();
1125  h_ele_dEtaEleCl_propOut_eg = new TH1F("h_ele_dEtaEleCl_propOut_eg",
1126  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven",
1127  nbindetamatch,
1128  detamatchmin,
1129  detamatchmax);
1130  h_ele_dEtaEleCl_propOut_eg->Sumw2();
1131  h_ele_dEtaEleCl_propOut_barrel = new TH1F("h_ele_dEtaEleCl_propOut_barrel",
1132  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, barrel",
1133  nbindetamatch,
1134  detamatchmin,
1135  detamatchmax);
1137  h_ele_dEtaEleCl_propOut_eg_barrel = new TH1F("h_ele_dEtaEleCl_propOut_eg_barrel",
1138  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, barrel",
1139  nbindetamatch,
1140  detamatchmin,
1141  detamatchmax);
1143  h_ele_dEtaEleCl_propOut_endcaps = new TH1F("h_ele_dEtaEleCl_propOut_endcaps",
1144  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, endcaps",
1145  nbindetamatch,
1146  detamatchmin,
1147  detamatchmax);
1150  new TH1F("h_ele_dEtaEleCl_propOut_eg_endcaps",
1151  "ele #eta_{EleCl} - #eta_{tr}, prop from outermost, ecal driven, endcaps",
1152  nbindetamatch,
1153  detamatchmin,
1154  detamatchmax);
1156  h_ele_dEtaEleClVsEta_propOut = new TH2F("h_ele_dEtaEleClVsEta_propOut",
1157  "ele #eta_{EleCl} - #eta_{tr} vs eta, prop from out",
1158  nbineta2D,
1159  etamin,
1160  etamax,
1162  detamatchmin,
1163  detamatchmax);
1164  h_ele_dEtaEleClVsPhi_propOut = new TH2F("h_ele_dEtaEleClVsPhi_propOut",
1165  "ele #eta_{EleCl} - #eta_{tr} vs phi, prop from out",
1166  nbinphi2D,
1167  phimin,
1168  phimax,
1170  detamatchmin,
1171  detamatchmax);
1172  h_ele_dEtaEleClVsPt_propOut = new TH2F("h_ele_dEtaScVsPt_propOut",
1173  "ele #eta_{EleCl} - #eta_{tr} vs pt, prop from out",
1174  nbinpt2D,
1175  0.,
1176  ptmax,
1178  detamatchmin,
1179  detamatchmax);
1180  h_ele_dPhiEleCl_propOut = new TH1F("h_ele_dPhiEleCl_propOut",
1181  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost",
1182  nbindphimatch,
1183  dphimatchmin,
1184  dphimatchmax);
1185  h_ele_dPhiEleCl_propOut->Sumw2();
1186  h_ele_dPhiEleCl_propOut_eg = new TH1F("h_ele_dPhiEleCl_propOut_eg",
1187  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven",
1188  nbindphimatch,
1189  dphimatchmin,
1190  dphimatchmax);
1191  h_ele_dPhiEleCl_propOut_eg->Sumw2();
1192  h_ele_dPhiEleCl_propOut_barrel = new TH1F("h_ele_dPhiEleCl_propOut_barrel",
1193  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, barrel",
1194  nbindphimatch,
1195  dphimatchmin,
1196  dphimatchmax);
1198  h_ele_dPhiEleCl_propOut_eg_barrel = new TH1F("h_ele_dPhiEleCl_propOut_eg_barrel",
1199  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, barrel",
1200  nbindphimatch,
1201  dphimatchmin,
1202  dphimatchmax);
1204  h_ele_dPhiEleCl_propOut_endcaps = new TH1F("h_ele_dPhiEleCl_propOut_endcaps",
1205  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, endcaps",
1206  nbindphimatch,
1207  dphimatchmin,
1208  dphimatchmax);
1211  new TH1F("h_ele_dPhiEleCl_propOut_eg_endcaps",
1212  "ele #phi_{EleCl} - #phi_{tr}, prop from outermost, ecal driven, endcaps",
1213  nbindphimatch,
1214  dphimatchmin,
1215  dphimatchmax);
1217  h_ele_dPhiEleClVsEta_propOut = new TH2F("h_ele_dPhiEleClVsEta_propOut",
1218  "ele #phi_{EleCl} - #phi_{tr} vs eta, prop from out",
1219  nbineta2D,
1220  etamin,
1221  etamax,
1223  dphimatchmin,
1224  dphimatchmax);
1225  h_ele_dPhiEleClVsPhi_propOut = new TH2F("h_ele_dPhiEleClVsPhi_propOut",
1226  "ele #phi_{EleCl} - #phi_{tr} vs phi, prop from out",
1227  nbinphi2D,
1228  phimin,
1229  phimax,
1231  dphimatchmin,
1232  dphimatchmax);
1233  h_ele_dPhiEleClVsPt_propOut = new TH2F("h_ele_dPhiSEleClsPt_propOut",
1234  "ele #phi_{EleCl} - #phi_{tr} vs pt, prop from out",
1235  nbinpt2D,
1236  0.,
1237  ptmax,
1239  dphimatchmin,
1240  dphimatchmax);
1241 
1242  h_ele_HoE = new TH1F("h_ele_HoE", "ele hadronic energy / em energy", nbinhoe, hoemin, hoemax);
1243  h_ele_HoE->Sumw2();
1244  h_ele_HoE_eg = new TH1F("h_ele_HoE_eg", "ele hadronic energy / em energy, ecal driven", nbinhoe, hoemin, hoemax);
1245  h_ele_HoE_eg->Sumw2();
1246  h_ele_HoE_barrel = new TH1F("h_ele_HoE_barrel", "ele hadronic energy / em energy, barrel", nbinhoe, hoemin, hoemax);
1247  h_ele_HoE_barrel->Sumw2();
1249  new TH1F("h_ele_HoE_eg_barrel", "ele hadronic energy / em energy, ecal driven, barrel", nbinhoe, hoemin, hoemax);
1250  h_ele_HoE_eg_barrel->Sumw2();
1252  new TH1F("h_ele_HoE_endcaps", "ele hadronic energy / em energy, endcaps", nbinhoe, hoemin, hoemax);
1253  h_ele_HoE_endcaps->Sumw2();
1254  h_ele_HoE_eg_endcaps = new TH1F(
1255  "h_ele_HoE_eg_endcaps", "ele hadronic energy / em energy, ecal driven, endcaps", nbinhoe, hoemin, hoemax);
1256  h_ele_HoE_eg_endcaps->Sumw2();
1257  h_ele_HoE_fiducial = new TH1F("h_ele_HoE_fiducial", "ele hadronic energy / em energy", nbinhoe, hoemin, hoemax);
1258  h_ele_HoEVsEta = new TH2F(
1259  "h_ele_HoEVsEta", "ele hadronic energy / em energy vs eta", nbineta, etamin, etamax, nbinhoe, hoemin, hoemax);
1260  h_ele_HoEVsPhi = new TH2F(
1261  "h_ele_HoEVsPhi", "ele hadronic energy / em energy vs phi", nbinphi2D, phimin, phimax, nbinhoe, hoemin, hoemax);
1262  h_ele_HoEVsE =
1263  new TH2F("h_ele_HoEVsE", "ele hadronic energy / em energy vs E", nbinp, 0., 300., nbinhoe, hoemin, hoemax);
1264 
1265  h_ele_seed_dphi2_ = new TH1F("h_ele_seedDphi2", "ele seed dphi 2nd layer", 50, -0.003, +0.003);
1267  new TH2F("h_ele_seedDphi2VsEta", "ele seed dphi 2nd layer vs eta", nbineta2D, etamin, etamax, 50, -0.003, +0.003);
1269  new TH2F("h_ele_seedDphi2VsPt", "ele seed dphi 2nd layer vs pt", nbinpt2D, 0., ptmax, 50, -0.003, +0.003);
1270  h_ele_seed_drz2_ = new TH1F("h_ele_seedDrz2", "ele seed dr/dz 2nd layer", 50, -0.03, +0.03);
1272  new TH2F("h_ele_seedDrz2VsEta", "ele seed dr/dz 2nd layer vs eta", nbineta2D, etamin, etamax, 50, -0.03, +0.03);
1274  new TH2F("h_ele_seedDrz2VsPt", "ele seed dr/dz 2nd layer vs pt", nbinpt2D, 0., ptmax, 50, -0.03, +0.03);
1275  h_ele_seed_subdet2_ = new TH1F("h_ele_seedSubdet2", "ele seed subdet 2nd layer", 10, 0., 10.);
1276 
1277  // classes
1278  h_ele_classes = new TH1F("h_ele_classes", "electron classes", 20, 0.0, 20.);
1279  h_ele_eta = new TH1F("h_ele_eta", "ele electron eta", nbineta / 2, 0.0, etamax);
1280  h_ele_eta_golden = new TH1F("h_ele_eta_golden", "ele electron eta golden", nbineta / 2, 0.0, etamax);
1281  h_ele_eta_bbrem = new TH1F("h_ele_eta_bbrem", "ele electron eta bbrem", nbineta / 2, 0.0, etamax);
1282  h_ele_eta_narrow = new TH1F("h_ele_eta_narrow", "ele electron eta narrow", nbineta / 2, 0.0, etamax);
1283  h_ele_eta_shower = new TH1F("h_ele_eta_show", "el, electron eta showering", nbineta / 2, 0.0, etamax);
1284  h_ele_PinVsPoutGolden_mode = new TH2F(
1285  "h_ele_PinVsPoutGolden_mode", "ele track inner p vs outer p, golden, mode", nbinp2D, 0., pmax, 50, 0., pmax);
1286  h_ele_PinVsPoutShowering_mode = new TH2F("h_ele_PinVsPoutShowering_mode",
1287  "ele track inner p vs outer p vs eta, showering, mode",
1288  nbinp2D,
1289  0.,
1290  pmax,
1291  50,
1292  0.,
1293  pmax);
1294  h_ele_PinVsPoutGolden_mean = new TH2F(
1295  "h_ele_PinVsPoutGolden_mean", "ele track inner p vs outer p, golden, mean", nbinp2D, 0., pmax, 50, 0., pmax);
1296  h_ele_PinVsPoutShowering_mean = new TH2F(
1297  "h_ele_PinVsPoutShowering_mean", "ele track inner p vs outer p, showering, mean", nbinp2D, 0., pmax, 50, 0., pmax);
1298  h_ele_PtinVsPtoutGolden_mode = new TH2F("h_ele_PtinVsPtoutGolden_mode",
1299  "ele track inner pt vs outer pt, golden, mode",
1300  nbinpt2D,
1301  0.,
1302  ptmax,
1303  50,
1304  0.,
1305  ptmax);
1306  h_ele_PtinVsPtoutShowering_mode = new TH2F("h_ele_PtinVsPtoutShowering_mode",
1307  "ele track inner pt vs outer pt, showering, mode",
1308  nbinpt2D,
1309  0.,
1310  ptmax,
1311  50,
1312  0.,
1313  ptmax);
1314  h_ele_PtinVsPtoutGolden_mean = new TH2F("h_ele_PtinVsPtoutGolden_mean",
1315  "ele track inner pt vs outer pt, golden, mean",
1316  nbinpt2D,
1317  0.,
1318  ptmax,
1319  50,
1320  0.,
1321  ptmax);
1322  h_ele_PtinVsPtoutShowering_mean = new TH2F("h_ele_PtinVsPtoutShowering_mean",
1323  "ele track inner pt vs outer pt, showering, mean",
1324  nbinpt2D,
1325  0.,
1326  ptmax,
1327  50,
1328  0.,
1329  ptmax);
1331  "h_scl_EoEmatchingObject golden, barrel", "ele SC energy over matching jet energy, golden, barrel", 100, 0.2, 1.2);
1332  histSclEoEmatchingObjectGolden_endcaps = new TH1F("h_scl_EoEmatchingObject golden, endcaps",
1333  "ele SC energy over matching jet energy, golden, endcaps",
1334  100,
1335  0.2,
1336  1.2);
1337  histSclEoEmatchingObjectShowering_barrel = new TH1F("h_scl_EoEmatchingObject showering, barrel",
1338  "ele SC energy over matching jet energy, showering, barrel",
1339  100,
1340  0.2,
1341  1.2);
1342  histSclEoEmatchingObjectShowering_endcaps = new TH1F("h_scl_EoEmatchingObject showering, endcaps",
1343  "ele SC energy over matching jet energy, showering, endcaps",
1344  100,
1345  0.2,
1346  1.2);
1347 
1348  // isolation
1349  h_ele_tkSumPt_dr03 = new TH1F("h_ele_tkSumPt_dr03", "tk isolation sum, dR=0.3", 100, 0.0, 20.);
1350  h_ele_ecalRecHitSumEt_dr03 = new TH1F("h_ele_ecalRecHitSumEt_dr03", "ecal isolation sum, dR=0.3", 100, 0.0, 20.);
1352  new TH1F("h_ele_hcalDepth1TowerSumEt_dr03", "hcal depth1 isolation sum, dR=0.3", 100, 0.0, 20.);
1354  new TH1F("h_ele_hcalDepth2TowerSumEt_dr03", "hcal depth2 isolation sum, dR=0.3", 100, 0.0, 20.);
1355  h_ele_tkSumPt_dr04 = new TH1F("h_ele_tkSumPt_dr04", "hcal isolation sum", 100, 0.0, 20.);
1356  h_ele_ecalRecHitSumEt_dr04 = new TH1F("h_ele_ecalRecHitSumEt_dr04", "ecal isolation sum, dR=0.4", 100, 0.0, 20.);
1358  new TH1F("h_ele_hcalDepth1TowerSumEt_dr04", "hcal depth1 isolation sum, dR=0.4", 100, 0.0, 20.);
1360  new TH1F("h_ele_hcalDepth2TowerSumEt_dr04", "hcal depth2 isolation sum, dR=0.4", 100, 0.0, 20.);
1361 
1362  // fbrem
1363  h_ele_fbrem = new TH1F("h_ele_fbrem", "ele brem fraction, mode", 100, 0., 1.);
1365  new TProfile("h_ele_fbremvsEtamode", "mean ele brem fraction vs eta, mode", nbineta2D, etamin, etamax, 0., 1.);
1367  new TProfile("h_ele_fbremvsEtamean", "mean ele brem fraction vs eta, mean", nbineta2D, etamin, etamax, 0., 1.);
1368 
1369  // e/g et pflow electrons
1370  h_ele_mva = new TH1F("h_ele_mva", "ele mva", 100, -1., 1.);
1371  h_ele_provenance = new TH1F("h_ele_provenance", "ele provenance", 5, -2., 3.);
1372 
1373  // histos titles
1374  h_matchingObjectNum->GetXaxis()->SetTitle("N_{GenJet}");
1375  h_matchingObjectNum->GetYaxis()->SetTitle("Events");
1376  h_matchingObjectEta->GetXaxis()->SetTitle("#eta_{GenJet}");
1377  h_matchingObjectEta->GetYaxis()->SetTitle("Events");
1378  h_matchingObjectP->GetXaxis()->SetTitle("E_{GenJet} (GeV)");
1379  h_matchingObjectP->GetYaxis()->SetTitle("Events");
1380  h_ele_foundHits->GetXaxis()->SetTitle("N_{hits}");
1381  h_ele_foundHits->GetYaxis()->SetTitle("Events");
1382  h_ele_ambiguousTracks->GetXaxis()->SetTitle("N_{ambiguous tracks}");
1383  h_ele_ambiguousTracks->GetYaxis()->SetTitle("Events");
1384  h_ele_lostHits->GetXaxis()->SetTitle("N_{lost hits}");
1385  h_ele_lostHits->GetYaxis()->SetTitle("Events");
1386  h_ele_chi2->GetXaxis()->SetTitle("#Chi^{2}");
1387  h_ele_chi2->GetYaxis()->SetTitle("Events");
1388  h_ele_charge->GetXaxis()->SetTitle("charge");
1389  h_ele_charge->GetYaxis()->SetTitle("Events");
1390  h_ele_vertexP->GetXaxis()->SetTitle("p_{vertex} (GeV/c)");
1391  h_ele_vertexP->GetYaxis()->SetTitle("Events");
1392  h_ele_vertexPt->GetXaxis()->SetTitle("p_{T vertex} (GeV/c)");
1393  h_ele_vertexPt->GetYaxis()->SetTitle("Events");
1394  h_ele_vertexEta->GetXaxis()->SetTitle("#eta");
1395  h_ele_vertexEta->GetYaxis()->SetTitle("Events");
1396  h_ele_vertexPhi->GetXaxis()->SetTitle("#phi (rad)");
1397  h_ele_vertexPhi->GetYaxis()->SetTitle("Events");
1398  h_ele_PoPmatchingObject->GetXaxis()->SetTitle("P/P_{gen jet}");
1399  h_ele_PoPmatchingObject->GetYaxis()->SetTitle("Events");
1400  h_ele_PoPmatchingObject_barrel->GetXaxis()->SetTitle("P/P_{gen jet}");
1401  h_ele_PoPmatchingObject_barrel->GetYaxis()->SetTitle("Events");
1402  h_ele_PoPmatchingObject_endcaps->GetXaxis()->SetTitle("P/P_{gen jet}");
1403  h_ele_PoPmatchingObject_endcaps->GetYaxis()->SetTitle("Events");
1404  histSclSigIEtaIEta_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1405  histSclSigIEtaIEta_->GetYaxis()->SetTitle("Events");
1406  histSclSigIEtaIEta_barrel_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1407  histSclSigIEtaIEta_barrel_->GetYaxis()->SetTitle("Events");
1408  histSclSigIEtaIEta_endcaps_->GetXaxis()->SetTitle("#sigma_{i#eta i#eta}");
1409  histSclSigIEtaIEta_endcaps_->GetYaxis()->SetTitle("Events");
1410  histSclE1x5_->GetXaxis()->SetTitle("E1x5 (GeV)");
1411  histSclE1x5_->GetYaxis()->SetTitle("Events");
1412  histSclE1x5_barrel_->GetXaxis()->SetTitle("E1x5 (GeV)");
1413  histSclE1x5_barrel_->GetYaxis()->SetTitle("Events");
1414  histSclE1x5_endcaps_->GetXaxis()->SetTitle("E1x5 (GeV)");
1415  histSclE1x5_endcaps_->GetYaxis()->SetTitle("Events");
1416  histSclE2x5max_->GetXaxis()->SetTitle("E2x5 (GeV)");
1417  histSclE2x5max_->GetYaxis()->SetTitle("Events");
1418  histSclE2x5max_barrel_->GetXaxis()->SetTitle("E2x5 (GeV)");
1419  histSclE2x5max_barrel_->GetYaxis()->SetTitle("Events");
1420  histSclE2x5max_endcaps_->GetXaxis()->SetTitle("E2x5 (GeV)");
1421  histSclE2x5max_endcaps_->GetYaxis()->SetTitle("Events");
1422  histSclE5x5_->GetXaxis()->SetTitle("E5x5 (GeV)");
1423  histSclE5x5_->GetYaxis()->SetTitle("Events");
1424  histSclE5x5_barrel_->GetXaxis()->SetTitle("E5x5 (GeV)");
1425  histSclE5x5_barrel_->GetYaxis()->SetTitle("Events");
1426  histSclE5x5_endcaps_->GetXaxis()->SetTitle("E5x5 (GeV)");
1427  histSclE5x5_endcaps_->GetYaxis()->SetTitle("Events");
1428  h_ele_EtaMnEtamatchingObject->GetXaxis()->SetTitle("#eta_{rec} - #eta_{jet}");
1429  h_ele_EtaMnEtamatchingObject->GetYaxis()->SetTitle("Events");
1430  h_ele_PhiMnPhimatchingObject->GetXaxis()->SetTitle("#phi_{rec} - #phi_{jet} (rad)");
1431  h_ele_PhiMnPhimatchingObject->GetYaxis()->SetTitle("Events");
1432  h_ele_PinMnPout->GetXaxis()->SetTitle("P_{vertex} - P_{out} (GeV/c)");
1433  h_ele_PinMnPout->GetYaxis()->SetTitle("Events");
1434  h_ele_PinMnPout_mode->GetXaxis()->SetTitle("P_{vertex} - P_{out}, mode (GeV/c)");
1435  h_ele_PinMnPout_mode->GetYaxis()->SetTitle("Events");
1436  h_ele_outerP->GetXaxis()->SetTitle("P_{out} (GeV/c)");
1437  h_ele_outerP->GetYaxis()->SetTitle("Events");
1438  h_ele_outerP_mode->GetXaxis()->SetTitle("P_{out} (GeV/c)");
1439  h_ele_outerP_mode->GetYaxis()->SetTitle("Events");
1440  h_ele_outerPt->GetXaxis()->SetTitle("P_{T out} (GeV/c)");
1441  h_ele_outerPt->GetYaxis()->SetTitle("Events");
1442  h_ele_outerPt_mode->GetXaxis()->SetTitle("P_{T out} (GeV/c)");
1443  h_ele_outerPt_mode->GetYaxis()->SetTitle("Events");
1444  h_ele_EoP->GetXaxis()->SetTitle("E/P_{vertex}");
1445  h_ele_EoP->GetYaxis()->SetTitle("Events");
1446  h_ele_EseedOP->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1447  h_ele_EseedOP->GetYaxis()->SetTitle("Events");
1448  h_ele_EoPout->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1449  h_ele_EoPout->GetYaxis()->SetTitle("Events");
1450  h_ele_EeleOPout->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1451  h_ele_EeleOPout->GetYaxis()->SetTitle("Events");
1452  h_ele_EoP_barrel->GetXaxis()->SetTitle("E/P_{vertex}");
1453  h_ele_EoP_barrel->GetYaxis()->SetTitle("Events");
1454  h_ele_EseedOP_barrel->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1455  h_ele_EseedOP_barrel->GetYaxis()->SetTitle("Events");
1456  h_ele_EoPout_barrel->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1457  h_ele_EoPout_barrel->GetYaxis()->SetTitle("Events");
1458  h_ele_EeleOPout_barrel->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1459  h_ele_EeleOPout_barrel->GetYaxis()->SetTitle("Events");
1460  h_ele_EoP_endcaps->GetXaxis()->SetTitle("E/P_{vertex}");
1461  h_ele_EoP_endcaps->GetYaxis()->SetTitle("Events");
1462  h_ele_EseedOP_endcaps->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1463  h_ele_EseedOP_endcaps->GetYaxis()->SetTitle("Events");
1464  h_ele_EoPout_endcaps->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1465  h_ele_EoPout_endcaps->GetYaxis()->SetTitle("Events");
1466  h_ele_EeleOPout_endcaps->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1467  h_ele_EeleOPout_endcaps->GetYaxis()->SetTitle("Events");
1468  h_ele_vertexX->GetXaxis()->SetTitle("x (cm)");
1469  h_ele_vertexX->GetYaxis()->SetTitle("Events");
1470  h_ele_vertexY->GetXaxis()->SetTitle("y (cm)");
1471  h_ele_vertexY->GetYaxis()->SetTitle("Events");
1472  h_ele_vertexZ->GetXaxis()->SetTitle("z (cm)");
1473  h_ele_vertexZ->GetYaxis()->SetTitle("Events");
1474  h_ele_vertexTIP->GetXaxis()->SetTitle("TIP (cm)");
1475  h_ele_vertexTIP->GetYaxis()->SetTitle("Events");
1476  h_ele_TIP_all->GetXaxis()->SetTitle("r_{T} (cm)");
1477  h_ele_TIP_all->GetYaxis()->SetTitle("Events");
1478  h_ele_vertexTIPVsEta->GetYaxis()->SetTitle("TIP (cm)");
1479  h_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
1480  h_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("TIP (cm)");
1481  h_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1482  h_ele_vertexTIPVsPt->GetYaxis()->SetTitle("TIP (cm)");
1483  h_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1484  h_ele_dEtaSc_propVtx->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1485  h_ele_dEtaSc_propVtx->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1486  h_ele_dEtaSc_propVtx->GetYaxis()->SetTitle("Events");
1487  h_ele_dEtaCl_propOut->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
1488  h_ele_dEtaCl_propOut->GetYaxis()->SetTitle("Events");
1489  h_ele_dEtaEleCl_propOut->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
1490  h_ele_dEtaEleCl_propOut->GetYaxis()->SetTitle("Events");
1491  h_ele_dPhiSc_propVtx->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1492  h_ele_dPhiSc_propVtx->GetYaxis()->SetTitle("Events");
1493  h_ele_dPhiCl_propOut->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
1494  h_ele_dPhiCl_propOut->GetYaxis()->SetTitle("Events");
1495  h_ele_dPhiEleCl_propOut->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
1496  h_ele_dPhiEleCl_propOut->GetYaxis()->SetTitle("Events");
1497  h_ele_dEtaSc_propVtx_barrel->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1498  h_ele_dEtaSc_propVtx_barrel->GetYaxis()->SetTitle("Events");
1499  h_ele_dEtaCl_propOut_barrel->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
1500  h_ele_dEtaCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1501  h_ele_dEtaEleCl_propOut_barrel->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
1502  h_ele_dEtaEleCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1503  h_ele_dPhiSc_propVtx_barrel->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1504  h_ele_dPhiSc_propVtx_barrel->GetYaxis()->SetTitle("Events");
1505  h_ele_dPhiCl_propOut_barrel->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
1506  h_ele_dPhiCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1507  h_ele_dPhiEleCl_propOut_barrel->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
1508  h_ele_dPhiEleCl_propOut_barrel->GetYaxis()->SetTitle("Events");
1509  h_ele_dEtaSc_propVtx_endcaps->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1510  h_ele_dEtaSc_propVtx_endcaps->GetYaxis()->SetTitle("Events");
1511  h_ele_dEtaCl_propOut_endcaps->GetXaxis()->SetTitle("#eta_{seedcl} - #eta_{tr}");
1512  h_ele_dEtaCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1513  h_ele_dEtaEleCl_propOut_endcaps->GetXaxis()->SetTitle("#eta_{elecl} - #eta_{tr}");
1514  h_ele_dEtaEleCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1515  h_ele_dPhiSc_propVtx_endcaps->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1516  h_ele_dPhiSc_propVtx_endcaps->GetYaxis()->SetTitle("Events");
1517  h_ele_dPhiCl_propOut_endcaps->GetXaxis()->SetTitle("#phi_{seedcl} - #phi_{tr} (rad)");
1518  h_ele_dPhiCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1519  h_ele_dPhiEleCl_propOut_endcaps->GetXaxis()->SetTitle("#phi_{elecl} - #phi_{tr} (rad)");
1520  h_ele_dPhiEleCl_propOut_endcaps->GetYaxis()->SetTitle("Events");
1521  h_ele_HoE->GetXaxis()->SetTitle("H/E");
1522  h_ele_HoE->GetYaxis()->SetTitle("Events");
1523  h_ele_HoE_barrel->GetXaxis()->SetTitle("H/E");
1524  h_ele_HoE_barrel->GetYaxis()->SetTitle("Events");
1525  h_ele_HoE_endcaps->GetXaxis()->SetTitle("H/E");
1526  h_ele_HoE_endcaps->GetYaxis()->SetTitle("Events");
1527  h_ele_HoE_fiducial->GetXaxis()->SetTitle("H/E");
1528  h_ele_HoE_fiducial->GetYaxis()->SetTitle("Events");
1529  h_ele_fbrem->GetXaxis()->SetTitle("P_{in} - P_{out} / P_{in}");
1530  h_ele_fbrem->GetYaxis()->SetTitle("Events");
1531  h_ele_seed_dphi2_->GetXaxis()->SetTitle("#phi_{hit}-#phi_{pred} (rad)");
1532  h_ele_seed_dphi2_->GetYaxis()->SetTitle("Events");
1533  h_ele_seed_drz2_->GetXaxis()->SetTitle("r(z)_{hit}-r(z)_{pred} (cm)");
1534  h_ele_seed_drz2_->GetYaxis()->SetTitle("Events");
1535  h_ele_seed_subdet2_->GetXaxis()->SetTitle("2nd hit subdet Id");
1536  h_ele_seed_subdet2_->GetYaxis()->SetTitle("Events");
1537  h_ele_classes->GetXaxis()->SetTitle("class Id");
1538  h_ele_classes->GetYaxis()->SetTitle("Events");
1539  h_ele_EoverP_all->GetXaxis()->SetTitle("E/P_{vertex}");
1540  h_ele_EoverP_all->GetYaxis()->SetTitle("Events");
1541  h_ele_EseedOP_all->GetXaxis()->SetTitle("E_{seed}/P_{vertex}");
1542  h_ele_EseedOP_all->GetYaxis()->SetTitle("Events");
1543  h_ele_EoPout_all->GetXaxis()->SetTitle("E_{seed}/P_{out}");
1544  h_ele_EoPout_all->GetYaxis()->SetTitle("Events");
1545  h_ele_EeleOPout_all->GetXaxis()->SetTitle("E_{ele}/P_{out}");
1546  h_ele_EeleOPout_all->GetYaxis()->SetTitle("Events");
1547  h_ele_dEtaSc_propVtx_all->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1548  h_ele_dEtaSc_propVtx_all->GetYaxis()->SetTitle("Events");
1549  h_ele_dPhiSc_propVtx_all->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1550  h_ele_dPhiSc_propVtx_all->GetYaxis()->SetTitle("Events");
1551  h_ele_dEtaCl_propOut_all->GetXaxis()->SetTitle("#eta_{sc} - #eta_{tr}");
1552  h_ele_dEtaCl_propOut_all->GetYaxis()->SetTitle("Events");
1553  h_ele_dPhiCl_propOut_all->GetXaxis()->SetTitle("#phi_{sc} - #phi_{tr} (rad)");
1554  h_ele_dPhiCl_propOut_all->GetYaxis()->SetTitle("Events");
1555  h_ele_HoE_all->GetXaxis()->SetTitle("H/E");
1556  h_ele_HoE_all->GetYaxis()->SetTitle("Events");
1557  h_ele_mee_all->GetXaxis()->SetTitle("m_{ee} (GeV/c^{2})");
1558  h_ele_mee_all->GetYaxis()->SetTitle("Events");
1559  h_ele_mee_os->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1560  h_ele_mee_os->GetYaxis()->SetTitle("Events");
1561  h_ele_E2mnE1vsMee_all->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1562  h_ele_E2mnE1vsMee_all->GetYaxis()->SetTitle("E2 - E1 (GeV)");
1563  h_ele_E2mnE1vsMee_egeg_all->GetXaxis()->SetTitle("m_{e^{+}e^{-}} (GeV/c^{2})");
1564  h_ele_E2mnE1vsMee_egeg_all->GetYaxis()->SetTitle("E2 - E1 (GeV)");
1565  histNum_->GetXaxis()->SetTitle("N_{ele}");
1566  histNum_->GetYaxis()->SetTitle("Events");
1567  h_ele_fbremVsEta_mode->GetXaxis()->SetTitle("#eta");
1568  h_ele_fbremVsEta_mean->GetXaxis()->SetTitle("#eta");
1569 }
1570 
1572  histfile_->cd();
1573  std::cout << "efficiency calculation " << std::endl;
1574  // efficiency vs eta
1575  TH1F *h_ele_etaEff = (TH1F *)h_ele_matchingObjectEta_matched->Clone("h_ele_etaEff");
1576  h_ele_etaEff->Reset();
1577  h_ele_etaEff->Divide(h_ele_matchingObjectEta_matched, h_matchingObjectEta, 1, 1, "b");
1578  h_ele_etaEff->Print();
1579  h_ele_etaEff->GetXaxis()->SetTitle("#eta");
1580  h_ele_etaEff->GetYaxis()->SetTitle("Efficiency");
1581 
1582  // efficiency vs z
1583  TH1F *h_ele_zEff = (TH1F *)h_ele_matchingObjectZ_matched->Clone("h_ele_zEff");
1584  h_ele_zEff->Reset();
1585  h_ele_zEff->Divide(h_ele_matchingObjectZ_matched, h_matchingObjectZ, 1, 1, "b");
1586  h_ele_zEff->Print();
1587  h_ele_zEff->GetXaxis()->SetTitle("z (cm)");
1588  h_ele_zEff->GetYaxis()->SetTitle("Efficiency");
1589 
1590  // efficiency vs |eta|
1591  TH1F *h_ele_absetaEff = (TH1F *)h_ele_matchingObjectAbsEta_matched->Clone("h_ele_absetaEff");
1592  h_ele_absetaEff->Reset();
1593  h_ele_absetaEff->Divide(h_ele_matchingObjectAbsEta_matched, h_matchingObjectAbsEta, 1, 1, "b");
1594  h_ele_absetaEff->GetXaxis()->SetTitle("|#eta|");
1595  h_ele_absetaEff->GetYaxis()->SetTitle("Efficiency");
1596 
1597  // efficiency vs pt
1598  TH1F *h_ele_ptEff = (TH1F *)h_ele_matchingObjectPt_matched->Clone("h_ele_ptEff");
1599  h_ele_ptEff->Reset();
1600  h_ele_ptEff->Divide(h_ele_matchingObjectPt_matched, h_matchingObjectPt, 1, 1, "b");
1601  h_ele_ptEff->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1602  h_ele_ptEff->GetYaxis()->SetTitle("Efficiency");
1603 
1604  // efficiency vs phi
1605  TH1F *h_ele_phiEff = (TH1F *)h_ele_matchingObjectPhi_matched->Clone("h_ele_phiEff");
1606  h_ele_phiEff->Reset();
1607  h_ele_phiEff->Divide(h_ele_matchingObjectPhi_matched, h_matchingObjectPhi, 1, 1, "b");
1608  h_ele_phiEff->GetXaxis()->SetTitle("#phi (rad)");
1609  h_ele_phiEff->GetYaxis()->SetTitle("Efficiency");
1610 
1611  // rec/matching objects all electrons
1612  TH1F *h_ele_etaEff_all = (TH1F *)h_ele_vertexEta_all->Clone("h_ele_etaEff_all");
1613  h_ele_etaEff_all->Reset();
1614  h_ele_etaEff_all->Divide(h_ele_vertexEta_all, h_matchingObjectEta, 1, 1, "b");
1615  h_ele_etaEff_all->Print();
1616  h_ele_etaEff_all->GetXaxis()->SetTitle("#eta");
1617  h_ele_etaEff_all->GetYaxis()->SetTitle("N_{rec}/N_{matching jet}");
1618 
1619  TH1F *h_ele_ptEff_all = (TH1F *)h_ele_vertexPt_all->Clone("h_ele_ptEff_all");
1620  h_ele_ptEff_all->Reset();
1621  h_ele_ptEff_all->Divide(h_ele_vertexPt_all, h_matchingObjectPt, 1, 1, "b");
1622  h_ele_ptEff_all->Print();
1623  h_ele_ptEff_all->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1624  h_ele_ptEff_all->GetYaxis()->SetTitle("N_{rec}/N_{matching gen jet}");
1625 
1626  // classes
1627  TH1F *h_ele_eta_goldenFrac = (TH1F *)h_ele_eta_golden->Clone("h_ele_eta_goldenFrac");
1628  h_ele_eta_goldenFrac->Reset();
1629  h_ele_eta_goldenFrac->GetXaxis()->SetTitle("|#eta|");
1630  h_ele_eta_goldenFrac->GetYaxis()->SetTitle("Fraction of electrons");
1631  h_ele_eta_goldenFrac->Divide(h_ele_eta_golden, h_ele_eta, 1, 1);
1632  h_ele_eta_goldenFrac->SetTitle("fraction of golden electrons vs eta");
1633  TH1F *h_ele_eta_bbremFrac = (TH1F *)h_ele_eta_bbrem->Clone("h_ele_eta_bbremFrac");
1634  h_ele_eta_bbremFrac->Reset();
1635  h_ele_eta_bbremFrac->Divide(h_ele_eta_bbrem, h_ele_eta, 1, 1);
1636  h_ele_eta_bbremFrac->GetXaxis()->SetTitle("|#eta|");
1637  h_ele_eta_bbremFrac->GetYaxis()->SetTitle("Fraction of electrons");
1638  h_ele_eta_bbremFrac->SetTitle("fraction of big brem electrons vs eta");
1639  TH1F *h_ele_eta_narrowFrac = (TH1F *)h_ele_eta_narrow->Clone("h_ele_eta_narrowFrac");
1640  h_ele_eta_narrowFrac->Reset();
1641  h_ele_eta_narrowFrac->Divide(h_ele_eta_narrow, h_ele_eta, 1, 1);
1642  h_ele_eta_narrowFrac->GetXaxis()->SetTitle("|#eta|");
1643  h_ele_eta_narrowFrac->GetYaxis()->SetTitle("Fraction of electrons");
1644  h_ele_eta_narrowFrac->SetTitle("fraction of narrow electrons vs eta");
1645  TH1F *h_ele_eta_showerFrac = (TH1F *)h_ele_eta_shower->Clone("h_ele_eta_showerFrac");
1646  h_ele_eta_showerFrac->Reset();
1647  h_ele_eta_showerFrac->Divide(h_ele_eta_shower, h_ele_eta, 1, 1);
1648  h_ele_eta_showerFrac->GetXaxis()->SetTitle("|#eta|");
1649  h_ele_eta_showerFrac->GetYaxis()->SetTitle("Fraction of electrons");
1650  h_ele_eta_showerFrac->SetTitle("fraction of showering electrons vs eta");
1651 
1652  // fbrem
1653  TH1F *h_ele_xOverX0VsEta = new TH1F("h_ele_xOverx0VsEta", "mean X/X_0 vs eta", nbineta / 2, 0.0, 2.5);
1654  for (int ibin = 1; ibin < h_ele_fbremVsEta_mean->GetNbinsX() + 1; ibin++) {
1655  double xOverX0 = 0.;
1656  if (h_ele_fbremVsEta_mean->GetBinContent(ibin) > 0.)
1657  xOverX0 = -log(h_ele_fbremVsEta_mean->GetBinContent(ibin));
1658  h_ele_xOverX0VsEta->SetBinContent(ibin, xOverX0);
1659  }
1660 
1661  //profiles from 2D histos
1662  TProfile *p_ele_PoPmatchingObjectVsEta = h_ele_PoPmatchingObjectVsEta->ProfileX();
1663  p_ele_PoPmatchingObjectVsEta->SetTitle("mean ele momentum / matching SC energy vs eta");
1664  p_ele_PoPmatchingObjectVsEta->GetXaxis()->SetTitle("#eta");
1665  p_ele_PoPmatchingObjectVsEta->GetYaxis()->SetTitle("<P/E_{matching gen jet}>");
1666  p_ele_PoPmatchingObjectVsEta->Write();
1667  TProfile *p_ele_PoPmatchingObjectVsPhi = h_ele_PoPmatchingObjectVsPhi->ProfileX();
1668  p_ele_PoPmatchingObjectVsPhi->SetTitle("mean ele momentum / gen momentum vs phi");
1669  p_ele_PoPmatchingObjectVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1670  p_ele_PoPmatchingObjectVsPhi->GetYaxis()->SetTitle("<P/E_{matching gen jet}>");
1671  p_ele_PoPmatchingObjectVsPhi->Write();
1672  TProfile *p_ele_EtaMnEtamatchingObjectVsEta = h_ele_EtaMnEtamatchingObjectVsEta->ProfileX();
1673  p_ele_EtaMnEtamatchingObjectVsEta->GetXaxis()->SetTitle("#eta");
1674  p_ele_EtaMnEtamatchingObjectVsEta->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{matching gen jet}>");
1675  p_ele_EtaMnEtamatchingObjectVsEta->Write();
1676  TProfile *p_ele_EtaMnEtamatchingObjectVsPhi = h_ele_EtaMnEtamatchingObjectVsPhi->ProfileX();
1677  p_ele_EtaMnEtamatchingObjectVsPhi->GetXaxis()->SetTitle("#phi");
1678  p_ele_EtaMnEtamatchingObjectVsPhi->GetYaxis()->SetTitle("<#eta_{rec} - #eta_{matching gen jet}>");
1679  p_ele_EtaMnEtamatchingObjectVsPhi->Write();
1680  TProfile *p_ele_PhiMnPhimatchingObjectVsEta = h_ele_PhiMnPhimatchingObjectVsEta->ProfileX();
1681  p_ele_PhiMnPhimatchingObjectVsEta->GetXaxis()->SetTitle("#eta");
1682  p_ele_PhiMnPhimatchingObjectVsEta->GetYaxis()->SetTitle("<#phi_{rec} - #phi_{matching gen jet}> (rad)");
1683  p_ele_PhiMnPhimatchingObjectVsEta->Write();
1684  TProfile *p_ele_PhiMnPhimatchingObjectVsPhi = h_ele_PhiMnPhimatchingObjectVsPhi->ProfileX();
1685  p_ele_PhiMnPhimatchingObjectVsPhi->GetXaxis()->SetTitle("#phi");
1686  p_ele_PhiMnPhimatchingObjectVsPhi->GetYaxis()->SetTitle("<#phi_{rec} - #phi_{matching gen jet}> (rad)");
1687  p_ele_PhiMnPhimatchingObjectVsPhi->Write();
1688  TProfile *p_ele_vertexPtVsEta = h_ele_vertexPtVsEta->ProfileX();
1689  p_ele_vertexPtVsEta->GetXaxis()->SetTitle("#eta");
1690  p_ele_vertexPtVsEta->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
1691  p_ele_vertexPtVsEta->Write();
1692  TProfile *p_ele_vertexPtVsPhi = h_ele_vertexPtVsPhi->ProfileX();
1693  p_ele_vertexPtVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1694  p_ele_vertexPtVsPhi->GetYaxis()->SetTitle("<p_{T}> (GeV/c)");
1695  p_ele_vertexPtVsPhi->Write();
1696  TProfile *p_ele_EoPVsEta = h_ele_EoPVsEta->ProfileX();
1697  p_ele_EoPVsEta->GetXaxis()->SetTitle("#eta");
1698  p_ele_EoPVsEta->GetYaxis()->SetTitle("<E/P_{vertex}>");
1699  p_ele_EoPVsEta->Write();
1700  TProfile *p_ele_EoPVsPhi = h_ele_EoPVsPhi->ProfileX();
1701  p_ele_EoPVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1702  p_ele_EoPVsPhi->GetYaxis()->SetTitle("<E/P_{vertex}>");
1703  p_ele_EoPVsPhi->Write();
1704  TProfile *p_ele_EoPoutVsEta = h_ele_EoPoutVsEta->ProfileX();
1705  p_ele_EoPoutVsEta->GetXaxis()->SetTitle("#eta");
1706  p_ele_EoPoutVsEta->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
1707  p_ele_EoPoutVsEta->Write();
1708  TProfile *p_ele_EoPoutVsPhi = h_ele_EoPoutVsPhi->ProfileX();
1709  p_ele_EoPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1710  p_ele_EoPoutVsPhi->GetYaxis()->SetTitle("<E_{seed}/P_{out}>");
1711  p_ele_EoPoutVsPhi->Write();
1712  TProfile *p_ele_EeleOPoutVsEta = h_ele_EeleOPoutVsEta->ProfileX();
1713  p_ele_EeleOPoutVsEta->SetTitle("mean ele Eele/pout vs eta");
1714  p_ele_EeleOPoutVsEta->GetXaxis()->SetTitle("#eta");
1715  p_ele_EeleOPoutVsEta->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
1716  p_ele_EeleOPoutVsEta->Write();
1717  TProfile *p_ele_EeleOPoutVsPhi = h_ele_EeleOPoutVsPhi->ProfileX();
1718  p_ele_EeleOPoutVsPhi->SetTitle("mean ele Eele/pout vs phi");
1719  p_ele_EeleOPoutVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1720  p_ele_EeleOPoutVsPhi->GetYaxis()->SetTitle("<E_{ele}/P_{out}>");
1721  p_ele_EeleOPoutVsPhi->Write();
1722  TProfile *p_ele_HoEVsEta = h_ele_HoEVsEta->ProfileX();
1723  p_ele_HoEVsEta->GetXaxis()->SetTitle("#eta");
1724  p_ele_HoEVsEta->GetYaxis()->SetTitle("<H/E>");
1725  p_ele_HoEVsEta->Write();
1726  TProfile *p_ele_HoEVsPhi = h_ele_HoEVsPhi->ProfileX();
1727  p_ele_HoEVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1728  p_ele_HoEVsPhi->GetYaxis()->SetTitle("<H/E>");
1729  p_ele_HoEVsPhi->Write();
1730  TProfile *p_ele_chi2VsEta = h_ele_chi2VsEta->ProfileX();
1731  p_ele_chi2VsEta->GetXaxis()->SetTitle("#eta");
1732  p_ele_chi2VsEta->GetYaxis()->SetTitle("<#Chi^{2}>");
1733  p_ele_chi2VsEta->Write();
1734  TProfile *p_ele_chi2VsPhi = h_ele_chi2VsPhi->ProfileX();
1735  p_ele_chi2VsPhi->GetXaxis()->SetTitle("#phi (rad)");
1736  p_ele_chi2VsPhi->GetYaxis()->SetTitle("<#Chi^{2}>");
1737  p_ele_chi2VsPhi->Write();
1738  TProfile *p_ele_foundHitsVsEta = h_ele_foundHitsVsEta->ProfileX();
1739  p_ele_foundHitsVsEta->GetXaxis()->SetTitle("#eta");
1740  p_ele_foundHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
1741  p_ele_foundHitsVsEta->Write();
1742  TProfile *p_ele_foundHitsVsPhi = h_ele_foundHitsVsPhi->ProfileX();
1743  p_ele_foundHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1744  p_ele_foundHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
1745  p_ele_foundHitsVsPhi->Write();
1746  TProfile *p_ele_lostHitsVsEta = h_ele_lostHitsVsEta->ProfileX();
1747  p_ele_lostHitsVsEta->GetXaxis()->SetTitle("#eta");
1748  p_ele_lostHitsVsEta->GetYaxis()->SetTitle("<N_{hits}>");
1749  p_ele_lostHitsVsEta->Write();
1750  TProfile *p_ele_lostHitsVsPhi = h_ele_lostHitsVsPhi->ProfileX();
1751  p_ele_lostHitsVsPhi->GetXaxis()->SetTitle("#phi (rad)");
1752  p_ele_lostHitsVsPhi->GetYaxis()->SetTitle("<N_{hits}>");
1753  p_ele_lostHitsVsPhi->Write();
1754  TProfile *p_ele_vertexTIPVsEta = h_ele_vertexTIPVsEta->ProfileX();
1755  p_ele_vertexTIPVsEta->SetTitle("mean tip (wrt gen vtx) vs eta");
1756  p_ele_vertexTIPVsEta->GetXaxis()->SetTitle("#eta");
1757  p_ele_vertexTIPVsEta->GetYaxis()->SetTitle("<TIP> (cm)");
1758  p_ele_vertexTIPVsEta->Write();
1759  TProfile *p_ele_vertexTIPVsPhi = h_ele_vertexTIPVsPhi->ProfileX();
1760  p_ele_vertexTIPVsPhi->SetTitle("mean tip (wrt gen vtx) vs phi");
1761  p_ele_vertexTIPVsPhi->GetXaxis()->SetTitle("#phi");
1762  p_ele_vertexTIPVsPhi->GetYaxis()->SetTitle("<TIP> (cm)");
1763  p_ele_vertexTIPVsPhi->Write();
1764  TProfile *p_ele_vertexTIPVsPt = h_ele_vertexTIPVsPt->ProfileX();
1765  p_ele_vertexTIPVsPt->SetTitle("mean tip (wrt gen vtx) vs phi");
1766  p_ele_vertexTIPVsPt->GetXaxis()->SetTitle("p_{T} (GeV/c)");
1767  p_ele_vertexTIPVsPt->GetYaxis()->SetTitle("<TIP> (cm)");
1768  p_ele_vertexTIPVsPt->Write();
1769 
1770  // mc truth
1771 
1772  h_matchingObjectNum->Write();
1773 
1774  // rec event
1775 
1776  histNum_->Write();
1777 
1778  // mc
1779  h_matchingObjectEta->Write();
1780  h_matchingObjectAbsEta->Write();
1781  h_matchingObjectP->Write();
1782  h_matchingObjectPt->Write();
1783  h_matchingObjectPhi->Write();
1784  h_matchingObjectZ->Write();
1785 
1786  // all electrons
1787  h_ele_EoverP_all->Write();
1788  h_ele_EseedOP_all->Write();
1789  h_ele_EoPout_all->Write();
1790  h_ele_EeleOPout_all->Write();
1791  h_ele_dEtaSc_propVtx_all->Write();
1792  h_ele_dPhiSc_propVtx_all->Write();
1793  h_ele_dEtaCl_propOut_all->Write();
1794  h_ele_dPhiCl_propOut_all->Write();
1795  h_ele_HoE_all->Write();
1796  h_ele_TIP_all->Write();
1797  h_ele_vertexPt_all->Write();
1798  h_ele_vertexEta_all->Write();
1799  h_ele_mee_all->Write();
1800  h_ele_mee_os->Write();
1801  h_ele_E2mnE1vsMee_all->Write();
1802  h_ele_E2mnE1vsMee_egeg_all->Write();
1803 
1804  // matched electrons
1805  h_ele_charge->Write();
1806  h_ele_chargeVsEta->Write();
1807  h_ele_chargeVsPhi->Write();
1808  h_ele_chargeVsPt->Write();
1809  h_ele_vertexP->Write();
1810  h_ele_vertexPt->Write();
1811  h_ele_vertexPtVsEta->Write();
1812  h_ele_vertexPtVsPhi->Write();
1814  h_ele_vertexEta->Write();
1815  h_ele_vertexEtaVsPhi->Write();
1818  h_ele_vertexPhi->Write();
1820  h_ele_vertexX->Write();
1821  h_ele_vertexY->Write();
1822  h_ele_vertexZ->Write();
1823  h_ele_vertexTIP->Write();
1825  h_ele_vertexTIPVsEta->Write();
1826  h_ele_vertexTIPVsPhi->Write();
1827  h_ele_vertexTIPVsPt->Write();
1828  h_ele_PoPmatchingObject->Write();
1831  h_ele_PoPmatchingObjectVsPt->Write();
1843 
1844  // matched electron, superclusters
1845  histSclEn_->Write();
1848  histSclEt_->Write();
1849  histSclEtVsEta_->Write();
1850  histSclEtVsPhi_->Write();
1851  histSclEtaVsPhi_->Write();
1852  histSclEta_->Write();
1853  histSclPhi_->Write();
1854  histSclSigIEtaIEta_->Write();
1855  histSclSigIEtaIEta_barrel_->Write();
1856  histSclSigIEtaIEta_endcaps_->Write();
1857  histSclE1x5_->Write();
1858  histSclE1x5_barrel_->Write();
1859  histSclE1x5_endcaps_->Write();
1860  histSclE2x5max_->Write();
1861  histSclE2x5max_barrel_->Write();
1862  histSclE2x5max_endcaps_->Write();
1863  histSclE5x5_->Write();
1864  histSclE5x5_barrel_->Write();
1865  histSclE5x5_endcaps_->Write();
1866 
1867  // matched electron, gsf tracks
1868  h_ele_ambiguousTracks->Write();
1869  h_ele_ambiguousTracksVsEta->Write();
1870  h_ele_ambiguousTracksVsPhi->Write();
1871  h_ele_ambiguousTracksVsPt->Write();
1872  h_ele_foundHits->Write();
1873  h_ele_foundHitsVsEta->Write();
1874  h_ele_foundHitsVsPhi->Write();
1875  h_ele_foundHitsVsPt->Write();
1876  h_ele_lostHits->Write();
1877  h_ele_lostHitsVsEta->Write();
1878  h_ele_lostHitsVsPhi->Write();
1879  h_ele_lostHitsVsPt->Write();
1880  h_ele_chi2->Write();
1881  h_ele_chi2VsEta->Write();
1882  h_ele_chi2VsPhi->Write();
1883  h_ele_chi2VsPt->Write();
1884  h_ele_PinMnPout->Write();
1885  h_ele_PinMnPout_mode->Write();
1886  h_ele_PinMnPoutVsEta_mode->Write();
1887  h_ele_PinMnPoutVsPhi_mode->Write();
1888  h_ele_PinMnPoutVsPt_mode->Write();
1889  h_ele_PinMnPoutVsE_mode->Write();
1890  h_ele_PinMnPoutVsChi2_mode->Write();
1891  h_ele_outerP->Write();
1892  h_ele_outerP_mode->Write();
1893  h_ele_outerPVsEta_mode->Write();
1894  h_ele_outerPt->Write();
1895  h_ele_outerPt_mode->Write();
1896  h_ele_outerPtVsEta_mode->Write();
1897  h_ele_outerPtVsPhi_mode->Write();
1898  h_ele_outerPtVsPt_mode->Write();
1899 
1900  // matched electrons, matching
1901  h_ele_EoP->Write();
1902  h_ele_EoP_eg->Write();
1903  h_ele_EoP_barrel->Write();
1904  h_ele_EoP_eg_barrel->Write();
1905  h_ele_EoP_endcaps->Write();
1906  h_ele_EoP_eg_endcaps->Write();
1907  h_ele_EoPVsEta->Write();
1908  h_ele_EoPVsPhi->Write();
1909  h_ele_EoPVsE->Write();
1910  h_ele_EseedOP->Write();
1911  h_ele_EseedOP_eg->Write();
1912  h_ele_EseedOP_barrel->Write();
1913  h_ele_EseedOP_eg_barrel->Write();
1914  h_ele_EseedOP_endcaps->Write();
1915  h_ele_EseedOP_eg_endcaps->Write();
1916  h_ele_EseedOPVsEta->Write();
1917  h_ele_EseedOPVsPhi->Write();
1918  h_ele_EseedOPVsE->Write();
1919  h_ele_EoPout->Write();
1920  h_ele_EoPout_eg->Write();
1921  h_ele_EoPout_barrel->Write();
1922  h_ele_EoPout_eg_barrel->Write();
1923  h_ele_EoPout_endcaps->Write();
1924  h_ele_EoPout_eg_endcaps->Write();
1925  h_ele_EoPoutVsEta->Write();
1926  h_ele_EoPoutVsPhi->Write();
1927  h_ele_EoPoutVsE->Write();
1928  h_ele_EeleOPout->Write();
1929  h_ele_EeleOPout_eg->Write();
1930  h_ele_EeleOPout_barrel->Write();
1931  h_ele_EeleOPout_eg_barrel->Write();
1932  h_ele_EeleOPout_endcaps->Write();
1933  h_ele_EeleOPout_eg_endcaps->Write();
1934  h_ele_EeleOPoutVsEta->Write();
1935  h_ele_EeleOPoutVsPhi->Write();
1936  h_ele_EeleOPoutVsE->Write();
1937  h_ele_dEtaSc_propVtx->Write();
1938  h_ele_dEtaSc_propVtx_eg->Write();
1939  h_ele_dEtaSc_propVtx_barrel->Write();
1943  h_ele_dEtaScVsEta_propVtx->Write();
1944  h_ele_dEtaScVsPhi_propVtx->Write();
1945  h_ele_dEtaScVsPt_propVtx->Write();
1946  h_ele_dPhiSc_propVtx->Write();
1947  h_ele_dPhiSc_propVtx_eg->Write();
1948  h_ele_dPhiSc_propVtx_barrel->Write();
1952  h_ele_dPhiScVsEta_propVtx->Write();
1953  h_ele_dPhiScVsPhi_propVtx->Write();
1954  h_ele_dPhiScVsPt_propVtx->Write();
1955  h_ele_dEtaCl_propOut->Write();
1956  h_ele_dEtaCl_propOut_eg->Write();
1957  h_ele_dEtaCl_propOut_barrel->Write();
1961  h_ele_dEtaClVsEta_propOut->Write();
1962  h_ele_dEtaClVsPhi_propOut->Write();
1963  h_ele_dEtaClVsPt_propOut->Write();
1964  h_ele_dPhiCl_propOut->Write();
1965  h_ele_dPhiCl_propOut_eg->Write();
1966  h_ele_dPhiCl_propOut_barrel->Write();
1970  h_ele_dPhiClVsEta_propOut->Write();
1971  h_ele_dPhiClVsPhi_propOut->Write();
1972  h_ele_dPhiClVsPt_propOut->Write();
1973  h_ele_dEtaEleCl_propOut->Write();
1974  h_ele_dEtaEleCl_propOut_eg->Write();
1981  h_ele_dEtaEleClVsPt_propOut->Write();
1982  h_ele_dPhiEleCl_propOut->Write();
1983  h_ele_dPhiEleCl_propOut_eg->Write();
1990  h_ele_dPhiEleClVsPt_propOut->Write();
1991  h_ele_HoE->Write();
1992  h_ele_HoE_eg->Write();
1993  h_ele_HoE_barrel->Write();
1994  h_ele_HoE_eg_barrel->Write();
1995  h_ele_HoE_endcaps->Write();
1996  h_ele_HoE_eg_endcaps->Write();
1997  h_ele_HoE_fiducial->Write();
1998  h_ele_HoEVsEta->Write();
1999  h_ele_HoEVsPhi->Write();
2000  h_ele_HoEVsE->Write();
2001 
2002  h_ele_seed_dphi2_->Write();
2003  h_ele_seed_subdet2_->Write();
2004  TProfile *p_ele_seed_dphi2VsEta_ = h_ele_seed_dphi2VsEta_->ProfileX();
2005  p_ele_seed_dphi2VsEta_->SetTitle("mean ele seed dphi 2nd layer vs eta");
2006  p_ele_seed_dphi2VsEta_->GetXaxis()->SetTitle("#eta");
2007  p_ele_seed_dphi2VsEta_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2008  p_ele_seed_dphi2VsEta_->SetMinimum(-0.004);
2009  p_ele_seed_dphi2VsEta_->SetMaximum(0.004);
2010  p_ele_seed_dphi2VsEta_->Write();
2011  TProfile *p_ele_seed_dphi2VsPt_ = h_ele_seed_dphi2VsPt_->ProfileX();
2012  p_ele_seed_dphi2VsPt_->SetTitle("mean ele seed dphi 2nd layer vs pt");
2013  p_ele_seed_dphi2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2014  p_ele_seed_dphi2VsPt_->GetYaxis()->SetTitle("<#phi_{pred} - #phi_{hit}, 2nd layer> (rad)");
2015  p_ele_seed_dphi2VsPt_->SetMinimum(-0.004);
2016  p_ele_seed_dphi2VsPt_->SetMaximum(0.004);
2017  p_ele_seed_dphi2VsPt_->Write();
2018  h_ele_seed_drz2_->Write();
2019  TProfile *p_ele_seed_drz2VsEta_ = h_ele_seed_drz2VsEta_->ProfileX();
2020  p_ele_seed_drz2VsEta_->SetTitle("mean ele seed dr(dz) 2nd layer vs eta");
2021  p_ele_seed_drz2VsEta_->GetXaxis()->SetTitle("#eta");
2022  p_ele_seed_drz2VsEta_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2023  p_ele_seed_drz2VsEta_->SetMinimum(-0.15);
2024  p_ele_seed_drz2VsEta_->SetMaximum(0.15);
2025  p_ele_seed_drz2VsEta_->Write();
2026  TProfile *p_ele_seed_drz2VsPt_ = h_ele_seed_drz2VsPt_->ProfileX();
2027  p_ele_seed_drz2VsPt_->SetTitle("mean ele seed dr(dz) 2nd layer vs pt");
2028  p_ele_seed_drz2VsPt_->GetXaxis()->SetTitle("p_{T} (GeV/c)");
2029  p_ele_seed_drz2VsPt_->GetYaxis()->SetTitle("<r(z)_{pred} - r(z)_{hit}, 2nd layer> (cm)");
2030  p_ele_seed_drz2VsPt_->SetMinimum(-0.15);
2031  p_ele_seed_drz2VsPt_->SetMaximum(0.15);
2032  p_ele_seed_drz2VsPt_->Write();
2033 
2034  // classes
2035  h_ele_classes->Write();
2036  h_ele_eta->Write();
2037  h_ele_eta_golden->Write();
2038  h_ele_eta_bbrem->Write();
2039  h_ele_eta_narrow->Write();
2040  h_ele_eta_shower->Write();
2041  h_ele_PinVsPoutGolden_mode->Write();
2043  h_ele_PinVsPoutGolden_mean->Write();
2053 
2054  // fbrem
2055  h_ele_fbrem->Write();
2056  h_ele_fbremVsEta_mode->Write();
2057  h_ele_fbremVsEta_mean->Write();
2058  h_ele_etaEff->Write();
2059  h_ele_zEff->Write();
2060  h_ele_phiEff->Write();
2061  h_ele_absetaEff->Write();
2062  h_ele_ptEff->Write();
2063  h_ele_etaEff_all->Write();
2064  h_ele_ptEff_all->Write();
2065  h_ele_eta_goldenFrac->Write();
2066  h_ele_eta_bbremFrac->Write();
2067  h_ele_eta_narrowFrac->Write();
2068  h_ele_eta_showerFrac->Write();
2069  h_ele_xOverX0VsEta->Write();
2070 
2071  // e/g et pflow electrons
2072  h_ele_mva->Write();
2073  h_ele_provenance->Write();
2074 
2075  // isolation
2076  h_ele_tkSumPt_dr03->GetXaxis()->SetTitle("TkIsoSum, cone 0.3 (GeV/c)");
2077  h_ele_tkSumPt_dr03->GetYaxis()->SetTitle("Events");
2078  h_ele_tkSumPt_dr03->Write();
2079  h_ele_ecalRecHitSumEt_dr03->GetXaxis()->SetTitle("EcalIsoSum, cone 0.3 (GeV)");
2080  h_ele_ecalRecHitSumEt_dr03->GetYaxis()->SetTitle("Events");
2081  h_ele_ecalRecHitSumEt_dr03->Write();
2082  h_ele_hcalDepth1TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.3 (GeV)");
2083  h_ele_hcalDepth1TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
2085  h_ele_hcalDepth2TowerSumEt_dr03->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.3 (GeV)");
2086  h_ele_hcalDepth2TowerSumEt_dr03->GetYaxis()->SetTitle("Events");
2088  h_ele_tkSumPt_dr04->GetXaxis()->SetTitle("TkIsoSum, cone 0.4 (GeV/c)");
2089  h_ele_tkSumPt_dr04->GetYaxis()->SetTitle("Events");
2090  h_ele_tkSumPt_dr04->Write();
2091  h_ele_ecalRecHitSumEt_dr04->GetXaxis()->SetTitle("EcalIsoSum, cone 0.4 (GeV)");
2092  h_ele_ecalRecHitSumEt_dr04->GetYaxis()->SetTitle("Events");
2093  h_ele_ecalRecHitSumEt_dr04->Write();
2094  h_ele_hcalDepth1TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal1IsoSum, cone 0.4 (GeV)");
2095  h_ele_hcalDepth1TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
2097  h_ele_hcalDepth2TowerSumEt_dr04->GetXaxis()->SetTitle("Hcal2IsoSum, cone 0.4 (GeV)");
2098  h_ele_hcalDepth2TowerSumEt_dr04->GetYaxis()->SetTitle("Events");
2100 }
2101 
2103  std::cout << "analyzing new event " << std::endl;
2104 
2105  // get reco electrons
2107  iEvent.getByLabel(electronCollection_, gsfElectrons);
2108  edm::LogInfo("") << "\n\n =================> Treating event " << iEvent.id() << " Number of electrons "
2109  << gsfElectrons.product()->size();
2110 
2111  // get gen jets
2113  iEvent.getByLabel(matchingObjectCollection_, genJets);
2114 
2115  // get the beamspot from the Event:
2116  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
2117  iEvent.getByLabel(beamSpot_, recoBeamSpotHandle);
2118  const BeamSpot bs = *recoBeamSpotHandle;
2119 
2120  histNum_->Fill((*gsfElectrons).size());
2121 
2122  // all rec electrons
2123  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin(); gsfIter != gsfElectrons->end();
2124  gsfIter++) {
2125  // preselect electrons
2126  if (gsfIter->pt() > maxPt_ || std::abs(gsfIter->eta()) > maxAbsEta_)
2127  continue;
2128  h_ele_EoverP_all->Fill(gsfIter->eSuperClusterOverP());
2129  h_ele_EseedOP_all->Fill(gsfIter->eSeedClusterOverP());
2130  h_ele_EoPout_all->Fill(gsfIter->eSeedClusterOverPout());
2131  h_ele_EeleOPout_all->Fill(gsfIter->eEleClusterOverPout());
2132  h_ele_dEtaSc_propVtx_all->Fill(gsfIter->deltaEtaSuperClusterTrackAtVtx());
2133  h_ele_dPhiSc_propVtx_all->Fill(gsfIter->deltaPhiSuperClusterTrackAtVtx());
2134  h_ele_dEtaCl_propOut_all->Fill(gsfIter->deltaEtaSeedClusterTrackAtCalo());
2135  h_ele_dPhiCl_propOut_all->Fill(gsfIter->deltaPhiSeedClusterTrackAtCalo());
2136  h_ele_HoE_all->Fill(gsfIter->hadronicOverEm());
2137  double d = gsfIter->vertex().x() * gsfIter->vertex().x() + gsfIter->vertex().y() * gsfIter->vertex().y();
2138  h_ele_TIP_all->Fill(sqrt(d));
2139  h_ele_vertexEta_all->Fill(gsfIter->eta());
2140  h_ele_vertexPt_all->Fill(gsfIter->pt());
2141  float enrj1 = gsfIter->superCluster()->energy();
2142  // mee
2143  for (reco::GsfElectronCollection::const_iterator gsfIter2 = gsfIter + 1; gsfIter2 != gsfElectrons->end();
2144  gsfIter2++) {
2145  math::XYZTLorentzVector p12 = (*gsfIter).p4() + (*gsfIter2).p4();
2146  float mee2 = p12.Dot(p12);
2147  h_ele_mee_all->Fill(sqrt(mee2));
2148  float enrj2 = gsfIter2->superCluster()->energy();
2149  h_ele_E2mnE1vsMee_all->Fill(sqrt(mee2), enrj2 - enrj1);
2150  if (gsfIter->ecalDrivenSeed() && gsfIter2->ecalDrivenSeed())
2151  h_ele_E2mnE1vsMee_egeg_all->Fill(sqrt(mee2), enrj2 - enrj1);
2152  if (gsfIter->charge() * gsfIter2->charge() < 0.)
2153  h_ele_mee_os->Fill(sqrt(mee2));
2154  }
2155  }
2156 
2157  // association matching object-reco electrons
2158  int matchingObjectNum = 0;
2159 
2160  for (reco::GenJetCollection::const_iterator moIter = genJets->begin(); moIter != genJets->end(); ++moIter) {
2161  // number of matching objects
2162  matchingObjectNum++;
2163 
2164  if (moIter->energy() / cosh(moIter->eta()) > maxPt_ || std::abs(moIter->eta()) > maxAbsEta_)
2165  continue;
2166 
2167  // suppress the endcaps
2168  //if (std::abs(moIter->eta()) > 1.5) continue;
2169  // select central z
2170  //if ( std::abs((*mcIter)->production_vertex()->position().z())>50.) continue;
2171 
2172  h_matchingObjectEta->Fill(moIter->eta());
2173  h_matchingObjectAbsEta->Fill(std::abs(moIter->eta()));
2174  h_matchingObjectP->Fill(moIter->energy());
2175  h_matchingObjectPt->Fill(moIter->energy() / cosh(moIter->eta()));
2176  h_matchingObjectPhi->Fill(moIter->phi());
2177  h_matchingObjectZ->Fill(moIter->vz());
2178 
2179  // looking for the best matching gsf electron
2180  bool okGsfFound = false;
2181  double gsfOkRatio = 999999.;
2182 
2183  // find best matched electron
2184  reco::GsfElectron bestGsfElectron;
2185  for (reco::GsfElectronCollection::const_iterator gsfIter = gsfElectrons->begin(); gsfIter != gsfElectrons->end();
2186  gsfIter++) {
2187  double dphi = gsfIter->phi() - moIter->phi();
2188  if (std::abs(dphi) > CLHEP::pi)
2189  dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
2190  double deltaR = sqrt(std::pow((gsfIter->eta() - moIter->eta()), 2) + std::pow(dphi, 2));
2191  if (deltaR < deltaR_) {
2192  //if ( (genPc->pdg_id() == 11) && (gsfIter->charge() < 0.) || (genPc->pdg_id() == -11) &&
2193  //(gsfIter->charge() > 0.) ){
2194  double tmpGsfRatio = gsfIter->p() / moIter->energy();
2195  if (std::abs(tmpGsfRatio - 1) < std::abs(gsfOkRatio - 1)) {
2196  gsfOkRatio = tmpGsfRatio;
2197  bestGsfElectron = *gsfIter;
2198  okGsfFound = true;
2199  }
2200  //}
2201  }
2202  } // loop over rec ele to look for the best one
2203 
2204  // analysis when the matching object is matched by a rec electron
2205  if (okGsfFound) {
2206  // electron related distributions
2207  h_ele_charge->Fill(bestGsfElectron.charge());
2208  h_ele_chargeVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.charge());
2209  h_ele_chargeVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.charge());
2210  h_ele_chargeVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.charge());
2211  h_ele_vertexP->Fill(bestGsfElectron.p());
2212  h_ele_vertexPt->Fill(bestGsfElectron.pt());
2213  h_ele_vertexPtVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.pt());
2214  h_ele_vertexPtVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.pt());
2215  h_ele_vertexEta->Fill(bestGsfElectron.eta());
2216  // generated distributions for matched electrons
2217  h_ele_matchingObjectPt_matched->Fill(moIter->energy() / cosh(moIter->eta()));
2218  h_ele_matchingObjectPhi_matched->Fill(moIter->phi());
2219  h_ele_matchingObjectAbsEta_matched->Fill(std::abs(moIter->eta()));
2220  h_ele_matchingObjectEta_matched->Fill(moIter->eta());
2221  h_ele_vertexEtaVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta());
2222  h_ele_vertexPhi->Fill(bestGsfElectron.phi());
2223  h_ele_vertexX->Fill(bestGsfElectron.vertex().x());
2224  h_ele_vertexY->Fill(bestGsfElectron.vertex().y());
2225  h_ele_vertexZ->Fill(bestGsfElectron.vertex().z());
2226  h_ele_matchingObjectZ_matched->Fill(moIter->vz());
2227  double d =
2228  (bestGsfElectron.vertex().x() - bs.position().x()) * (bestGsfElectron.vertex().x() - bs.position().x()) +
2229  (bestGsfElectron.vertex().y() - bs.position().y()) * (bestGsfElectron.vertex().y() - bs.position().y());
2230  d = sqrt(d);
2231  h_ele_vertexTIP->Fill(d);
2232  h_ele_vertexTIPVsEta->Fill(bestGsfElectron.eta(), d);
2233  h_ele_vertexTIPVsPhi->Fill(bestGsfElectron.phi(), d);
2234  h_ele_vertexTIPVsPt->Fill(bestGsfElectron.pt(), d);
2235  h_ele_EtaMnEtamatchingObject->Fill(bestGsfElectron.eta() - moIter->eta());
2236  h_ele_EtaMnEtamatchingObjectVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eta() - moIter->eta());
2237  h_ele_EtaMnEtamatchingObjectVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eta() - moIter->eta());
2238  h_ele_EtaMnEtamatchingObjectVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.eta() - moIter->eta());
2239  h_ele_PhiMnPhimatchingObject->Fill(bestGsfElectron.phi() - moIter->phi());
2240  h_ele_PhiMnPhimatchingObject2->Fill(bestGsfElectron.phi() - moIter->phi());
2241  h_ele_PhiMnPhimatchingObjectVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.phi() - moIter->phi());
2242  h_ele_PhiMnPhimatchingObjectVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.phi() - moIter->phi());
2243  h_ele_PhiMnPhimatchingObjectVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.phi() - moIter->phi());
2244  h_ele_PoPmatchingObject->Fill(bestGsfElectron.p() / moIter->energy());
2245  h_ele_PoPmatchingObjectVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.p() / moIter->energy());
2246  h_ele_PoPmatchingObjectVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.p() / moIter->energy());
2247  h_ele_PoPmatchingObjectVsPt->Fill(bestGsfElectron.py(), bestGsfElectron.p() / moIter->energy());
2248  if (bestGsfElectron.isEB())
2249  h_ele_PoPmatchingObject_barrel->Fill(bestGsfElectron.p() / moIter->energy());
2250  if (bestGsfElectron.isEE())
2251  h_ele_PoPmatchingObject_endcaps->Fill(bestGsfElectron.p() / moIter->energy());
2252 
2253  // supercluster related distributions
2254  reco::SuperClusterRef sclRef = bestGsfElectron.superCluster();
2255  if (!bestGsfElectron.ecalDrivenSeed() && bestGsfElectron.trackerDrivenSeed())
2256  sclRef = bestGsfElectron.parentSuperCluster();
2257  histSclEn_->Fill(sclRef->energy());
2258  double R = std::sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y() + sclRef->z() * sclRef->z());
2259  double Rt = std::sqrt(sclRef->x() * sclRef->x() + sclRef->y() * sclRef->y());
2260  histSclEt_->Fill(sclRef->energy() * (Rt / R));
2261  histSclEtVsEta_->Fill(sclRef->eta(), sclRef->energy() * (Rt / R));
2262  histSclEtVsPhi_->Fill(sclRef->phi(), sclRef->energy() * (Rt / R));
2263  if (bestGsfElectron.isEB())
2264  histSclEoEmatchingObject_barrel->Fill(sclRef->energy() / moIter->energy());
2265  if (bestGsfElectron.isEE())
2266  histSclEoEmatchingObject_endcaps->Fill(sclRef->energy() / moIter->energy());
2267  histSclEta_->Fill(sclRef->eta());
2268  histSclEtaVsPhi_->Fill(sclRef->phi(), sclRef->eta());
2269  histSclPhi_->Fill(sclRef->phi());
2270  histSclSigIEtaIEta_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2271  if (bestGsfElectron.isEB())
2272  histSclSigIEtaIEta_barrel_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2273  if (bestGsfElectron.isEE())
2274  histSclSigIEtaIEta_endcaps_->Fill(bestGsfElectron.scSigmaIEtaIEta());
2275  histSclE1x5_->Fill(bestGsfElectron.scE1x5());
2276  if (bestGsfElectron.isEB())
2277  histSclE1x5_barrel_->Fill(bestGsfElectron.scE1x5());
2278  if (bestGsfElectron.isEE())
2279  histSclE1x5_endcaps_->Fill(bestGsfElectron.scE1x5());
2280  histSclE2x5max_->Fill(bestGsfElectron.scE2x5Max());
2281  if (bestGsfElectron.isEB())
2282  histSclE2x5max_barrel_->Fill(bestGsfElectron.scE2x5Max());
2283  if (bestGsfElectron.isEE())
2284  histSclE2x5max_endcaps_->Fill(bestGsfElectron.scE2x5Max());
2285  histSclE5x5_->Fill(bestGsfElectron.scE5x5());
2286  if (bestGsfElectron.isEB())
2287  histSclE5x5_barrel_->Fill(bestGsfElectron.scE5x5());
2288  if (bestGsfElectron.isEE())
2289  histSclE5x5_endcaps_->Fill(bestGsfElectron.scE5x5());
2290 
2291  // track related distributions
2292  h_ele_ambiguousTracks->Fill(bestGsfElectron.ambiguousGsfTracksSize());
2293  h_ele_ambiguousTracksVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.ambiguousGsfTracksSize());
2294  h_ele_ambiguousTracksVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.ambiguousGsfTracksSize());
2295  h_ele_ambiguousTracksVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.ambiguousGsfTracksSize());
2296  if (!readAOD_) { // track extra does not exist in AOD
2297  h_ele_foundHits->Fill(bestGsfElectron.gsfTrack()->numberOfValidHits());
2298  h_ele_foundHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfValidHits());
2299  h_ele_foundHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfValidHits());
2300  h_ele_foundHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfValidHits());
2301  h_ele_lostHits->Fill(bestGsfElectron.gsfTrack()->numberOfLostHits());
2302  h_ele_lostHitsVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->numberOfLostHits());
2303  h_ele_lostHitsVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->numberOfLostHits());
2304  h_ele_lostHitsVsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->numberOfLostHits());
2305  h_ele_chi2->Fill(bestGsfElectron.gsfTrack()->normalizedChi2());
2306  h_ele_chi2VsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.gsfTrack()->normalizedChi2());
2307  h_ele_chi2VsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.gsfTrack()->normalizedChi2());
2308  h_ele_chi2VsPt->Fill(bestGsfElectron.pt(), bestGsfElectron.gsfTrack()->normalizedChi2());
2309  }
2310  // from gsf track interface, hence using mean
2311  if (!readAOD_) { // track extra does not exist in AOD
2312  h_ele_PinMnPout->Fill(bestGsfElectron.gsfTrack()->innerMomentum().R() -
2313  bestGsfElectron.gsfTrack()->outerMomentum().R());
2314  h_ele_outerP->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R());
2315  h_ele_outerPt->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho());
2316  }
2317  // from electron interface, hence using mode
2318  h_ele_PinMnPout_mode->Fill(bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2320  bestGsfElectron.eta(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2322  bestGsfElectron.phi(), bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2323  h_ele_PinMnPoutVsPt_mode->Fill(bestGsfElectron.pt(),
2324  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2325  h_ele_PinMnPoutVsE_mode->Fill(bestGsfElectron.caloEnergy(),
2326  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2327  if (!readAOD_) // track extra does not exist in AOD
2329  bestGsfElectron.gsfTrack()->normalizedChi2(),
2330  bestGsfElectron.trackMomentumAtVtx().R() - bestGsfElectron.trackMomentumOut().R());
2331  h_ele_outerP_mode->Fill(bestGsfElectron.trackMomentumOut().R());
2332  h_ele_outerPVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().R());
2333  h_ele_outerPt_mode->Fill(bestGsfElectron.trackMomentumOut().Rho());
2334  h_ele_outerPtVsEta_mode->Fill(bestGsfElectron.eta(), bestGsfElectron.trackMomentumOut().Rho());
2335  h_ele_outerPtVsPhi_mode->Fill(bestGsfElectron.phi(), bestGsfElectron.trackMomentumOut().Rho());
2336  h_ele_outerPtVsPt_mode->Fill(bestGsfElectron.pt(), bestGsfElectron.trackMomentumOut().Rho());
2337 
2338  if (!readAOD_) { // track extra does not exist in AOD
2339  edm::RefToBase<TrajectorySeed> seed = bestGsfElectron.gsfTrack()->extra()->seedRef();
2340  ElectronSeedRef elseed = seed.castTo<ElectronSeedRef>();
2341  h_ele_seed_dphi2_->Fill(elseed->dPhiNeg(1));
2342  h_ele_seed_dphi2VsEta_->Fill(bestGsfElectron.eta(), elseed->dPhiNeg(1));
2343  h_ele_seed_dphi2VsPt_->Fill(bestGsfElectron.pt(), elseed->dPhiNeg(1));
2344  h_ele_seed_drz2_->Fill(elseed->dRZNeg(1));
2345  h_ele_seed_drz2VsEta_->Fill(bestGsfElectron.eta(), elseed->dRZNeg(1));
2346  h_ele_seed_drz2VsPt_->Fill(bestGsfElectron.pt(), elseed->dRZNeg(1));
2347  h_ele_seed_subdet2_->Fill(elseed->subDet(1));
2348  }
2349  // match distributions
2350  h_ele_EoP->Fill(bestGsfElectron.eSuperClusterOverP());
2351  if (bestGsfElectron.ecalDrivenSeed())
2352  h_ele_EoP_eg->Fill(bestGsfElectron.eSuperClusterOverP());
2353  if (bestGsfElectron.isEB())
2354  h_ele_EoP_barrel->Fill(bestGsfElectron.eSuperClusterOverP());
2355  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2356  h_ele_EoP_eg_barrel->Fill(bestGsfElectron.eSuperClusterOverP());
2357  if (bestGsfElectron.isEE())
2358  h_ele_EoP_endcaps->Fill(bestGsfElectron.eSuperClusterOverP());
2359  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2360  h_ele_EoP_eg_endcaps->Fill(bestGsfElectron.eSuperClusterOverP());
2361  h_ele_EoPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSuperClusterOverP());
2362  h_ele_EoPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSuperClusterOverP());
2363  h_ele_EoPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSuperClusterOverP());
2364  h_ele_EseedOP->Fill(bestGsfElectron.eSeedClusterOverP());
2365  if (bestGsfElectron.ecalDrivenSeed())
2366  h_ele_EseedOP_eg->Fill(bestGsfElectron.eSeedClusterOverP());
2367  if (bestGsfElectron.isEB())
2368  h_ele_EseedOP_barrel->Fill(bestGsfElectron.eSeedClusterOverP());
2369  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2370  h_ele_EseedOP_eg_barrel->Fill(bestGsfElectron.eSeedClusterOverP());
2371  if (bestGsfElectron.isEE())
2372  h_ele_EseedOP_endcaps->Fill(bestGsfElectron.eSeedClusterOverP());
2373  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2374  h_ele_EseedOP_eg_endcaps->Fill(bestGsfElectron.eSeedClusterOverP());
2375  h_ele_EseedOPVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverP());
2376  h_ele_EseedOPVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverP());
2377  h_ele_EseedOPVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverP());
2378  h_ele_EoPout->Fill(bestGsfElectron.eSeedClusterOverPout());
2379  if (bestGsfElectron.ecalDrivenSeed())
2380  h_ele_EoPout_eg->Fill(bestGsfElectron.eSeedClusterOverPout());
2381  if (bestGsfElectron.isEB())
2382  h_ele_EoPout_barrel->Fill(bestGsfElectron.eSeedClusterOverPout());
2383  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2384  h_ele_EoPout_eg_barrel->Fill(bestGsfElectron.eSeedClusterOverPout());
2385  if (bestGsfElectron.isEE())
2386  h_ele_EoPout_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout());
2387  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2388  h_ele_EoPout_eg_endcaps->Fill(bestGsfElectron.eSeedClusterOverPout());
2389  h_ele_EoPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eSeedClusterOverPout());
2390  h_ele_EoPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eSeedClusterOverPout());
2391  h_ele_EoPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eSeedClusterOverPout());
2392  h_ele_EeleOPout->Fill(bestGsfElectron.eEleClusterOverPout());
2393  if (bestGsfElectron.ecalDrivenSeed())
2394  h_ele_EeleOPout_eg->Fill(bestGsfElectron.eEleClusterOverPout());
2395  if (bestGsfElectron.isEB())
2396  h_ele_EeleOPout_barrel->Fill(bestGsfElectron.eEleClusterOverPout());
2397  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2398  h_ele_EeleOPout_eg_barrel->Fill(bestGsfElectron.eEleClusterOverPout());
2399  if (bestGsfElectron.isEE())
2400  h_ele_EeleOPout_endcaps->Fill(bestGsfElectron.eEleClusterOverPout());
2401  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2402  h_ele_EeleOPout_eg_endcaps->Fill(bestGsfElectron.eEleClusterOverPout());
2403  h_ele_EeleOPoutVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.eEleClusterOverPout());
2404  h_ele_EeleOPoutVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.eEleClusterOverPout());
2405  h_ele_EeleOPoutVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.eEleClusterOverPout());
2406  h_ele_dEtaSc_propVtx->Fill(bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2407  if (bestGsfElectron.ecalDrivenSeed())
2409  if (bestGsfElectron.isEB())
2411  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2413  if (bestGsfElectron.isEE())
2415  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2417  h_ele_dEtaScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2418  h_ele_dEtaScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2419  h_ele_dEtaScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSuperClusterTrackAtVtx());
2420  h_ele_dPhiSc_propVtx->Fill(bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2421  if (bestGsfElectron.ecalDrivenSeed())
2423  if (bestGsfElectron.isEB())
2425  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2427  if (bestGsfElectron.isEE())
2429  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2431  h_ele_dPhiScVsEta_propVtx->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2432  h_ele_dPhiScVsPhi_propVtx->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2433  h_ele_dPhiScVsPt_propVtx->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSuperClusterTrackAtVtx());
2434  h_ele_dEtaCl_propOut->Fill(bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2435  if (bestGsfElectron.ecalDrivenSeed())
2437  if (bestGsfElectron.isEB())
2439  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2441  if (bestGsfElectron.isEE())
2443  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2445  h_ele_dEtaClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2446  h_ele_dEtaClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2447  h_ele_dEtaClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaSeedClusterTrackAtCalo());
2448  h_ele_dPhiCl_propOut->Fill(bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2449  if (bestGsfElectron.ecalDrivenSeed())
2451  if (bestGsfElectron.isEB())
2453  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2455  if (bestGsfElectron.isEE())
2457  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2459  h_ele_dPhiClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2460  h_ele_dPhiClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2461  h_ele_dPhiClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiSeedClusterTrackAtCalo());
2462  h_ele_dEtaEleCl_propOut->Fill(bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2463  if (bestGsfElectron.ecalDrivenSeed())
2465  if (bestGsfElectron.isEB())
2467  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2469  if (bestGsfElectron.isEE())
2471  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2473  h_ele_dEtaEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2474  h_ele_dEtaEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2475  h_ele_dEtaEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaEtaEleClusterTrackAtCalo());
2476  h_ele_dPhiEleCl_propOut->Fill(bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2477  if (bestGsfElectron.ecalDrivenSeed())
2479  if (bestGsfElectron.isEB())
2481  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2483  if (bestGsfElectron.isEE())
2485  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2487  h_ele_dPhiEleClVsEta_propOut->Fill(bestGsfElectron.eta(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2488  h_ele_dPhiEleClVsPhi_propOut->Fill(bestGsfElectron.phi(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2489  h_ele_dPhiEleClVsPt_propOut->Fill(bestGsfElectron.pt(), bestGsfElectron.deltaPhiEleClusterTrackAtCalo());
2490  h_ele_HoE->Fill(bestGsfElectron.hadronicOverEm());
2491  if (bestGsfElectron.ecalDrivenSeed())
2492  h_ele_HoE_eg->Fill(bestGsfElectron.hadronicOverEm());
2493  if (bestGsfElectron.isEB())
2494  h_ele_HoE_barrel->Fill(bestGsfElectron.hadronicOverEm());
2495  if (bestGsfElectron.isEB() && bestGsfElectron.ecalDrivenSeed())
2496  h_ele_HoE_eg_barrel->Fill(bestGsfElectron.hadronicOverEm());
2497  if (bestGsfElectron.isEE())
2498  h_ele_HoE_endcaps->Fill(bestGsfElectron.hadronicOverEm());
2499  if (bestGsfElectron.isEE() && bestGsfElectron.ecalDrivenSeed())
2500  h_ele_HoE_eg_endcaps->Fill(bestGsfElectron.hadronicOverEm());
2501  if (!bestGsfElectron.isEBEtaGap() && !bestGsfElectron.isEBPhiGap() && !bestGsfElectron.isEBEEGap() &&
2502  !bestGsfElectron.isEERingGap() && !bestGsfElectron.isEEDeeGap())
2503  h_ele_HoE_fiducial->Fill(bestGsfElectron.hadronicOverEm());
2504  h_ele_HoEVsEta->Fill(bestGsfElectron.eta(), bestGsfElectron.hadronicOverEm());
2505  h_ele_HoEVsPhi->Fill(bestGsfElectron.phi(), bestGsfElectron.hadronicOverEm());
2506  h_ele_HoEVsE->Fill(bestGsfElectron.caloEnergy(), bestGsfElectron.hadronicOverEm());
2507 
2508  //classes
2509  int eleClass = bestGsfElectron.classification();
2510  if (bestGsfElectron.isEE())
2511  eleClass += 10;
2512  h_ele_classes->Fill(eleClass);
2513 
2514  h_ele_eta->Fill(std::abs(bestGsfElectron.eta()));
2515  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2516  h_ele_eta_golden->Fill(std::abs(bestGsfElectron.eta()));
2517  if (bestGsfElectron.classification() == GsfElectron::BIGBREM)
2518  h_ele_eta_bbrem->Fill(std::abs(bestGsfElectron.eta()));
2519  //if (bestGsfElectron.classification() == GsfElectron::OLDNARROW) h_ele_eta_narrow ->Fill(std::abs(bestGsfElectron.eta()));
2520  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2521  h_ele_eta_shower->Fill(std::abs(bestGsfElectron.eta()));
2522 
2523  //fbrem
2524  double fbrem_mean = 0.;
2525  if (!readAOD_) // track extra does not exist in AOD
2526  fbrem_mean =
2527  1. - bestGsfElectron.gsfTrack()->outerMomentum().R() / bestGsfElectron.gsfTrack()->innerMomentum().R();
2528  double fbrem_mode = bestGsfElectron.fbrem();
2529  h_ele_fbrem->Fill(fbrem_mode);
2530  h_ele_fbremVsEta_mode->Fill(bestGsfElectron.eta(), fbrem_mode);
2531  if (!readAOD_) // track extra does not exist in AOD
2532  h_ele_fbremVsEta_mean->Fill(bestGsfElectron.eta(), fbrem_mean);
2533 
2534  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2535  h_ele_PinVsPoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
2536  bestGsfElectron.trackMomentumAtVtx().R());
2537  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2538  h_ele_PinVsPoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().R(),
2539  bestGsfElectron.trackMomentumAtVtx().R());
2540  if (!readAOD_) // track extra does not exist in AOD
2541  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2542  h_ele_PinVsPoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
2543  bestGsfElectron.gsfTrack()->innerMomentum().R());
2544  if (!readAOD_) // track extra does not exist in AOD
2545  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2546  h_ele_PinVsPoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().R(),
2547  bestGsfElectron.gsfTrack()->innerMomentum().R());
2548  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2549  h_ele_PtinVsPtoutGolden_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
2550  bestGsfElectron.trackMomentumAtVtx().Rho());
2551  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2552  h_ele_PtinVsPtoutShowering_mode->Fill(bestGsfElectron.trackMomentumOut().Rho(),
2553  bestGsfElectron.trackMomentumAtVtx().Rho());
2554  if (!readAOD_) // track extra does not exist in AOD
2555  if (bestGsfElectron.classification() == GsfElectron::GOLDEN)
2556  h_ele_PtinVsPtoutGolden_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
2557  bestGsfElectron.gsfTrack()->innerMomentum().Rho());
2558  if (!readAOD_) // track extra does not exist in AOD
2559  if (bestGsfElectron.classification() == GsfElectron::SHOWERING)
2560  h_ele_PtinVsPtoutShowering_mean->Fill(bestGsfElectron.gsfTrack()->outerMomentum().Rho(),
2561  bestGsfElectron.gsfTrack()->innerMomentum().Rho());
2562 
2563  h_ele_mva->Fill(bestGsfElectron.mva_e_pi());
2564  if (bestGsfElectron.ecalDrivenSeed())
2565  h_ele_provenance->Fill(1.);
2566  if (bestGsfElectron.trackerDrivenSeed())
2567  h_ele_provenance->Fill(-1.);
2568  if (bestGsfElectron.trackerDrivenSeed() || bestGsfElectron.ecalDrivenSeed())
2569  h_ele_provenance->Fill(0.);
2570  if (bestGsfElectron.trackerDrivenSeed() && !bestGsfElectron.ecalDrivenSeed())
2571  h_ele_provenance->Fill(-2.);
2572  if (!bestGsfElectron.trackerDrivenSeed() && bestGsfElectron.ecalDrivenSeed())
2573  h_ele_provenance->Fill(2.);
2574 
2575  h_ele_tkSumPt_dr03->Fill(bestGsfElectron.dr03TkSumPt());
2576  h_ele_ecalRecHitSumEt_dr03->Fill(bestGsfElectron.dr03EcalRecHitSumEt());
2577  h_ele_hcalDepth1TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalTowerSumEt(1));
2578  h_ele_hcalDepth2TowerSumEt_dr03->Fill(bestGsfElectron.dr03HcalTowerSumEt(2));
2579  h_ele_tkSumPt_dr04->Fill(bestGsfElectron.dr04TkSumPt());
2580  h_ele_ecalRecHitSumEt_dr04->Fill(bestGsfElectron.dr04EcalRecHitSumEt());
2581  h_ele_hcalDepth1TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalTowerSumEt(1));
2582  h_ele_hcalDepth2TowerSumEt_dr04->Fill(bestGsfElectron.dr04HcalTowerSumEt(2));
2583 
2584  } // gsf electron found
2585 
2586  // } // matching object found
2587 
2588  // }
2589 
2590  } // loop overmatching object
2591 
2592  h_matchingObjectNum->Fill(matchingObjectNum);
2593 }
void analyze(const edm::Event &e, const edm::EventSetup &c) override
static std::vector< std::string > checklist log
const edm::EventSetup & c
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
bool isEBEEGap() const
Definition: GsfElectron.h:331
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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
const Point & vertex() const override
vertex position (overwritten by PF...)
TrajectoryStateTransform transformer_
float fbrem() const
Definition: GsfElectron.h:809
float scE2x5Max() const
Definition: GsfElectron.h:498
uint16_t size_type
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
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
float deltaPhiEleClusterTrackAtCalo() const
Definition: GsfElectron.h:230
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
std::string const & label() const
Definition: InputTag.h:36
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
const Point & position() const
position
Definition: BeamSpot.h:59
float scE5x5() const
Definition: GsfElectron.h:499
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
GsfElectronMCFakeAnalyzer(const edm::ParameterSet &conf)
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