abstract base class More...
#include <Benchmark.h>
Classes | |
class | PhaseSpace |
Public Types | |
enum | Mode { DEFAULT, DQMOFFLINE, VALIDATION } |
Public Member Functions | |
Benchmark (Mode mode=DEFAULT) | |
bool | isInRange (float pt, float eta, float phi) const |
virtual void | setDirectory (TDirectory *dir) |
void | setParameters (Mode mode) |
void | setRange (float ptMin, float ptMax, float etaMin, float etaMax, float phiMin, float phiMax) |
void | write () |
write to the TFile, in plain ROOT mode. No need to call this function in DQM mode | |
virtual | ~Benchmark () |
Static Public Attributes | |
static DQMStore * | DQM_ = 0 |
Protected Member Functions | |
TH1F * | book1D (const char *histname, const char *title, int nbins, float xmin, float xmax) |
book a 1D histogram, either with DQM or plain root. | |
TH2F * | book2D (const char *histname, const char *title, int nbinsx, float *xbins, int nbinsy, float ymin, float ymax) |
book a 2D histogram, either with DQM or plain root. | |
TH2F * | book2D (const char *histname, const char *title, int nbinsx, float xmin, float xmax, int nbinsy, float ymin, float ymax) |
book a 2D histogram, either with DQM or plain root. | |
Protected Attributes | |
TDirectory * | dir_ |
float | etaMax_ |
float | etaMin_ |
Mode | mode_ |
float | phiMax_ |
float | phiMin_ |
float | ptMax_ |
float | ptMin_ |
abstract base class
Definition at line 20 of file Benchmark.h.
enum Benchmark::Mode |
Definition at line 33 of file Benchmark.h.
{ DEFAULT, DQMOFFLINE, VALIDATION };
Benchmark::Benchmark | ( | Mode | mode = DEFAULT | ) | [inline] |
Benchmark::~Benchmark | ( | ) | [virtual] |
Definition at line 15 of file Benchmark.cc.
{ }
TH1F * Benchmark::book1D | ( | const char * | histname, |
const char * | title, | ||
int | nbins, | ||
float | xmin, | ||
float | xmax | ||
) | [protected] |
book a 1D histogram, either with DQM or plain root.
Definition at line 25 of file Benchmark.cc.
References gather_cfg::cout, sistrip::dir_, and estimatePileup::hist.
Referenced by PFMETMonitor::setup(), and CandidateBenchmark::setup().
{ // DQM_ has to be initialized in a child analyzer. if(DQM_) { edm::LogInfo("Benchmark") << " Benchmark::book1D " << "booking "<<histname; return DQM_->book1D(histname,title,nbins,xmin, xmax)->getTH1F(); } else if(dir_){ TDirectory *oldpwd = gDirectory; dir_->cd(); TH1F *hist = new TH1F(histname, title, nbins, xmin, xmax); cout<<"booking (ROOT mode) "<<histname<<" in "<<dir_->GetName()<<endl; oldpwd->cd(); return hist; } else assert(0); }
TH2F * Benchmark::book2D | ( | const char * | histname, |
const char * | title, | ||
int | nbinsx, | ||
float * | xbins, | ||
int | nbinsy, | ||
float | ymin, | ||
float | ymax | ||
) | [protected] |
book a 2D histogram, either with DQM or plain root.
Definition at line 62 of file Benchmark.cc.
References gather_cfg::cout, sistrip::dir_, estimatePileup::hist, and i.
{ if(DQM_) { edm::LogInfo("Benchmark") << " Benchmark::book2D " << " booked "<<histname; // need to build the y bin array manually, due to a missing // function in DQMStore vector<float> ybins( nbinsy+1 ); double binsize = (ymax - ymin) / nbinsy; for(int i=0; i<=nbinsy; ++i) { ybins[i] = ymin + i*binsize; } return DQM_->book2D(histname,title,nbinsx, xbins, nbinsy, &ybins[0])->getTH2F(); } else if(dir_) { TDirectory *oldpwd = gDirectory; dir_->cd(); // need to convert the float bin array into a double bin array, // because the DQMStore functions take floats, while the ROOT functions // take double. vector<double> xbinsd(nbinsx+1); for(int i=0; i<=nbinsx; ++i) { xbinsd[i] = xbins[i]; } TH2F *hist = new TH2F(histname, title, nbinsx, &xbinsd[0], nbinsy, ymin, ymax); cout<<"booked (ROOT mode) "<<histname<<" in "<<dir_->GetName()<<endl; oldpwd->cd(); return hist; } else assert(0); }
TH2F * Benchmark::book2D | ( | const char * | histname, |
const char * | title, | ||
int | nbinsx, | ||
float | xmin, | ||
float | xmax, | ||
int | nbinsy, | ||
float | ymin, | ||
float | ymax | ||
) | [protected] |
book a 2D histogram, either with DQM or plain root.
Definition at line 43 of file Benchmark.cc.
References gather_cfg::cout, sistrip::dir_, and estimatePileup::hist.
Referenced by PFMETMonitor::setup(), MatchCandidateBenchmark::setup(), and PFJetMonitor::setup().
{ // DQM_ has to be initialized in a child analyzer. if(DQM_) { edm::LogInfo("Benchmark") << " Benchmark::book2D "<<"booked "<<histname; return DQM_->book2D(histname,title,nbinsx,xmin, xmax, nbinsy, ymin, ymax)->getTH2F(); } else if(dir_) { TDirectory *oldpwd = gDirectory; dir_->cd(); TH2F *hist = new TH2F(histname, title, nbinsx, xmin, xmax, nbinsy, ymin, ymax); cout<<"booked (ROOT mode) "<<histname<<" in "<<dir_->GetName()<<endl; oldpwd->cd(); return hist; } else assert(0); }
bool Benchmark::isInRange | ( | float | pt, |
float | eta, | ||
float | phi | ||
) | const [inline] |
Definition at line 58 of file Benchmark.h.
References etaMin_, phiMax_, phiMin_, and ptMin_.
Referenced by PFCandidateManager::fill(), PFJetMonitor::fill(), CandidateBenchmark::fillOne(), MatchCandidateBenchmark::fillOne(), and PFMETMonitor::fillOne().
void Benchmark::setDirectory | ( | TDirectory * | dir | ) | [virtual] |
Reimplemented in PFCandidateManager, PFJetMonitor, and PFMETMonitor.
Definition at line 19 of file Benchmark.cc.
References dir, and sistrip::dir_.
Referenced by PFJetMonitor::setDirectory(), PFCandidateManager::setDirectory(), and PFMETMonitor::setDirectory().
void Benchmark::setParameters | ( | Mode | mode | ) | [inline] |
Definition at line 49 of file Benchmark.h.
Referenced by PFMETMonitor::setParameters(), and PFJetMonitor::setParameters().
void Benchmark::setRange | ( | float | ptMin, |
float | ptMax, | ||
float | etaMin, | ||
float | etaMax, | ||
float | phiMin, | ||
float | phiMax | ||
) | [inline] |
Definition at line 51 of file Benchmark.h.
References ExpressReco_HICollisions_FallBack::etaMax, etaMax_, ExpressReco_HICollisions_FallBack::etaMin, etaMin_, ExpressReco_HICollisions_FallBack::phiMax, phiMax_, ExpressReco_HICollisions_FallBack::phiMin, phiMin_, ExpressReco_HICollisions_FallBack::ptMax, ptMax_, ExpressReco_HICollisions_FallBack::ptMin, and ptMin_.
Referenced by CandidateBenchmarkAnalyzer::CandidateBenchmarkAnalyzer(), METBenchmarkAnalyzer::METBenchmarkAnalyzer(), PFCandidateBenchmarkAnalyzer::PFCandidateBenchmarkAnalyzer(), PFCandidateManagerAnalyzer::PFCandidateManagerAnalyzer(), PFRootEventManager::readOptions(), PFMETMonitor::setParameters(), and PFJetMonitor::setParameters().
void Benchmark::write | ( | void | ) |
write to the TFile, in plain ROOT mode. No need to call this function in DQM mode
Definition at line 99 of file Benchmark.cc.
References sistrip::dir_.
TDirectory* Benchmark::dir_ [protected] |
Definition at line 84 of file Benchmark.h.
DQMStore * Benchmark::DQM_ = 0 [static] |
Definition at line 39 of file Benchmark.h.
Referenced by PFMETDQMAnalyzer::beginJob(), BenchmarkAnalyzer::beginJob(), PFJetDQMAnalyzer::beginJob(), PFMETDQMAnalyzer::storeBadEvents(), and PFJetDQMAnalyzer::storeBadEvents().
float Benchmark::etaMax_ [protected] |
Definition at line 91 of file Benchmark.h.
Referenced by setRange().
float Benchmark::etaMin_ [protected] |
Definition at line 90 of file Benchmark.h.
Referenced by isInRange(), and setRange().
Mode Benchmark::mode_ [protected] |
Definition at line 86 of file Benchmark.h.
Referenced by setParameters(), PFMETMonitor::setParameters(), PFJetMonitor::setParameters(), MatchCandidateBenchmark::setup(), and CandidateBenchmark::setup().
float Benchmark::phiMax_ [protected] |
Definition at line 93 of file Benchmark.h.
Referenced by isInRange(), and setRange().
float Benchmark::phiMin_ [protected] |
Definition at line 92 of file Benchmark.h.
Referenced by isInRange(), and setRange().
float Benchmark::ptMax_ [protected] |
Definition at line 89 of file Benchmark.h.
Referenced by setRange().
float Benchmark::ptMin_ [protected] |
Definition at line 88 of file Benchmark.h.
Referenced by isInRange(), and setRange().