CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
12 
14  if(!isValid() || pathObjects_.empty())
15  return;
16 
17  //Create the histograms
18  iBooker.setCurrentFolder(triggerTag()+"/helpers");
19 
20  all_events = iBooker.book1D("RefEvents", "All events", pathObjects_.size(), 0, pathObjects_.size());
21  accepted_events = iBooker.book1D("PathTriggerBits","Accepted Events per Path;;entries", pathObjects_.size(), 0, pathObjects_.size());
22  for(size_t i=0; i<pathObjects_.size(); ++i) {
23  all_events->setBinLabel(i+1, pathObjects_[i]->getPathName());
24  accepted_events->setBinLabel(i+1, pathObjects_[i]->getPathName());
25  }
26 
27  iBooker.setCurrentFolder(triggerTag());
28 }
29 
31  if(doRefAnalysis_) {
32  std::vector<HLTTauDQMPath::Object> triggerObjs;
33  std::vector<HLTTauDQMPath::Object> matchedTriggerObjs;
34  HLTTauDQMOfflineObjects matchedOfflineObjs;
35 
36  for(size_t i=0; i<pathObjects_.size(); ++i) {
37  const HLTTauDQMPath *path = pathObjects_[i];
38  const int lastFilter = path->filtersSize()-1;
39 
40  if(path->goodOfflineEvent(lastFilter, refCollection)) {
41  all_events->Fill(i+0.5);
42  }
43  if(path->fired(triggerResults)) {
44  triggerObjs.clear();
45  matchedTriggerObjs.clear();
46  matchedOfflineObjs.clear();
47  path->getFilterObjects(triggerEvent, lastFilter, triggerObjs);
48  if(path->offlineMatching(lastFilter, triggerObjs, refCollection, hltMatchDr_, matchedTriggerObjs, matchedOfflineObjs)) {
49  accepted_events->Fill(i+0.5);
50  }
51  }
52  }
53  }
54  else {
55  for(size_t i=0; i<pathObjects_.size(); ++i) {
56  const HLTTauDQMPath *path = pathObjects_[i];
57  all_events->Fill(i+0.5);
58  if(path->fired(triggerResults)) {
59  accepted_events->Fill(i+0.5);
60  }
61  }
62  }
63 }
bool isValid() const
int i
Definition: DBlmapReader.cc:9
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
tuple path
else: Piece not in the list, fine.
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:51
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void bookHistograms(DQMStore::IBooker &iBooker)
static std::string const triggerResults
Definition: EdmProvDump.cc:40
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:274
bool fired(const edm::TriggerResults &triggerResults) const
void analyze(const edm::TriggerResults &triggerResults, const trigger::TriggerEvent &triggerEvent, const HLTTauDQMOfflineObjects &refCollection)