CMS 3D CMS Logo

EventShapeDQM.cc
Go to the documentation of this file.
7 
9  triggerResults_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("triggerResults"));
10  theEPCollection_ = consumes<reco::EvtPlaneCollection>(ps.getParameter<edm::InputTag>("EPlabel"));
11  triggerPath_ = ps.getParameter<std::string>("triggerPath");
12 
13  order_ = ps.getParameter<int>("order");
14  EPidx_ = ps.getParameter<int>("EPidx");
15  EPlvl_ = ps.getParameter<int>("EPlvl");
16 }
17 
19 
21  ibooker_.cd();
22  ;
23  ibooker_.setCurrentFolder("HLT/HI/" + triggerPath_);
24 
25  h_Q = ibooker_.book1D("hQn", Form("Q%i;Q%i", order_, order_), 500, 0, 0.5);
26 
27  ibooker_.cd();
28 }
29 
30 void EventShapeDQM::analyze(edm::Event const& e, edm::EventSetup const& eSetup) {
32  e.getByToken(triggerResults_, hltresults);
33  if (!hltresults.isValid()) {
34  return;
35  }
36 
37  bool hasFired = false;
38  const edm::TriggerNames& trigNames = e.triggerNames(*hltresults);
39  unsigned int numTriggers = trigNames.size();
40  for (unsigned int hltIndex = 0; hltIndex < numTriggers; ++hltIndex) {
41  if (trigNames.triggerName(hltIndex).find(triggerPath_) != std::string::npos && hltresults->wasrun(hltIndex) &&
42  hltresults->accept(hltIndex)) {
43  hasFired = true;
44  }
45  }
46 
48  e.getByToken(theEPCollection_, ep_);
49  if (!ep_.isValid()) {
50  return;
51  }
52 
53  if (hasFired) {
54  h_Q->Fill((*ep_)[EPidx_].vn(EPlvl_));
55  }
56 }
57 
MonitorElement * h_Q
Definition: EventShapeDQM.h:41
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
~EventShapeDQM() override
void Fill(long long x)
std::string triggerPath_
Definition: EventShapeDQM.h:35
EventShapeDQM(const edm::ParameterSet &ps)
Definition: EventShapeDQM.cc:8
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:57
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< reco::EvtPlaneCollection > theEPCollection_
Definition: EventShapeDQM.h:33
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Definition: EventShapeDQM.h:32
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
Definition: Run.h:45