CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTTauDQMPath.cc
Go to the documentation of this file.
3 
5 
10 
11 #include<cstdio>
12 #include<sstream>
13 #include<algorithm>
14 
15 namespace {
16  // Used as a helper only in this file
17  class HLTPath {
18  public:
19  HLTPath(const std::string& name, const boost::smatch& what):
20  name_(name)
21  {
22  char buffer[10];
23  for(int i=0; i<10; ++i) {
24  snprintf(buffer, 10, "tr%d", i);
25  boost::ssub_match sm = what[buffer];
26  if(sm.length() == 0)
27  break;
28 
29  try {
30  thresholds_.push_back(std::stoi(sm.str())); // C++11
31  } catch(std::invalid_argument& e) {
32  throw cms::Exception("Configuration") << "Interpreting regex of path " << name << ", threshold " << buffer << ": unable to convert '" << sm.str() << "' to integer";
33  } catch(std::out_of_range& e) {
34  throw cms::Exception("Configuration") << "Interpreting regex of path " << name << ", threshold " << buffer << ": '" << sm.str() << "' is out of int range";
35  }
36  }
37  }
38 
39  bool isBetterThan(const HLTPath& other, const HLTConfigProvider& HLTCP) const {
40  // First compare prescales
41  // Search for prescale set where either is enabled
42  // If other is disabled (prescale = 0), pick the enabled one
43  // If prescales are different, pick the one with smaller
44  // If prescales are same, continue to compare thresholds
45  // FIXME: try to include L1 prescale to the comparison
46  for(unsigned int iSet = 0; iSet < HLTCP.prescaleSize(); ++iSet) {
47  unsigned int prescale = HLTCP.prescaleValue(iSet, name_);
48  unsigned int prescaleOther = HLTCP.prescaleValue(iSet, other.name_);
49  if(prescale == 0 && prescaleOther == 0)
50  continue;
51  if(prescale == 0)
52  return false;
53  if(prescaleOther == 0)
54  return true;
55 
56  if(prescale != prescaleOther)
57  return prescale < prescaleOther;
58  break;
59  }
60 
61  // Then thresholds
62  if(thresholds_.size() != other.thresholds_.size())
63  throw cms::Exception("Configuration") << "Comparing path " << name_ << " and " << other.name_ << ", they have different numbers of thresholds (" << thresholds_.size() << " != " << other.thresholds_.size() << ")";
64  for(size_t i=0; i<thresholds_.size(); ++i) {
65  if(thresholds_[i] != other.thresholds_[i])
66  return thresholds_[i] < other.thresholds_[i];
67  }
68 
69  // Nothing left, what to do? In principle this is an error
70  throw cms::Exception("Configuration") << "Comparing path " << name_ << " and " << other.name_ << ", unable to tell which to choose. Improve your input regex!";
71  return true;
72  }
73 
74  typedef HLTTauDQMPath::FilterIndex FilterIndex;
75 
76  std::vector<FilterIndex> interestingFilters(const HLTConfigProvider& HLTCP, bool doRefAnalysis, const std::vector<boost::regex>& ignoreFilterTypes, const std::vector<boost::regex>& ignoreFilterNames) const {
77  const std::vector<std::string>& moduleLabels = HLTCP.moduleLabels(name_);
78  std::vector<FilterIndex> selectedFilters;
79  std::vector<std::string> leptonTauFilters;
80 
81  // Ignore all "Selector"s, for ref-analysis keep only those with saveTags=True
82  // Also record HLT2(Electron|Muon)(PF)?Tau module names
83  for(std::vector<std::string>::const_iterator iLabel = moduleLabels.begin(); iLabel != moduleLabels.end(); ++iLabel) {
84  if(HLTCP.moduleEDMType(*iLabel) != "EDFilter")
85  continue;
86  const std::string type = HLTCP.moduleType(*iLabel);
87  if(type.find("Selector") != std::string::npos)
88  continue;
89  if(type == "HLTTriggerTypeFilter" || type == "HLTBool")
90  continue;
91  if(doRefAnalysis && !HLTCP.saveTags(*iLabel))
92  continue;
93  if(type == "HLT2ElectronPFTau" || type == "HLT2MuonPFTau" || type == "HLT2ElectronTau" || type == "HLT2MuonTau")
94  leptonTauFilters.emplace_back(*iLabel);
95  else if(type.find("Electron") != std::string::npos || type.find("Egamma") != std::string::npos || type.find("Muon") != std::string::npos)
96  continue;
97  selectedFilters.emplace_back(*iLabel, iLabel-moduleLabels.begin());
98  }
99 
100  // Insert the last filters of lepton legs
101  for(const std::string& leptonTauLabel: leptonTauFilters) {
102  const edm::ParameterSet& pset = HLTCP.modulePSet(leptonTauLabel);
103  std::string input1 = pset.getParameter<edm::InputTag>("inputTag1").label();
104  std::string input2 = pset.getParameter<edm::InputTag>("inputTag2").label();
105  unsigned idx1 = HLTCP.moduleIndex(name_, input1);
106  unsigned idx2 = HLTCP.moduleIndex(name_, input2);
107 
108  auto func = [&](const FilterIndex& a, unsigned idxb) {
109  return std::get<1>(a) < idxb;
110  };
111  std::vector<FilterIndex>::iterator found = std::lower_bound(selectedFilters.begin(), selectedFilters.end(), idx1, func);
112  if(found == selectedFilters.end() || std::get<1>(*found) != idx1)
113  selectedFilters.emplace(found, input1, idx1);
114  found = std::lower_bound(selectedFilters.begin(), selectedFilters.end(), idx2, func);
115  if(found == selectedFilters.end() || std::get<1>(*found) != idx2)
116  selectedFilters.emplace(found, input2, idx2);
117  }
118 
119  // Remove filters ignored by their type
120  std::vector<FilterIndex>::iterator selectedFiltersEnd = std::remove_if(selectedFilters.begin(), selectedFilters.end(), [&](const FilterIndex& labelIndex) {
121  for(const boost::regex& re: ignoreFilterTypes) {
122  if(boost::regex_search(HLTCP.moduleType(std::get<0>(labelIndex)), re))
123  return true;
124  }
125  return false;
126  });
127  // Remove filters ignored by their label
128  selectedFiltersEnd = std::remove_if(selectedFilters.begin(), selectedFiltersEnd, [&](const FilterIndex& labelIndex) {
129  for(const boost::regex& re: ignoreFilterNames) {
130  if(boost::regex_search(std::get<0>(labelIndex), re))
131  return true;
132  }
133  return false;
134  });
135 
136 
137  std::vector<FilterIndex> ret;
138  ret.reserve(selectedFiltersEnd-selectedFilters.begin());
139  std::move(selectedFilters.begin(), selectedFiltersEnd, std::back_inserter(ret));
140  return ret;
141  }
142 
143  size_t tauProducerIndex(const HLTConfigProvider& HLTCP) const {
144  const std::vector<std::string>& moduleLabels = HLTCP.moduleLabels(name_);
145  for(std::vector<std::string>::const_iterator iLabel = moduleLabels.begin(); iLabel != moduleLabels.end(); ++iLabel) {
146  const std::string type = HLTCP.moduleType(*iLabel);
147  // FIXME: this will not work in unscheduled mode, where
148  // producers are not in paths. Try looking first filter using
149  // the PFRecoTauProducer output instead.
150  if(type == "PFRecoTauProducer") {
151  //edm::LogInfo("HLTTauDQMOffline") << "Found PFTauProducer " << *iLabel << " index " << (iLabel-moduleLabels.begin());
152  return iLabel-moduleLabels.begin();
153  }
154  }
156  }
157 
158  const std::string& name() const { return name_; }
159 
160  private:
161  std::string name_;
162 
163  std::vector<int> thresholds_;
164  };
165 
166  int getParameterSafe(const HLTConfigProvider& HLTCP, const std::string& filterName, const std::string& parameterName) {
167  const edm::ParameterSet& pset = HLTCP.modulePSet(filterName);
168  if(pset.existsAs<int>(parameterName))
169  return pset.getParameter<int>(parameterName);
170  else {
171  edm::LogWarning("HLTTauDQMOfflineSource") << "No parameter '" << parameterName << "' in configuration of filter " << filterName << " pset " << pset.dump() << std::endl;
172  return 0;
173  }
174  }
175 
176  struct TauLeptonMultiplicity {
177  TauLeptonMultiplicity(): tau(0), electron(0), muon(0) {}
178  int tau;
179  int electron;
180  int muon;
181  };
182  TauLeptonMultiplicity inferTauLeptonMultiplicity(const HLTConfigProvider& HLTCP, const std::string& filterName, const std::string& moduleType) {
183  TauLeptonMultiplicity n;
184 
185  if(moduleType == "HLTLevel1GTSeed") {
186  if(filterName.find("SingleMu") != std::string::npos) {
187  n.muon = 1;
188  }
189  else if(filterName.find("SingleEG") != std::string::npos) {
190  n.electron = 1;
191  }
192  else if(filterName.find("DoubleTau") != std::string::npos) {
193  n.tau = 2;
194  }
195  }
196  else if(moduleType == "HLT1CaloJet") {
197  //const edm::ParameterSet& pset = HLTCP.modulePSet(filterName);
198  //pset.getParameter<int>("triggerType") == trigger::TriggerTau) {
199  if(getParameterSafe(HLTCP, filterName, "triggerType") == trigger::TriggerTau) {
200  //n.tau = pset.getParameter<int>("MinN");
201  n.tau = getParameterSafe(HLTCP, filterName, "MinN");
202  }
203  }
204  else if(moduleType == "HLTCaloJetTag") {
205  //const edm::ParameterSet& pset = HLTCP.modulePSet(filterName);
206  //if(pset.getParameter<int>("triggerType") == trigger::TriggerTau) {
207  if(getParameterSafe(HLTCP, filterName, "TriggerType") == trigger::TriggerTau) {
208  //n.tau = pset.getParameter<int>("MinJets");
209  n.tau = getParameterSafe(HLTCP, filterName, "MinJets");
210  }
211  }
212  else if(moduleType == "HLT1PFTau") {
213  //n.tau = HLTCP.modulePSet(filterName).getParameter<int>("MinN");
214  n.tau = getParameterSafe(HLTCP, filterName, "MinN");
215  }
216  else if(moduleType == "HLTPFTauPairDzMatchFilter") {
217  n.tau = 2;
218  }
219  else if(moduleType == "HLTElectronGenericFilter") {
220  //n.electron = HLTCP.modulePSet(filterName).getParameter<int>("ncandcut");
221  n.electron = getParameterSafe(HLTCP, filterName, "ncandcut");
222  }
223  else if(moduleType == "HLTMuonIsoFilter") {
224  n.muon = HLTCP.modulePSet(filterName).getParameter<int>("MinN");
225  }
226  else if(moduleType == "HLT2ElectronTau" || moduleType == "HLT2ElectronPFTau") {
227  //int num = HLTCP.modulePSet(filterName).getParameter<int>("MinN");
228  int num = getParameterSafe(HLTCP, filterName, "MinN");
229  n.tau = num;
230  n.electron = num;
231  }
232  else if(moduleType == "HLT2MuonPFTau") {
233  //int num = HLTCP.modulePSet(filterName).getParameter<int>("MinN");
234  int num = getParameterSafe(HLTCP, filterName, "MinN");
235  n.tau = num;
236  n.muon = num;
237  }
238  else if(moduleType == "HLTPrescaler" || moduleType == "HLT1CaloMET") {
239  // ignore
240  }
241  else {
242  edm::LogWarning("HLTTauDQMOfflineSource") << "HLTTauDQMPath.cc, inferTauLeptonMultiplicity(): module type '" << moduleType << "' not recognized, filter '" << filterName << "' will be ignored for offline matching." << std::endl;
243  }
244 
245  return n;
246  }
247 
248  template <typename T1, typename T2>
249  bool deltaRmatch(const T1& obj, const std::vector<T2>& refColl, double dR, std::vector<bool>& refMask, std::vector<T2>& matchedRefs) {
250  double minDr = 2*dR;
251  size_t found = refColl.size();
252  //std::cout << "Matching with DR " << dR << ", obj eta " << obj.eta() << " phi " << obj.phi() << std::endl;
253  for(size_t i=0; i<refColl.size(); ++i) {
254  if(!refMask[i])
255  continue;
256 
257  double dr = reco::deltaR(obj, refColl[i]);
258  //std::cout << " " << i << " ref eta " << refColl[i].eta() << " phi " << refColl[i].phi() << " dr " << dr << std::endl;
259  if(dr < minDr) {
260  minDr = dr;
261  found = i;
262  }
263  }
264  if(found < refColl.size()) {
265  matchedRefs.emplace_back(refColl[found]);
266  refMask[found] = false;
267  return true;
268  }
269  return false;
270  }
271 }
272 
273 
274 HLTTauDQMPath::HLTTauDQMPath(const std::string& hltProcess, const std::string& dqmFolder, bool doRefAnalysis):
275  hltProcess_(hltProcess),
276  dqmFolder_(dqmFolder),
277  doRefAnalysis_(doRefAnalysis),
278  pathIndex_(0),
279  lastFilterBeforeL2TauIndex_(0), lastL2TauFilterIndex_(0),
280  lastFilterBeforeL3TauIndex_(0), lastL3TauFilterIndex_(0),
281  isFirstL1Seed_(false)
282 {}
284 
286  std::vector<std::string> regexs;
287  std::vector<boost::regex> ignoreFilterTypes;
288  std::vector<boost::regex> ignoreFilterNames;
289  std::vector<std::string> regexsTmp = pset.getUntrackedParameter<std::vector<std::string> >("Path");
290  pathRegexs_.reserve(regexsTmp.size());
291  for(const std::string& str: regexsTmp)
292  pathRegexs_.emplace_back(str);
293 
294  std::vector<std::string> ignoreFilterTypesTmp;
295  std::vector<std::string> ignoreFilterNamesTmp;
296  ignoreFilterTypesTmp = pset.getUntrackedParameter<std::vector<std::string> >("IgnoreFilterTypes");
297  ignoreFilterNamesTmp = pset.getUntrackedParameter<std::vector<std::string> >("IgnoreFilterNames");
298  ignoreFilterTypes.reserve(ignoreFilterTypesTmp.size());
299  ignoreFilterNames.reserve(ignoreFilterNamesTmp.size());
300  for(const std::string& str: ignoreFilterTypesTmp)
301  ignoreFilterTypes.emplace_back(str);
302  for(const std::string& str: ignoreFilterNamesTmp)
303  ignoreFilterNames.emplace_back(str);
304 }
305 
307  // Search path candidates
308 
309  std::vector<HLTPath> foundPaths;
310  const std::vector<std::string>& triggerNames = HLTCP.triggerNames();
311  for(const boost::regex& re: pathRegexs_) {
312  //std::cout << regexStr << std::endl;
313  boost::smatch what;
314 
315  for(const std::string& path: triggerNames) {
316  if(boost::regex_match(path, what, re)) {
317  foundPaths.emplace_back(path, what);
318  }
319  }
320  if(!foundPaths.empty())
321  break;
322  }
323  if(foundPaths.empty()) {
324  std::stringstream ss;
325  for(std::vector<boost::regex>::const_iterator iRegex = pathRegexs_.begin(); iRegex != pathRegexs_.end(); ++iRegex) {
326  if(iRegex != pathRegexs_.begin())
327  ss << ",";
328  ss << iRegex->str();
329  }
330  edm::LogWarning("HLTTauDQMOffline") << "HLTTauDQMPath::beginRun(): did not find any paths matching to regexes " << ss.str();
331  return false;
332  }
333 
334  // If more than one, find the best match
335  std::vector<HLTPath>::const_iterator thePath = foundPaths.begin();
336  try {
337  std::vector<HLTPath>::const_iterator iPath = thePath;
338  ++iPath;
339  for(; iPath != foundPaths.end(); ++iPath) {
340  if(!thePath->isBetterThan(*iPath, HLTCP))
341  thePath = iPath;
342  }
343  } catch(cms::Exception& e) {
344  edm::LogError("HLTTauDQMOffline") << "HLTTauDQMPath::beginRun(): " << e.what();
345  return false;
346  }
347  std::stringstream ss;
348  ss << "HLTTauDQMPath::beginRun(): " << dqmFolder_ << ": chose path " << thePath->name() << "\n";
349 
350  // Get the filters
351  filterIndices_ = thePath->interestingFilters(HLTCP, doRefAnalysis_, ignoreFilterTypes_, ignoreFilterNames_);
352  isFirstL1Seed_ = HLTCP.moduleType(std::get<0>(filterIndices_[0])) == "HLTLevel1GTSeed";
353  ss << " Filters";
354  // Set the filter multiplicity counts
355  filterTauN_.clear();
356  filterElectronN_.clear();
357  filterMuonN_.clear();
358  filterTauN_.reserve(filterIndices_.size());
359  filterElectronN_.reserve(filterIndices_.size());
360  filterMuonN_.reserve(filterIndices_.size());
361  for(size_t i=0; i<filterIndices_.size(); ++i) {
362  const std::string& filterName = std::get<0>(filterIndices_[i]);
363  const std::string& moduleType = HLTCP.moduleType(filterName);
364 
365  TauLeptonMultiplicity n = inferTauLeptonMultiplicity(HLTCP, filterName, moduleType);
366  filterTauN_.push_back(n.tau);
367  filterElectronN_.push_back(n.electron);
368  filterMuonN_.push_back(n.muon);
369 
370  ss << "\n " << std::get<1>(filterIndices_[i])
371  << " " << filterName
372  << " " << moduleType
373  << " ntau " << n.tau
374  << " nele " << n.electron
375  << " nmu " << n.muon;
376 
377  }
378  edm::LogInfo("HLTTauDQMOffline") << ss.str();
379 
380 
381  // Find the position of PFRecoTauProducer, use filters with taus
382  // before it for L2 tau efficiency, and filters with taus after it
383  // for L3 tau efficiency
384  const size_t tauProducerIndex = thePath->tauProducerIndex(HLTCP);
385  if(tauProducerIndex == std::numeric_limits<size_t>::max()) {
386  edm::LogWarning("HLTTauDQMOffline") << "HLTTauDQMPath::beginRun(): Did not find PFRecoTauProducer from HLT path " << thePath->name();
387  return false;
388  }
389  //lastFilterBeforeL2TauIndex_ = std::numeric_limits<size_t>::max();
391  //lastFilterBeforeL3TauIndex_ = std::numeric_limits<size_t>::max();
393  size_t i = 0;
395  for(; i<filtersSize() && getFilterIndex(i) < tauProducerIndex; ++i) {
398  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
400  }
402  for(; i<filtersSize(); ++i) {
405  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
407  }
408  LogDebug("HLTTauDQMOffline") << "lastFilterBeforeL2 " << lastFilterBeforeL2TauIndex_
409  << " lastL2TauFilter " << lastL2TauFilterIndex_
410  << " lastFilterBeforeL3 " << lastFilterBeforeL3TauIndex_
411  << " lastL3TauFilter " << lastL3TauFilterIndex_;
412 
413  // Set path index
414  pathName_ = thePath->name();
415  pathIndex_ = HLTCP.triggerIndex(thePath->name());
416 
417 
418  return true;
419 }
420 
422  return triggerResults.accept(pathIndex_);
423 }
424 
426  if(fired(triggerResults)) {
427  //std::cout << "Event passed" << std::endl;
428  return filterIndices_.size()-1;
429  }
430 
431  unsigned int firstFailedFilter = triggerResults.index(pathIndex_);
432  int lastPassedFilter = -1;
433  for(size_t i=0; i<filterIndices_.size(); ++i) {
434  if(std::get<1>(filterIndices_[i]) < firstFailedFilter) {
435  lastPassedFilter = i;
436  }
437  else {
438  //std::cout << "Decision-making filter " << firstFailedFilter << " this " << std::get<1>(filterIndices_[i]) << std::endl;
439  break;
440  }
441  }
442  return lastPassedFilter;
443 }
444 
445 void HLTTauDQMPath::getFilterObjects(const trigger::TriggerEvent& triggerEvent, size_t i, std::vector<Object>& retval) const {
446  trigger::size_type filterIndex = triggerEvent.filterIndex(edm::InputTag(getFilterName(i), "", hltProcess_));
447  if(filterIndex != triggerEvent.sizeFilters()) {
448  const trigger::Keys& keys = triggerEvent.filterKeys(filterIndex);
449  const trigger::Vids& ids = triggerEvent.filterIds(filterIndex);
450  const trigger::TriggerObjectCollection& triggerObjects = triggerEvent.getObjects();
451  //std::cout << "Filter name " << getFilterName(i) << std::endl;
452  for(size_t i=0; i<keys.size(); ++i) {
453  const trigger::TriggerObject& object = triggerObjects[keys[i]];
454  retval.emplace_back(Object{object, ids[i]});
455  //std::cout << " object id " << object.id() << std::endl;
456  }
457  }
458 }
459 
460 bool HLTTauDQMPath::offlineMatching(size_t i, const std::vector<Object>& triggerObjects, const HLTTauDQMOfflineObjects& offlineObjects, double dR, std::vector<Object>& matchedTriggerObjects, HLTTauDQMOfflineObjects& matchedOfflineObjects) const {
461  bool isL1 = (i==0 && isFirstL1Seed_);
462  std::vector<bool> offlineMask;
463  if(filterTauN_[i] > 0) {
464  int matchedObjects = 0;
465  offlineMask.resize(offlineObjects.taus.size());
466  std::fill(offlineMask.begin(), offlineMask.end(), true);
467  for(const Object& trgObj: triggerObjects) {
468  //std::cout << "trigger object id " << trgObj.id << std::endl;
469  if(! ((isL1 && (trgObj.id == trigger::TriggerL1TauJet || trgObj.id == trigger::TriggerL1CenJet))
470  || trgObj.id == trigger::TriggerTau) )
471  continue;
472  if(deltaRmatch(trgObj.object, offlineObjects.taus, dR, offlineMask, matchedOfflineObjects.taus)) {
473  ++matchedObjects;
474  matchedTriggerObjects.emplace_back(trgObj);
475  }
476  }
477  if(matchedObjects < filterTauN_[i])
478  return false;
479  }
480  if(filterElectronN_[i] > 0) {
481  int matchedObjects = 0;
482  offlineMask.resize(offlineObjects.electrons.size());
483  std::fill(offlineMask.begin(), offlineMask.end(), true);
484  for(const Object& trgObj: triggerObjects) {
485  //std::cout << "trigger object id " << trgObj.id << std::endl;
486  if(! ((isL1 && (trgObj.id == trigger::TriggerL1NoIsoEG || trgObj.id == trigger::TriggerL1IsoEG))
487  || trgObj.id == trigger::TriggerElectron) )
488  continue;
489  if(deltaRmatch(trgObj.object, offlineObjects.electrons, dR, offlineMask, matchedOfflineObjects.electrons)) {
490  ++matchedObjects;
491  matchedTriggerObjects.emplace_back(trgObj);
492  }
493  }
494  if(matchedObjects < filterElectronN_[i])
495  return false;
496  }
497  if(filterMuonN_[i] > 0) {
498  int matchedObjects = 0;
499  offlineMask.resize(offlineObjects.muons.size());
500  std::fill(offlineMask.begin(), offlineMask.end(), true);
501  for(const Object& trgObj: triggerObjects) {
502  //std::cout << "trigger object id " << trgObj.id << std::endl;
503  if(! ((isL1 && trgObj.id == trigger::TriggerL1Mu)
504  || trgObj.id == trigger::TriggerMuon) )
505  continue;
506  if(deltaRmatch(trgObj.object, offlineObjects.muons, dR, offlineMask, matchedOfflineObjects.muons)) {
507  ++matchedObjects;
508  matchedTriggerObjects.emplace_back(trgObj);
509  }
510  }
511  if(matchedObjects < filterMuonN_[i])
512  return false;
513  }
514  // Sort offline objects by pt
515  std::sort(matchedOfflineObjects.taus.begin(), matchedOfflineObjects.taus.end(), [](const LV& a, const LV&b) { return a.pt() > b.pt();});
516  std::sort(matchedOfflineObjects.electrons.begin(), matchedOfflineObjects.electrons.end(), [](const LV& a, const LV&b) { return a.pt() > b.pt();});
517  std::sort(matchedOfflineObjects.muons.begin(), matchedOfflineObjects.muons.end(), [](const LV& a, const LV&b) { return a.pt() > b.pt();});
518 
519  return true;
520 }
521 
522 bool HLTTauDQMPath::goodOfflineEvent(size_t i, const HLTTauDQMOfflineObjects& offlineObjects) const {
523  return (static_cast<size_t>(getFilterNTaus(i)) <= offlineObjects.taus.size() &&
524  static_cast<size_t>(getFilterNElectrons(i)) <= offlineObjects.electrons.size() &&
525  static_cast<size_t>(getFilterNMuons(i)) <= offlineObjects.muons.size());
526 }
#define LogDebug(id)
std::vector< boost::regex > pathRegexs_
Definition: HLTTauDQMPath.h:83
virtual char const * what() const
Definition: Exception.cc:141
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::tuple< std::string, size_t > FilterIndex
Definition: HLTTauDQMPath.h:77
bool saveTags(const std::string &module) const
Is module an L3 filter (ie, tracked saveTags=true)
bool goodOfflineEvent(size_t i, const HLTTauDQMOfflineObjects &offlineObjects) const
string fill
Definition: lumiContext.py:319
const std::string moduleType(const std::string &module) const
C++ class name of module.
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:184
std::vector< LV > electrons
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
std::vector< LV > taus
std::vector< boost::regex > ignoreFilterTypes_
Definition: HLTTauDQMPath.h:84
std::string dump(unsigned int indent=0) const
enum start value shifted to 81 so as to avoid clashes with PDG codes
bool accept() const
Has at least one path accepted the event?
const std::vector< std::string > & triggerNames() const
names of trigger paths
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
const std::string moduleEDMType(const std::string &module) const
C++ base class name of module.
int lastPassedFilter(const edm::TriggerResults &triggerResults) const
const edm::ParameterSet & modulePSet(const std::string &module) const
ParameterSet of module.
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:53
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:52
uint16_t size_type
#define input2
Definition: AMPTWrapper.h:149
const std::string hltProcess_
Definition: HLTTauDQMPath.h:79
void initialize(const edm::ParameterSet &pset)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:110
void getFilterObjects(const trigger::TriggerEvent &triggerEvent, size_t i, std::vector< Object > &retval) const
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
unsigned int moduleIndex(unsigned int trigger, const std::string &module) const
slot position of module on trigger path (0 to size-1)
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:54
HLTTauDQMPath(const std::string &hltProcess, const std::string &dqmFolder, bool doRefAnalysis)
const T & max(const T &a, const T &b)
size_t lastFilterBeforeL2TauIndex_
Definition: HLTTauDQMPath.h:93
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
unsigned int pathIndex_
Definition: HLTTauDQMPath.h:92
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
size_t filtersSize() const
Definition: HLTTauDQMPath.h:50
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
#define input1
Definition: AMPTWrapper.h:129
size_t lastFilterBeforeL3TauIndex_
Definition: HLTTauDQMPath.h:95
static std::string const triggerResults
Definition: EdmProvDump.cc:41
std::string pathName_
Definition: HLTTauDQMPath.h:91
bool beginRun(const HLTConfigProvider &HLTCP)
bool offlineMatching(size_t i, const std::vector< Object > &triggerObjects, const HLTTauDQMOfflineObjects &offlineObjects, double dR, std::vector< Object > &matchedTriggerObjects, HLTTauDQMOfflineObjects &matchedOfflineObjects) const
std::vector< int > filterTauN_
Definition: HLTTauDQMPath.h:88
const std::string dqmFolder_
Definition: HLTTauDQMPath.h:80
math::XYZTLorentzVectorD LV
Definition: HLTTauDQMPath.h:26
std::vector< FilterIndex > filterIndices_
Definition: HLTTauDQMPath.h:87
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
size_t getFilterIndex(size_t i) const
Definition: HLTTauDQMPath.h:67
const bool doRefAnalysis_
Definition: HLTTauDQMPath.h:81
std::vector< boost::regex > ignoreFilterNames_
Definition: HLTTauDQMPath.h:85
std::vector< size_type > Keys
const std::string & getFilterName(size_t i) const
Definition: HLTTauDQMPath.h:51
size_t lastL3TauFilterIndex_
Definition: HLTTauDQMPath.h:96
double b
Definition: hdecay.h:120
bool fired(const edm::TriggerResults &triggerResults) const
list object
Definition: dbtoconf.py:77
size_t lastL2TauFilterIndex_
Definition: HLTTauDQMPath.h:94
double a
Definition: hdecay.h:121
std::vector< int > filterElectronN_
Definition: HLTTauDQMPath.h:89
string func
Definition: statics.py:48
unsigned int prescaleSize() const
volatile std::atomic< bool > shutdown_flag false
std::vector< int > filterMuonN_
Definition: HLTTauDQMPath.h:90
std::vector< int > Vids
std::vector< LV > muons