CMS 3D CMS Logo

DemoNormalDQMEDAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DQMServices/Demo
4 // Class: DemoNormalDQMEDAnalyzer
5 //
13 //
14 // Original Author: Marcel Schneider
15 // Created: Wed, 22 May 2019 15:18:07 GMT
16 //
17 //
18 
19 #include <string>
20 
23 
27 
29 public:
31  ~DemoNormalDQMEDAnalyzer() override;
32 
33  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
34 
35 private:
36  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
37 
38  void analyze(const edm::Event&, const edm::EventSetup&) override;
39 
46 };
47 
49  : folder_(iConfig.getParameter<std::string>("folder")) {
50  // now do what ever initialization is needed
51 }
52 
54  // do anything here that needs to be done at desctruction time
55  // (e.g. close files, deallocate resources etc.)
56 }
57 
58 // ------------ method called for each event ------------
60  using namespace edm;
61  example_->Fill(5);
62  example2D_->Fill(1.0, 2.0);
63  example3D_->Fill(1.0, 2.0, 3.0);
64  exampleTProfile_->Fill(1.0, 2.0);
65  exampleTProfile2D_->Fill(1.0, 2.0, 3.0);
66 }
67 
69  edm::Run const& run,
70  edm::EventSetup const& iSetup) {
72 
73  example_ = ibook.book1D(
74  "EXAMPLE", "Example 1D", 20, 0., 10., [](TH1*) { edm::LogInfo("DemoNormalDQMEDAnalyzer") << "booked!\n"; });
75  example2D_ = ibook.book2D("EXAMPLE_2D", "Example 2D", 20, 0, 20, 15, 0, 15);
76  example3D_ = ibook.book3D("EXAMPLE_3D", "Example 3D", 20, 0, 20, 15, 0, 15, 25, 0, 25);
77  exampleTProfile_ = ibook.bookProfile("EXAMPLE_TPROFILE", "Example TProfile", 20, 0, 20, 15, 0, 15);
78  exampleTProfile2D_ = ibook.bookProfile2D("EXAMPLE_TPROFILE2D", "Example TProfile 2D", 20, 0, 20, 15, 0, 15, 0, 100);
79 }
80 
81 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
84  desc.add<std::string>("folder", "MY_FOLDER");
85  descriptions.add("demo", desc);
86 }
87 
88 // define this as a plug-in
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
DemoNormalDQMEDAnalyzer::exampleTProfile2D_
MonitorElement * exampleTProfile2D_
Definition: DemoNormalDQMEDAnalyzer.cc:45
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
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
DemoNormalDQMEDAnalyzer::example_
MonitorElement * example_
Definition: DemoNormalDQMEDAnalyzer.cc:41
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
DemoNormalDQMEDAnalyzer::exampleTProfile_
MonitorElement * exampleTProfile_
Definition: DemoNormalDQMEDAnalyzer.cc:44
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
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
DemoNormalDQMEDAnalyzer::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: DemoNormalDQMEDAnalyzer.cc:68
DQMEDAnalyzer.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
folder_
std::string folder_
Definition: DQMEDAnalyzer.cc:60
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
edm::ParameterSet
Definition: ParameterSet.h:36
DemoNormalDQMEDAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: DemoNormalDQMEDAnalyzer.cc:59
Event.h
DemoNormalDQMEDAnalyzer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: DemoNormalDQMEDAnalyzer.cc:82
iEvent
int iEvent
Definition: GenABIO.cc:224
DemoNormalDQMEDAnalyzer::folder_
std::string folder_
Definition: DemoNormalDQMEDAnalyzer.cc:40
edm::EventSetup
Definition: EventSetup.h:57
DemoNormalDQMEDAnalyzer::example2D_
MonitorElement * example2D_
Definition: DemoNormalDQMEDAnalyzer.cc:42
DemoNormalDQMEDAnalyzer::~DemoNormalDQMEDAnalyzer
~DemoNormalDQMEDAnalyzer() override
Definition: DemoNormalDQMEDAnalyzer.cc:53
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
Frameworkfwd.h
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
dqm::implementation::IBooker
Definition: DQMStore.h:43
ParameterSet.h
edm::Event
Definition: Event.h:73
DemoNormalDQMEDAnalyzer
Definition: DemoNormalDQMEDAnalyzer.cc:28
DemoNormalDQMEDAnalyzer::example3D_
MonitorElement * example3D_
Definition: DemoNormalDQMEDAnalyzer.cc:43
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
DemoNormalDQMEDAnalyzer::DemoNormalDQMEDAnalyzer
DemoNormalDQMEDAnalyzer(const edm::ParameterSet &)
Definition: DemoNormalDQMEDAnalyzer.cc:48