CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GlobalHitsTester Class Reference

#include <GlobalHitsTester.h>

Inheritance diagram for GlobalHitsTester:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 GlobalHitsTester (const edm::ParameterSet &)
 
 ~GlobalHitsTester () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

unsigned int count
 
bool doOutput
 
std::string fName
 
int frequency
 
bool getAllProvenances
 
std::string label
 
MonitorElementmeTestFloat
 
MonitorElementmeTestInt
 
MonitorElementmeTestProfile1
 
MonitorElementmeTestProfile2
 
MonitorElementmeTestString
 
MonitorElementmeTestTH1F
 
MonitorElementmeTestTH2F
 
MonitorElementmeTestTH3F
 
std::string outputfile
 
bool printProvenanceInfo
 
TRandom * Random
 
double RandomVal1
 
double RandomVal2
 
double RandomVal3
 
int verbosity
 
int vtxunit
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 75 of file GlobalHitsTester.h.

Constructor & Destructor Documentation

◆ GlobalHitsTester()

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

Definition at line 4 of file GlobalHitsTester.cc.

5  : fName(""),
6  verbosity(0),
7  frequency(0),
8  vtxunit(0),
9  label(""),
10  getAllProvenances(false),
11  printProvenanceInfo(false),
12  count(0) {
13  std::string MsgLoggerCat = "GlobalHitsTester_GlobalHitsTester";
14 
15  fName = iPSet.getUntrackedParameter<std::string>("Name");
16  verbosity = iPSet.getUntrackedParameter<int>("Verbosity");
17  frequency = iPSet.getUntrackedParameter<int>("Frequency");
18  vtxunit = iPSet.getUntrackedParameter<int>("VtxUnit");
19  outputfile = iPSet.getParameter<std::string>("OutputFile");
20  doOutput = iPSet.getParameter<bool>("DoOutput");
21  edm::ParameterSet m_Prov = iPSet.getParameter<edm::ParameterSet>("ProvenanceLookup");
22  getAllProvenances = m_Prov.getUntrackedParameter<bool>("GetAllProvenances");
23  printProvenanceInfo = m_Prov.getUntrackedParameter<bool>("PrintProvenanceInfo");
24 
25  if (verbosity >= 0) {
26  edm::LogInfo(MsgLoggerCat) << "\n===============================\n"
27  << "Initialized as EDAnalyzer with parameter values:\n"
28  << " Name = " << fName << "\n"
29  << " Verbosity = " << verbosity << "\n"
30  << " Frequency = " << frequency << "\n"
31  << " VtxUnit = " << vtxunit << "\n"
32  << " OutputFile = " << outputfile << "\n"
33  << " DoOutput = " << doOutput << "\n"
34  << " GetProv = " << getAllProvenances << "\n"
35  << " PrintProv = " << printProvenanceInfo << "\n"
36  << "===============================\n";
37  }
38 }

References doOutput, fName, frequency, getAllProvenances, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), outputfile, printProvenanceInfo, AlCaHLTBitMon_QueryRunRegistry::string, verbosity, and vtxunit.

◆ ~GlobalHitsTester()

GlobalHitsTester::~GlobalHitsTester ( )
override

Definition at line 40 of file GlobalHitsTester.cc.

40 {}

Member Function Documentation

◆ analyze()

void GlobalHitsTester::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 78 of file GlobalHitsTester.cc.

78  {
79  for (int i = 0; i < 1000; ++i) {
80  RandomVal1 = Random->Gaus(0., 1.);
81  RandomVal2 = Random->Gaus(0., 1.);
82  RandomVal3 = Random->Gaus(0., 1.);
83 
89  }
90 
91  meTestInt->Fill(100);
92  meTestFloat->Fill(3.141592);
93 }

References dqm::impl::MonitorElement::Fill(), mps_fire::i, meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestTH1F, meTestTH2F, meTestTH3F, RandomVal1, RandomVal2, and RandomVal3.

◆ bookHistograms()

void GlobalHitsTester::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 42 of file GlobalHitsTester.cc.

42  {
43  meTestString = nullptr;
44  meTestInt = nullptr;
45  meTestFloat = nullptr;
46  meTestTH1F = nullptr;
47  meTestTH2F = nullptr;
48  meTestTH3F = nullptr;
49  meTestProfile1 = nullptr;
50  meTestProfile2 = nullptr;
51  Random = new TRandom3();
52 
53  ibooker.setCurrentFolder("GlobalTestV/String");
54  meTestString = ibooker.bookString("TestString", "Hello World");
55 
56  ibooker.setCurrentFolder("GlobalTestV/Int");
57  meTestInt = ibooker.bookInt("TestInt");
58 
59  ibooker.setCurrentFolder("GlobalTestV/Float");
60  meTestFloat = ibooker.bookFloat("TestFloat");
61 
62  ibooker.setCurrentFolder("GlobalTestV/TH1F");
63  meTestTH1F = ibooker.book1D("Random1D", "Random1D", 100, -10., 10.);
64 
65  ibooker.setCurrentFolder("GlobalTestV/TH2F");
66  meTestTH2F = ibooker.book2D("Random2D", "Random2D", 100, -10, 10., 100, -10., 10.);
67 
68  ibooker.setCurrentFolder("GlobalTestV/TH3F");
69  meTestTH3F = ibooker.book3D("Random3D", "Random3D", 100, -10., 10., 100, -10., 10., 100, -10., 10.);
70 
71  ibooker.setCurrentFolder("GlobalTestV/TProfile");
72  meTestProfile1 = ibooker.bookProfile("Profile1", "Profile1", 100, -10., 10., 100, -10., 10.);
73 
74  ibooker.setCurrentFolder("GlobalTestV/TProfile2D");
75  meTestProfile2 = ibooker.bookProfile2D("Profile2", "Profile2", 100, -10., 10., 100, -10, 10., 100, -10., 10.);
76 }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::book3D(), dqm::implementation::IBooker::bookFloat(), dqm::implementation::IBooker::bookInt(), dqm::implementation::IBooker::bookProfile(), dqm::implementation::IBooker::bookProfile2D(), dqm::implementation::IBooker::bookString(), meTestFloat, meTestInt, meTestProfile1, meTestProfile2, meTestString, meTestTH1F, meTestTH2F, meTestTH3F, and dqm::implementation::NavigatorBase::setCurrentFolder().

Member Data Documentation

◆ count

unsigned int GlobalHitsTester::count
private

Definition at line 109 of file GlobalHitsTester.h.

◆ doOutput

bool GlobalHitsTester::doOutput
private

Definition at line 92 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

◆ fName

std::string GlobalHitsTester::fName
private

Definition at line 83 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

◆ frequency

int GlobalHitsTester::frequency
private

Definition at line 85 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

◆ getAllProvenances

bool GlobalHitsTester::getAllProvenances
private

Definition at line 88 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

◆ label

std::string GlobalHitsTester::label
private

Definition at line 87 of file GlobalHitsTester.h.

◆ meTestFloat

MonitorElement* GlobalHitsTester::meTestFloat
private

Definition at line 96 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

◆ meTestInt

MonitorElement* GlobalHitsTester::meTestInt
private

Definition at line 95 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

◆ meTestProfile1

MonitorElement* GlobalHitsTester::meTestProfile1
private

Definition at line 100 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

◆ meTestProfile2

MonitorElement* GlobalHitsTester::meTestProfile2
private

Definition at line 101 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

◆ meTestString

MonitorElement* GlobalHitsTester::meTestString
private

Definition at line 94 of file GlobalHitsTester.h.

Referenced by bookHistograms().

◆ meTestTH1F

MonitorElement* GlobalHitsTester::meTestTH1F
private

Definition at line 97 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

◆ meTestTH2F

MonitorElement* GlobalHitsTester::meTestTH2F
private

Definition at line 98 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

◆ meTestTH3F

MonitorElement* GlobalHitsTester::meTestTH3F
private

Definition at line 99 of file GlobalHitsTester.h.

Referenced by analyze(), and bookHistograms().

◆ outputfile

std::string GlobalHitsTester::outputfile
private

Definition at line 91 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

◆ printProvenanceInfo

bool GlobalHitsTester::printProvenanceInfo
private

Definition at line 89 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

◆ Random

TRandom* GlobalHitsTester::Random
private

Definition at line 103 of file GlobalHitsTester.h.

◆ RandomVal1

double GlobalHitsTester::RandomVal1
private

Definition at line 104 of file GlobalHitsTester.h.

Referenced by analyze().

◆ RandomVal2

double GlobalHitsTester::RandomVal2
private

Definition at line 105 of file GlobalHitsTester.h.

Referenced by analyze().

◆ RandomVal3

double GlobalHitsTester::RandomVal3
private

Definition at line 106 of file GlobalHitsTester.h.

Referenced by analyze().

◆ verbosity

int GlobalHitsTester::verbosity
private

Definition at line 84 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

◆ vtxunit

int GlobalHitsTester::vtxunit
private

Definition at line 86 of file GlobalHitsTester.h.

Referenced by GlobalHitsTester().

mps_fire.i
i
Definition: mps_fire.py:428
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
GlobalHitsTester::meTestTH1F
MonitorElement * meTestTH1F
Definition: GlobalHitsTester.h:97
GlobalHitsTester::getAllProvenances
bool getAllProvenances
Definition: GlobalHitsTester.h:88
GlobalHitsTester::meTestProfile2
MonitorElement * meTestProfile2
Definition: GlobalHitsTester.h:101
dqm::implementation::IBooker::bookProfile2D
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
GlobalHitsTester::meTestFloat
MonitorElement * meTestFloat
Definition: GlobalHitsTester.h:96
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
GlobalHitsTester::meTestTH2F
MonitorElement * meTestTH2F
Definition: GlobalHitsTester.h:98
Random_struct
Definition: Random.h:4
GlobalHitsTester::count
unsigned int count
Definition: GlobalHitsTester.h:109
GlobalHitsTester::frequency
int frequency
Definition: GlobalHitsTester.h:85
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
GlobalHitsTester::label
std::string label
Definition: GlobalHitsTester.h:87
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
dqm::implementation::IBooker::bookString
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
Definition: DQMStore.h:87
GlobalHitsTester::meTestProfile1
MonitorElement * meTestProfile1
Definition: GlobalHitsTester.h:100
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
GlobalHitsTester::vtxunit
int vtxunit
Definition: GlobalHitsTester.h:86
GlobalHitsTester::verbosity
int verbosity
Definition: GlobalHitsTester.h:84
GlobalHitsTester::RandomVal2
double RandomVal2
Definition: GlobalHitsTester.h:105
GlobalHitsTester::meTestInt
MonitorElement * meTestInt
Definition: GlobalHitsTester.h:95
GlobalHitsTester::RandomVal1
double RandomVal1
Definition: GlobalHitsTester.h:104
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
dqm::implementation::IBooker::book3D
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())
Definition: DQMStore.h:290
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GlobalHitsTester::printProvenanceInfo
bool printProvenanceInfo
Definition: GlobalHitsTester.h:89
GlobalHitsTester::outputfile
std::string outputfile
Definition: GlobalHitsTester.h:91
GlobalHitsTester::doOutput
bool doOutput
Definition: GlobalHitsTester.h:92
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
GlobalHitsTester::meTestTH3F
MonitorElement * meTestTH3F
Definition: GlobalHitsTester.h:99
GlobalHitsTester::RandomVal3
double RandomVal3
Definition: GlobalHitsTester.h:106
GlobalHitsTester::meTestString
MonitorElement * meTestString
Definition: GlobalHitsTester.h:94
GlobalHitsTester::fName
std::string fName
Definition: GlobalHitsTester.h:83