CMS 3D CMS Logo

DemoGlobalDQMEDAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DQMServices/Demo
4 // Class: DemoGlobalDQMEDAnalyzer
5 //
13 //
14 // Original Author: Marcel Schneider
15 // Created: Wed, 22 May 2019 15:18:23 GMT
16 //
17 //
18 
19 #include <string>
20 
23 
27 
31 };
32 
33 class DemoGlobalDQMEDAnalyzer : public DQMGlobalEDAnalyzer<Histograms_Demo2> {
34 public:
36  ~DemoGlobalDQMEDAnalyzer() override;
37 
38  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
39 
40 private:
41  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&, Histograms_Demo2&) const override;
42 
43  void dqmAnalyze(edm::Event const&, edm::EventSetup const&, Histograms_Demo2 const&) const override;
44 
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  edm::EventSetup const& iSetup,
61  Histograms_Demo2 const& histos) const {
62  histos.histo_->Fill(5);
63 }
64 
65 void DemoGlobalDQMEDAnalyzer::bookHistograms(DQMStore::IBooker& ibook,
66  edm::Run const& run,
67  edm::EventSetup const& iSetup,
68  Histograms_Demo2& histos) const {
69  ibook.setCurrentFolder(folder_);
70  histos.histo_ = ibook.book1D("EXAMPLE", "EXAMPLE", 10, 0., 10.);
71 }
72 
73 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
76  desc.add<std::string>("folder", "MY_FOLDER");
77  descriptions.add("demo2", desc);
78 }
79 
80 // define this as a plug-in
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
DemoGlobalDQMEDAnalyzer::~DemoGlobalDQMEDAnalyzer
~DemoGlobalDQMEDAnalyzer() override
Definition: DemoGlobalDQMEDAnalyzer.cc:53
edm::Run
Definition: Run.h:45
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
Histograms_Demo2::histo_
MonitorElement * histo_
Definition: DemoGlobalDQMEDAnalyzer.cc:30
dqm::legacy::DQMStore::IBooker
dqm::implementation::IBooker IBooker
Definition: DQMStore.h:729
MakerMacros.h
DemoGlobalDQMEDAnalyzer::folder_
std::string folder_
Definition: DemoGlobalDQMEDAnalyzer.cc:45
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
DemoGlobalDQMEDAnalyzer::dqmAnalyze
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, Histograms_Demo2 const &) const override
Definition: DemoGlobalDQMEDAnalyzer.cc:59
Histograms_Demo2::MonitorElement
dqm::reco::MonitorElement MonitorElement
Definition: DemoGlobalDQMEDAnalyzer.cc:29
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
folder_
std::string folder_
Definition: DQMEDAnalyzer.cc:60
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
DemoGlobalDQMEDAnalyzer
Definition: DemoGlobalDQMEDAnalyzer.cc:33
DemoGlobalDQMEDAnalyzer::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms_Demo2 &) const override
Definition: DemoGlobalDQMEDAnalyzer.cc:65
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
combine.histos
histos
Definition: combine.py:4
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
Frameworkfwd.h
DemoGlobalDQMEDAnalyzer::DemoGlobalDQMEDAnalyzer
DemoGlobalDQMEDAnalyzer(const edm::ParameterSet &)
Definition: DemoGlobalDQMEDAnalyzer.cc:48
DemoGlobalDQMEDAnalyzer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: DemoGlobalDQMEDAnalyzer.cc:74
Histograms_Demo2
Definition: DemoGlobalDQMEDAnalyzer.cc:28
DQMGlobalEDAnalyzer
Definition: DQMGlobalEDAnalyzer.h:13
ParameterSet.h
edm::Event
Definition: Event.h:73
DQMGlobalEDAnalyzer.h