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 }
MonitorElement * book2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1161
MonitorElement * bookProfile2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s")
Definition: DQMStore.cc:1367
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 * meTestTH3F
MonitorElement * meTestString
MonitorElement * bookInt(char_string const &name)
Book int.
Definition: DQMStore.cc:1015
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
Definition: DQMStore.cc:1086
MonitorElement * bookFloat(char_string const &name)
Book float.
Definition: DQMStore.cc:1036
void Fill(long long x)
MonitorElement * meTestTH2F
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1488
MonitorElement * meTestFloat
int iEvent
Definition: GenABIO.cc:230
MonitorElement * meTestTH1FN
void endRun(const edm::Run &, const edm::EventSetup &) override
~ConverterTester() override
unsigned int count
void beginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * bookString(char_string const &name, char_string const &value)
Book string.
Definition: DQMStore.cc:1057
const std::string getFullname() const
get full name of ME including Pathname
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:565
MonitorElement * bookProfile(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
Definition: DQMStore.cc:1273
MonitorElement * meTestProfile1
MonitorElement * meTestProfile2
MonitorElement * meTestTH1FD
MonitorElement * book3D(char_string const &name, char_string const &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:1241
MonitorElement * meTestInt
void beginJob() override
std::string fName
Definition: Run.h:44