CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Attributes
HLTTauDQMPath Class Reference

#include <HLTTauDQMPath.h>

Classes

struct  Object
 

Public Types

typedef std::tuple
< std::string, size_t > 
FilterIndex
 
typedef math::XYZTLorentzVectorD LV
 
typedef std::vector< LVLVColl
 

Public Member Functions

bool beginRun (const HLTConfigProvider &HLTCP)
 
size_t filtersSize () const
 
bool fired (const edm::TriggerResults &triggerResults) const
 
size_t getFilterIndex (size_t i) const
 
const std::string & getFilterName (size_t i) const
 
int getFilterNElectrons (size_t i) const
 
int getFilterNMuons (size_t i) const
 
int getFilterNTaus (size_t i) const
 
void getFilterObjects (const trigger::TriggerEvent &triggerEvent, size_t i, std::vector< Object > &retval) const
 
size_t getLastFilterBeforeL2TauIndex () const
 
size_t getLastFilterBeforeL3TauIndex () const
 
const std::string & getLastFilterName () const
 
size_t getLastL2TauFilterIndex () const
 
size_t getLastL3TauFilterIndex () const
 
const unsigned int getPathIndex () const
 
const std::string & getPathName () const
 
bool goodOfflineEvent (size_t i, const HLTTauDQMOfflineObjects &offlineObjects) const
 
bool hasL2Taus () const
 
bool hasL3Taus () const
 
 HLTTauDQMPath (const std::string &hltProcess, const std::string &dqmFolder, bool doRefAnalysis)
 
void initialize (const edm::ParameterSet &pset)
 
bool isFirstFilterL1Seed () const
 
int lastPassedFilter (const edm::TriggerResults &triggerResults) const
 
bool offlineMatching (size_t i, const std::vector< Object > &triggerObjects, const HLTTauDQMOfflineObjects &offlineObjects, double dR, std::vector< Object > &matchedTriggerObjects, HLTTauDQMOfflineObjects &matchedOfflineObjects) const
 
 ~HLTTauDQMPath ()
 

Private Attributes

const bool doRefAnalysis_
 
const std::string dqmFolder_
 
std::vector< int > filterElectronN_
 
std::vector< FilterIndexfilterIndices_
 
std::vector< int > filterMuonN_
 
std::vector< int > filterTauN_
 
const std::string hltProcess_
 
std::vector< boost::regex > ignoreFilterNames_
 
std::vector< boost::regex > ignoreFilterTypes_
 
bool isFirstL1Seed_
 
size_t lastFilterBeforeL2TauIndex_
 
size_t lastFilterBeforeL3TauIndex_
 
size_t lastL2TauFilterIndex_
 
size_t lastL3TauFilterIndex_
 
unsigned int pathIndex_
 
std::string pathName_
 
std::vector< boost::regex > pathRegexs_
 

Detailed Description

Definition at line 24 of file HLTTauDQMPath.h.

Member Typedef Documentation

typedef std::tuple<std::string, size_t> HLTTauDQMPath::FilterIndex

Definition at line 77 of file HLTTauDQMPath.h.

Definition at line 26 of file HLTTauDQMPath.h.

typedef std::vector<LV> HLTTauDQMPath::LVColl

Definition at line 27 of file HLTTauDQMPath.h.

Constructor & Destructor Documentation

HLTTauDQMPath::HLTTauDQMPath ( const std::string &  hltProcess,
const std::string &  dqmFolder,
bool  doRefAnalysis 
)

Definition at line 274 of file HLTTauDQMPath.cc.

274  :
275  hltProcess_(hltProcess),
276  dqmFolder_(dqmFolder),
277  doRefAnalysis_(doRefAnalysis),
278  pathIndex_(0),
281  isFirstL1Seed_(false)
282 {}
const std::string hltProcess_
Definition: HLTTauDQMPath.h:79
size_t lastFilterBeforeL2TauIndex_
Definition: HLTTauDQMPath.h:93
unsigned int pathIndex_
Definition: HLTTauDQMPath.h:92
size_t lastFilterBeforeL3TauIndex_
Definition: HLTTauDQMPath.h:95
const std::string dqmFolder_
Definition: HLTTauDQMPath.h:80
const bool doRefAnalysis_
Definition: HLTTauDQMPath.h:81
size_t lastL3TauFilterIndex_
Definition: HLTTauDQMPath.h:96
size_t lastL2TauFilterIndex_
Definition: HLTTauDQMPath.h:94
HLTTauDQMPath::~HLTTauDQMPath ( )

Definition at line 283 of file HLTTauDQMPath.cc.

283 {}

Member Function Documentation

bool HLTTauDQMPath::beginRun ( const HLTConfigProvider HLTCP)

Definition at line 306 of file HLTTauDQMPath.cc.

References doRefAnalysis_, dqmFolder_, filterElectronN_, filterIndices_, filterMuonN_, filtersSize(), filterTauN_, getFilterIndex(), getFilterNElectrons(), getFilterNMuons(), getFilterNTaus(), i, ignoreFilterNames_, ignoreFilterTypes_, isFirstL1Seed_, lastFilterBeforeL2TauIndex_, lastFilterBeforeL3TauIndex_, lastL2TauFilterIndex_, lastL3TauFilterIndex_, LogDebug, max(), HLTConfigProvider::moduleType(), getHLTPrescaleColumns::path, pathIndex_, pathName_, pathRegexs_, AlCaHLTBitMon_QueryRunRegistry::string, HLTConfigProvider::triggerIndex(), HLTConfigProvider::triggerNames(), and cms::Exception::what().

Referenced by HLTTauDQMPathPlotter::beginRun().

306  {
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 }
#define LogDebug(id)
std::vector< boost::regex > pathRegexs_
Definition: HLTTauDQMPath.h:83
virtual char const * what() const
Definition: Exception.cc:141
int i
Definition: DBlmapReader.cc:9
const std::string moduleType(const std::string &module) const
C++ class name of module.
std::vector< boost::regex > ignoreFilterTypes_
Definition: HLTTauDQMPath.h:84
const std::vector< std::string > & triggerNames() const
names of trigger paths
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:53
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:52
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:54
const T & max(const T &a, const T &b)
size_t lastFilterBeforeL2TauIndex_
Definition: HLTTauDQMPath.h:93
unsigned int pathIndex_
Definition: HLTTauDQMPath.h:92
size_t filtersSize() const
Definition: HLTTauDQMPath.h:50
size_t lastFilterBeforeL3TauIndex_
Definition: HLTTauDQMPath.h:95
std::string pathName_
Definition: HLTTauDQMPath.h:91
std::vector< int > filterTauN_
Definition: HLTTauDQMPath.h:88
const std::string dqmFolder_
Definition: HLTTauDQMPath.h:80
std::vector< FilterIndex > filterIndices_
Definition: HLTTauDQMPath.h:87
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
size_t lastL3TauFilterIndex_
Definition: HLTTauDQMPath.h:96
size_t lastL2TauFilterIndex_
Definition: HLTTauDQMPath.h:94
std::vector< int > filterElectronN_
Definition: HLTTauDQMPath.h:89
std::vector< int > filterMuonN_
Definition: HLTTauDQMPath.h:90
size_t HLTTauDQMPath::filtersSize ( ) const
inline

Definition at line 50 of file HLTTauDQMPath.h.

References filterIndices_.

Referenced by HLTTauDQMPathSummaryPlotter::analyze(), HLTTauDQMPathPlotter::beginRun(), and beginRun().

50 { return filterIndices_.size(); }
std::vector< FilterIndex > filterIndices_
Definition: HLTTauDQMPath.h:87
bool HLTTauDQMPath::fired ( const edm::TriggerResults triggerResults) const

Definition at line 421 of file HLTTauDQMPath.cc.

References edm::HLTGlobalStatus::accept(), and pathIndex_.

Referenced by HLTTauDQMPathSummaryPlotter::analyze(), HLTTauDQMPathPlotter::analyze(), and lastPassedFilter().

421  {
422  return triggerResults.accept(pathIndex_);
423 }
bool accept() const
Has at least one path accepted the event?
unsigned int pathIndex_
Definition: HLTTauDQMPath.h:92
size_t HLTTauDQMPath::getFilterIndex ( size_t  i) const
inline

Definition at line 67 of file HLTTauDQMPath.h.

References filterIndices_, and i.

Referenced by beginRun().

67 { return std::get<1>(filterIndices_[i]); }
int i
Definition: DBlmapReader.cc:9
std::vector< FilterIndex > filterIndices_
Definition: HLTTauDQMPath.h:87
const std::string& HLTTauDQMPath::getFilterName ( size_t  i) const
inline

Definition at line 51 of file HLTTauDQMPath.h.

References filterIndices_, and i.

Referenced by HLTTauDQMPathPlotter::beginRun(), and getFilterObjects().

51 { return std::get<0>(filterIndices_[i]); }
int i
Definition: DBlmapReader.cc:9
std::vector< FilterIndex > filterIndices_
Definition: HLTTauDQMPath.h:87
int HLTTauDQMPath::getFilterNElectrons ( size_t  i) const
inline

Definition at line 53 of file HLTTauDQMPath.h.

References filterElectronN_, and i.

Referenced by HLTTauDQMPathPlotter::analyze(), HLTTauDQMPathPlotter::beginRun(), beginRun(), and goodOfflineEvent().

53 {return filterElectronN_[i]; }
int i
Definition: DBlmapReader.cc:9
std::vector< int > filterElectronN_
Definition: HLTTauDQMPath.h:89
int HLTTauDQMPath::getFilterNMuons ( size_t  i) const
inline

Definition at line 54 of file HLTTauDQMPath.h.

References filterMuonN_, and i.

Referenced by HLTTauDQMPathPlotter::analyze(), HLTTauDQMPathPlotter::beginRun(), beginRun(), and goodOfflineEvent().

54 {return filterMuonN_[i]; }
int i
Definition: DBlmapReader.cc:9
std::vector< int > filterMuonN_
Definition: HLTTauDQMPath.h:90
int HLTTauDQMPath::getFilterNTaus ( size_t  i) const
inline

Definition at line 52 of file HLTTauDQMPath.h.

References filterTauN_, and i.

Referenced by HLTTauDQMPathPlotter::analyze(), HLTTauDQMPathPlotter::beginRun(), beginRun(), and goodOfflineEvent().

52 { return filterTauN_[i]; }
int i
Definition: DBlmapReader.cc:9
std::vector< int > filterTauN_
Definition: HLTTauDQMPath.h:88
void HLTTauDQMPath::getFilterObjects ( const trigger::TriggerEvent triggerEvent,
size_t  i,
std::vector< Object > &  retval 
) const

Definition at line 445 of file HLTTauDQMPath.cc.

References trigger::TriggerEvent::filterIds(), trigger::TriggerEvent::filterIndex(), trigger::TriggerEvent::filterKeys(), getFilterName(), trigger::TriggerEvent::getObjects(), hltProcess_, i, relativeConstraints::keys, dbtoconf::object, and trigger::TriggerEvent::sizeFilters().

Referenced by HLTTauDQMPathSummaryPlotter::analyze(), and HLTTauDQMPathPlotter::analyze().

445  {
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 }
int i
Definition: DBlmapReader.cc:9
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
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
uint16_t size_type
const std::string hltProcess_
Definition: HLTTauDQMPath.h:79
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
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
std::vector< size_type > Keys
const std::string & getFilterName(size_t i) const
Definition: HLTTauDQMPath.h:51
list object
Definition: dbtoconf.py:77
std::vector< int > Vids
size_t HLTTauDQMPath::getLastFilterBeforeL2TauIndex ( ) const
inline

Definition at line 61 of file HLTTauDQMPath.h.

References lastFilterBeforeL2TauIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2TauIndex_
Definition: HLTTauDQMPath.h:93
size_t HLTTauDQMPath::getLastFilterBeforeL3TauIndex ( ) const
inline

Definition at line 63 of file HLTTauDQMPath.h.

References lastFilterBeforeL3TauIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3TauIndex_
Definition: HLTTauDQMPath.h:95
const std::string& HLTTauDQMPath::getLastFilterName ( ) const
inline

Definition at line 57 of file HLTTauDQMPath.h.

References filterIndices_.

57 { return std::get<0>(filterIndices_.back()); }
std::vector< FilterIndex > filterIndices_
Definition: HLTTauDQMPath.h:87
size_t HLTTauDQMPath::getLastL2TauFilterIndex ( ) const
inline

Definition at line 62 of file HLTTauDQMPath.h.

References lastL2TauFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

62 { return lastL2TauFilterIndex_; }
size_t lastL2TauFilterIndex_
Definition: HLTTauDQMPath.h:94
size_t HLTTauDQMPath::getLastL3TauFilterIndex ( ) const
inline

Definition at line 64 of file HLTTauDQMPath.h.

References lastL3TauFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

64 { return lastL3TauFilterIndex_; }
size_t lastL3TauFilterIndex_
Definition: HLTTauDQMPath.h:96
const unsigned int HLTTauDQMPath::getPathIndex ( ) const
inline

Definition at line 48 of file HLTTauDQMPath.h.

References pathIndex_.

48 { return pathIndex_; }
unsigned int pathIndex_
Definition: HLTTauDQMPath.h:92
const std::string& HLTTauDQMPath::getPathName ( ) const
inline

Definition at line 47 of file HLTTauDQMPath.h.

References pathName_.

47 { return pathName_; }
std::string pathName_
Definition: HLTTauDQMPath.h:91
bool HLTTauDQMPath::goodOfflineEvent ( size_t  i,
const HLTTauDQMOfflineObjects offlineObjects 
) const

Definition at line 522 of file HLTTauDQMPath.cc.

References HLTTauDQMOfflineObjects::electrons, getFilterNElectrons(), getFilterNMuons(), getFilterNTaus(), HLTTauDQMOfflineObjects::muons, and HLTTauDQMOfflineObjects::taus.

Referenced by HLTTauDQMPathSummaryPlotter::analyze().

522  {
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 }
int i
Definition: DBlmapReader.cc:9
std::vector< LV > electrons
std::vector< LV > taus
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:53
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:52
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:54
std::vector< LV > muons
bool HLTTauDQMPath::hasL2Taus ( ) const
inline

Definition at line 59 of file HLTTauDQMPath.h.

References lastL2TauFilterIndex_, and max().

Referenced by HLTTauDQMPathPlotter::analyze(), and HLTTauDQMPathPlotter::beginRun().

const T & max(const T &a, const T &b)
size_t lastL2TauFilterIndex_
Definition: HLTTauDQMPath.h:94
bool HLTTauDQMPath::hasL3Taus ( ) const
inline

Definition at line 60 of file HLTTauDQMPath.h.

References lastL3TauFilterIndex_, and max().

Referenced by HLTTauDQMPathPlotter::analyze(), and HLTTauDQMPathPlotter::beginRun().

const T & max(const T &a, const T &b)
size_t lastL3TauFilterIndex_
Definition: HLTTauDQMPath.h:96
void HLTTauDQMPath::initialize ( const edm::ParameterSet pset)

Definition at line 285 of file HLTTauDQMPath.cc.

References edm::ParameterSet::getUntrackedParameter(), pathRegexs_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HLTTauDQMPathPlotter::HLTTauDQMPathPlotter().

285  {
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 }
std::vector< boost::regex > pathRegexs_
Definition: HLTTauDQMPath.h:83
T getUntrackedParameter(std::string const &, T const &) const
bool HLTTauDQMPath::isFirstFilterL1Seed ( ) const
inline

Definition at line 56 of file HLTTauDQMPath.h.

References isFirstL1Seed_.

Referenced by HLTTauDQMPathPlotter::analyze().

56 { return isFirstL1Seed_; }
int HLTTauDQMPath::lastPassedFilter ( const edm::TriggerResults triggerResults) const

Definition at line 425 of file HLTTauDQMPath.cc.

References filterIndices_, fired(), i, edm::HLTGlobalStatus::index(), and pathIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

425  {
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 }
int i
Definition: DBlmapReader.cc:9
int lastPassedFilter(const edm::TriggerResults &triggerResults) const
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.
std::vector< FilterIndex > filterIndices_
Definition: HLTTauDQMPath.h:87
bool fired(const edm::TriggerResults &triggerResults) const
bool HLTTauDQMPath::offlineMatching ( size_t  i,
const std::vector< Object > &  triggerObjects,
const HLTTauDQMOfflineObjects offlineObjects,
double  dR,
std::vector< Object > &  matchedTriggerObjects,
HLTTauDQMOfflineObjects matchedOfflineObjects 
) const

Definition at line 460 of file HLTTauDQMPath.cc.

References a, b, HLTTauDQMOfflineObjects::electrons, lumiContext::fill, filterElectronN_, filterMuonN_, filterTauN_, isFirstL1Seed_, HLTTauDQMOfflineObjects::muons, python.multivaluedict::sort(), HLTTauDQMOfflineObjects::taus, trigger::TriggerElectron, trigger::TriggerL1CenJet, trigger::TriggerL1IsoEG, trigger::TriggerL1Mu, trigger::TriggerL1NoIsoEG, trigger::TriggerL1TauJet, trigger::TriggerMuon, and trigger::TriggerTau.

Referenced by HLTTauDQMPathSummaryPlotter::analyze(), and HLTTauDQMPathPlotter::analyze().

460  {
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 }
int i
Definition: DBlmapReader.cc:9
string fill
Definition: lumiContext.py:319
std::vector< LV > electrons
std::vector< LV > taus
enum start value shifted to 81 so as to avoid clashes with PDG codes
math::XYZTLorentzVectorD LV
std::vector< int > filterTauN_
Definition: HLTTauDQMPath.h:88
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
std::vector< int > filterElectronN_
Definition: HLTTauDQMPath.h:89
std::vector< int > filterMuonN_
Definition: HLTTauDQMPath.h:90
std::vector< LV > muons

Member Data Documentation

const bool HLTTauDQMPath::doRefAnalysis_
private

Definition at line 81 of file HLTTauDQMPath.h.

Referenced by beginRun().

const std::string HLTTauDQMPath::dqmFolder_
private

Definition at line 80 of file HLTTauDQMPath.h.

Referenced by beginRun().

std::vector<int> HLTTauDQMPath::filterElectronN_
private

Definition at line 89 of file HLTTauDQMPath.h.

Referenced by beginRun(), getFilterNElectrons(), and offlineMatching().

std::vector<FilterIndex> HLTTauDQMPath::filterIndices_
private
std::vector<int> HLTTauDQMPath::filterMuonN_
private

Definition at line 90 of file HLTTauDQMPath.h.

Referenced by beginRun(), getFilterNMuons(), and offlineMatching().

std::vector<int> HLTTauDQMPath::filterTauN_
private

Definition at line 88 of file HLTTauDQMPath.h.

Referenced by beginRun(), getFilterNTaus(), and offlineMatching().

const std::string HLTTauDQMPath::hltProcess_
private

Definition at line 79 of file HLTTauDQMPath.h.

Referenced by getFilterObjects().

std::vector<boost::regex> HLTTauDQMPath::ignoreFilterNames_
private

Definition at line 85 of file HLTTauDQMPath.h.

Referenced by beginRun().

std::vector<boost::regex> HLTTauDQMPath::ignoreFilterTypes_
private

Definition at line 84 of file HLTTauDQMPath.h.

Referenced by beginRun().

bool HLTTauDQMPath::isFirstL1Seed_
private

Definition at line 97 of file HLTTauDQMPath.h.

Referenced by beginRun(), isFirstFilterL1Seed(), and offlineMatching().

size_t HLTTauDQMPath::lastFilterBeforeL2TauIndex_
private

Definition at line 93 of file HLTTauDQMPath.h.

Referenced by beginRun(), and getLastFilterBeforeL2TauIndex().

size_t HLTTauDQMPath::lastFilterBeforeL3TauIndex_
private

Definition at line 95 of file HLTTauDQMPath.h.

Referenced by beginRun(), and getLastFilterBeforeL3TauIndex().

size_t HLTTauDQMPath::lastL2TauFilterIndex_
private

Definition at line 94 of file HLTTauDQMPath.h.

Referenced by beginRun(), getLastL2TauFilterIndex(), and hasL2Taus().

size_t HLTTauDQMPath::lastL3TauFilterIndex_
private

Definition at line 96 of file HLTTauDQMPath.h.

Referenced by beginRun(), getLastL3TauFilterIndex(), and hasL3Taus().

unsigned int HLTTauDQMPath::pathIndex_
private

Definition at line 92 of file HLTTauDQMPath.h.

Referenced by beginRun(), fired(), getPathIndex(), and lastPassedFilter().

std::string HLTTauDQMPath::pathName_
private

Definition at line 91 of file HLTTauDQMPath.h.

Referenced by beginRun(), and getPathName().

std::vector<boost::regex> HLTTauDQMPath::pathRegexs_
private

Definition at line 83 of file HLTTauDQMPath.h.

Referenced by beginRun(), and initialize().