CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelPhase1Base.h
Go to the documentation of this file.
1 #ifndef SiPixel_DefaultTemplates_h
2 #define SiPixel_DefaultTemplates_h
3 //
4 // This defines two classes, one that has to be extended to make a new plugin,
5 // and one that can be used as-is for the Harvesting.
6 //
7 // As with the entire SiPixelPhase1Common framework, you do not have to use
8 // this but can still use the other helpers. However, the HistogramManager
9 // needs to run in step1 and step2 of the DQM, and need to have exactly the
10 // same spec to work properly. This has to be guranteed by the configuration.
11 //
12 // Original Author: Marcel Schneider
13 //
14 
18 
20 
21 #include <vector>
22 
23 // used as a mixin for Analyzer and Harvester.
25  public:
27  : geometryInterface(iConfig.getParameter<edm::ParameterSet>("geometry")) {
28  auto histograms = iConfig.getParameter<edm::VParameterSet>("histograms");
29  for (auto histoconf : histograms) {
30  histo.emplace_back(HistogramManager(histoconf, geometryInterface));
31  }
32  };
33 
34  protected:
35  std::vector<HistogramManager> histo;
37 };
38 
39 // This is the base class your plugin may derive from. You are not required to
40 // use it but if you just need some normal HistogramManager this should be perfect.
42  public:
44  : DQMEDAnalyzer(), HistogramManagerHolder(iConfig) {};
45 
46  // You should analyze something, and call histoman.fill(...).
47  //void analyze(edm::Event const& e, edm::EventSetup const& eSetup);
48 
49  // This booking is usually fine.
50  void bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& run, edm::EventSetup const& iSetup) {
51  for (HistogramManager& histoman : histo)
52  histoman.book(iBooker, iSetup);
53  };
54 
55  virtual ~SiPixelPhase1Base() {};
56 };
57 
58 // This wraps the Histogram Managers into a DQMEDHarvester. It
59 // provides sane default implementations, so most plugins don't care about this.
60 // However, you have to instantiate one with the same config as your Analyzer
61 // to get the Harvesting done.
62 // For custom harvesting, you have to derive from this.
64  public:
66  : DQMEDHarvester(), HistogramManagerHolder(iConfig) {};
67 
68  void dqmEndLuminosityBlock(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter, edm::LuminosityBlock const& lumiBlock, edm::EventSetup const& eSetup) ;
69  void dqmEndJob(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter);
70 };
71 #endif
T getParameter(std::string const &) const
void bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &run, edm::EventSetup const &iSetup)
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
SiPixelPhase1Base(const edm::ParameterSet &iConfig)
GeometryInterface geometryInterface
SiPixelPhase1Harvester(const edm::ParameterSet &iConfig)
virtual ~SiPixelPhase1Base()
void dqmEndLuminosityBlock(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &eSetup)
HistogramManagerHolder(const edm::ParameterSet &iConfig)
std::vector< HistogramManager > histo
void dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter)
Definition: Run.h:42