CMS 3D CMS Logo

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