CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/RecoEgamma/Examples/plugins/PatPhotonSimpleAnalyzer.h

Go to the documentation of this file.
00001 #ifndef RecoEgamma_PhotonIdentification_PatPhotonSimpleAnalyzer_H
00002 #define RecoEgamma_PhotonIdentification_PatPhotonSimpleAnalyzer_H
00003 
00011 //
00012 
00013 //
00014 
00015 // system include files
00016 #include <memory>
00017 
00018 // user include files
00019 #include "FWCore/Framework/interface/Frameworkfwd.h"
00020 #include "FWCore/Framework/interface/EDAnalyzer.h"
00021 
00022 #include "FWCore/Framework/interface/Event.h"
00023 #include "FWCore/Framework/interface/MakerMacros.h"
00024 
00025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00026 
00027 #include <string>
00028 #include "TH1.h"
00029 #include "TTree.h"
00030 
00031 
00032 class TFile;
00033 
00034 //
00035 // class declaration
00036 //
00037 class PatPhotonSimpleAnalyzer : public edm::EDAnalyzer {
00038    public:
00039       explicit PatPhotonSimpleAnalyzer( const edm::ParameterSet& );
00040       ~PatPhotonSimpleAnalyzer();
00041 
00042 
00043       virtual void analyze( const edm::Event&, const edm::EventSetup& );
00044       virtual void beginJob();
00045       virtual void endJob();
00046  private:
00047 
00048       std::string outputFile_;   // output file
00049       double minPhotonEt_;       // minimum photon Et
00050       double minPhotonAbsEta_;   // min and
00051       double maxPhotonAbsEta_;   // max abs(eta)
00052       double minPhotonR9_;       // minimum R9 = E(3x3)/E(SuperCluster)
00053       double maxPhotonHoverE_;   // maximum HCAL / ECAL
00054       bool   createPhotonTTree_; // Create a TTree of photon variables
00055 
00056       // Will be used for creating TTree of photons.
00057       // These names did not have to match those from a phtn->...
00058       // but do match for clarity.
00059       struct struct_recPhoton {
00060         float isolationEcalRecHit;
00061         float isolationHcalRecHit;
00062         float isolationSolidTrkCone;
00063         float isolationHollowTrkCone;
00064         float nTrkSolidCone;
00065         float nTrkHollowCone;
00066         float isEBGap;
00067         float isEEGap;
00068         float isEBEEGap;
00069         float r9;
00070         float et;
00071         float eta;
00072         float phi;
00073         float hadronicOverEm;
00074         float ecalIso;
00075         float hcalIso;
00076         float trackIso;
00077       } ;
00078       struct_recPhoton recPhoton;
00079 
00080       // root file to store histograms
00081       TFile*  rootFile_;
00082 
00083       // data members for histograms to be filled
00084 
00085       // PhotonID Histograms
00086       TH1F* h_isoEcalRecHit_;
00087       TH1F* h_isoHcalRecHit_;
00088       TH1F* h_trk_pt_solid_;
00089       TH1F* h_trk_pt_hollow_;
00090       TH1F* h_ntrk_solid_;
00091       TH1F* h_ntrk_hollow_;
00092       TH1F* h_ebgap_;
00093       TH1F* h_eeGap_;
00094       TH1F* h_ebeeGap_;
00095       TH1F* h_r9_;
00096 
00097       // Photon Histograms
00098       TH1F* h_photonEt_;
00099       TH1F* h_photonEta_;
00100       TH1F* h_photonPhi_;
00101       TH1F* h_hadoverem_;
00102 
00103       // Photon's SuperCluster Histograms
00104       TH1F* h_photonScEt_;
00105       TH1F* h_photonScEta_;
00106       TH1F* h_photonScPhi_;
00107       TH1F* h_photonScEtaWidth_;
00108 
00109       // Composite or Other Histograms
00110       TH1F* h_photonInAnyGap_;
00111       TH1F* h_nPassingPho_;
00112       TH1F* h_nPho_;
00113 
00114       // TTree
00115       TTree* tree_PhotonAll_;
00116 };
00117 #endif