CMS 3D CMS Logo

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

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 ConverterTester (const edm::ParameterSet &)
 
void endJob () override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 
 ~ConverterTester () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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(), Utilities::operator, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

3  {
4  std::string MsgLoggerCat = "ConverterTester_ConverterTester";
5 
6  fName = iPSet.getUntrackedParameter<std::string>("Name");
7  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
8  frequency = iPSet.getUntrackedParameter<int>("Frequency");
9 
10  if (verbosity >= 0) {
11  edm::LogInfo(MsgLoggerCat) << "\n===============================\n"
12  << "Initialized as EDAnalyzer with parameter values:\n"
13  << " Name = " << fName << "\n"
14  << " Verbosity = " << verbosity << "\n"
15  << " Frequency = " << frequency << "\n"
16  << "===============================\n";
17  }
18 
19  dbe = nullptr;
21 
22  count = 0;
23 }
T getUntrackedParameter(std::string const &, T const &) const
unsigned int count
std::string fName
ConverterTester::~ConverterTester ( )
override

Definition at line 25 of file ConverterTester.cc.

25 {}

Member Function Documentation

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

Definition at line 95 of file ConverterTester.cc.

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

95  {
96  ++count;
97 
98  for (int i = 0; i < 1000; ++i) {
99  RandomVal1 = Random->Gaus(0., 1.);
100  RandomVal2 = Random->Gaus(0., 1.);
101  RandomVal3 = Random->Gaus(0., 1.);
102 
103  meTestTH1FN->Fill(0.5 * RandomVal1);
109  }
110 }
MonitorElement * meTestTH3F
void Fill(long long x)
MonitorElement * meTestTH2F
MonitorElement * meTestTH1FN
unsigned int count
MonitorElement * meTestProfile1
MonitorElement * meTestProfile2
MonitorElement * meTestTH1FD
void ConverterTester::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 27 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().

27  {
28  if (dbe) {
29  meTestString = nullptr;
30  meTestInt = nullptr;
31  meTestFloat = nullptr;
32  meTestTH1FN = nullptr;
33  meTestTH1FD = nullptr;
34  meTestTH2F = nullptr;
35  meTestTH3F = nullptr;
36  meTestProfile1 = nullptr;
37  meTestProfile2 = nullptr;
38  Random = new TRandom3();
39 
40  dbe->setCurrentFolder("ConverterTest/String");
41  meTestString = dbe->bookString("TestString", "Test String");
42 
43  dbe->setCurrentFolder("ConverterTest/Int");
44  meTestInt = dbe->bookInt("TestInt");
45 
46  dbe->setCurrentFolder("ConverterTest/Float");
47  meTestFloat = dbe->bookFloat("TestFloat");
48 
49  dbe->setCurrentFolder("ConverterTest/TH1F");
50  meTestTH1FN = dbe->book1D("Random1DN", "Random1D Numerator", 100, -10., 10.);
51  meTestTH1FD = dbe->book1D("Random1DD", "Random1D Denominator", 100, -10., 10.);
52 
53  dbe->setCurrentFolder("ConverterTest/TH2F");
54  meTestTH2F = dbe->book2D("Random2D", "Random2D", 100, -10, 10., 100, -10., 10.);
55 
56  dbe->setCurrentFolder("ConverterTest/TH3F");
57  meTestTH3F = dbe->book3D("Random3D", "Random3D", 100, -10., 10., 100, -10., 10., 100, -10., 10.);
58 
59  dbe->setCurrentFolder("ConverterTest/TProfile");
60  meTestProfile1 = dbe->bookProfile("Profile1", "Profile1", 100, -10., 10., 100, -10., 10.);
61 
62  dbe->setCurrentFolder("ConverterTest/TProfile2D");
63  meTestProfile2 = dbe->bookProfile2D("Profile2", "Profile2", 100, -10., 10., 100, -10, 10., 100, -10., 10.);
64 
67  dbe->tag(meTestTH2F->getFullname(), 3);
68  dbe->tag(meTestTH3F->getFullname(), 4);
72  dbe->tag(meTestInt->getFullname(), 8);
74  }
75 
76  return;
77 }
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:1173
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:1379
MonitorElement * meTestTH3F
MonitorElement * meTestString
MonitorElement * bookInt(char_string const &name)
Book int.
Definition: DQMStore.cc:1027
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:1098
MonitorElement * bookFloat(char_string const &name)
Book float.
Definition: DQMStore.cc:1048
MonitorElement * meTestTH2F
void tag(MonitorElement *me, unsigned int myTag)
Definition: DQMStore.cc:1500
MonitorElement * meTestFloat
MonitorElement * meTestTH1FN
MonitorElement * bookString(char_string const &name, char_string const &value)
Book string.
Definition: DQMStore.cc:1069
const std::string getFullname() const
get full name of ME including Pathname
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
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:1285
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:1253
MonitorElement * meTestInt
void ConverterTester::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 86 of file ConverterTester.cc.

86 { return; }
void ConverterTester::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 79 of file ConverterTester.cc.

References count, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity.

79  {
80  std::string MsgLoggerCat = "ConverterTester_endJob";
81  if (verbosity >= 0)
82  edm::LogInfo(MsgLoggerCat) << "Terminating having processed " << count << " events.";
83  return;
84 }
unsigned int count
void ConverterTester::endRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 88 of file ConverterTester.cc.

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

88  {
89  meTestInt->Fill(100);
90  meTestFloat->Fill(3.141592);
91 
92  return;
93 }
void Fill(long long x)
MonitorElement * meTestFloat
MonitorElement * meTestInt

Member Data Documentation

unsigned int ConverterTester::count
private

Definition at line 69 of file ConverterTester.h.

Referenced by analyze(), ConverterTester(), and endJob().

DQMStore* ConverterTester::dbe
private

Definition at line 51 of file ConverterTester.h.

Referenced by beginJob(), and ConverterTester().

std::string ConverterTester::fName
private

Definition at line 47 of file ConverterTester.h.

Referenced by ConverterTester().

int ConverterTester::frequency
private

Definition at line 49 of file ConverterTester.h.

Referenced by ConverterTester().

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

Definition at line 55 of file ConverterTester.h.

Referenced by beginJob(), and endRun().

MonitorElement* ConverterTester::meTestInt
private

Definition at line 54 of file ConverterTester.h.

Referenced by beginJob(), and endRun().

MonitorElement* ConverterTester::meTestProfile1
private

Definition at line 60 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestProfile2
private

Definition at line 61 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestString
private

Definition at line 53 of file ConverterTester.h.

Referenced by beginJob().

MonitorElement* ConverterTester::meTestTH1FD
private

Definition at line 56 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestTH1FN
private

Definition at line 57 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestTH2F
private

Definition at line 58 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

MonitorElement* ConverterTester::meTestTH3F
private

Definition at line 59 of file ConverterTester.h.

Referenced by analyze(), and beginJob().

TRandom* ConverterTester::Random
private

Definition at line 63 of file ConverterTester.h.

double ConverterTester::RandomVal1
private

Definition at line 64 of file ConverterTester.h.

Referenced by analyze().

double ConverterTester::RandomVal2
private

Definition at line 65 of file ConverterTester.h.

Referenced by analyze().

double ConverterTester::RandomVal3
private

Definition at line 66 of file ConverterTester.h.

Referenced by analyze().

int ConverterTester::verbosity
private

Definition at line 48 of file ConverterTester.h.

Referenced by ConverterTester(), and endJob().