CMS 3D CMS Logo

GlobalHitsTester.cc
Go to the documentation of this file.
3 
5  fName(""), verbosity(0), frequency(0), vtxunit(0), label(""),
6  getAllProvenances(false), printProvenanceInfo(false), count(0)
7 {
8  std::string MsgLoggerCat = "GlobalHitsTester_GlobalHitsTester";
9 
10  fName = iPSet.getUntrackedParameter<std::string>("Name");
11  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
12  frequency = iPSet.getUntrackedParameter<int>("Frequency");
13  vtxunit = iPSet.getUntrackedParameter<int>("VtxUnit");
14  outputfile = iPSet.getParameter<std::string>("OutputFile");
15  doOutput = iPSet.getParameter<bool>("DoOutput");
16  edm::ParameterSet m_Prov =
17  iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
19  m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
21  m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
22 
23  if (verbosity >= 0) {
24  edm::LogInfo(MsgLoggerCat)
25  << "\n===============================\n"
26  << "Initialized as EDAnalyzer with parameter values:\n"
27  << " Name = " << fName << "\n"
28  << " Verbosity = " << verbosity << "\n"
29  << " Frequency = " << frequency << "\n"
30  << " VtxUnit = " << vtxunit << "\n"
31  << " OutputFile = " << outputfile << "\n"
32  << " DoOutput = " << doOutput << "\n"
33  << " GetProv = " << getAllProvenances << "\n"
34  << " PrintProv = " << printProvenanceInfo << "\n"
35  << "===============================\n";
36  }
37 }
38 
40 {
41 }
42 
44  edm::Run const &, edm::EventSetup const & ){
45 
46  meTestString = nullptr;
47  meTestInt = nullptr;
48  meTestFloat = nullptr;
49  meTestTH1F = nullptr;
50  meTestTH2F = nullptr;
51  meTestTH3F = nullptr;
52  meTestProfile1 = nullptr;
53  meTestProfile2 = nullptr;
54  Random = new TRandom3();
55 
56  ibooker.setCurrentFolder("GlobalTestV/String");
57  meTestString = ibooker.bookString("TestString", "Hello World" );
58 
59  ibooker.setCurrentFolder("GlobalTestV/Int");
60  meTestInt = ibooker.bookInt("TestInt");
61 
62  ibooker.setCurrentFolder("GlobalTestV/Float");
63  meTestFloat = ibooker.bookFloat("TestFloat");
64 
65  ibooker.setCurrentFolder("GlobalTestV/TH1F");
66  meTestTH1F = ibooker.book1D("Random1D", "Random1D", 100, -10., 10.);
67 
68  ibooker.setCurrentFolder("GlobalTestV/TH2F");
69  meTestTH2F = ibooker.book2D("Random2D", "Random2D", 100, -10, 10., 100, -10.,
70  10.);
71 
72  ibooker.setCurrentFolder("GlobalTestV/TH3F");
73  meTestTH3F = ibooker.book3D("Random3D", "Random3D", 100, -10., 10., 100,
74  -10., 10., 100, -10., 10.);
75 
76  ibooker.setCurrentFolder("GlobalTestV/TProfile");
77  meTestProfile1 = ibooker.bookProfile("Profile1", "Profile1", 100, -10., 10.,
78  100, -10., 10.);
79 
80  ibooker.setCurrentFolder("GlobalTestV/TProfile2D");
81  meTestProfile2 = ibooker.bookProfile2D("Profile2", "Profile2", 100, -10.,
82  10., 100, -10, 10., 100, -10., 10.);
83 
84  ibooker.tag(meTestTH1F, 1);
85  ibooker.tag(meTestTH2F, 2);
86  ibooker.tag(meTestTH3F, 3);
87  ibooker.tag(meTestProfile1, 4);
88  ibooker.tag(meTestProfile2, 5);
89  ibooker.tag(meTestString, 6);
90  ibooker.tag(meTestInt, 7);
91  ibooker.tag(meTestFloat, 8);
92 
93 }
94 
96  const edm::EventSetup& iSetup)
97 {
98 
99  for(int i = 0; i < 1000; ++i) {
100  RandomVal1 = Random->Gaus(0.,1.);
101  RandomVal2 = Random->Gaus(0.,1.);
102  RandomVal3 = Random->Gaus(0.,1.);
103 
109  }
110 
111  meTestInt->Fill(100);
112  meTestFloat->Fill(3.141592);
113 }
T getParameter(std::string const &) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * meTestProfile1
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:160
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:106
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:100
std::string outputfile
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * meTestInt
MonitorElement * meTestString
MonitorElement * meTestTH3F
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:230
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:166
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
void tag(MonitorElement *, unsigned int)
Definition: DQMStore.cc:286
MonitorElement * meTestProfile2
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
MonitorElement * meTestTH1F
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112
MonitorElement * meTestFloat
MonitorElement * book3D(Args &&...args)
Definition: DQMStore.h:154
GlobalHitsTester(const edm::ParameterSet &)
MonitorElement * meTestTH2F
~GlobalHitsTester() override
Definition: Run.h:44