00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "L1TriggerOffline/L1Analyzer/interface/EfficiencyHistograms.h"
00015
00016 EfficiencyHistograms::EfficiencyHistograms(const std::string name, const edm::ParameterSet & cfg):
00017 m_dirName(name),
00018 m_etNBins(cfg.getUntrackedParameter<int>("etNBins")),
00019 m_etaNBins(cfg.getUntrackedParameter<int>("etaNBins")),
00020 m_phiNBins(cfg.getUntrackedParameter<int>("phiNBins")),
00021 m_etMin(cfg.getUntrackedParameter<double>("etMin")),
00022 m_etaMin(cfg.getUntrackedParameter<double>("etaMin")),
00023 m_phiMin(cfg.getUntrackedParameter<double>("phiMin")),
00024 m_etMax(cfg.getUntrackedParameter<double>("etMax")),
00025 m_etaMax(cfg.getUntrackedParameter<double>("etaMax")),
00026 m_phiMax(cfg.getUntrackedParameter<double>("phiMax"))
00027 {
00028
00029 edm::Service<TFileService> fs;
00030
00031 TFileDirectory dir = fs->mkdir(m_dirName);
00032
00033 m_EtEff = dir.make<TH1F>("EtEff", "E_{T} Efficiency",m_etNBins,m_etMin,m_etMax);
00034 m_EtaEff = dir.make<TH1F>("EtaEff","#eta Efficiency", m_etaNBins,m_etaMin,m_etaMax);
00035 m_PhiEff = dir.make<TH1F>("PhiEff","#phi Efficiency", m_phiNBins,m_phiMin,m_phiMax);
00036
00037 m_L1EtEff = dir.make<TH1F>("L1EtEff", "E_{T}",m_etNBins,m_etMin,m_etMax); m_L1EtEff->Sumw2();
00038 m_L1EtaEff = dir.make<TH1F>("L1EtaEff","#eta", m_etaNBins,m_etaMin,m_etaMax); m_L1EtaEff->Sumw2();
00039 m_L1PhiEff = dir.make<TH1F>("L1PhiEff","#phi", m_phiNBins,m_phiMin,m_phiMax); m_L1PhiEff->Sumw2();
00040
00041 m_RefEtEff = dir.make<TH1F>("RefEtEff", "E_{T}",m_etNBins,m_etMin,m_etMax); m_RefEtEff->Sumw2();
00042 m_RefEtaEff = dir.make<TH1F>("RefEtaEff","#eta", m_etaNBins,m_etaMin,m_etaMax); m_RefEtaEff->Sumw2();
00043 m_RefPhiEff = dir.make<TH1F>("RefPhiEff","#phi", m_phiNBins,m_phiMin,m_phiMax); m_RefPhiEff->Sumw2();
00044
00045 }
00046
00047 EfficiencyHistograms::~EfficiencyHistograms()
00048 {
00049
00050
00051
00052 m_EtEff->Divide(m_L1EtEff,m_RefEtEff,1.,1.,"B");
00053 m_EtaEff->Divide(m_L1EtaEff,m_RefEtaEff,1.,1.,"B");
00054 m_PhiEff->Divide(m_L1PhiEff,m_RefPhiEff,1.,1.,"B");
00055 }
00056
00057 void EfficiencyHistograms::FillL1(const reco::CandidateRef &ref)
00058 {
00059 m_L1EtEff->Fill(ref->et());
00060 m_L1EtaEff->Fill(ref->eta());
00061 m_L1PhiEff->Fill(ref->phi());
00062 }
00063
00064 void EfficiencyHistograms::FillReference(const reco::CandidateRef &ref)
00065 {
00066 m_RefEtEff->Fill(ref->et());
00067 m_RefEtaEff->Fill(ref->eta());
00068 m_RefPhiEff->Fill(ref->phi());
00069 }