#include <ConverterTester.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
virtual void | beginRun (const edm::Run &, const edm::EventSetup &) |
ConverterTester (const edm::ParameterSet &) | |
virtual void | endJob () |
virtual void | endRun (const edm::Run &, const edm::EventSetup &) |
virtual | ~ConverterTester () |
Private Attributes | |
unsigned int | count |
DQMStore * | dbe |
std::string | fName |
int | frequency |
std::string | label |
MonitorElement * | meTestFloat |
MonitorElement * | meTestInt |
MonitorElement * | meTestProfile1 |
MonitorElement * | meTestProfile2 |
MonitorElement * | meTestString |
MonitorElement * | meTestTH1FD |
MonitorElement * | meTestTH1FN |
MonitorElement * | meTestTH2F |
MonitorElement * | meTestTH3F |
TRandom * | Random |
double | RandomVal1 |
double | RandomVal2 |
double | RandomVal3 |
int | verbosity |
Class to fill dqm monitor elements from existing EDM file
Definition at line 38 of file ConverterTester.h.
ConverterTester::ConverterTester | ( | const edm::ParameterSet & | iPSet | ) | [explicit] |
Definition at line 3 of file ConverterTester.cc.
References count, dbe, fName, frequency, edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, and verbosity.
{ std::string MsgLoggerCat = "ConverterTester_ConverterTester"; fName = iPSet.getUntrackedParameter<std::string>("Name"); verbosity = iPSet.getUntrackedParameter<int>("Verbosity"); frequency = iPSet.getUntrackedParameter<int>("Frequency"); if (verbosity >= 0) { edm::LogInfo(MsgLoggerCat) << "\n===============================\n" << "Initialized as EDAnalyzer with parameter values:\n" << " Name = " << fName << "\n" << " Verbosity = " << verbosity << "\n" << " Frequency = " << frequency << "\n" << "===============================\n"; } dbe = 0; dbe = edm::Service<DQMStore>().operator->(); count = 0; }
ConverterTester::~ConverterTester | ( | ) | [virtual] |
Definition at line 28 of file ConverterTester.cc.
{}
void ConverterTester::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 114 of file ConverterTester.cc.
References count, MonitorElement::Fill(), i, meTestProfile1, meTestProfile2, meTestTH1FD, meTestTH1FN, meTestTH2F, meTestTH3F, RandomVal1, RandomVal2, and RandomVal3.
{ ++count; for(int i = 0; i < 1000; ++i) { RandomVal1 = Random->Gaus(0.,1.); RandomVal2 = Random->Gaus(0.,1.); RandomVal3 = Random->Gaus(0.,1.); meTestTH1FN->Fill(0.5*RandomVal1); meTestTH1FD->Fill(RandomVal1); meTestTH2F->Fill(RandomVal1, RandomVal2); meTestTH3F->Fill(RandomVal1, RandomVal2, RandomVal3); meTestProfile1->Fill(RandomVal1, RandomVal2); meTestProfile2->Fill(RandomVal1, RandomVal2, RandomVal3); } }
void ConverterTester::beginJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 30 of file ConverterTester.cc.
References DQMStore::book1D(), DQMStore::book2D(), DQMStore::book3D(), DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), DQMStore::bookString(), dbe, MonitorElement::getFullname(), meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestString, meTestTH1FD, meTestTH1FN, meTestTH2F, meTestTH3F, DQMStore::setCurrentFolder(), and DQMStore::tag().
{ if(dbe){ meTestString = 0; meTestInt = 0; meTestFloat = 0; meTestTH1FN = 0; meTestTH1FD = 0; meTestTH2F = 0; meTestTH3F = 0; meTestProfile1 = 0; meTestProfile2 = 0; Random = new TRandom3(); dbe->setCurrentFolder("ConverterTest/String"); meTestString = dbe->bookString("TestString","Test String" ); dbe->setCurrentFolder("ConverterTest/Int"); meTestInt = dbe->bookInt("TestInt"); dbe->setCurrentFolder("ConverterTest/Float"); meTestFloat = dbe->bookFloat("TestFloat"); dbe->setCurrentFolder("ConverterTest/TH1F"); meTestTH1FN = dbe->book1D("Random1DN", "Random1D Numerator", 100, -10., 10.); meTestTH1FD = dbe->book1D("Random1DD", "Random1D Denominator", 100, -10., 10.); dbe->setCurrentFolder("ConverterTest/TH2F"); meTestTH2F = dbe->book2D("Random2D", "Random2D", 100, -10, 10., 100, -10., 10.); dbe->setCurrentFolder("ConverterTest/TH3F"); meTestTH3F = dbe->book3D("Random3D", "Random3D", 100, -10., 10., 100, -10., 10., 100, -10., 10.); dbe->setCurrentFolder("ConverterTest/TProfile"); meTestProfile1 = dbe->bookProfile("Profile1", "Profile1", 100, -10., 10., 100, -10., 10.); dbe->setCurrentFolder("ConverterTest/TProfile2D"); meTestProfile2 = dbe->bookProfile2D("Profile2", "Profile2", 100, -10., 10., 100, -10, 10., 100, -10., 10.); dbe->tag(meTestTH1FN->getFullname(),1); dbe->tag(meTestTH1FD->getFullname(),2); dbe->tag(meTestTH2F->getFullname(),3); dbe->tag(meTestTH3F->getFullname(),4); dbe->tag(meTestProfile1->getFullname(),5); dbe->tag(meTestProfile2->getFullname(),6); dbe->tag(meTestString->getFullname(),7); dbe->tag(meTestInt->getFullname(),8); dbe->tag(meTestFloat->getFullname(),9); } return; }
void ConverterTester::beginRun | ( | const edm::Run & | iRun, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
void ConverterTester::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 90 of file ConverterTester.cc.
References count, and verbosity.
{ std::string MsgLoggerCat = "ConverterTester_endJob"; if (verbosity >= 0) edm::LogInfo(MsgLoggerCat) << "Terminating having processed " << count << " events."; return; }
void ConverterTester::endRun | ( | const edm::Run & | iRun, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 105 of file ConverterTester.cc.
References MonitorElement::Fill(), meTestFloat, and meTestInt.
{ meTestInt->Fill(100); meTestFloat->Fill(3.141592); return; }
unsigned int ConverterTester::count [private] |
Definition at line 75 of file ConverterTester.h.
Referenced by analyze(), ConverterTester(), and endJob().
DQMStore* ConverterTester::dbe [private] |
Definition at line 57 of file ConverterTester.h.
Referenced by beginJob(), and ConverterTester().
std::string ConverterTester::fName [private] |
Definition at line 53 of file ConverterTester.h.
Referenced by ConverterTester().
int ConverterTester::frequency [private] |
Definition at line 55 of file ConverterTester.h.
Referenced by ConverterTester().
std::string ConverterTester::label [private] |
Definition at line 56 of file ConverterTester.h.
MonitorElement* ConverterTester::meTestFloat [private] |
Definition at line 61 of file ConverterTester.h.
Referenced by beginJob(), and endRun().
MonitorElement* ConverterTester::meTestInt [private] |
Definition at line 60 of file ConverterTester.h.
Referenced by beginJob(), and endRun().
MonitorElement* ConverterTester::meTestProfile1 [private] |
Definition at line 66 of file ConverterTester.h.
Referenced by analyze(), and beginJob().
MonitorElement* ConverterTester::meTestProfile2 [private] |
Definition at line 67 of file ConverterTester.h.
Referenced by analyze(), and beginJob().
MonitorElement* ConverterTester::meTestString [private] |
Definition at line 59 of file ConverterTester.h.
Referenced by beginJob().
MonitorElement* ConverterTester::meTestTH1FD [private] |
Definition at line 62 of file ConverterTester.h.
Referenced by analyze(), and beginJob().
MonitorElement* ConverterTester::meTestTH1FN [private] |
Definition at line 63 of file ConverterTester.h.
Referenced by analyze(), and beginJob().
MonitorElement* ConverterTester::meTestTH2F [private] |
Definition at line 64 of file ConverterTester.h.
Referenced by analyze(), and beginJob().
MonitorElement* ConverterTester::meTestTH3F [private] |
Definition at line 65 of file ConverterTester.h.
Referenced by analyze(), and beginJob().
TRandom* ConverterTester::Random [private] |
Definition at line 69 of file ConverterTester.h.
double ConverterTester::RandomVal1 [private] |
Definition at line 70 of file ConverterTester.h.
Referenced by analyze().
double ConverterTester::RandomVal2 [private] |
Definition at line 71 of file ConverterTester.h.
Referenced by analyze().
double ConverterTester::RandomVal3 [private] |
Definition at line 72 of file ConverterTester.h.
Referenced by analyze().
int ConverterTester::verbosity [private] |
Definition at line 54 of file ConverterTester.h.
Referenced by ConverterTester(), and endJob().