CMS 3D CMS Logo

HLTTauDQMPathSummaryPlotter.cc
Go to the documentation of this file.
3 
4 HLTTauDQMPathSummaryPlotter::HLTTauDQMPathSummaryPlotter(const edm::ParameterSet& pset, bool doRefAnalysis, const std::string& dqmBaseFolder, double hltMatchDr):
5  HLTTauDQMPlotter(pset, dqmBaseFolder),
6  hltMatchDr_(hltMatchDr),
7  doRefAnalysis_(doRefAnalysis)
8 {}
9 
11 
13  if(!isValid() || pathObjects_.empty())
14  return;
15 
16  //Create the histograms
17  iBooker.setCurrentFolder(triggerTag()+"/helpers");
18 
19  all_events = iBooker.book1D("RefEvents", "All events", pathObjects_.size(), 0, pathObjects_.size());
20  accepted_events = iBooker.book1D("PathTriggerBits","Accepted Events per Path;;entries", pathObjects_.size(), 0, pathObjects_.size());
21  for(size_t i=0; i<pathObjects_.size(); ++i) {
22  all_events->setBinLabel(i+1, pathObjects_[i]->getPathName());
23  accepted_events->setBinLabel(i+1, pathObjects_[i]->getPathName());
24  }
25 
26  iBooker.setCurrentFolder(triggerTag());
27 }
28 
30  if(doRefAnalysis_) {
31  std::vector<HLTTauDQMPath::Object> triggerObjs;
32  std::vector<HLTTauDQMPath::Object> matchedTriggerObjs;
33  HLTTauDQMOfflineObjects matchedOfflineObjs;
34 
35  for(size_t i=0; i<pathObjects_.size(); ++i) {
36  const HLTTauDQMPath *path = pathObjects_[i];
37  const int lastFilter = path->filtersSize()-1;
38 
39  if(path->goodOfflineEvent(lastFilter, refCollection)) {
40  all_events->Fill(i+0.5);
41  }
42  if(path->fired(triggerResults)) {
43  triggerObjs.clear();
44  matchedTriggerObjs.clear();
45  matchedOfflineObjs.clear();
46  path->getFilterObjects(triggerEvent, lastFilter, triggerObjs);
47  if(path->offlineMatching(lastFilter, triggerObjs, refCollection, hltMatchDr_, matchedTriggerObjs, matchedOfflineObjs)) {
48  accepted_events->Fill(i+0.5);
49  }
50  }
51  }
52  }
53  else {
54  for(size_t i=0; i<pathObjects_.size(); ++i) {
55  const HLTTauDQMPath *path = pathObjects_[i];
56  all_events->Fill(i+0.5);
57  if(path->fired(triggerResults)) {
58  accepted_events->Fill(i+0.5);
59  }
60  }
61  }
62 }
bool isValid() const
bool goodOfflineEvent(size_t i, const HLTTauDQMOfflineObjects &offlineObjects) const
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
const std::string & triggerTag() const
void Fill(long long x)
void getFilterObjects(const trigger::TriggerEvent &triggerEvent, size_t i, std::vector< Object > &retval) const
HLTTauDQMPathSummaryPlotter(const edm::ParameterSet &pset, bool doRefAnalysis, const std::string &dqmBaseFolder, double hltMatchDr)
std::vector< const HLTTauDQMPath * > pathObjects_
size_t filtersSize() const
Definition: HLTTauDQMPath.h:52
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void bookHistograms(DQMStore::IBooker &iBooker)
static std::string const triggerResults
Definition: EdmProvDump.cc:41
bool offlineMatching(size_t i, const std::vector< Object > &triggerObjects, const HLTTauDQMOfflineObjects &offlineObjects, double dR, std::vector< Object > &matchedTriggerObjects, HLTTauDQMOfflineObjects &matchedOfflineObjects) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
bool fired(const edm::TriggerResults &triggerResults) const
void analyze(const edm::TriggerResults &triggerResults, const trigger::TriggerEvent &triggerEvent, const HLTTauDQMOfflineObjects &refCollection)