CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ConverterTester Class Reference

#include <ConverterTester.h>

Inheritance diagram for ConverterTester:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
 ConverterTester (const edm::ParameterSet &)
 
virtual void endJob ()
 
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 
virtual ~ConverterTester ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

unsigned int count
 
DQMStoredbe
 
std::string fName
 
int frequency
 
std::string label
 
MonitorElementmeTestFloat
 
MonitorElementmeTestInt
 
MonitorElementmeTestProfile1
 
MonitorElementmeTestProfile2
 
MonitorElementmeTestString
 
MonitorElementmeTestTH1FD
 
MonitorElementmeTestTH1FN
 
MonitorElementmeTestTH2F
 
MonitorElementmeTestTH3F
 
TRandom * Random
 
double RandomVal1
 
double RandomVal2
 
double RandomVal3
 
int verbosity
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Class to fill dqm monitor elements from existing EDM file

Author
M. Strang SUNY-Buffalo

Definition at line 36 of file ConverterTester.h.

Constructor & Destructor Documentation

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

Definition at line 3 of file ConverterTester.cc.

References count, dbe, fName, frequency, edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

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 }
T getUntrackedParameter(std::string const &, T const &) const
unsigned int count
std::string fName
ConverterTester::~ConverterTester ( )
virtual

Definition at line 28 of file ConverterTester.cc.

28 {}

Member Function Documentation

void ConverterTester::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 114 of file ConverterTester.cc.

References count, MonitorElement::Fill(), i, meTestProfile1, meTestProfile2, meTestTH1FD, meTestTH1FN, meTestTH2F, meTestTH3F, RandomVal1, RandomVal2, and RandomVal3.

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 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * meTestTH3F
void Fill(long long x)
MonitorElement * meTestTH2F
MonitorElement * meTestTH1FN
unsigned int count
MonitorElement * meTestProfile1
MonitorElement * meTestProfile2
MonitorElement * meTestTH1FD
void ConverterTester::beginJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 30 of file ConverterTester.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::book3D(), DQMStore::bookFloat(), DQMStore::bookInt(), DQMStore::bookProfile(), DQMStore::bookProfile2D(), DQMStore::bookString(), dbe, MonitorElement::getFullname(), meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestString, meTestTH1FD, meTestTH1FN, meTestTH2F, meTestTH3F, DQMStore::setCurrentFolder(), and DQMStore::tag().

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 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:1006
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:1268
MonitorElement * meTestString
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:943
MonitorElement * meTestTH2F
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1646
MonitorElement * meTestFloat
MonitorElement * meTestTH1FN
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:972
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:1320
const std::string getFullname(void) const
get full name of ME including Pathname
MonitorElement * meTestProfile1
MonitorElement * meTestProfile2
MonitorElement * meTestTH1FD
MonitorElement * meTestInt
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:913
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:1134
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:719
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:1464
void ConverterTester::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 99 of file ConverterTester.cc.

101 {
102  return;
103 }
void ConverterTester::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 90 of file ConverterTester.cc.

References count, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

91 {
92  std::string MsgLoggerCat = "ConverterTester_endJob";
93  if (verbosity >= 0)
94  edm::LogInfo(MsgLoggerCat)
95  << "Terminating having processed " << count << " events.";
96  return;
97 }
unsigned int count
void ConverterTester::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 105 of file ConverterTester.cc.

References MonitorElement::Fill(), meTestFloat, and meTestInt.

107 {
108  meTestInt->Fill(100);
109  meTestFloat->Fill(3.141592);
110 
111  return;
112 }
void Fill(long long x)
MonitorElement * meTestFloat
MonitorElement * meTestInt

Member Data Documentation

unsigned int ConverterTester::count
private
DQMStore* ConverterTester::dbe
private

Definition at line 55 of file ConverterTester.h.

Referenced by beginJob(), and ConverterTester().

std::string ConverterTester::fName
private

Definition at line 51 of file ConverterTester.h.

Referenced by ConverterTester().

int ConverterTester::frequency
private

Definition at line 53 of file ConverterTester.h.

Referenced by ConverterTester().

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

Definition at line 59 of file ConverterTester.h.

Referenced by beginJob(), and endRun().

MonitorElement* ConverterTester::meTestInt
private

Definition at line 58 of file ConverterTester.h.

Referenced by beginJob(), and endRun().

MonitorElement* ConverterTester::meTestProfile1
private

Definition at line 64 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestProfile2
private

Definition at line 65 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestString
private

Definition at line 57 of file ConverterTester.h.

Referenced by beginJob().

MonitorElement* ConverterTester::meTestTH1FD
private

Definition at line 60 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestTH1FN
private

Definition at line 61 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestTH2F
private

Definition at line 62 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestTH3F
private

Definition at line 63 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

TRandom* ConverterTester::Random
private

Definition at line 67 of file ConverterTester.h.

double ConverterTester::RandomVal1
private

Definition at line 68 of file ConverterTester.h.

Referenced by analyze().

double ConverterTester::RandomVal2
private

Definition at line 69 of file ConverterTester.h.

Referenced by analyze().

double ConverterTester::RandomVal3
private

Definition at line 70 of file ConverterTester.h.

Referenced by analyze().

int ConverterTester::verbosity
private

Definition at line 52 of file ConverterTester.h.

Referenced by ConverterTester(), and endJob().