CMS 3D CMS Logo

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 
20 
22 
23 #include <utility>
24 #include <vector>
25 
26 // used as a mixin for Analyzer and Harvester.
28 public:
32  : geometryInterface(iConfig.getParameter<edm::ParameterSet>("geometry"), std::move(iC), transition) {
33  auto histograms = iConfig.getParameter<edm::VParameterSet>("histograms");
34  for (auto histoconf : histograms) {
35  histo.emplace_back(HistogramManager(histoconf, geometryInterface));
36  }
37  };
38 
39 protected:
40  std::vector<HistogramManager> histo;
42 };
43 
44 // This is the base class your plugin may derive from. You are not required to
45 // use it but if you just need some normal HistogramManager this should be perfect.
47 public:
48  SiPixelPhase1Base(const edm::ParameterSet& iConfig);
49 
50  // You should analyze something, and call histoman.fill(...). Setting to pure virtual function
51  void analyze(edm::Event const& e, edm::EventSetup const&) override = 0;
52 
53  // This booking is usually fine.
54  // Also used to store the required triggers
55  void bookHistograms(DQMStore::IBooker& iBooker, edm::Run const& run, edm::EventSetup const&) override;
56 
57  ~SiPixelPhase1Base() override{};
58 
59 protected:
60  // Returns a value of whether the trigger stored at position "trgidx" is properly fired.
61  bool checktrigger(const edm::Event& iEvent, const edm::EventSetup&, const unsigned trgidx) const;
62 
63  // must match order in TriggerEventFlag_cfi.py
64  enum { DCS };
65 
66 private:
67  // Storing the trigger objects per plugin instance
68  std::vector<std::unique_ptr<GenericTriggerEventFlag>> triggerlist;
69 };
70 
71 // This wraps the Histogram Managers into a DQMEDHarvester. It
72 // provides sane default implementations, so most plugins don't care about this.
73 // However, you have to instantiate one with the same config as your Analyzer
74 // to get the Harvesting done.
75 // For custom harvesting, you have to derive from this.
77 public:
79  : DQMEDHarvester(), HistogramManagerHolder(iConfig, consumesCollector(), edm::Transition::EndLuminosityBlock){};
80 
82  DQMStore::IGetter& iGetter,
83  edm::LuminosityBlock const& lumiBlock,
84  edm::EventSetup const&) override;
85  void dqmEndJob(DQMStore::IBooker& iBooker, DQMStore::IGetter& iGetter) override;
86 };
87 #endif
DQMEDHarvester.h
SiPixelPhase1Base::~SiPixelPhase1Base
~SiPixelPhase1Base() override
Definition: SiPixelPhase1Base.h:57
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
SiPixelPhase1Base::triggerlist
std::vector< std::unique_ptr< GenericTriggerEventFlag > > triggerlist
Definition: SiPixelPhase1Base.h:68
HistogramManager
Definition: HistogramManager.h:31
edm::VParameterSet
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:34
edm::EDConsumerBase::consumesCollector
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: EDConsumerBase.cc:46
HistogramManagerHolder::histo
std::vector< HistogramManager > histo
Definition: SiPixelPhase1Base.h:37
SiPixelPhase1Base::SiPixelPhase1Base
SiPixelPhase1Base(const edm::ParameterSet &iConfig)
Definition: SiPixelPhase1Base.cc:14
SiPixelPhase1Harvester::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, edm::LuminosityBlock const &lumiBlock, edm::EventSetup const &) override
Definition: SiPixelPhase1Harvester.cc:7
SiPixelPhase1Base
Definition: SiPixelPhase1Base.h:46
GenericTriggerEventFlag.h
SiPixelPhase1Harvester::dqmEndJob
void dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
Definition: SiPixelPhase1Harvester.cc:14
Transition.h
DQMEDAnalyzer.h
DQMEDAnalyzer
Definition: DQMEDAnalyzer.py:1
SiPixelPhase1Base::DCS
Definition: SiPixelPhase1Base.h:64
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
HistogramManager.h
ParameterSet
Definition: Functions.h:16
HistogramManagerHolder
Definition: SiPixelPhase1Base.h:27
HistogramManagerHolder::HistogramManagerHolder
HistogramManagerHolder(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC, edm::Transition transition=edm::Transition::BeginRun)
Definition: SiPixelPhase1Base.h:29
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
histograms
Definition: histograms.py:1
SiPixelPhase1Base::bookHistograms
void bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &run, edm::EventSetup const &) override
Definition: SiPixelPhase1Base.cc:25
SiPixelPhase1Base::analyze
void analyze(edm::Event const &e, edm::EventSetup const &) override=0
DQMEDHarvester
Definition: DQMEDHarvester.py:1
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
dqm::implementation::IGetter
Definition: DQMStore.h:484
edm::Transition::BeginRun
SiPixelPhase1Harvester
Definition: SiPixelPhase1Base.h:76
HistogramManagerHolder::geometryInterface
GeometryInterface geometryInterface
Definition: SiPixelPhase1Base.h:41
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm::implementation::IBooker
Definition: DQMStore.h:43
SiPixelPhase1Harvester::SiPixelPhase1Harvester
SiPixelPhase1Harvester(const edm::ParameterSet &iConfig)
Definition: SiPixelPhase1Base.h:78
GeometryInterface
Definition: GeometryInterface.h:34
ParameterSet.h
edm::Event
Definition: Event.h:73
SiPixelPhase1Base::checktrigger
bool checktrigger(const edm::Event &iEvent, const edm::EventSetup &, const unsigned trgidx) const
Definition: SiPixelPhase1Base.cc:39
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37