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
DemoOneDQMEDAnalyzer::example_
MonitorElement * example_
Definition: DemoOneDQMEDAnalyzer.cc:41
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
edm::Run
Definition: Run.h:45
DemoOneDQMEDAnalyzer::eventCount_
int eventCount_
Definition: DemoOneDQMEDAnalyzer.cc:46
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
DemoOneDQMEDAnalyzer::~DemoOneDQMEDAnalyzer
~DemoOneDQMEDAnalyzer() override
Definition: DemoOneDQMEDAnalyzer.cc:54
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMOneEDAnalyzer
Definition: DQMOneEDAnalyzer.h:20
DemoOneDQMEDAnalyzer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: DemoOneDQMEDAnalyzer.cc:85
DemoOneDQMEDAnalyzer::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: DemoOneDQMEDAnalyzer.cc:72
DQMOneEDAnalyzer.h
dqm::legacy::DQMStore::IBooker
dqm::implementation::IBooker IBooker
Definition: DQMStore.h:729
MakerMacros.h
DemoOneDQMEDAnalyzer::exampleTProfile2D_
MonitorElement * exampleTProfile2D_
Definition: DemoOneDQMEDAnalyzer.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
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
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
folder_
std::string folder_
Definition: DQMEDAnalyzer.cc:60
DemoOneDQMEDAnalyzer::folder_
std::string folder_
Definition: DemoOneDQMEDAnalyzer.cc:40
edm::ParameterSet
Definition: ParameterSet.h:36
DemoOneDQMEDAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: DemoOneDQMEDAnalyzer.cc:60
Event.h
DemoOneDQMEDAnalyzer::exampleTProfile_
MonitorElement * exampleTProfile_
Definition: DemoOneDQMEDAnalyzer.cc:44
DemoOneDQMEDAnalyzer
Definition: DemoOneDQMEDAnalyzer.cc:28
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
DemoOneDQMEDAnalyzer::example2D_
MonitorElement * example2D_
Definition: DemoOneDQMEDAnalyzer.cc:42
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
DemoOneDQMEDAnalyzer::DemoOneDQMEDAnalyzer
DemoOneDQMEDAnalyzer(const edm::ParameterSet &)
Definition: DemoOneDQMEDAnalyzer.cc:49
DemoOneDQMEDAnalyzer::example3D_
MonitorElement * example3D_
Definition: DemoOneDQMEDAnalyzer.cc:43
dqm::implementation::IBooker
Definition: DQMStore.h:43
ParameterSet.h
edm::Event
Definition: Event.h:73
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