#include <DQMServices/Examples/interface/HarvestingAnalyzer.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | beginRun (const edm::Run &, const edm::EventSetup &) |
virtual void | endJob () |
virtual void | endRun (const edm::Run &, const edm::EventSetup &) |
HarvestingAnalyzer (const edm::ParameterSet &) | |
virtual | ~HarvestingAnalyzer () |
Private Attributes | |
DQMStore * | dbe |
std::string | fName |
int | verbosity |
Definition at line 36 of file HarvestingAnalyzer.h.
HarvestingAnalyzer::HarvestingAnalyzer | ( | const edm::ParameterSet & | iPSet | ) | [explicit] |
Definition at line 3 of file HarvestingAnalyzer.cc.
References fName, edm::ParameterSet::getUntrackedParameter(), and verbosity.
00004 { 00005 std::string MsgLoggerCat = "HarvestingAnalyzer_HarvestingAnalyzer"; 00006 00007 fName = iPSet.getUntrackedParameter<std::string>("Name"); 00008 verbosity = iPSet.getUntrackedParameter<int>("Verbosity"); 00009 00010 if (verbosity >= 0) { 00011 edm::LogInfo(MsgLoggerCat) 00012 << "\n===============================\n" 00013 << "Initialized as EDAnalyzer with parameter values:\n" 00014 << " Name = " << fName << "\n" 00015 << " Verbosity = " << verbosity << "\n" 00016 << "===============================\n"; 00017 } 00018 }
HarvestingAnalyzer::~HarvestingAnalyzer | ( | ) | [virtual] |
void HarvestingAnalyzer::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
void HarvestingAnalyzer::beginJob | ( | const edm::EventSetup & | iSetup | ) | [virtual] |
void HarvestingAnalyzer::beginRun | ( | const edm::Run & | iRun, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 27 of file HarvestingAnalyzer.cc.
References DQMStore::book1D(), GenMuonPlsPt100GeV_cfg::cout, dbe, lat::endl(), DQMStore::get(), MonitorElement::getTH1F(), me, and DQMStore::setCurrentFolder().
00028 { 00029 00030 dbe = 0; 00031 dbe = edm::Service<DQMStore>().operator->(); 00032 00033 if (dbe) { 00034 00035 // monitoring element numerator and denominator histogram 00036 MonitorElement *meN = 00037 dbe->get("ConverterTest/TH1F/Random1DN"); 00038 MonitorElement *meD = 00039 dbe->get("ConverterTest/TH1F/Random1DD"); 00040 00041 if (meN && meD) { 00042 00043 // get the numerator and denominator histogram 00044 TH1F *numerator = meN->getTH1F(); 00045 numerator->Sumw2(); 00046 TH1F *denominator = meD->getTH1F(); 00047 denominator->Sumw2(); 00048 00049 // set the current directory 00050 dbe->setCurrentFolder("ConverterTest/TH1F"); 00051 00052 // booked the new histogram to contain the results 00053 MonitorElement *me = 00054 dbe->book1D("Divide","Divide calculation", 00055 numerator->GetNbinsX(), 00056 numerator->GetXaxis()->GetXmin(), 00057 numerator->GetXaxis()->GetXmax()); 00058 00059 // Calculate the efficiency 00060 me->getTH1F()->Divide(numerator, denominator, 1., 1., "B"); 00061 00062 } else { 00063 std::cout << "Monitor elements don't exist" << std::endl; 00064 } 00065 } else { 00066 std::cout << "Don't have a valid DQM back end" << std::endl; 00067 } 00068 00069 return; 00070 }
void HarvestingAnalyzer::endRun | ( | const edm::Run & | iRun, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
DQMStore* HarvestingAnalyzer::dbe [private] |
std::string HarvestingAnalyzer::fName [private] |
int HarvestingAnalyzer::verbosity [private] |