CMS 3D CMS Logo

EventShapeDQM.cc
Go to the documentation of this file.
7 
9 {
10  triggerResults_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("triggerResults"));
11  theEPCollection_ = consumes<reco::EvtPlaneCollection>(ps.getParameter<edm::InputTag>("EPlabel"));
12  triggerPath_ = ps.getParameter<std::string>("triggerPath");
13 
14  order_ = ps.getParameter<int>("order");
15  EPidx_ = ps.getParameter<int>("EPidx");
16  EPlvl_ = ps.getParameter<int>("EPlvl");
17 }
18 
20 
21 
23 {
24  ibooker_.cd();;
25  ibooker_.setCurrentFolder("HLT/HI/" + triggerPath_);
26 
27  h_Q = ibooker_.book1D("hQn", Form("Q%i;Q%i", order_, order_), 500, 0, 0.5);
28 
29  ibooker_.cd();
30 }
31 
33 {
34 
36  e.getByToken(triggerResults_,hltresults);
37  if(!hltresults.isValid())
38  {
39  return;
40  }
41 
42  bool hasFired = false;
43  const edm::TriggerNames& trigNames = e.triggerNames(*hltresults);
44  unsigned int numTriggers = trigNames.size();
45  for( unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex ) {
46  if (trigNames.triggerName(hltIndex).find(triggerPath_) != std::string::npos && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex)){
47  hasFired = true;
48  }
49  }
50 
53  if ( !ep_.isValid() ) {
54  return;
55  }
56 
57  if ( hasFired ) {
58  h_Q->Fill( (*ep_)[EPidx_].vn(EPlvl_) );
59  }
60 
61 }
62 
T getParameter(std::string const &) const
bool wasrun() const
Was at least one path run?
MonitorElement * h_Q
Definition: EventShapeDQM.h:42
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool accept() const
Has at least one path accepted the event?
~EventShapeDQM() override
Strings::size_type size() const
Definition: TriggerNames.cc:39
void Fill(long long x)
std::string triggerPath_
Definition: EventShapeDQM.h:36
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
bool isValid() const
Definition: HandleBase.h:74
EventShapeDQM(const edm::ParameterSet &ps)
Definition: EventShapeDQM.cc:8
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
edm::EDGetTokenT< reco::EvtPlaneCollection > theEPCollection_
Definition: EventShapeDQM.h:34
edm::EDGetTokenT< edm::TriggerResults > triggerResults_
Definition: EventShapeDQM.h:33
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
Definition: Run.h:44