CMS 3D CMS Logo

ConverterTester.cc
Go to the documentation of this file.
2 
4 {
5  std::string MsgLoggerCat = "ConverterTester_ConverterTester";
6 
7  fName = iPSet.getUntrackedParameter<std::string>("Name");
8  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
9  frequency = iPSet.getUntrackedParameter<int>("Frequency");
10 
11  if (verbosity >= 0) {
12  edm::LogInfo(MsgLoggerCat)
13  << "\n===============================\n"
14  << "Initialized as EDAnalyzer with parameter values:\n"
15  << " Name = " << fName << "\n"
16  << " Verbosity = " << verbosity << "\n"
17  << " Frequency = " << frequency << "\n"
18  << "===============================\n";
19  }
20 
21  dbe = nullptr;
23 
24  count = 0;
25 
26 }
27 
29 
31 {
32 
33  if(dbe){
34  meTestString = nullptr;
35  meTestInt = nullptr;
36  meTestFloat = nullptr;
37  meTestTH1FN = nullptr;
38  meTestTH1FD = nullptr;
39  meTestTH2F = nullptr;
40  meTestTH3F = nullptr;
41  meTestProfile1 = nullptr;
42  meTestProfile2 = nullptr;
43  Random = new TRandom3();
44 
45  dbe->setCurrentFolder("ConverterTest/String");
46  meTestString = dbe->bookString("TestString","Test String" );
47 
48  dbe->setCurrentFolder("ConverterTest/Int");
49  meTestInt = dbe->bookInt("TestInt");
50 
51  dbe->setCurrentFolder("ConverterTest/Float");
52  meTestFloat = dbe->bookFloat("TestFloat");
53 
54  dbe->setCurrentFolder("ConverterTest/TH1F");
55  meTestTH1FN =
56  dbe->book1D("Random1DN", "Random1D Numerator", 100, -10., 10.);
57  meTestTH1FD =
58  dbe->book1D("Random1DD", "Random1D Denominator", 100, -10., 10.);
59 
60  dbe->setCurrentFolder("ConverterTest/TH2F");
61  meTestTH2F = dbe->book2D("Random2D", "Random2D", 100, -10, 10., 100, -10.,
62  10.);
63 
64  dbe->setCurrentFolder("ConverterTest/TH3F");
65  meTestTH3F = dbe->book3D("Random3D", "Random3D", 100, -10., 10., 100,
66  -10., 10., 100, -10., 10.);
67 
68  dbe->setCurrentFolder("ConverterTest/TProfile");
69  meTestProfile1 = dbe->bookProfile("Profile1", "Profile1", 100, -10., 10.,
70  100, -10., 10.);
71 
72  dbe->setCurrentFolder("ConverterTest/TProfile2D");
73  meTestProfile2 = dbe->bookProfile2D("Profile2", "Profile2", 100, -10.,
74  10., 100, -10, 10., 100, -10., 10.);
75 
85  }
86 
87  return;
88 }
89 
91 {
92  std::string MsgLoggerCat = "ConverterTester_endJob";
93  if (verbosity >= 0)
94  edm::LogInfo(MsgLoggerCat)
95  << "Terminating having processed " << count << " events.";
96  return;
97 }
98 
100  const edm::EventSetup& iSetup)
101 {
102  return;
103 }
104 
106  const edm::EventSetup& iSetup)
107 {
108  meTestInt->Fill(100);
109  meTestFloat->Fill(3.141592);
110 
111  return;
112 }
113 
115  const edm::EventSetup& iSetup)
116 {
117 
118  ++count;
119 
120  for(int i = 0; i < 1000; ++i) {
121  RandomVal1 = Random->Gaus(0.,1.);
122  RandomVal2 = Random->Gaus(0.,1.);
123  RandomVal3 = Random->Gaus(0.,1.);
124 
131  }
132 }
void endJob() override
ConverterTester(const edm::ParameterSet &)
T getUntrackedParameter(std::string const &, T const &) const
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:837
MonitorElement * meTestTH3F
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
Definition: DQMStore.cc:1118
MonitorElement * meTestString
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:774
void Fill(long long x)
MonitorElement * meTestTH2F
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1496
MonitorElement * meTestFloat
int iEvent
Definition: GenABIO.cc:230
MonitorElement * meTestTH1FN
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:803
void endRun(const edm::Run &, const edm::EventSetup &) override
~ConverterTester() override
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1170
unsigned int count
void beginRun(const edm::Run &, const edm::EventSetup &) override
const std::string getFullname() const
get full name of ME including Pathname
MonitorElement * meTestProfile1
MonitorElement * meTestProfile2
MonitorElement * meTestTH1FD
MonitorElement * meTestInt
void beginJob() override
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:744
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:965
std::string fName
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:545
Definition: Run.h:44
MonitorElement * bookProfile2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, const char *option="s")
Definition: DQMStore.cc:1314