CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/Validation/RecoEgamma/plugins/EgammaObjects.h

Go to the documentation of this file.
00001 #ifndef EgammaObjects_h
00002 #define EgammaObjects_h
00003 
00004 #include <string>
00005 
00006 #include "FWCore/Framework/interface/Event.h"
00007 #include "FWCore/Framework/interface/EDAnalyzer.h"
00008 #include "FWCore/Framework/interface/Frameworkfwd.h"
00009 #include "FWCore/Framework/interface/MakerMacros.h"
00010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00011 
00012 #include "DQMServices/Core/interface/DQMStore.h"
00013 
00014 #include "DataFormats/EgammaCandidates/interface/Photon.h"
00015 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00016 
00017 #include "TFile.h"
00018 #include "TH1D.h"
00019 #include "TH2D.h"
00020 
00021 class EgammaObjects : public edm::EDAnalyzer {
00022   public:
00023     explicit EgammaObjects( const edm::ParameterSet& );
00024     ~EgammaObjects();
00025 
00026     virtual void analyze( const edm::Event&, const edm::EventSetup& );
00027     virtual void beginJob();
00028     virtual void endJob();
00029 
00030   private:
00031     TFile*  rootFile_;
00032 
00033     edm::InputTag MCTruthCollection_;
00034     edm::InputTag RecoCollection_;
00035 
00036     int particleID; 
00037     std::string particleString;
00038     
00039     int EtCut; 
00040 
00041     double hist_min_Et_;
00042     double hist_max_Et_;
00043     int    hist_bins_Et_;
00044     
00045     double hist_min_E_;
00046     double hist_max_E_;
00047     int    hist_bins_E_;
00048     
00049     double hist_min_Eta_;
00050     double hist_max_Eta_;
00051     int    hist_bins_Eta_;
00052     
00053     double hist_min_Phi_;
00054     double hist_max_Phi_;
00055     int    hist_bins_Phi_;
00056     
00057     double hist_min_EtOverTruth_;
00058     double hist_max_EtOverTruth_;
00059     int    hist_bins_EtOverTruth_;
00060     
00061     double hist_min_EOverTruth_;
00062     double hist_max_EOverTruth_;
00063     int    hist_bins_EOverTruth_;
00064 
00065     double hist_min_EtaOverTruth_;
00066     double hist_max_EtaOverTruth_;
00067     int    hist_bins_EtaOverTruth_;
00068     
00069     double hist_min_PhiOverTruth_;
00070     double hist_max_PhiOverTruth_;
00071     int    hist_bins_PhiOverTruth_;
00072 
00073     double hist_min_deltaEta_;
00074     double hist_max_deltaEta_;
00075     int    hist_bins_deltaEta_;
00076     
00077     double hist_min_deltaPhi_;
00078     double hist_max_deltaPhi_;
00079     int    hist_bins_deltaPhi_;
00080     
00081     double hist_min_recoMass_;
00082     double hist_max_recoMass_;
00083     int    hist_bins_recoMass_;
00084     
00085     TH1D* hist_Et_;
00086     TH1D* hist_EtOverTruth_;
00087     TH1D* hist_EtEfficiency_;
00088     TH1D* hist_EtNumRecoOverNumTrue_;
00089     TH1D* hist_EtOverTruthVsEt_;
00090     TH1D* hist_EtOverTruthVsE_;
00091     TH1D* hist_EtOverTruthVsEta_;
00092     TH1D* hist_EtOverTruthVsPhi_;
00093     TH1D* hist_resolutionEtVsEt_;
00094     TH1D* hist_resolutionEtVsE_;    
00095     TH1D* hist_resolutionEtVsEta_;
00096     TH1D* hist_resolutionEtVsPhi_;
00097     
00098     TH1D* hist_E_;
00099     TH1D* hist_EOverTruth_;
00100     TH1D* hist_EEfficiency_;
00101     TH1D* hist_ENumRecoOverNumTrue_;
00102     TH1D* hist_EOverTruthVsEt_;
00103     TH1D* hist_EOverTruthVsE_;
00104     TH1D* hist_EOverTruthVsEta_;
00105     TH1D* hist_EOverTruthVsPhi_;
00106     TH1D* hist_resolutionEVsEt_;
00107     TH1D* hist_resolutionEVsE_;    
00108     TH1D* hist_resolutionEVsEta_;
00109     TH1D* hist_resolutionEVsPhi_;
00110     
00111     TH1D* hist_Eta_;
00112     TH1D* hist_EtaOverTruth_;
00113     TH1D* hist_EtaEfficiency_;
00114     TH1D* hist_EtaNumRecoOverNumTrue_;
00115     TH1D* hist_deltaEtaVsEt_;
00116     TH1D* hist_deltaEtaVsE_;
00117     TH1D* hist_deltaEtaVsEta_;
00118     TH1D* hist_deltaEtaVsPhi_;
00119     TH1D* hist_resolutionEtaVsEt_;
00120     TH1D* hist_resolutionEtaVsE_;    
00121     TH1D* hist_resolutionEtaVsEta_;
00122     TH1D* hist_resolutionEtaVsPhi_;
00123     
00124     TH1D* hist_Phi_;
00125     TH1D* hist_PhiOverTruth_;
00126     TH1D* hist_PhiEfficiency_;
00127     TH1D* hist_PhiNumRecoOverNumTrue_;
00128     TH1D* hist_deltaPhiVsEt_;
00129     TH1D* hist_deltaPhiVsE_;
00130     TH1D* hist_deltaPhiVsEta_;
00131     TH1D* hist_deltaPhiVsPhi_;
00132     TH1D* hist_resolutionPhiVsEt_;
00133     TH1D* hist_resolutionPhiVsE_;    
00134     TH1D* hist_resolutionPhiVsEta_;
00135     TH1D* hist_resolutionPhiVsPhi_;
00136     
00137     TH1D* hist_All_recoMass_;
00138     TH1D* hist_BarrelOnly_recoMass_;
00139     TH1D* hist_EndcapOnly_recoMass_;
00140     TH1D* hist_Mixed_recoMass_;
00141 
00142     TH1D* hist_recoMass_withBackgroud_NoEtCut_;
00143     TH1D* hist_recoMass_withBackgroud_5EtCut_;
00144     TH1D* hist_recoMass_withBackgroud_10EtCut_;
00145     TH1D* hist_recoMass_withBackgroud_20EtCut_;
00146     
00147     TH2D* _TEMP_scatterPlot_EtOverTruthVsEt_;
00148     TH2D* _TEMP_scatterPlot_EtOverTruthVsE_;
00149     TH2D* _TEMP_scatterPlot_EtOverTruthVsEta_;
00150     TH2D* _TEMP_scatterPlot_EtOverTruthVsPhi_;
00151     
00152     TH2D* _TEMP_scatterPlot_EOverTruthVsEt_;
00153     TH2D* _TEMP_scatterPlot_EOverTruthVsE_;
00154     TH2D* _TEMP_scatterPlot_EOverTruthVsEta_;
00155     TH2D* _TEMP_scatterPlot_EOverTruthVsPhi_;
00156     
00157     TH2D* _TEMP_scatterPlot_deltaEtaVsEt_;
00158     TH2D* _TEMP_scatterPlot_deltaEtaVsE_;    
00159     TH2D* _TEMP_scatterPlot_deltaEtaVsEta_;
00160     TH2D* _TEMP_scatterPlot_deltaEtaVsPhi_;
00161     
00162     TH2D* _TEMP_scatterPlot_deltaPhiVsEt_;
00163     TH2D* _TEMP_scatterPlot_deltaPhiVsE_;
00164     TH2D* _TEMP_scatterPlot_deltaPhiVsEta_;
00165     TH2D* _TEMP_scatterPlot_deltaPhiVsPhi_;
00166 
00167     void loadCMSSWObjects(const edm::ParameterSet& ps);
00168     void loadHistoParameters(const edm::ParameterSet& ps);
00169   
00170     void createBookedHistoObjects();
00171     void createTempHistoObjects();
00172     
00173     void analyzePhotons( const edm::Event&, const edm::EventSetup& );
00174     void analyzeElectrons( const edm::Event&, const edm::EventSetup& );    
00175 
00176     void getEfficiencyHistosViaDividing();
00177     void getDeltaResHistosViaSlicing();
00178     void fitHistos(); 
00179     
00180     void applyLabels(); 
00181     void setDrawOptions();
00182     void saveHistos();
00183 
00184     double findRecoMass(reco::Photon pOne, reco::Photon pTwo);
00185     double findRecoMass(reco::GsfElectron eOne, reco::GsfElectron eTwo);
00186     
00187     float ecalEta(float EtaParticle , float Zvertex, float plane_Radius);
00188 };
00189 #endif
00190