#include <GlobalHitsTester.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (void) |
virtual void | beginRun (const edm::Run &, const edm::EventSetup &) |
virtual void | endJob () |
virtual void | endRun (const edm::Run &, const edm::EventSetup &) |
GlobalHitsTester (const edm::ParameterSet &) | |
virtual | ~GlobalHitsTester () |
Private Attributes | |
unsigned int | count |
DQMStore * | dbe |
bool | doOutput |
std::string | fName |
int | frequency |
bool | getAllProvenances |
std::string | label |
MonitorElement * | meTestFloat |
MonitorElement * | meTestInt |
MonitorElement * | meTestProfile1 |
MonitorElement * | meTestProfile2 |
MonitorElement * | meTestString |
MonitorElement * | meTestTH1F |
MonitorElement * | meTestTH2F |
MonitorElement * | meTestTH3F |
std::string | outputfile |
bool | printProvenanceInfo |
TRandom * | Random |
double | RandomVal1 |
double | RandomVal2 |
double | RandomVal3 |
int | verbosity |
int | vtxunit |
Definition at line 78 of file GlobalHitsTester.h.
GlobalHitsTester::GlobalHitsTester | ( | const edm::ParameterSet & | iPSet | ) | [explicit] |
Definition at line 4 of file GlobalHitsTester.cc.
References DQMStore::book1D(), DQMStore::book2D(), DQMStore::book3D(), DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), DQMStore::bookString(), dbe, doOutput, fName, frequency, getAllProvenances, MonitorElement::getFullname(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestString, meTestTH1F, meTestTH2F, meTestTH3F, cmsCodeRules::cppFunctionSkipper::operator, outputfile, printProvenanceInfo, DQMStore::setCurrentFolder(), DQMStore::tag(), verbosity, and vtxunit.
: fName(""), verbosity(0), frequency(0), vtxunit(0), label(""), getAllProvenances(false), printProvenanceInfo(false), count(0) { std::string MsgLoggerCat = "GlobalHitsTester_GlobalHitsTester"; fName = iPSet.getUntrackedParameter<std::string>("Name"); verbosity = iPSet.getUntrackedParameter<int>("Verbosity"); frequency = iPSet.getUntrackedParameter<int>("Frequency"); vtxunit = iPSet.getUntrackedParameter<int>("VtxUnit"); outputfile = iPSet.getParameter<std::string>("OutputFile"); doOutput = iPSet.getParameter<bool>("DoOutput"); edm::ParameterSet m_Prov = iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup"); getAllProvenances = m_Prov.getUntrackedParameter<bool>("GetAllProvenances"); printProvenanceInfo = m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo"); if (verbosity >= 0) { edm::LogInfo(MsgLoggerCat) << "\n===============================\n" << "Initialized as EDAnalyzer with parameter values:\n" << " Name = " << fName << "\n" << " Verbosity = " << verbosity << "\n" << " Frequency = " << frequency << "\n" << " VtxUnit = " << vtxunit << "\n" << " OutputFile = " << outputfile << "\n" << " DoOutput = " << doOutput << "\n" << " GetProv = " << getAllProvenances << "\n" << " PrintProv = " << printProvenanceInfo << "\n" << "===============================\n"; } dbe = 0; dbe = edm::Service<DQMStore>().operator->(); if(dbe){ meTestString = 0; meTestInt = 0; meTestFloat = 0; meTestTH1F = 0; meTestTH2F = 0; meTestTH3F = 0; meTestProfile1 = 0; meTestProfile2 = 0; Random = new TRandom3(); dbe->setCurrentFolder("GlobalTestV/String"); meTestString = dbe->bookString("TestString","Hello World" ); dbe->setCurrentFolder("GlobalTestV/Int"); meTestInt = dbe->bookInt("TestInt"); dbe->setCurrentFolder("GlobalTestV/Float"); meTestFloat = dbe->bookFloat("TestFloat"); dbe->setCurrentFolder("GlobalTestV/TH1F"); meTestTH1F = dbe->book1D("Random1D", "Random1D", 100, -10., 10.); dbe->setCurrentFolder("GlobalTestV/TH2F"); meTestTH2F = dbe->book2D("Random2D", "Random2D", 100, -10, 10., 100, -10., 10.); dbe->setCurrentFolder("GlobalTestV/TH3F"); meTestTH3F = dbe->book3D("Random3D", "Random3D", 100, -10., 10., 100, -10., 10., 100, -10., 10.); dbe->setCurrentFolder("GlobalTestV/TProfile"); meTestProfile1 = dbe->bookProfile("Profile1", "Profile1", 100, -10., 10., 100, -10., 10.); dbe->setCurrentFolder("GlobalTestV/TProfile2D"); meTestProfile2 = dbe->bookProfile2D("Profile2", "Profile2", 100, -10., 10., 100, -10, 10., 100, -10., 10.); dbe->tag(meTestTH1F->getFullname(),1); dbe->tag(meTestTH2F->getFullname(),2); dbe->tag(meTestTH3F->getFullname(),3); dbe->tag(meTestProfile1->getFullname(),4); dbe->tag(meTestProfile2->getFullname(),5); dbe->tag(meTestString->getFullname(),6); dbe->tag(meTestInt->getFullname(),7); dbe->tag(meTestFloat->getFullname(),8); } }
GlobalHitsTester::~GlobalHitsTester | ( | ) | [virtual] |
Definition at line 91 of file GlobalHitsTester.cc.
References dbe, doOutput, outputfile, and DQMStore::save().
{ if (doOutput) if (outputfile.size() != 0 && dbe) dbe->save(outputfile); }
void GlobalHitsTester::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 126 of file GlobalHitsTester.cc.
References MonitorElement::Fill(), i, meTestProfile1, meTestProfile2, meTestTH1F, meTestTH2F, meTestTH3F, RandomVal1, RandomVal2, and RandomVal3.
{ for(int i = 0; i < 1000; ++i) { RandomVal1 = Random->Gaus(0.,1.); RandomVal2 = Random->Gaus(0.,1.); RandomVal3 = Random->Gaus(0.,1.); meTestTH1F->Fill(RandomVal1); meTestTH2F->Fill(RandomVal1, RandomVal2); meTestTH3F->Fill(RandomVal1, RandomVal2, RandomVal3); meTestProfile1->Fill(RandomVal1, RandomVal2); meTestProfile2->Fill(RandomVal1, RandomVal2, RandomVal3); } }
void GlobalHitsTester::beginJob | ( | void | ) | [virtual] |
void GlobalHitsTester::beginRun | ( | const edm::Run & | iRun, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
void GlobalHitsTester::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 102 of file GlobalHitsTester.cc.
References count, and verbosity.
{ std::string MsgLoggerCat = "GlobalHitsTester_endJob"; if (verbosity >= 0) edm::LogInfo(MsgLoggerCat) << "Terminating having processed " << count << " events."; return; }
void GlobalHitsTester::endRun | ( | const edm::Run & | iRun, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 117 of file GlobalHitsTester.cc.
References MonitorElement::Fill(), meTestFloat, and meTestInt.
{ meTestInt->Fill(100); meTestFloat->Fill(3.141592); return; }
unsigned int GlobalHitsTester::count [private] |
Definition at line 119 of file GlobalHitsTester.h.
Referenced by endJob().
DQMStore* GlobalHitsTester::dbe [private] |
Definition at line 100 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester(), and ~GlobalHitsTester().
bool GlobalHitsTester::doOutput [private] |
Definition at line 102 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester(), and ~GlobalHitsTester().
std::string GlobalHitsTester::fName [private] |
Definition at line 93 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester().
int GlobalHitsTester::frequency [private] |
Definition at line 95 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester().
bool GlobalHitsTester::getAllProvenances [private] |
Definition at line 98 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester().
std::string GlobalHitsTester::label [private] |
Definition at line 97 of file GlobalHitsTester.h.
MonitorElement* GlobalHitsTester::meTestFloat [private] |
Definition at line 106 of file GlobalHitsTester.h.
Referenced by endRun(), and GlobalHitsTester().
MonitorElement* GlobalHitsTester::meTestInt [private] |
Definition at line 105 of file GlobalHitsTester.h.
Referenced by endRun(), and GlobalHitsTester().
MonitorElement* GlobalHitsTester::meTestProfile1 [private] |
Definition at line 110 of file GlobalHitsTester.h.
Referenced by analyze(), and GlobalHitsTester().
MonitorElement* GlobalHitsTester::meTestProfile2 [private] |
Definition at line 111 of file GlobalHitsTester.h.
Referenced by analyze(), and GlobalHitsTester().
MonitorElement* GlobalHitsTester::meTestString [private] |
Definition at line 104 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester().
MonitorElement* GlobalHitsTester::meTestTH1F [private] |
Definition at line 107 of file GlobalHitsTester.h.
Referenced by analyze(), and GlobalHitsTester().
MonitorElement* GlobalHitsTester::meTestTH2F [private] |
Definition at line 108 of file GlobalHitsTester.h.
Referenced by analyze(), and GlobalHitsTester().
MonitorElement* GlobalHitsTester::meTestTH3F [private] |
Definition at line 109 of file GlobalHitsTester.h.
Referenced by analyze(), and GlobalHitsTester().
std::string GlobalHitsTester::outputfile [private] |
Definition at line 101 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester(), and ~GlobalHitsTester().
bool GlobalHitsTester::printProvenanceInfo [private] |
Definition at line 99 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester().
TRandom* GlobalHitsTester::Random [private] |
Definition at line 113 of file GlobalHitsTester.h.
double GlobalHitsTester::RandomVal1 [private] |
Definition at line 114 of file GlobalHitsTester.h.
Referenced by analyze().
double GlobalHitsTester::RandomVal2 [private] |
Definition at line 115 of file GlobalHitsTester.h.
Referenced by analyze().
double GlobalHitsTester::RandomVal3 [private] |
Definition at line 116 of file GlobalHitsTester.h.
Referenced by analyze().
int GlobalHitsTester::verbosity [private] |
Definition at line 94 of file GlobalHitsTester.h.
Referenced by endJob(), and GlobalHitsTester().
int GlobalHitsTester::vtxunit [private] |
Definition at line 96 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester().