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 
66  edm::Run const& run,
67  edm::EventSetup const& iSetup,
68  Histograms_Demo2& histos) const {
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
std::string folder_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
dqm::reco::MonitorElement MonitorElement
int iEvent
Definition: GenABIO.cc:224
void dqmAnalyze(edm::Event const &, edm::EventSetup const &, Histograms_Demo2 const &) const override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &, Histograms_Demo2 &) const override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
DemoGlobalDQMEDAnalyzer(const edm::ParameterSet &)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
Definition: Run.h:45