CMS 3D CMS Logo

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