CMS 3D CMS Logo

GlobalHitsTester.cc
Go to the documentation of this file.
3 
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 }
39 
41 
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 }
77 
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 }
HIPAlignmentAlgorithm_cfi.verbosity
verbosity
Definition: HIPAlignmentAlgorithm_cfi.py:7
mps_fire.i
i
Definition: mps_fire.py:428
funct::false
false
Definition: Factorize.h:29
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
edm::Run
Definition: Run.h:45
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
DQMStore.h
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
MainPageGenerator.fName
fName
Definition: MainPageGenerator.py:301
GlobalHitsTester.h
GlobalHitsTester::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: GlobalHitsTester.cc:42
GlobalHitsTester::~GlobalHitsTester
~GlobalHitsTester() override
Definition: GlobalHitsTester.cc:40
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
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
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::GlobalHitsTester
GlobalHitsTester(const edm::ParameterSet &)
Definition: GlobalHitsTester.cc:4
GlobalHitsTester::meTestProfile1
MonitorElement * meTestProfile1
Definition: GlobalHitsTester.h:100
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
iEvent
int iEvent
Definition: GenABIO.cc:224
GlobalHitsTester::vtxunit
int vtxunit
Definition: GlobalHitsTester.h:86
edm::EventSetup
Definition: EventSetup.h:58
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
GlobalHitsTester::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: GlobalHitsTester.cc:78
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm::implementation::IBooker
Definition: DQMStore.h:43
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
edm::Event
Definition: Event.h:73
label
const char * label
Definition: PFTauDecayModeTools.cc:11
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