CMS 3D CMS Logo

DemoOneDQMEDAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: DQMServices/Demo
4 // Class: DemoOneDQMEDAnalyzer
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:
30  explicit DemoOneDQMEDAnalyzer(const edm::ParameterSet&);
31  ~DemoOneDQMEDAnalyzer() 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  int eventCount_ = 0;
47 };
48 
50  : folder_(iConfig.getParameter<std::string>("folder")) {
51  // now do what ever initialization is needed
52 }
53 
55  // do anything here that needs to be done at desctruction time
56  // (e.g. close files, deallocate resources etc.)
57 }
58 
59 // ------------ method called for each event ------------
61  using namespace edm;
62 
63  eventCount_++;
64 
65  example_->Fill(5);
70 }
71 
73  edm::Run const& run,
74  edm::EventSetup const& iSetup) {
76 
77  example_ = ibook.book1D("EXAMPLE", "Example 1D", 20, 0., 10.);
78  example2D_ = ibook.book2D("EXAMPLE_2D", "Example 2D", 20, 0, 20, 15, 0, 15);
79  example3D_ = ibook.book3D("EXAMPLE_3D", "Example 3D", 20, 0, 20, 15, 0, 15, 25, 0, 25);
80  exampleTProfile_ = ibook.bookProfile("EXAMPLE_TPROFILE", "Example TProfile", 20, 0, 20, 15, 0, 15);
81  exampleTProfile2D_ = ibook.bookProfile2D("EXAMPLE_TPROFILE2D", "Example TProfile 2D", 20, 0, 20, 15, 0, 15, 0, 100);
82 }
83 
84 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
87  desc.add<std::string>("folder", "MY_FOLDER");
88  descriptions.add("demoone", desc);
89 }
90 
91 // define this as a plug-in
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:476
std::string folder_
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * exampleTProfile2D_
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * exampleTProfile_
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:224
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:399
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
double f[11][100]
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:212
void add(std::string const &label, ParameterSetDescription const &psetDescription)
MonitorElement * example3D_
HLT enums.
MonitorElement * example2D_
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:367
DemoOneDQMEDAnalyzer(const edm::ParameterSet &)
Definition: Run.h:45