#include <Validation/GlobalHits/interface/GlobalHitsTester.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 &) |
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, outputfile, printProvenanceInfo, DQMStore::setCurrentFolder(), DQMStore::tag(), verbosity, and vtxunit.
00004 : 00005 fName(""), verbosity(0), frequency(0), vtxunit(0), label(""), 00006 getAllProvenances(false), printProvenanceInfo(false), count(0) 00007 { 00008 std::string MsgLoggerCat = "GlobalHitsTester_GlobalHitsTester"; 00009 00010 fName = iPSet.getUntrackedParameter<std::string>("Name"); 00011 verbosity = iPSet.getUntrackedParameter<int>("Verbosity"); 00012 frequency = iPSet.getUntrackedParameter<int>("Frequency"); 00013 vtxunit = iPSet.getUntrackedParameter<int>("VtxUnit"); 00014 outputfile = iPSet.getParameter<std::string>("OutputFile"); 00015 doOutput = iPSet.getParameter<bool>("DoOutput"); 00016 edm::ParameterSet m_Prov = 00017 iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup"); 00018 getAllProvenances = 00019 m_Prov.getUntrackedParameter<bool>("GetAllProvenances"); 00020 printProvenanceInfo = 00021 m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo"); 00022 00023 if (verbosity >= 0) { 00024 edm::LogInfo(MsgLoggerCat) 00025 << "\n===============================\n" 00026 << "Initialized as EDAnalyzer with parameter values:\n" 00027 << " Name = " << fName << "\n" 00028 << " Verbosity = " << verbosity << "\n" 00029 << " Frequency = " << frequency << "\n" 00030 << " VtxUnit = " << vtxunit << "\n" 00031 << " OutputFile = " << outputfile << "\n" 00032 << " DoOutput = " << doOutput << "\n" 00033 << " GetProv = " << getAllProvenances << "\n" 00034 << " PrintProv = " << printProvenanceInfo << "\n" 00035 << "===============================\n"; 00036 } 00037 00038 dbe = 0; 00039 dbe = edm::Service<DQMStore>().operator->(); 00040 00041 if(dbe){ 00042 meTestString = 0; 00043 meTestInt = 0; 00044 meTestFloat = 0; 00045 meTestTH1F = 0; 00046 meTestTH2F = 0; 00047 meTestTH3F = 0; 00048 meTestProfile1 = 0; 00049 meTestProfile2 = 0; 00050 Random = new TRandom3(); 00051 00052 dbe->setCurrentFolder("GlobalTestV/String"); 00053 meTestString = dbe->bookString("TestString","Hello World" ); 00054 00055 dbe->setCurrentFolder("GlobalTestV/Int"); 00056 meTestInt = dbe->bookInt("TestInt"); 00057 00058 dbe->setCurrentFolder("GlobalTestV/Float"); 00059 meTestFloat = dbe->bookFloat("TestFloat"); 00060 00061 dbe->setCurrentFolder("GlobalTestV/TH1F"); 00062 meTestTH1F = dbe->book1D("Random1D", "Random1D", 100, -10., 10.); 00063 00064 dbe->setCurrentFolder("GlobalTestV/TH2F"); 00065 meTestTH2F = dbe->book2D("Random2D", "Random2D", 100, -10, 10., 100, -10., 00066 10.); 00067 00068 dbe->setCurrentFolder("GlobalTestV/TH3F"); 00069 meTestTH3F = dbe->book3D("Random3D", "Random3D", 100, -10., 10., 100, 00070 -10., 10., 100, -10., 10.); 00071 00072 dbe->setCurrentFolder("GlobalTestV/TProfile"); 00073 meTestProfile1 = dbe->bookProfile("Profile1", "Profile1", 100, -10., 10., 00074 100, -10., 10.); 00075 00076 dbe->setCurrentFolder("GlobalTestV/TProfile2D"); 00077 meTestProfile2 = dbe->bookProfile2D("Profile2", "Profile2", 100, -10., 00078 10., 100, -10, 10., 100, -10., 10.); 00079 00080 dbe->tag(meTestTH1F->getFullname(),1); 00081 dbe->tag(meTestTH2F->getFullname(),2); 00082 dbe->tag(meTestTH3F->getFullname(),3); 00083 dbe->tag(meTestProfile1->getFullname(),4); 00084 dbe->tag(meTestProfile2->getFullname(),5); 00085 dbe->tag(meTestString->getFullname(),6); 00086 dbe->tag(meTestInt->getFullname(),7); 00087 dbe->tag(meTestFloat->getFullname(),8); 00088 } 00089 }
GlobalHitsTester::~GlobalHitsTester | ( | ) | [virtual] |
Definition at line 91 of file GlobalHitsTester.cc.
References dbe, doOutput, outputfile, and DQMStore::save().
00092 { 00093 if (doOutput) 00094 if (outputfile.size() != 0 && dbe) dbe->save(outputfile); 00095 }
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.
00128 { 00129 00130 for(int i = 0; i < 1000; ++i) { 00131 RandomVal1 = Random->Gaus(0.,1.); 00132 RandomVal2 = Random->Gaus(0.,1.); 00133 RandomVal3 = Random->Gaus(0.,1.); 00134 00135 meTestTH1F->Fill(RandomVal1); 00136 meTestTH2F->Fill(RandomVal1, RandomVal2); 00137 meTestTH3F->Fill(RandomVal1, RandomVal2, RandomVal3); 00138 meTestProfile1->Fill(RandomVal1, RandomVal2); 00139 meTestProfile2->Fill(RandomVal1, RandomVal2, RandomVal3); 00140 } 00141 }
void GlobalHitsTester::beginJob | ( | const edm::EventSetup & | iSetup | ) | [virtual] |
void GlobalHitsTester::beginRun | ( | const edm::Run & | iRun, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 102 of file GlobalHitsTester.cc.
References count, and verbosity.
00103 { 00104 std::string MsgLoggerCat = "GlobalHitsTester_endJob"; 00105 if (verbosity >= 0) 00106 edm::LogInfo(MsgLoggerCat) 00107 << "Terminating having processed " << count << " events."; 00108 return; 00109 }
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.
00119 { 00120 meTestInt->Fill(100); 00121 meTestFloat->Fill(3.141592); 00122 00123 return; 00124 }
unsigned int GlobalHitsTester::count [private] |
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] |
int GlobalHitsTester::frequency [private] |
bool GlobalHitsTester::getAllProvenances [private] |
std::string GlobalHitsTester::label [private] |
Definition at line 97 of file GlobalHitsTester.h.
MonitorElement* GlobalHitsTester::meTestFloat [private] |
MonitorElement* GlobalHitsTester::meTestInt [private] |
MonitorElement* GlobalHitsTester::meTestProfile1 [private] |
MonitorElement* GlobalHitsTester::meTestProfile2 [private] |
MonitorElement* GlobalHitsTester::meTestString [private] |
MonitorElement* GlobalHitsTester::meTestTH1F [private] |
MonitorElement* GlobalHitsTester::meTestTH2F [private] |
MonitorElement* GlobalHitsTester::meTestTH3F [private] |
std::string GlobalHitsTester::outputfile [private] |
Definition at line 101 of file GlobalHitsTester.h.
Referenced by GlobalHitsTester(), and ~GlobalHitsTester().
bool GlobalHitsTester::printProvenanceInfo [private] |
TRandom* GlobalHitsTester::Random [private] |
Definition at line 113 of file GlobalHitsTester.h.
double GlobalHitsTester::RandomVal1 [private] |
double GlobalHitsTester::RandomVal2 [private] |
double GlobalHitsTester::RandomVal3 [private] |
int GlobalHitsTester::verbosity [private] |
int GlobalHitsTester::vtxunit [private] |