#include <PhotonPostprocessing.h>
$Id: PhotonPostprocessing
authors: Nancy Marinelli, U. of Notre Dame, US
$Id: PhotonPostprocessing
author: Nancy Marinelli, U. of Notre Dame, US
Definition at line 53 of file PhotonPostprocessing.h.
PhotonPostprocessing::PhotonPostprocessing | ( | const edm::ParameterSet & | pset | ) | [explicit] |
Definition at line 26 of file PhotonPostprocessing.cc.
References dbe_, ExpressReco_HICollisions_FallBack::etaBin, ExpressReco_HICollisions_FallBack::etaMax, ExpressReco_HICollisions_FallBack::etaMin, jptDQMConfig_cff::etMax, ExpressReco_HICollisions_FallBack::etMin, edm::ParameterSet::getParameter(), cmsCodeRules::cppFunctionSkipper::operator, ExpressReco_HICollisions_FallBack::phiBin, ExpressReco_HICollisions_FallBack::phiMax, ExpressReco_HICollisions_FallBack::phiMin, CrabTask::pset, and DQMStore::setVerbose().
{ dbe_ = 0; dbe_ = edm::Service<DQMStore>().operator->(); dbe_->setVerbose(0); parameters_ = pset; standAlone_ = pset.getParameter<bool>("standAlone"); batch_ = pset.getParameter<bool>("batch"); outputFileName_ = pset.getParameter<string>("OutputFileName"); inputFileName_ = pset.getParameter<std::string>("InputFileName"); etMin = parameters_.getParameter<double>("etMin"); etMax = parameters_.getParameter<double>("etMax"); etBin = parameters_.getParameter<int>("etBin"); etaMin = parameters_.getParameter<double>("etaMin"); etaMax = parameters_.getParameter<double>("etaMax"); etaBin = parameters_.getParameter<int>("etaBin"); etaBin2 = parameters_.getParameter<int>("etaBin2"); phiMin = parameters_.getParameter<double>("phiMin"); phiMax = parameters_.getParameter<double>("phiMax"); phiBin = parameters_.getParameter<int>("phiBin"); rMin = parameters_.getParameter<double>("rMin"); rMax = parameters_.getParameter<double>("rMax"); rBin = parameters_.getParameter<int>("rBin"); zMin = parameters_.getParameter<double>("zMin"); zMax = parameters_.getParameter<double>("zMax"); zBin = parameters_.getParameter<int>("zBin"); }
PhotonPostprocessing::~PhotonPostprocessing | ( | ) | [virtual] |
Definition at line 70 of file PhotonPostprocessing.cc.
{}
void PhotonPostprocessing::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | esup | ||
) | [virtual] |
void PhotonPostprocessing::beginJob | ( | void | ) | [virtual] |
void PhotonPostprocessing::dividePlots | ( | MonitorElement * | dividend, |
MonitorElement * | numerator, | ||
double | denominator | ||
) | [private] |
Definition at line 259 of file PhotonPostprocessing.cc.
References MonitorElement::getBinContent(), MonitorElement::getNbinsX(), j, MonitorElement::setBinContent(), MonitorElement::setBinError(), mathSSE::sqrt(), and relativeConstraints::value.
{ double value,err; for (int j=1; j<=numerator->getNbinsX(); j++){ if (denominator!=0){ value = ((double) numerator->getBinContent(j))/denominator; err = sqrt( value*(1-value) / denominator); dividend->setBinContent(j, value); dividend->setBinError(j,err); } else { dividend->setBinContent(j, 0); } } }
void PhotonPostprocessing::dividePlots | ( | MonitorElement * | dividend, |
MonitorElement * | numerator, | ||
MonitorElement * | denominator, | ||
std::string | type | ||
) | [private] |
Definition at line 234 of file PhotonPostprocessing.cc.
References MonitorElement::getBinContent(), MonitorElement::getNbinsX(), j, MonitorElement::setBinContent(), MonitorElement::setBinError(), mathSSE::sqrt(), and relativeConstraints::value.
{ double value,err; for (int j=1; j<=numerator->getNbinsX(); j++){ if (denominator->getBinContent(j)!=0){ if (type=="effic") value = ((double) numerator->getBinContent(j))/((double) denominator->getBinContent(j)); else if (type=="fakerate") value = 1-((double) numerator->getBinContent(j))/((double) denominator->getBinContent(j)); else return; err = sqrt( value*(1-value) / ((double) denominator->getBinContent(j)) ); dividend->setBinContent(j, value); if ( err !=0 ) dividend->setBinError(j,err); } else { dividend->setBinContent(j, 0); dividend->setBinError(j,0); } } }
void PhotonPostprocessing::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 82 of file PhotonPostprocessing.cc.
{ if(standAlone_) runPostprocessing(); }
void PhotonPostprocessing::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumi, |
const edm::EventSetup & | setup | ||
) | [virtual] |
void PhotonPostprocessing::endRun | ( | const edm::Run & | run, |
const edm::EventSetup & | setup | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 88 of file PhotonPostprocessing.cc.
{ if(!standAlone_) runPostprocessing(); }
void PhotonPostprocessing::runPostprocessing | ( | ) | [private, virtual] |
Definition at line 95 of file PhotonPostprocessing.cc.
References DQMStore::book1D(), dbe_, ExpressReco_HICollisions_FallBack::etaBin, ExpressReco_HICollisions_FallBack::etaMax, ExpressReco_HICollisions_FallBack::etaMin, jptDQMConfig_cff::etMax, ExpressReco_HICollisions_FallBack::etMin, DQMStore::get(), DQMStore::open(), ExpressReco_HICollisions_FallBack::phiBin, ExpressReco_HICollisions_FallBack::phiMax, ExpressReco_HICollisions_FallBack::phiMin, DQMStore::save(), and DQMStore::setCurrentFolder().
{ std::string simInfoPathName = "EgammaV/PhotonValidator/SimulationInfo/"; std::string convPathName = "EgammaV/PhotonValidator/ConversionInfo/"; std::string effPathName = "EgammaV/PhotonValidator/Efficiencies/"; if(batch_) dbe_->open(inputFileName_); dbe_->setCurrentFolder(effPathName); // Photon reconstruction efficiencies string histname = "recoEffVsEta"; phoRecoEffEta_ = dbe_->book1D(histname,"Photon reconstruction efficiency vs simulated #eta",etaBin,etaMin, etaMax); histname = "recoEffVsPhi"; phoRecoEffPhi_ = dbe_->book1D(histname,"Photon reconstruction efficiency vs simulated #phi",phiBin,phiMin, phiMax); histname = "recoEffVsEt"; phoRecoEffEt_ = dbe_->book1D(histname,"Photon reconstruction efficiency vs simulated Et",etBin,etMin, etMax) ; // Fraction of photons with at least one dead channel histname = "deadChVsEta"; phoDeadChEta_ = dbe_->book1D(histname,"Fraction of photons with >=1 dead Xtal vs simulated #eta",etaBin,etaMin, etaMax); histname = "deadChVsPhi"; phoDeadChPhi_ = dbe_->book1D(histname,"Fraction of photons with >=1 dead Xtal vs simulated #phi",phiBin,phiMin, phiMax); histname = "deadChVsEt"; phoDeadChEt_ = dbe_->book1D(histname,"Fraction of photons with >=1 dead Xtal vs simulated Et",etBin,etMin, etMax) ; // Conversion reconstruction efficiency histname = "convEffVsEtaTwoTracks"; convEffEtaTwoTracks_ = dbe_->book1D(histname,histname,etaBin2,etaMin, etaMax); histname = "convEffVsPhiTwoTracks"; convEffPhiTwoTracks_ = dbe_->book1D(histname,histname,phiBin,phiMin,phiMax); histname = "convEffVsRTwoTracks"; convEffRTwoTracks_ = dbe_->book1D(histname,histname,rBin,rMin, rMax); histname = "convEffVsZTwoTracks"; convEffZTwoTracks_ = dbe_->book1D(histname,histname,zBin,zMin,zMax); histname = "convEffVsEtTwoTracks"; convEffEtTwoTracks_ = dbe_->book1D(histname,histname,etBin,etMin, etMax); // histname = "convEffVsEtaTwoTracksAndVtxProbGT0"; convEffEtaTwoTracksAndVtxProbGT0_ = dbe_->book1D(histname,histname,etaBin2,etaMin, etaMax); histname = "convEffVsEtaTwoTracksAndVtxProbGT0005"; convEffEtaTwoTracksAndVtxProbGT0005_ = dbe_->book1D(histname,histname,etaBin2,etaMin, etaMax); histname = "convEffVsRTwoTracksAndVtxProbGT0"; convEffRTwoTracksAndVtxProbGT0_ = dbe_->book1D(histname,histname,rBin,rMin,rMax); histname = "convEffVsRTwoTracksAndVtxProbGT0005"; convEffRTwoTracksAndVtxProbGT0005_ = dbe_->book1D(histname,histname,rBin,rMin,rMax); // histname = "convEffVsEtaOneTrack"; convEffEtaOneTrack_ = dbe_->book1D(histname,histname,etaBin2,etaMin, etaMax); histname = "convEffVsROneTrack"; convEffROneTrack_ = dbe_->book1D(histname,histname,rBin,rMin, rMax); histname = "convEffVsEtOneTrack"; convEffEtOneTrack_ = dbe_->book1D(histname,histname,etBin,etMin, etMax); // Fake rate histname = "convFakeRateVsEtaTwoTracks"; convFakeRateEtaTwoTracks_ = dbe_->book1D(histname,histname,etaBin2,etaMin, etaMax); histname = "convFakeRateVsPhiTwoTracks"; convFakeRatePhiTwoTracks_ = dbe_->book1D(histname,histname,phiBin,phiMin,phiMax); histname = "convFakeRateVsRTwoTracks"; convFakeRateRTwoTracks_ = dbe_->book1D(histname,histname,rBin,rMin, rMax); histname = "convFakeRateVsZTwoTracks"; convFakeRateZTwoTracks_ = dbe_->book1D(histname,histname,zBin,zMin,zMax); histname = "convFakeRateVsEtTwoTracks"; convFakeRateEtTwoTracks_ = dbe_->book1D(histname,histname,etBin,etMin, etMax); histname = "bkgEffVsEta"; bkgRecoEffEta_ = dbe_->book1D(histname,"Bkg reconstruction efficiency vs simulated #eta",etaBin,etaMin, etaMax); histname = "bkgEffVsPhi"; bkgRecoEffPhi_ = dbe_->book1D(histname,"Bkg reconstruction efficiency vs simulated #phi",phiBin,phiMin, phiMax); histname = "bkgEffVsEt"; bkgRecoEffEt_ = dbe_->book1D(histname,"Bkg reconstruction efficiency vs simulated Et",etBin,etMin, etMax) ; // Fraction of photons with at least one dead channel histname = "deadChVsEtaBkg"; bkgDeadChEta_ = dbe_->book1D(histname,"Fraction of bkg with >=1 dead Xtal vs simulated #eta",etaBin,etaMin, etaMax); histname = "deadChVsPhiBkg"; bkgDeadChPhi_ = dbe_->book1D(histname,"Fraction of bkg with >=1 dead Xtal vs simulated #phi",phiBin,phiMin, phiMax); histname = "deadChVsEtBkg"; bkgDeadChEt_ = dbe_->book1D(histname,"Fraction of bkg with >=1 dead Xtal vs simulated Et",etBin,etMin, etMax) ; // efficiencies dividePlots(dbe_->get(effPathName+"recoEffVsEta"),dbe_->get(simInfoPathName+"h_MatchedSimPhoEta"),dbe_->get(simInfoPathName+"h_SimPhoEta"), "effic"); dividePlots(dbe_->get(effPathName+"recoEffVsPhi"),dbe_->get(simInfoPathName+"h_MatchedSimPhoPhi"),dbe_->get(simInfoPathName+"h_SimPhoPhi"),"effic"); dividePlots(dbe_->get(effPathName+"recoEffVsEt"),dbe_->get(simInfoPathName+"h_MatchedSimPhoEt"),dbe_->get(simInfoPathName+"h_SimPhoEt"),"effic"); // fraction of photons with at least one dead channel dividePlots(dbe_->get(effPathName+"deadChVsEta"),dbe_->get(simInfoPathName+"h_MatchedSimPhoBadChEta"),dbe_->get(simInfoPathName+"h_MatchedSimPhoEta"), "effic"); dividePlots(dbe_->get(effPathName+"deadChVsPhi"),dbe_->get(simInfoPathName+"h_MatchedSimPhoBadChPhi"),dbe_->get(simInfoPathName+"h_MatchedSimPhoPhi"),"effic"); dividePlots(dbe_->get(effPathName+"deadChVsEt"), dbe_->get(simInfoPathName+"h_MatchedSimPhoBadChEt"),dbe_->get(simInfoPathName+"h_MatchedSimPhoEt"),"effic"); // dividePlots(dbe_->get(effPathName+"convEffVsEtaTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEta"),dbe_->get(simInfoPathName+"h_VisSimConvEta"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsPhiTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksPhi"),dbe_->get(simInfoPathName+"h_VisSimConvPhi"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsRTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksR"),dbe_->get(simInfoPathName+"h_VisSimConvR"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsZTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksZ"),dbe_->get(simInfoPathName+"h_VisSimConvZ"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsEtTwoTracks"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEt"),dbe_->get(simInfoPathName+"h_VisSimConvEt"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsEtaTwoTracksAndVtxProbGT0"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEtaAndVtxPGT0"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEta"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsEtaTwoTracksAndVtxProbGT0005"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEtaAndVtxPGT0005"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksEta"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsRTwoTracksAndVtxProbGT0"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksRAndVtxPGT0"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksR"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsRTwoTracksAndVtxProbGT0005"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksRAndVtxPGT0005"),dbe_->get(simInfoPathName+"h_SimConvTwoMTracksR"),"effic"); // dividePlots(dbe_->get(effPathName+"convEffVsEtaOneTrack"),dbe_->get(simInfoPathName+"h_SimConvOneMTracksEta"),dbe_->get(simInfoPathName+"h_VisSimConvEta"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsROneTrack"),dbe_->get(simInfoPathName+"h_SimConvOneMTracksR"),dbe_->get(simInfoPathName+"h_VisSimConvR"),"effic"); dividePlots(dbe_->get(effPathName+"convEffVsEtOneTrack"),dbe_->get(simInfoPathName+"h_SimConvOneMTracksEt"),dbe_->get(simInfoPathName+"h_VisSimConvEt"),"effic"); // fake rate dividePlots(dbe_->get(effPathName+"convFakeRateVsEtaTwoTracks"),dbe_->get(convPathName+"h_RecoConvTwoMTracksEta"),dbe_->get(convPathName+"h_RecoConvTwoTracksEta"),"fakerate"); dividePlots(dbe_->get(effPathName+"convFakeRateVsPhiTwoTracks"),dbe_->get(convPathName+"h_RecoConvTwoMTracksPhi"),dbe_->get(convPathName+"h_RecoConvTwoTracksPhi"),"fakerate"); dividePlots(dbe_->get(effPathName+"convFakeRateVsRTwoTracks"),dbe_->get(convPathName+"h_RecoConvTwoMTracksR"),dbe_->get(convPathName+"h_RecoConvTwoTracksR"),"fakerate"); dividePlots(dbe_->get(effPathName+"convFakeRateVsZTwoTracks"),dbe_->get(convPathName+"h_RecoConvTwoMTracksZ"),dbe_->get(convPathName+"h_RecoConvTwoTracksZ"),"fakerate"); dividePlots(dbe_->get(effPathName+"convFakeRateVsEtTwoTracks"),dbe_->get(convPathName+"h_RecoConvTwoMTracksEt"),dbe_->get(convPathName+"h_RecoConvTwoTracksEt"),"fakerate"); // Background efficiency dividePlots(dbe_->get(effPathName+"bkgEffVsEta"),dbe_->get(simInfoPathName+"h_MatchedSimJetEta"),dbe_->get(simInfoPathName+"h_SimJetEta"), "effic"); dividePlots(dbe_->get(effPathName+"bkgEffVsPhi"),dbe_->get(simInfoPathName+"h_MatchedSimJetPhi"),dbe_->get(simInfoPathName+"h_SimJetPhi"),"effic"); dividePlots(dbe_->get(effPathName+"bkgEffVsEt"),dbe_->get(simInfoPathName+"h_MatchedSimJetEt"),dbe_->get(simInfoPathName+"h_SimJetEt"),"effic"); // fraction of photons with at least one dead channel dividePlots(dbe_->get(effPathName+"deadChVsEtaBkg"),dbe_->get(simInfoPathName+"h_MatchedSimJetBadChEta"),dbe_->get(simInfoPathName+"h_MatchedSimJetEta"), "effic"); dividePlots(dbe_->get(effPathName+"deadChVsPhiBkg"),dbe_->get(simInfoPathName+"h_MatchedSimJetBadChPhi"),dbe_->get(simInfoPathName+"h_MatchedSimJetPhi"),"effic"); dividePlots(dbe_->get(effPathName+"deadChVsEtBkg"), dbe_->get(simInfoPathName+"h_MatchedSimJetBadChEt"),dbe_->get(simInfoPathName+"h_MatchedSimJetEt"),"effic"); if(standAlone_) dbe_->save(outputFileName_); else if(batch_) dbe_->save(inputFileName_); }
bool PhotonPostprocessing::batch_ [private] |
Definition at line 86 of file PhotonPostprocessing.h.
MonitorElement* PhotonPostprocessing::bkgDeadChEt_ [private] |
Definition at line 148 of file PhotonPostprocessing.h.
Definition at line 146 of file PhotonPostprocessing.h.
Definition at line 147 of file PhotonPostprocessing.h.
Definition at line 144 of file PhotonPostprocessing.h.
Definition at line 142 of file PhotonPostprocessing.h.
Definition at line 143 of file PhotonPostprocessing.h.
Definition at line 132 of file PhotonPostprocessing.h.
Definition at line 121 of file PhotonPostprocessing.h.
Definition at line 128 of file PhotonPostprocessing.h.
Definition at line 127 of file PhotonPostprocessing.h.
Definition at line 134 of file PhotonPostprocessing.h.
Definition at line 125 of file PhotonPostprocessing.h.
Definition at line 122 of file PhotonPostprocessing.h.
Definition at line 133 of file PhotonPostprocessing.h.
Definition at line 123 of file PhotonPostprocessing.h.
Definition at line 130 of file PhotonPostprocessing.h.
Definition at line 129 of file PhotonPostprocessing.h.
Definition at line 124 of file PhotonPostprocessing.h.
Definition at line 136 of file PhotonPostprocessing.h.
Definition at line 140 of file PhotonPostprocessing.h.
Definition at line 137 of file PhotonPostprocessing.h.
Definition at line 138 of file PhotonPostprocessing.h.
Definition at line 139 of file PhotonPostprocessing.h.
std::stringstream PhotonPostprocessing::currentFolder_ [private] |
Definition at line 90 of file PhotonPostprocessing.h.
DQMStore* PhotonPostprocessing::dbe_ [private] |
Definition at line 79 of file PhotonPostprocessing.h.
int PhotonPostprocessing::etaBin [private] |
Definition at line 98 of file PhotonPostprocessing.h.
int PhotonPostprocessing::etaBin2 [private] |
Definition at line 99 of file PhotonPostprocessing.h.
double PhotonPostprocessing::etaMax [private] |
Definition at line 97 of file PhotonPostprocessing.h.
double PhotonPostprocessing::etaMin [private] |
Definition at line 96 of file PhotonPostprocessing.h.
int PhotonPostprocessing::etBin [private] |
Definition at line 95 of file PhotonPostprocessing.h.
double PhotonPostprocessing::etMax [private] |
Definition at line 94 of file PhotonPostprocessing.h.
double PhotonPostprocessing::etMin [private] |
Definition at line 93 of file PhotonPostprocessing.h.
std::string PhotonPostprocessing::inputFileName_ [private] |
Definition at line 88 of file PhotonPostprocessing.h.
std::string PhotonPostprocessing::outputFileName_ [private] |
Definition at line 87 of file PhotonPostprocessing.h.
Definition at line 82 of file PhotonPostprocessing.h.
int PhotonPostprocessing::phiBin [private] |
Definition at line 102 of file PhotonPostprocessing.h.
double PhotonPostprocessing::phiMax [private] |
Definition at line 101 of file PhotonPostprocessing.h.
double PhotonPostprocessing::phiMin [private] |
Definition at line 100 of file PhotonPostprocessing.h.
MonitorElement* PhotonPostprocessing::phoDeadChEt_ [private] |
Definition at line 118 of file PhotonPostprocessing.h.
Definition at line 116 of file PhotonPostprocessing.h.
Definition at line 117 of file PhotonPostprocessing.h.
Definition at line 114 of file PhotonPostprocessing.h.
Definition at line 112 of file PhotonPostprocessing.h.
Definition at line 113 of file PhotonPostprocessing.h.
int PhotonPostprocessing::rBin [private] |
Definition at line 105 of file PhotonPostprocessing.h.
double PhotonPostprocessing::rMax [private] |
Definition at line 104 of file PhotonPostprocessing.h.
double PhotonPostprocessing::rMin [private] |
Definition at line 103 of file PhotonPostprocessing.h.
bool PhotonPostprocessing::standAlone_ [private] |
Definition at line 85 of file PhotonPostprocessing.h.
int PhotonPostprocessing::verbosity_ [private] |
Definition at line 80 of file PhotonPostprocessing.h.
int PhotonPostprocessing::zBin [private] |
Definition at line 108 of file PhotonPostprocessing.h.
double PhotonPostprocessing::zMax [private] |
Definition at line 107 of file PhotonPostprocessing.h.
double PhotonPostprocessing::zMin [private] |
Definition at line 106 of file PhotonPostprocessing.h.