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
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 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
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...
bool isRealData() const
Definition: EventBase.h:62
SiPixelPhase1Base(const edm::ParameterSet &iConfig)
bool checktrigger(const edm::Event &iEvent, const edm::EventSetup &iSetup, const unsigned trgidx) const
int iEvent
Definition: GenABIO.cc:224
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &run, edm::EventSetup const &iSetup) override
std::vector< HistogramManager > histo
Definition: Run.h:45