CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/RecoEgamma/Examples/plugins/GsfElectronMCFakeAnalyzer.h

Go to the documentation of this file.
00001 #ifndef GsfElectronMCFakeAnalyzer_h
00002 #define GsfElectronMCFakeAnalyzer_h
00003 
00004 //
00005 // Package:         RecoEgamma/Examples
00006 // Class:           GsfElectronMCFakeAnalyzer
00007 //
00008 
00009 //
00010 // Original Author:  Ursula Berthon, Claude Charlot
00011 //         Created:  Mon Mar 27 13:22:06 CEST 2006
00012 // $Id: GsfElectronMCFakeAnalyzer.h,v 1.3 2011/05/20 17:17:28 wmtan Exp $
00013 //
00014 //
00015 
00016 
00017 #include "FWCore/Framework/interface/EDAnalyzer.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "DataFormats/Common/interface/Handle.h"
00020 #include "FWCore/Framework/interface/ESHandle.h"
00021 #include "FWCore/Framework/interface/EventSetup.h"
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 
00024 
00025 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00026 
00027 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateTransform.h"
00028 
00029 class MagneticField;
00030 class TFile;
00031 class TH1F;
00032 class TH2F;
00033 class TH1I;
00034 class TProfile;
00035 class TTree;
00036 
00037 class GsfElectronMCFakeAnalyzer : public edm::EDAnalyzer
00038  {
00039   public:
00040 
00041     explicit GsfElectronMCFakeAnalyzer(const edm::ParameterSet& conf);
00042 
00043     virtual ~GsfElectronMCFakeAnalyzer();
00044 
00045     virtual void beginJob();
00046     virtual void endJob();
00047     virtual void analyze(const edm::Event& e, const edm::EventSetup& c);
00048 
00049   private:
00050 
00051     edm::InputTag electronCollection_;
00052     edm::InputTag matchingObjectCollection_;
00053     bool readAOD_;
00054     std::string outputFile_;
00055 
00056     TrajectoryStateTransform transformer_;
00057     edm::ESHandle<TrackerGeometry> pDD;
00058     edm::ESHandle<MagneticField> theMagField;
00059 
00060     float mcEnergy[10], mcEta[10], mcPhi[10], mcPt[10], mcQ[10];
00061     float superclusterEnergy[10], superclusterEta[10], superclusterPhi[10], superclusterEt[10];
00062     float seedMomentum[10], seedEta[10], seedPhi[10], seedPt[10], seedQ[10];
00063 
00064     double maxPt_;
00065     double maxAbsEta_;
00066     double deltaR_;
00067 
00068     TFile *histfile_;
00069     TTree *tree_;
00070 
00071     // histos limits and binning
00072 
00073     int nbinxyz ;
00074     int nbinp ; int nbinp2D ; double pmax ;
00075     int nbinpt ; int nbinpt2D ; int nbinpteff ; double ptmax ;
00076     int nbinfhits ; double fhitsmax ;
00077     int nbinlhits ; double lhitsmax ;
00078     int nbineta ; int nbineta2D ; double etamin ; double etamax ;
00079     int nbindeta ;  double detamin ; double detamax ;
00080     int nbindetamatch ; int nbindetamatch2D ; double detamatchmin ; double detamatchmax ;
00081     int nbinphi ; int nbinphi2D ; double phimin ; double phimax ;
00082     int nbindphi ; double dphimin ; double dphimax ;
00083     int nbindphimatch ; int nbindphimatch2D ; double dphimatchmin ; double dphimatchmax ;
00084     int nbineop ; int nbineop2D ; double eopmax ; double eopmaxsht ;
00085     int nbinmee ; double meemin ; double meemax ;
00086     int nbinhoe ; double hoemin ; double hoemax ;
00087 
00088     // histos
00089 
00090     TH1F *h_matchingObjectNum;
00091 
00092     TH1F *h_matchingObjectEta;
00093     TH1F *h_matchingObjectAbsEta;
00094     TH1F *h_matchingObjectP;
00095     TH1F *h_matchingObjectPt;
00096     TH1F *h_matchingObjectPhi;
00097     TH1F *h_matchingObjectZ;
00098 
00099     TH1F *h_ele_EoverP_all;
00100     TH1F *h_ele_EseedOP_all;
00101     TH1F *h_ele_EoPout_all;
00102     TH1F *h_ele_EeleOPout_all;
00103     TH1F *h_ele_dEtaSc_propVtx_all;
00104     TH1F *h_ele_dPhiSc_propVtx_all;
00105     TH1F *h_ele_dEtaCl_propOut_all;
00106     TH1F *h_ele_dPhiCl_propOut_all;
00107     TH1F *h_ele_TIP_all;
00108     TH1F *h_ele_HoE_all;
00109     TH1F *h_ele_vertexEta_all;
00110     TH1F *h_ele_vertexPt_all;
00111     TH1F *h_ele_mee_all;
00112     TH1F *h_ele_mee_os;
00113 
00114     TH2F *h_ele_E2mnE1vsMee_all;
00115     TH2F *h_ele_E2mnE1vsMee_egeg_all;
00116 
00117     TH1F *h_ele_matchingObjectEta_matched;
00118     TH1F *h_ele_matchingObjectAbsEta_matched;
00119     TH1F *h_ele_matchingObjectPt_matched;
00120     TH1F *h_ele_matchingObjectPhi_matched;
00121     TH1F *h_ele_matchingObjectZ_matched;
00122 
00123     TH1F *h_ele_charge;
00124     TH2F *h_ele_chargeVsEta;
00125     TH2F *h_ele_chargeVsPhi;
00126     TH2F *h_ele_chargeVsPt;
00127     TH1F *h_ele_vertexP;
00128     TH1F *h_ele_vertexPt;
00129     TH2F *h_ele_vertexPtVsEta;
00130     TH2F *h_ele_vertexPtVsPhi;
00131     TH1F *h_ele_vertexEta;
00132     TH2F *h_ele_vertexEtaVsPhi;
00133     TH1F *h_ele_vertexAbsEta;
00134     TH1F *h_ele_vertexPhi;
00135     TH1F *h_ele_vertexX;
00136     TH1F *h_ele_vertexY;
00137     TH1F *h_ele_vertexZ;
00138     TH1F *h_ele_vertexTIP;
00139     TH2F *h_ele_vertexTIPVsEta;
00140     TH2F *h_ele_vertexTIPVsPhi;
00141     TH2F *h_ele_vertexTIPVsPt;
00142 
00143     TH1F *histNum_;
00144 
00145     TH1F *histSclEn_ ;
00146     TH1F *histSclEoEmatchingObject_barrel;
00147     TH1F *histSclEoEmatchingObject_endcaps;
00148     TH1F *histSclEt_ ;
00149     TH2F *histSclEtVsEta_ ;
00150     TH2F *histSclEtVsPhi_ ;
00151     TH2F *histSclEtaVsPhi_ ;
00152     TH1F *histSclEta_ ;
00153     TH1F *histSclPhi_ ;
00154     TH1F *histSclSigEtaEta_ ;
00155     TH1F *histSclSigEtaEta_barrel_ ;
00156     TH1F *histSclSigEtaEta_endcaps_ ;
00157     TH1F *histSclSigIEtaIEta_ ;
00158     TH1F *histSclSigIEtaIEta_barrel_ ;
00159     TH1F *histSclSigIEtaIEta_endcaps_ ;
00160     TH1F *histSclE1x5_ ;
00161     TH1F *histSclE1x5_barrel_ ;
00162     TH1F *histSclE1x5_endcaps_ ;
00163     TH1F *histSclE2x5max_ ;
00164     TH1F *histSclE2x5max_barrel_ ;
00165     TH1F *histSclE2x5max_endcaps_ ;
00166     TH1F *histSclE5x5_ ;
00167     TH1F *histSclE5x5_barrel_ ;
00168     TH1F *histSclE5x5_endcaps_ ;
00169 
00170     TH1F *h_ele_ambiguousTracks;
00171     TH2F *h_ele_ambiguousTracksVsEta;
00172     TH2F *h_ele_ambiguousTracksVsPhi;
00173     TH2F *h_ele_ambiguousTracksVsPt;
00174     TH1F *h_ele_foundHits;
00175     TH1F *h_ele_foundHits_barrel;
00176     TH1F *h_ele_foundHits_endcaps;
00177     TH2F *h_ele_foundHitsVsEta;
00178     TH2F *h_ele_foundHitsVsPhi;
00179     TH2F *h_ele_foundHitsVsPt;
00180     TH1F *h_ele_lostHits;
00181     TH1F *h_ele_lostHits_barrel;
00182     TH1F *h_ele_lostHits_endcaps;
00183     TH2F *h_ele_lostHitsVsEta;
00184     TH2F *h_ele_lostHitsVsPhi;
00185     TH2F *h_ele_lostHitsVsPt;
00186     TH1F *h_ele_chi2;
00187     TH1F *h_ele_chi2_barrel;
00188     TH1F *h_ele_chi2_endcaps;
00189     TH2F *h_ele_chi2VsEta;
00190     TH2F *h_ele_chi2VsPhi;
00191     TH2F *h_ele_chi2VsPt;
00192 
00193     TH1F *h_ele_PoPmatchingObject;
00194     TH2F *h_ele_PoPmatchingObjectVsEta;
00195     TH2F *h_ele_PoPmatchingObjectVsPhi;
00196     TH2F *h_ele_PoPmatchingObjectVsPt;
00197     TH1F *h_ele_PoPmatchingObject_barrel;
00198     TH1F *h_ele_PoPmatchingObject_endcaps;
00199     TH1F *h_ele_EtaMnEtamatchingObject;
00200     TH2F *h_ele_EtaMnEtamatchingObjectVsEta;
00201     TH2F *h_ele_EtaMnEtamatchingObjectVsPhi;
00202     TH2F *h_ele_EtaMnEtamatchingObjectVsPt;
00203     TH1F *h_ele_PhiMnPhimatchingObject;
00204     TH1F *h_ele_PhiMnPhimatchingObject2;
00205     TH2F *h_ele_PhiMnPhimatchingObjectVsEta;
00206     TH2F *h_ele_PhiMnPhimatchingObjectVsPhi;
00207     TH2F *h_ele_PhiMnPhimatchingObjectVsPt;
00208 
00209     TH1F *h_ele_PinMnPout;
00210     TH1F *h_ele_PinMnPout_mode;
00211     TH2F *h_ele_PinMnPoutVsEta_mode;
00212     TH2F *h_ele_PinMnPoutVsPhi_mode;
00213     TH2F *h_ele_PinMnPoutVsPt_mode;
00214     TH2F *h_ele_PinMnPoutVsE_mode;
00215     TH2F *h_ele_PinMnPoutVsChi2_mode;
00216 
00217     TH1F *h_ele_outerP;
00218     TH1F *h_ele_outerP_mode;
00219     TH2F *h_ele_outerPVsEta_mode;
00220     TH1F *h_ele_outerPt;
00221     TH1F *h_ele_outerPt_mode;
00222     TH2F *h_ele_outerPtVsEta_mode;
00223     TH2F *h_ele_outerPtVsPhi_mode;
00224     TH2F *h_ele_outerPtVsPt_mode;
00225     TH1F *h_ele_EoP;
00226     TH1F *h_ele_EoP_barrel;
00227     TH1F *h_ele_EoP_endcaps;
00228     TH1F *h_ele_EoP_eg;
00229     TH1F *h_ele_EoP_eg_barrel;
00230     TH1F *h_ele_EoP_eg_endcaps;
00231     TH2F *h_ele_EoPVsEta;
00232     TH2F *h_ele_EoPVsPhi;
00233     TH2F *h_ele_EoPVsE;
00234     TH1F *h_ele_EseedOP;
00235     TH1F *h_ele_EseedOP_barrel;
00236     TH1F *h_ele_EseedOP_endcaps;
00237     TH1F *h_ele_EseedOP_eg;
00238     TH1F *h_ele_EseedOP_eg_barrel;
00239     TH1F *h_ele_EseedOP_eg_endcaps;
00240     TH2F *h_ele_EseedOPVsEta;
00241     TH2F *h_ele_EseedOPVsPhi;
00242     TH2F *h_ele_EseedOPVsE;
00243     TH1F *h_ele_EoPout;
00244     TH1F *h_ele_EoPout_barrel;
00245     TH1F *h_ele_EoPout_endcaps;
00246     TH1F *h_ele_EoPout_eg;
00247     TH1F *h_ele_EoPout_eg_barrel;
00248     TH1F *h_ele_EoPout_eg_endcaps;
00249     TH2F *h_ele_EoPoutVsEta;
00250     TH2F *h_ele_EoPoutVsPhi;
00251     TH2F *h_ele_EoPoutVsE;
00252     TH1F *h_ele_EeleOPout;
00253     TH1F *h_ele_EeleOPout_barrel;
00254     TH1F *h_ele_EeleOPout_endcaps;
00255     TH1F *h_ele_EeleOPout_eg;
00256     TH1F *h_ele_EeleOPout_eg_barrel;
00257     TH1F *h_ele_EeleOPout_eg_endcaps;
00258     TH2F *h_ele_EeleOPoutVsEta;
00259     TH2F *h_ele_EeleOPoutVsPhi;
00260     TH2F *h_ele_EeleOPoutVsE;
00261 
00262     TH1F *h_ele_dEtaSc_propVtx;
00263     TH1F *h_ele_dEtaSc_propVtx_barrel;
00264     TH1F *h_ele_dEtaSc_propVtx_endcaps;
00265     TH1F *h_ele_dEtaSc_propVtx_eg;
00266     TH1F *h_ele_dEtaSc_propVtx_eg_barrel;
00267     TH1F *h_ele_dEtaSc_propVtx_eg_endcaps;
00268     TH2F *h_ele_dEtaScVsEta_propVtx;
00269     TH2F *h_ele_dEtaScVsPhi_propVtx;
00270     TH2F *h_ele_dEtaScVsPt_propVtx;
00271     TH1F *h_ele_dPhiSc_propVtx;
00272     TH1F *h_ele_dPhiSc_propVtx_barrel;
00273     TH1F *h_ele_dPhiSc_propVtx_endcaps;
00274     TH1F *h_ele_dPhiSc_propVtx_eg;
00275     TH1F *h_ele_dPhiSc_propVtx_eg_barrel;
00276     TH1F *h_ele_dPhiSc_propVtx_eg_endcaps;
00277     TH2F *h_ele_dPhiScVsEta_propVtx;
00278     TH2F *h_ele_dPhiScVsPhi_propVtx;
00279     TH2F *h_ele_dPhiScVsPt_propVtx;
00280     TH1F *h_ele_dEtaCl_propOut;
00281     TH1F *h_ele_dEtaCl_propOut_barrel;
00282     TH1F *h_ele_dEtaCl_propOut_endcaps;
00283     TH1F *h_ele_dEtaCl_propOut_eg;
00284     TH1F *h_ele_dEtaCl_propOut_eg_barrel;
00285     TH1F *h_ele_dEtaCl_propOut_eg_endcaps;
00286     TH2F *h_ele_dEtaClVsEta_propOut;
00287     TH2F *h_ele_dEtaClVsPhi_propOut;
00288     TH2F *h_ele_dEtaClVsPt_propOut;
00289     TH1F *h_ele_dPhiCl_propOut;
00290     TH1F *h_ele_dPhiCl_propOut_barrel;
00291     TH1F *h_ele_dPhiCl_propOut_endcaps;
00292     TH1F *h_ele_dPhiCl_propOut_eg;
00293     TH1F *h_ele_dPhiCl_propOut_eg_barrel;
00294     TH1F *h_ele_dPhiCl_propOut_eg_endcaps;
00295     TH2F *h_ele_dPhiClVsEta_propOut;
00296     TH2F *h_ele_dPhiClVsPhi_propOut;
00297     TH2F *h_ele_dPhiClVsPt_propOut;
00298     TH1F *h_ele_dEtaEleCl_propOut;
00299     TH1F *h_ele_dEtaEleCl_propOut_barrel;
00300     TH1F *h_ele_dEtaEleCl_propOut_endcaps;
00301     TH1F *h_ele_dEtaEleCl_propOut_eg;
00302     TH1F *h_ele_dEtaEleCl_propOut_eg_barrel;
00303     TH1F *h_ele_dEtaEleCl_propOut_eg_endcaps;
00304     TH2F *h_ele_dEtaEleClVsEta_propOut;
00305     TH2F *h_ele_dEtaEleClVsPhi_propOut;
00306     TH2F *h_ele_dEtaEleClVsPt_propOut;
00307     TH1F *h_ele_dPhiEleCl_propOut;
00308     TH1F *h_ele_dPhiEleCl_propOut_barrel;
00309     TH1F *h_ele_dPhiEleCl_propOut_endcaps;
00310     TH1F *h_ele_dPhiEleCl_propOut_eg;
00311     TH1F *h_ele_dPhiEleCl_propOut_eg_barrel;
00312     TH1F *h_ele_dPhiEleCl_propOut_eg_endcaps;
00313     TH2F *h_ele_dPhiEleClVsEta_propOut;
00314     TH2F *h_ele_dPhiEleClVsPhi_propOut;
00315     TH2F *h_ele_dPhiEleClVsPt_propOut;
00316 
00317     TH1F *h_ele_seed_dphi2_;
00318     TH2F *h_ele_seed_dphi2VsEta_;
00319     TH2F *h_ele_seed_dphi2VsPt_ ;
00320     TH1F *h_ele_seed_drz2_;
00321     TH2F *h_ele_seed_drz2VsEta_;
00322     TH2F *h_ele_seed_drz2VsPt_;
00323     TH1F *h_ele_seed_subdet2_;
00324 
00325     TH1F *h_ele_classes;
00326     TH1F *h_ele_eta;
00327     TH1F *h_ele_eta_golden;
00328     TH1F *h_ele_eta_bbrem;
00329     TH1F *h_ele_eta_narrow;
00330     TH1F *h_ele_eta_shower;
00331 
00332     TH1F *h_ele_HoE;
00333     TH1F *h_ele_HoE_barrel;
00334     TH1F *h_ele_HoE_endcaps;
00335     TH1F *h_ele_HoE_eg;
00336     TH1F *h_ele_HoE_eg_barrel;
00337     TH1F *h_ele_HoE_eg_endcaps;
00338     TH1F *h_ele_HoE_fiducial;
00339     TH2F *h_ele_HoEVsEta;
00340     TH2F *h_ele_HoEVsPhi;
00341     TH2F *h_ele_HoEVsE;
00342 
00343     TH1F *h_ele_fbrem;
00344     TProfile *h_ele_fbremVsEta_mode;
00345     TProfile *h_ele_fbremVsEta_mean;
00346 
00347     TH2F *h_ele_PinVsPoutGolden_mode;
00348     TH2F *h_ele_PinVsPoutShowering_mode;
00349     TH2F *h_ele_PinVsPoutGolden_mean;
00350     TH2F *h_ele_PinVsPoutShowering_mean;
00351     TH2F *h_ele_PtinVsPtoutGolden_mode;
00352     TH2F *h_ele_PtinVsPtoutShowering_mode;
00353     TH2F *h_ele_PtinVsPtoutGolden_mean;
00354     TH2F *h_ele_PtinVsPtoutShowering_mean;
00355     TH1F *histSclEoEmatchingObjectGolden_barrel;
00356     TH1F *histSclEoEmatchingObjectGolden_endcaps;
00357     TH1F *histSclEoEmatchingObjectShowering_barrel;
00358     TH1F *histSclEoEmatchingObjectShowering_endcaps;
00359 
00360     TH1F *h_ele_mva;
00361     TH1F *h_ele_provenance;
00362 
00363     TH1F *h_ele_tkSumPt_dr03;
00364     TH1F *h_ele_ecalRecHitSumEt_dr03;
00365     TH1F *h_ele_hcalDepth1TowerSumEt_dr03;
00366     TH1F *h_ele_hcalDepth2TowerSumEt_dr03;
00367     TH1F *h_ele_tkSumPt_dr04;
00368     TH1F *h_ele_ecalRecHitSumEt_dr04;
00369     TH1F *h_ele_hcalDepth1TowerSumEt_dr04;
00370     TH1F *h_ele_hcalDepth2TowerSumEt_dr04;
00371 
00372  };
00373 
00374 #endif
00375 
00376 
00377