CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GlobalHitsTester Class Reference

#include <GlobalHitsTester.h>

Inheritance diagram for GlobalHitsTester:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 GlobalHitsTester (const edm::ParameterSet &)
 
 ~GlobalHitsTester () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Private Attributes

unsigned int count
 
bool doOutput
 
std::string fName
 
int frequency
 
bool getAllProvenances
 
std::string label
 
MonitorElementmeTestFloat
 
MonitorElementmeTestInt
 
MonitorElementmeTestProfile1
 
MonitorElementmeTestProfile2
 
MonitorElementmeTestString
 
MonitorElementmeTestTH1F
 
MonitorElementmeTestTH2F
 
MonitorElementmeTestTH3F
 
std::string outputfile
 
bool printProvenanceInfo
 
TRandom * Random
 
double RandomVal1
 
double RandomVal2
 
double RandomVal3
 
int verbosity
 
int vtxunit
 

Detailed Description

Definition at line 76 of file GlobalHitsTester.h.

Constructor & Destructor Documentation

GlobalHitsTester::GlobalHitsTester ( const edm::ParameterSet iPSet)
explicit

Definition at line 4 of file GlobalHitsTester.cc.

References doOutput, fName, frequency, getAllProvenances, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputfile, printProvenanceInfo, AlCaHLTBitMon_QueryRunRegistry::string, verbosity, and vtxunit.

5  : fName(""),
6  verbosity(0),
7  frequency(0),
8  vtxunit(0),
9  label(""),
10  getAllProvenances(false),
11  printProvenanceInfo(false),
12  count(0) {
13  std::string MsgLoggerCat = "GlobalHitsTester_GlobalHitsTester";
14 
15  fName = iPSet.getUntrackedParameter<std::string>("Name");
16  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
17  frequency = iPSet.getUntrackedParameter<int>("Frequency");
18  vtxunit = iPSet.getUntrackedParameter<int>("VtxUnit");
19  outputfile = iPSet.getParameter<std::string>("OutputFile");
20  doOutput = iPSet.getParameter<bool>("DoOutput");
21  edm::ParameterSet m_Prov = iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
22  getAllProvenances = m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
23  printProvenanceInfo = m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
24 
25  if (verbosity >= 0) {
26  edm::LogInfo(MsgLoggerCat) << "\n===============================\n"
27  << "Initialized as EDAnalyzer with parameter values:\n"
28  << " Name = " << fName << "\n"
29  << " Verbosity = " << verbosity << "\n"
30  << " Frequency = " << frequency << "\n"
31  << " VtxUnit = " << vtxunit << "\n"
32  << " OutputFile = " << outputfile << "\n"
33  << " DoOutput = " << doOutput << "\n"
34  << " GetProv = " << getAllProvenances << "\n"
35  << " PrintProv = " << printProvenanceInfo << "\n"
36  << "===============================\n";
37  }
38 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string outputfile
unsigned int count
GlobalHitsTester::~GlobalHitsTester ( )
override

Definition at line 40 of file GlobalHitsTester.cc.

40 {}

Member Function Documentation

void GlobalHitsTester::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 87 of file GlobalHitsTester.cc.

References MonitorElement::Fill(), mps_fire::i, meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestTH1F, meTestTH2F, meTestTH3F, RandomVal1, RandomVal2, and RandomVal3.

87  {
88  for (int i = 0; i < 1000; ++i) {
89  RandomVal1 = Random->Gaus(0., 1.);
90  RandomVal2 = Random->Gaus(0., 1.);
91  RandomVal3 = Random->Gaus(0., 1.);
92 
98  }
99 
100  meTestInt->Fill(100);
101  meTestFloat->Fill(3.141592);
102 }
MonitorElement * meTestProfile1
MonitorElement * meTestInt
MonitorElement * meTestTH3F
void Fill(long long x)
MonitorElement * meTestProfile2
MonitorElement * meTestTH1F
MonitorElement * meTestFloat
MonitorElement * meTestTH2F
void GlobalHitsTester::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 42 of file GlobalHitsTester.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::book3D(), DQMStore::IBooker::bookFloat(), DQMStore::IBooker::bookInt(), DQMStore::IBooker::bookProfile(), DQMStore::IBooker::bookProfile2D(), DQMStore::IBooker::bookString(), meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestString, meTestTH1F, meTestTH2F, meTestTH3F, DQMStore::IBooker::setCurrentFolder(), and DQMStore::IBooker::tag().

42  {
43  meTestString = nullptr;
44  meTestInt = nullptr;
45  meTestFloat = nullptr;
46  meTestTH1F = nullptr;
47  meTestTH2F = nullptr;
48  meTestTH3F = nullptr;
49  meTestProfile1 = nullptr;
50  meTestProfile2 = nullptr;
51  Random = new TRandom3();
52 
53  ibooker.setCurrentFolder("GlobalTestV/String");
54  meTestString = ibooker.bookString("TestString", "Hello World");
55 
56  ibooker.setCurrentFolder("GlobalTestV/Int");
57  meTestInt = ibooker.bookInt("TestInt");
58 
59  ibooker.setCurrentFolder("GlobalTestV/Float");
60  meTestFloat = ibooker.bookFloat("TestFloat");
61 
62  ibooker.setCurrentFolder("GlobalTestV/TH1F");
63  meTestTH1F = ibooker.book1D("Random1D", "Random1D", 100, -10., 10.);
64 
65  ibooker.setCurrentFolder("GlobalTestV/TH2F");
66  meTestTH2F = ibooker.book2D("Random2D", "Random2D", 100, -10, 10., 100, -10., 10.);
67 
68  ibooker.setCurrentFolder("GlobalTestV/TH3F");
69  meTestTH3F = ibooker.book3D("Random3D", "Random3D", 100, -10., 10., 100, -10., 10., 100, -10., 10.);
70 
71  ibooker.setCurrentFolder("GlobalTestV/TProfile");
72  meTestProfile1 = ibooker.bookProfile("Profile1", "Profile1", 100, -10., 10., 100, -10., 10.);
73 
74  ibooker.setCurrentFolder("GlobalTestV/TProfile2D");
75  meTestProfile2 = ibooker.bookProfile2D("Profile2", "Profile2", 100, -10., 10., 100, -10, 10., 100, -10., 10.);
76 
77  ibooker.tag(meTestTH1F, 1);
78  ibooker.tag(meTestTH2F, 2);
79  ibooker.tag(meTestTH3F, 3);
80  ibooker.tag(meTestProfile1, 4);
81  ibooker.tag(meTestProfile2, 5);
82  ibooker.tag(meTestString, 6);
83  ibooker.tag(meTestInt, 7);
84  ibooker.tag(meTestFloat, 8);
85 }
MonitorElement * meTestProfile1
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:113
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:104
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:103
MonitorElement * meTestInt
MonitorElement * meTestString
MonitorElement * meTestTH3F
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:114
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:283
MonitorElement * meTestProfile2
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
MonitorElement * meTestTH1F
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:105
MonitorElement * meTestFloat
MonitorElement * book3D(Args &&...args)
Definition: DQMStore.h:112
MonitorElement * meTestTH2F

Member Data Documentation

unsigned int GlobalHitsTester::count
private

Definition at line 110 of file GlobalHitsTester.h.

bool GlobalHitsTester::doOutput
private

Definition at line 93 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

std::string GlobalHitsTester::fName
private

Definition at line 84 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

int GlobalHitsTester::frequency
private

Definition at line 86 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

bool GlobalHitsTester::getAllProvenances
private

Definition at line 89 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

std::string GlobalHitsTester::label
private
MonitorElement* GlobalHitsTester::meTestFloat
private

Definition at line 97 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestInt
private

Definition at line 96 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestProfile1
private

Definition at line 101 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestProfile2
private

Definition at line 102 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestString
private

Definition at line 95 of file GlobalHitsTester.h.

Referenced by bookHistograms().

MonitorElement* GlobalHitsTester::meTestTH1F
private

Definition at line 98 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestTH2F
private

Definition at line 99 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* GlobalHitsTester::meTestTH3F
private

Definition at line 100 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

std::string GlobalHitsTester::outputfile
private

Definition at line 92 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

bool GlobalHitsTester::printProvenanceInfo
private

Definition at line 90 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

TRandom* GlobalHitsTester::Random
private

Definition at line 104 of file GlobalHitsTester.h.

double GlobalHitsTester::RandomVal1
private

Definition at line 105 of file GlobalHitsTester.h.

Referenced by analyze().

double GlobalHitsTester::RandomVal2
private

Definition at line 106 of file GlobalHitsTester.h.

Referenced by analyze().

double GlobalHitsTester::RandomVal3
private

Definition at line 107 of file GlobalHitsTester.h.

Referenced by analyze().

int GlobalHitsTester::verbosity
private

Definition at line 85 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

int GlobalHitsTester::vtxunit
private

Definition at line 87 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().