CMS 3D CMS Logo

SiPixelPhase1Base.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Class: SiPixelPhase1Base
4 //
5 // Implementations of the class
6 //
7 // Original Author: Yi-Mu "Enoch" Chen
8 
10 
11 // Constructor requires manually looping the trigger flag settings
12 // Since constructor of GenericTriggerEventFlag requires
13 // EDConsumerBase class protected member calls
15  : DQMEDAnalyzer(), HistogramManagerHolder(iConfig, consumesCollector()) {
16  // Flags will default to empty vector if not specified in configuration file
17  auto flags = iConfig.getUntrackedParameter<edm::VParameterSet>("triggerflags", {});
18 
19  for (auto& flag : flags) {
20  triggerlist.emplace_back(new GenericTriggerEventFlag(flag, consumesCollector(), *this));
21  }
22 }
23 
24 // Booking histograms as required by the DQM
26  for (HistogramManager& histoman : histo) {
27  histoman.book(iBooker, iSetup);
28  }
29 
30  // Running trigger flag initialization (per run)
31  for (auto& trigger : triggerlist) {
32  if (trigger->on()) {
33  trigger->initRun(run, iSetup);
34  }
35  }
36 }
37 
38 // trigger checking function
40  const edm::EventSetup& iSetup,
41  const unsigned trgidx) const {
42  //true if no trigger, MC, off, or accepted
43 
44  return triggerlist.empty() || !iEvent.isRealData() || !triggerlist.at(trgidx)->on() ||
45  triggerlist.at(trgidx)->accept(iEvent, iSetup);
46 }
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:35
std::vector< std::unique_ptr< GenericTriggerEventFlag > > triggerlist
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
SiPixelPhase1Base(const edm::ParameterSet &iConfig)
T getUntrackedParameter(std::string const &, T const &) const
int iEvent
Definition: GenABIO.cc:224
void bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &run, edm::EventSetup const &) override
std::vector< HistogramManager > histo
bool checktrigger(const edm::Event &iEvent, const edm::EventSetup &, const unsigned trgidx) const
Definition: Run.h:45