test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
22 }
23 
24 
26 {
27  ibooker_.cd();;
28  ibooker_.setCurrentFolder("HLT/HI/" + triggerPath_);
29 
30  h_Q = ibooker_.book1D("hQn", Form("Q%i;Q%i", order_, order_), 500, 0, 0.5);
31 
32  ibooker_.cd();
33 }
34 
36 {
37 
39  e.getByToken(triggerResults_,hltresults);
40  if(!hltresults.isValid())
41  {
42  return;
43  }
44 
45  bool hasFired = false;
46  const edm::TriggerNames& trigNames = e.triggerNames(*hltresults);
47  unsigned int numTriggers = trigNames.size();
48  for( unsigned int hltIndex=0; hltIndex<numTriggers; ++hltIndex ) {
49  if (trigNames.triggerName(hltIndex).find(triggerPath_) != std::string::npos && hltresults->wasrun(hltIndex) && hltresults->accept(hltIndex)){
50  hasFired = true;
51  }
52  }
53 
56  if ( !ep_.isValid() ) {
57  return;
58  }
59 
60  if ( hasFired ) {
61  h_Q->Fill( (*ep_)[EPidx_].vn(EPlvl_) );
62  }
63 
64 }
65 
T getParameter(std::string const &) const
MonitorElement * h_Q
Definition: EventShapeDQM.h:42
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
void cd(void)
Definition: DQMStore.cc:268
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
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:115
bool isValid() const
Definition: HandleBase.h:75
EventShapeDQM(const edm::ParameterSet &ps)
Definition: EventShapeDQM.cc:8
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
virtual ~EventShapeDQM()
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
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
Definition: Run.h:43