CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 = 0;
23 
24  count = 0;
25 
26 }
27 
29 
31 {
32 
33  if(dbe){
34  meTestString = 0;
35  meTestInt = 0;
36  meTestFloat = 0;
37  meTestTH1FN = 0;
38  meTestTH1FD = 0;
39  meTestTH2F = 0;
40  meTestTH3F = 0;
41  meTestProfile1 = 0;
42  meTestProfile2 = 0;
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 }
ConverterTester(const edm::ParameterSet &)
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:1000
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:1262
MonitorElement * meTestString
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:937
void Fill(long long x)
MonitorElement * meTestTH2F
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1640
MonitorElement * meTestFloat
int iEvent
Definition: GenABIO.cc:230
virtual ~ConverterTester()
MonitorElement * meTestTH1FN
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:966
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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:1314
unsigned int count
const std::string getFullname(void) const
get full name of ME including Pathname
virtual void endRun(const edm::Run &, const edm::EventSetup &)
virtual void endJob()
MonitorElement * meTestProfile1
virtual void beginJob()
MonitorElement * meTestProfile2
MonitorElement * meTestTH1FD
MonitorElement * meTestInt
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:907
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:1128
std::string fName
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:706
Definition: Run.h:43
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:1458