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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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 >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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.

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

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::string outputfile
T getUntrackedParameter(std::string const &, T const &) const
Log< level::Info, false > LogInfo
unsigned int count

◆ ~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.

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

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 }
MonitorElement * meTestProfile1
MonitorElement * meTestInt
MonitorElement * meTestTH3F
void Fill(long long x)
MonitorElement * meTestProfile2
MonitorElement * meTestTH1F
MonitorElement * meTestFloat
MonitorElement * meTestTH2F

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 42 of file GlobalHitsTester.cc.

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().

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 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
MonitorElement * meTestProfile1
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:485
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * meTestInt
MonitorElement * bookString(TString const &name, TString const &value, FUNC onbooking=NOOP())
Definition: DQMStore.h:87
MonitorElement * meTestString
MonitorElement * meTestTH3F
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:408
MonitorElement * meTestProfile2
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:221
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
MonitorElement * meTestTH1F
MonitorElement * meTestFloat
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
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:376
MonitorElement * meTestTH2F

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().