File indexing completed on 2024-09-11 04:32:38
0001 #ifndef SiPixel_DefaultTemplates_h
0002 #define SiPixel_DefaultTemplates_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0016 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018 #include "FWCore/Utilities/interface/Transition.h"
0019 #include "CommonTools/TriggerUtils/interface/GenericTriggerEventFlag.h"
0020
0021 #include "DQM/SiPixelPhase1Common/interface/HistogramManager.h"
0022
0023 #include <utility>
0024 #include <vector>
0025
0026
0027 class HistogramManagerHolder {
0028 public:
0029 HistogramManagerHolder(const edm::ParameterSet& iConfig,
0030 edm::ConsumesCollector&& iC,
0031 edm::Transition transition = edm::Transition::BeginRun)
0032 : geometryInterface(iConfig.getParameter<edm::ParameterSet>("geometry"), std::move(iC), transition) {
0033 auto histograms = iConfig.getParameter<edm::VParameterSet>("histograms");
0034 for (const auto& histoconf : histograms) {
0035 histo.emplace_back(HistogramManager(histoconf, geometryInterface));
0036 }
0037 };
0038
0039 protected:
0040 std::vector<HistogramManager> histo;
0041 GeometryInterface geometryInterface;
0042 };
0043
0044
0045
0046 class SiPixelPhase1Base : public DQMEDAnalyzer, public HistogramManagerHolder {
0047 public:
0048 SiPixelPhase1Base(const edm::ParameterSet& iConfig);
0049
0050
0051 void analyze(edm::Event const& e, edm::EventSetup const&) override = 0;
0052
0053
0054
0055 void bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& run, edm::EventSetup const&) override;
0056
0057 ~SiPixelPhase1Base() override {}
0058
0059 protected:
0060
0061 bool checktrigger(const edm::Event& iEvent, const edm::EventSetup&, const unsigned trgidx) const;
0062
0063
0064 enum { DCS };
0065
0066 private:
0067
0068 std::vector<std::unique_ptr<GenericTriggerEventFlag>> triggerlist;
0069 };
0070
0071
0072
0073
0074
0075
0076 class SiPixelPhase1Harvester : public DQMEDHarvester, public HistogramManagerHolder {
0077 public:
0078 SiPixelPhase1Harvester(const edm::ParameterSet& iConfig)
0079 : DQMEDHarvester(), HistogramManagerHolder(iConfig, consumesCollector(), edm::Transition::EndLuminosityBlock) {}
0080
0081 void dqmEndLuminosityBlock(DQMStore::IBooker& iBooker,
0082 DQMStore::IGetter& iGetter,
0083 edm::LuminosityBlock const& lumiBlock,
0084 edm::EventSetup const&) override;
0085 void dqmEndJob(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter) override;
0086 };
0087 #endif