CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Private Attributes
HLTTauDQMPath Class Reference

#include <HLTTauDQMPath.h>

Classes

struct  Object
 

Public Types

typedef std::tuple< std::string, std::string, size_t > FilterIndex
 
using LV = math::XYZTLorentzVectorD
 
using LVColl = std::vector< LV >
 

Public Member Functions

size_t filtersSize () const
 
bool fired (const edm::TriggerResults &triggerResults) const
 
size_t getFilterIndex (size_t i) const
 
int getFilterLevel (size_t i) const
 
int getFilterMET (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
 
const std::string & getFilterType (size_t i) const
 
size_t getFirstFilterBeforeL2CaloMETIndex () const
 
size_t getFirstL2CaloMETFilterIndex () const
 
size_t getLastFilterBeforeL2CaloMETIndex () const
 
size_t getLastFilterBeforeL2ElectronIndex () const
 
size_t getLastFilterBeforeL2MuonIndex () const
 
size_t getLastFilterBeforeL2TauIndex () const
 
size_t getLastFilterBeforeL3ElectronIndex () const
 
size_t getLastFilterBeforeL3MuonIndex () const
 
size_t getLastFilterBeforeL3TauIndex () const
 
const std::string & getLastFilterName () const
 
size_t getLastL2CaloMETFilterIndex () const
 
size_t getLastL2ElectronFilterIndex () const
 
size_t getLastL2MuonFilterIndex () const
 
size_t getLastL2TauFilterIndex () const
 
size_t getLastL3ElectronFilterIndex () const
 
size_t getLastL3MuonFilterIndex () 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 hasL2CaloMET () const
 
bool hasL2Electrons () const
 
bool hasL2Muons () const
 
bool hasL2Taus () const
 
bool hasL3Electrons () const
 
bool hasL3Muons () const
 
bool hasL3Taus () const
 
 HLTTauDQMPath (std::string pathName, std::string hltProcess, bool doRefAnalysis, const HLTConfigProvider &HLTCP)
 
bool isFirstFilterL1Seed () const
 
bool isValid () 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 ()
 

Static Public Attributes

static constexpr size_t kInvalidIndex = std::numeric_limits<size_t>::max()
 
static constexpr size_t kModuleIndex = 2
 
static constexpr size_t kName = 0
 
static constexpr size_t kType = 1
 

Private Attributes

const bool doRefAnalysis_
 
std::vector< int > filterElectronN_
 
std::vector< FilterIndexfilterIndices_
 
std::vector< int > filterLevel_
 
std::vector< int > filterMET_
 
std::vector< int > filterMuonN_
 
std::vector< int > filterTauN_
 
size_t firstFilterBeforeL2METIndex_
 
size_t firstL2METFilterIndex_
 
const std::string hltProcess_
 
bool isFirstL1Seed_
 
bool isValid_
 
size_t lastFilterBeforeL2ElectronIndex_
 
size_t lastFilterBeforeL2METIndex_
 
size_t lastFilterBeforeL2MuonIndex_
 
size_t lastFilterBeforeL2TauIndex_
 
size_t lastFilterBeforeL3ElectronIndex_
 
size_t lastFilterBeforeL3MuonIndex_
 
size_t lastFilterBeforeL3TauIndex_
 
size_t lastL2ElectronFilterIndex_
 
size_t lastL2METFilterIndex_
 
size_t lastL2MuonFilterIndex_
 
size_t lastL2TauFilterIndex_
 
size_t lastL3ElectronFilterIndex_
 
size_t lastL3MuonFilterIndex_
 
size_t lastL3TauFilterIndex_
 
const unsigned int pathIndex_
 
const std::string pathName_
 

Detailed Description

Definition at line 22 of file HLTTauDQMPath.h.

Member Typedef Documentation

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

Definition at line 26 of file HLTTauDQMPath.h.

Definition at line 24 of file HLTTauDQMPath.h.

using HLTTauDQMPath::LVColl = std::vector<LV>

Definition at line 25 of file HLTTauDQMPath.h.

Constructor & Destructor Documentation

HLTTauDQMPath::HLTTauDQMPath ( std::string  pathName,
std::string  hltProcess,
bool  doRefAnalysis,
const HLTConfigProvider HLTCP 
)

Definition at line 352 of file HLTTauDQMPath.cc.

References doRefAnalysis_, filterElectronN_, filterIndices_, filterLevel_, filterMET_, filterMuonN_, filtersSize(), filterTauN_, firstFilterBeforeL2METIndex_, firstL2METFilterIndex_, getFilterLevel(), getFilterMET(), getFilterNElectrons(), getFilterNMuons(), getFilterNTaus(), SingleJetValidationHI_cfi::HLTPath, mps_fire::i, isFirstL1Seed_, isValid_, kInvalidIndex, lastFilterBeforeL2ElectronIndex_, lastFilterBeforeL2METIndex_, lastFilterBeforeL2MuonIndex_, lastFilterBeforeL2TauIndex_, lastFilterBeforeL3ElectronIndex_, lastFilterBeforeL3MuonIndex_, lastFilterBeforeL3TauIndex_, lastL2ElectronFilterIndex_, lastL2METFilterIndex_, lastL2MuonFilterIndex_, lastL2TauFilterIndex_, lastL3ElectronFilterIndex_, lastL3MuonFilterIndex_, lastL3TauFilterIndex_, LogDebug, HLTConfigProvider::moduleType(), pathName_, AlCaHLTBitMon_QueryRunRegistry::string, and ~HLTTauDQMPath().

352  :
353  hltProcess_(std::move(hltProcess)),
354  doRefAnalysis_(doRefAnalysis),
355  pathName_(std::move(pathName)),
363 
364  isFirstL1Seed_(false),
365  isValid_(false)
366 {
367 #ifdef EDM_ML_DEBUG
368  std::stringstream ss;
369  ss << "HLTTauDQMPath: " << pathName_ << "\n";
370 #endif
371  // Get the filters
372  HLTPath thePath(pathName_);
373  filterIndices_ = thePath.interestingFilters(HLTCP, doRefAnalysis_);
374  if(filterIndices_.empty()) {
375  edm::LogInfo("HLTTauDQMOffline") << "HLTTauDQMPath: " << pathName_ << " no interesting filters found";
376  return;
377  }
378  isFirstL1Seed_ = HLTCP.moduleType(std::get<kName>(filterIndices_[0])) == "HLTL1TSeed";
379 #ifdef EDM_ML_DEBUG
380  ss << " Interesting filters (preceded by the module index in the path)";
381 #endif
382  // Set the filter multiplicity counts
383  filterTauN_.clear();
384  filterElectronN_.clear();
385  filterMuonN_.clear();
386  filterMET_.clear();
387  filterTauN_.reserve(filterIndices_.size());
388  filterElectronN_.reserve(filterIndices_.size());
389  filterMuonN_.reserve(filterIndices_.size());
390  filterMET_.reserve(filterIndices_.size());
391  filterLevel_.reserve(filterIndices_.size());
392  for(auto & filterIndice : filterIndices_) {
393  const std::string& filterName = std::get<kName>(filterIndice);
394  const std::string& moduleType = HLTCP.moduleType(filterName);
395 
396  TauLeptonMultiplicity n = inferTauLeptonMultiplicity(HLTCP, filterName, moduleType, pathName_);
397  filterTauN_.push_back(n.tau);
398  filterElectronN_.push_back(n.electron);
399  filterMuonN_.push_back(n.muon);
400  filterMET_.push_back(n.met);
401  filterLevel_.push_back(n.level);
402 
403 #ifdef EDM_ML_DEBUG
404  ss << "\n " << i << " " << std::get<kModuleIndex>(filterIndices_[i])
405  << " " << filterName
406  << " " << moduleType
407  << " ntau " << n.tau
408  << " nele " << n.electron
409  << " nmu " << n.muon;
410 #endif
411  }
412 #ifdef EDM_ML_DEBUG
413  LogDebug("HLTTauDQMOffline") << ss.str();
414 #endif
415 
416  // Find the position of tau producer, use filters with taus before
417  // it for L2 tau efficiency, and filters with taus after it for L3
418  // tau efficiency. Here we have to take into account that for
419  // reference-matched case filterIndices_ contains only those filters
420  // that have saveTags=True, while for searching the first L3 tau
421  // filter we have to consider all filters
422  const size_t firstL3TauFilterIndex = thePath.firstL3TauFilterIndex(HLTCP);
423  if(firstL3TauFilterIndex == kInvalidIndex) {
424  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 tau producer as input in path " << pathName_;
425  }
426  const size_t firstL3ElectronFilterIndex = thePath.firstL3ElectronFilterIndex(HLTCP);
427  if(firstL3ElectronFilterIndex == kInvalidIndex) {
428  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 electron producer as input in path " << pathName_;
429  }
430  const size_t firstL3MuonFilterIndex = thePath.firstL3MuonFilterIndex(HLTCP);
431  if(firstL3MuonFilterIndex == kInvalidIndex) {
432  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 muon producer as input in path " << pathName_;
433  }
434 
451 /*
452  size_t i = 0;
453  for(; i<filtersSize() && getFilterIndex(i) < firstL3TauFilterIndex; ++i) {
454  if(lastL2TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
455  lastFilterBeforeL2TauIndex_ = i;
456  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
457  lastL2TauFilterIndex_ = i;
458  }
459  lastFilterBeforeL3TauIndex_ = i-1;
460  for(; i<filtersSize(); ++i) {
461  if(lastL3TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
462  lastFilterBeforeL3TauIndex_ = i;
463  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
464  lastL3TauFilterIndex_ = i;
465  }
466 */
467  for(size_t i = 0; i<filtersSize(); ++i) {
468  // Tau
469  if(getFilterLevel(i) == 2 && getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
473 
474 // if(lastFilterBeforeL3TauIndex_ < 2 && lastL3TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
475 // lastFilterBeforeL3TauIndex_ = i;
476  if(getFilterLevel(i) == 3 && getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
480 
481  // Electron
484  if(getFilterLevel(i) == 2 && getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
486 
487  if(getFilterLevel(i) == 3 && getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
491 /*
492  if(lastL2ElectronFilterIndex_ == kInvalidIndex && getFilterNElectrons(i) == 0)
493  lastFilterBeforeL2ElectronIndex_ = i;
494  if(getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
495  lastL2ElectronFilterIndex_ = i;
496 
497  if(lastFilterBeforeL3ElectronIndex_ == 0 && lastL3ElectronFilterIndex_ == kInvalidIndex && getFilterNElectrons(i) == 0)
498  lastFilterBeforeL3ElectronIndex_ = i;
499  if(getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
500  lastL3ElectronFilterIndex_ = i;
501 */
502  // Muon
505  if(getFilterLevel(i) == 2 && getFilterNMuons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNElectrons(i) == 0)
507 
508  if(getFilterLevel(i) == 3 && getFilterNMuons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNElectrons(i) == 0)
512 
513 
514  // MET
517  if(getFilterMET(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
519 
524  }
525 // lastFilterBeforeL3TauIndex_ = firstL3TauFilterIndex - 1;
526 // lastFilterBeforeL3ElectronIndex_ = firstL3ElectronFilterIndex - 1;
527 // lastFilterBeforeL3MuonIndex_ = firstL3MuonFilterIndex - 1;
528  LogDebug("HLTTauDQMOffline") << "lastFilterBeforeL2 " << lastFilterBeforeL2TauIndex_
529  << " lastL2TauFilter " << lastL2TauFilterIndex_
530  << " lastFilterBeforeL3 " << lastFilterBeforeL3TauIndex_
531  << " lastL3TauFilter " << lastL3TauFilterIndex_;
532  isValid_ = true;
533 }
#define LogDebug(id)
const std::string pathName_
int getFilterLevel(size_t i) const
Definition: HLTTauDQMPath.h:59
const std::string moduleType(const std::string &module) const
C++ class name of module.
size_t lastL3ElectronFilterIndex_
std::vector< int > filterMET_
size_t lastFilterBeforeL2METIndex_
size_t lastFilterBeforeL3ElectronIndex_
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:56
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:55
size_t lastFilterBeforeL3MuonIndex_
std::vector< int > filterLevel_
const std::string hltProcess_
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:57
const unsigned int pathIndex_
size_t lastFilterBeforeL2TauIndex_
size_t filtersSize() const
Definition: HLTTauDQMPath.h:52
size_t lastFilterBeforeL3TauIndex_
size_t lastFilterBeforeL2ElectronIndex_
std::vector< int > filterTauN_
size_t lastL2MuonFilterIndex_
std::vector< FilterIndex > filterIndices_
const bool doRefAnalysis_
size_t lastL3TauFilterIndex_
size_t lastL2TauFilterIndex_
int getFilterMET(size_t i) const
Definition: HLTTauDQMPath.h:58
std::vector< int > filterElectronN_
size_t lastL3MuonFilterIndex_
size_t lastL2ElectronFilterIndex_
size_t firstFilterBeforeL2METIndex_
std::vector< int > filterMuonN_
def move(src, dest)
Definition: eostools.py:511
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
size_t lastL2METFilterIndex_
size_t lastFilterBeforeL2MuonIndex_
size_t firstL2METFilterIndex_
HLTTauDQMPath::~HLTTauDQMPath ( )
default

Referenced by HLTTauDQMPath().

Member Function Documentation

size_t HLTTauDQMPath::filtersSize ( ) const
inline

Definition at line 52 of file HLTTauDQMPath.h.

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

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

Definition at line 538 of file HLTTauDQMPath.cc.

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

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

538  {
539  return triggerResults.accept(pathIndex_);
540 }
bool accept() const
Has at least one path accepted the event?
const unsigned int pathIndex_
size_t HLTTauDQMPath::getFilterIndex ( size_t  i) const
inline

Definition at line 92 of file HLTTauDQMPath.h.

References mps_fire::i, and TriggerAnalyzer::triggerObjects.

92 { return std::get<kModuleIndex>(filterIndices_[i]); }
std::vector< FilterIndex > filterIndices_
int HLTTauDQMPath::getFilterLevel ( size_t  i) const
inline

Definition at line 59 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

59 {if(i < filterLevel_.size()) return filterLevel_[i]; else return 0;}
std::vector< int > filterLevel_
int HLTTauDQMPath::getFilterMET ( size_t  i) const
inline

Definition at line 58 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze(), HLTTauDQMPathPlotter::bookHistograms(), and HLTTauDQMPath().

58 {if(i < filterMET_.size()) return filterMET_[i]; else return 0;}
std::vector< int > filterMET_
const std::string& HLTTauDQMPath::getFilterName ( size_t  i) const
inline

Definition at line 53 of file HLTTauDQMPath.h.

References mps_fire::i.

Referenced by HLTTauDQMPathPlotter::analyze(), HLTTauDQMPathPlotter::bookHistograms(), and getFilterObjects().

53 { return std::get<kName>(filterIndices_[i]); }
std::vector< FilterIndex > filterIndices_
int HLTTauDQMPath::getFilterNElectrons ( size_t  i) const
inline

Definition at line 56 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze(), HLTTauDQMPathPlotter::bookHistograms(), goodOfflineEvent(), and HLTTauDQMPath().

56 {if(i < filterElectronN_.size()) return filterElectronN_[i]; else return 0;}
std::vector< int > filterElectronN_
int HLTTauDQMPath::getFilterNMuons ( size_t  i) const
inline

Definition at line 57 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze(), HLTTauDQMPathPlotter::bookHistograms(), goodOfflineEvent(), and HLTTauDQMPath().

57 {if(i < filterMuonN_.size()) return filterMuonN_[i]; else return 0;}
std::vector< int > filterMuonN_
int HLTTauDQMPath::getFilterNTaus ( size_t  i) const
inline

Definition at line 55 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze(), HLTTauDQMPathPlotter::bookHistograms(), goodOfflineEvent(), and HLTTauDQMPath().

55 { if(i < filterTauN_.size()) return filterTauN_[i]; else return 0;}
std::vector< int > filterTauN_
void HLTTauDQMPath::getFilterObjects ( const trigger::TriggerEvent triggerEvent,
size_t  i,
std::vector< Object > &  retval 
) const

Definition at line 563 of file HLTTauDQMPath.cc.

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

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

563  {
564  trigger::size_type filterIndex = triggerEvent.filterIndex(edm::InputTag(getFilterName(i), "", hltProcess_));
565  if(filterIndex != triggerEvent.sizeFilters()) {
566  const trigger::Keys& keys = triggerEvent.filterKeys(filterIndex);
567  const trigger::Vids& ids = triggerEvent.filterIds(filterIndex);
569  for(size_t i=0; i<keys.size(); ++i) {
570  const trigger::TriggerObject& object = triggerObjects[keys[i]];
571  retval.emplace_back(Object{object, ids[i]});
572  }
573  }
574 }
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_
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:53
std::vector< int > Vids
const std::string& HLTTauDQMPath::getFilterType ( size_t  i) const
inline

Definition at line 54 of file HLTTauDQMPath.h.

References mps_fire::i.

Referenced by HLTTauDQMPathPlotter::analyze().

54 { return std::get<kType>(filterIndices_[i]); }
std::vector< FilterIndex > filterIndices_
size_t HLTTauDQMPath::getFirstFilterBeforeL2CaloMETIndex ( ) const
inline

Definition at line 88 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t firstFilterBeforeL2METIndex_
size_t HLTTauDQMPath::getFirstL2CaloMETFilterIndex ( ) const
inline

Definition at line 89 of file HLTTauDQMPath.h.

89 { return firstL2METFilterIndex_; }
size_t firstL2METFilterIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2CaloMETIndex ( ) const
inline

Definition at line 86 of file HLTTauDQMPath.h.

size_t lastFilterBeforeL2METIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2ElectronIndex ( ) const
inline

Definition at line 76 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2ElectronIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2MuonIndex ( ) const
inline

Definition at line 81 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2MuonIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2TauIndex ( ) const
inline

Definition at line 71 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2TauIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL3ElectronIndex ( ) const
inline

Definition at line 78 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3ElectronIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL3MuonIndex ( ) const
inline

Definition at line 83 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3MuonIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL3TauIndex ( ) const
inline

Definition at line 73 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3TauIndex_
const std::string& HLTTauDQMPath::getLastFilterName ( ) const
inline

Definition at line 62 of file HLTTauDQMPath.h.

62 { return std::get<kName>(filterIndices_.back()); }
std::vector< FilterIndex > filterIndices_
size_t HLTTauDQMPath::getLastL2CaloMETFilterIndex ( ) const
inline

Definition at line 87 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

87 { return lastL2METFilterIndex_; }
size_t lastL2METFilterIndex_
size_t HLTTauDQMPath::getLastL2ElectronFilterIndex ( ) const
inline

Definition at line 77 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastL2ElectronFilterIndex_
size_t HLTTauDQMPath::getLastL2MuonFilterIndex ( ) const
inline

Definition at line 82 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

82 { return lastL2MuonFilterIndex_; }
size_t lastL2MuonFilterIndex_
size_t HLTTauDQMPath::getLastL2TauFilterIndex ( ) const
inline

Definition at line 72 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

72 { return lastL2TauFilterIndex_; }
size_t lastL2TauFilterIndex_
size_t HLTTauDQMPath::getLastL3ElectronFilterIndex ( ) const
inline

Definition at line 79 of file HLTTauDQMPath.h.

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

size_t lastL3ElectronFilterIndex_
size_t HLTTauDQMPath::getLastL3MuonFilterIndex ( ) const
inline

Definition at line 84 of file HLTTauDQMPath.h.

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

84 { return lastL3MuonFilterIndex_; }
size_t lastL3MuonFilterIndex_
size_t HLTTauDQMPath::getLastL3TauFilterIndex ( ) const
inline

Definition at line 74 of file HLTTauDQMPath.h.

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

74 { return lastL3TauFilterIndex_; }
size_t lastL3TauFilterIndex_
const unsigned int HLTTauDQMPath::getPathIndex ( ) const
inline

Definition at line 50 of file HLTTauDQMPath.h.

50 { return pathIndex_; }
const unsigned int pathIndex_
const std::string& HLTTauDQMPath::getPathName ( ) const
inline

Definition at line 49 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::bookHistograms().

49 { return pathName_; }
const std::string pathName_
bool HLTTauDQMPath::goodOfflineEvent ( size_t  i,
const HLTTauDQMOfflineObjects offlineObjects 
) const

Definition at line 654 of file HLTTauDQMPath.cc.

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

Referenced by HLTTauDQMPathSummaryPlotter::analyze().

654  {
655  return (static_cast<size_t>(getFilterNTaus(i)) <= offlineObjects.taus.size() &&
656  static_cast<size_t>(getFilterNElectrons(i)) <= offlineObjects.electrons.size() &&
657  static_cast<size_t>(getFilterNMuons(i)) <= offlineObjects.muons.size());
658 }
std::vector< LV > electrons
std::vector< LV > taus
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:56
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:55
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:57
std::vector< LV > muons
bool HLTTauDQMPath::hasL2CaloMET ( ) const
inline

Definition at line 70 of file HLTTauDQMPath.h.

References edm::graph::kInvalidIndex.

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

static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
size_t lastL2METFilterIndex_
bool HLTTauDQMPath::hasL2Electrons ( ) const
inline

Definition at line 66 of file HLTTauDQMPath.h.

References edm::graph::kInvalidIndex.

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

size_t lastL2ElectronFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
bool HLTTauDQMPath::hasL2Muons ( ) const
inline

Definition at line 68 of file HLTTauDQMPath.h.

References edm::graph::kInvalidIndex.

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

size_t lastL2MuonFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
bool HLTTauDQMPath::hasL2Taus ( ) const
inline

Definition at line 64 of file HLTTauDQMPath.h.

References edm::graph::kInvalidIndex.

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

size_t lastL2TauFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
bool HLTTauDQMPath::hasL3Electrons ( ) const
inline

Definition at line 67 of file HLTTauDQMPath.h.

References edm::graph::kInvalidIndex.

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

size_t lastL3ElectronFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
bool HLTTauDQMPath::hasL3Muons ( ) const
inline

Definition at line 69 of file HLTTauDQMPath.h.

References edm::graph::kInvalidIndex.

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

size_t lastL3MuonFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
bool HLTTauDQMPath::hasL3Taus ( ) const
inline

Definition at line 65 of file HLTTauDQMPath.h.

References edm::graph::kInvalidIndex.

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

size_t lastL3TauFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
bool HLTTauDQMPath::isFirstFilterL1Seed ( ) const
inline

Definition at line 61 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPathPlotter::analyze().

61 { return isFirstL1Seed_; }
bool HLTTauDQMPath::isValid ( void  ) const
inline
int HLTTauDQMPath::lastPassedFilter ( const edm::TriggerResults triggerResults) const

Definition at line 542 of file HLTTauDQMPath.cc.

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

Referenced by HLTTauDQMPathPlotter::analyze().

542  {
543 
544  if(fired(triggerResults)) {
545  //std::cout << "Event passed" << std::endl;
546  return filterIndices_.size()-1;
547  }
548 
549  unsigned int firstFailedFilter = triggerResults.index(pathIndex_);
550  int lastPassedFilter = -1;
551  for(size_t i=0; i<filterIndices_.size(); ++i) {
552  if(std::get<kModuleIndex>(filterIndices_[i]) < firstFailedFilter) {
553  lastPassedFilter = i;
554  }
555  else {
556  //std::cout << "Decision-making filter " << firstFailedFilter << " this " << std::get<kModuleIndex>(filterIndices_[i]) << std::endl;
557  break;
558  }
559  }
560  return lastPassedFilter;
561 }
int lastPassedFilter(const edm::TriggerResults &triggerResults) const
const unsigned int pathIndex_
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_
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 576 of file HLTTauDQMPath.cc.

References a, b, HLTTauDQMOfflineObjects::electrons, lumiContext::fill, filterElectronN_, filterMET_, filterMuonN_, filterTauN_, isFirstL1Seed_, HLTTauDQMOfflineObjects::met, HLTTauDQMOfflineObjects::muons, jetUpdater_cfi::sort, HLTTauDQMOfflineObjects::taus, trigger::TriggerElectron, trigger::TriggerL1EG, trigger::TriggerL1ETM, trigger::TriggerL1ETMHF, trigger::TriggerL1Mu, trigger::TriggerL1Tau, trigger::TriggerMET, trigger::TriggerMuon, trigger::TriggerPhoton, and trigger::TriggerTau.

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

576  {
577  bool isL1 = (i==0 && isFirstL1Seed_);
578  std::vector<bool> offlineMask;
579  if(filterTauN_[i] > 0) {
580  int matchedObjects = 0;
581  offlineMask.resize(offlineObjects.taus.size());
582  std::fill(offlineMask.begin(), offlineMask.end(), true);
583  for(const Object& trgObj: triggerObjects) {
584  //std::cout << "trigger object id " << isL1 << " " << trgObj.id << " " << trigger::TriggerL1Tau << " "<< trigger::TriggerTau << std::endl;
585  if(! ((isL1 && trgObj.id == trigger::TriggerL1Tau) || trgObj.id == trigger::TriggerTau ) )
586  continue;
587  if(deltaRmatch(trgObj.object, offlineObjects.taus, dR, offlineMask, matchedOfflineObjects.taus)) {
588  ++matchedObjects;
589  matchedTriggerObjects.emplace_back(trgObj);
590  //std::cout << "trigger object DR match" << std::endl;
591  }
592  }
593  if(matchedObjects < filterTauN_[i])
594  return false;
595  }
596  if(filterElectronN_[i] > 0) {
597  int matchedObjects = 0;
598  offlineMask.resize(offlineObjects.electrons.size());
599  std::fill(offlineMask.begin(), offlineMask.end(), true);
600  for(const Object& trgObj: triggerObjects) {
601  //std::cout << "trigger object id " << trgObj.id << std::endl;
602  if(! ((isL1 && (trgObj.id == trigger::TriggerL1EG))
603  || trgObj.id == trigger::TriggerElectron || trgObj.id == trigger::TriggerPhoton) )
604  continue;
605  if(deltaRmatch(trgObj.object, offlineObjects.electrons, dR, offlineMask, matchedOfflineObjects.electrons)) {
606  ++matchedObjects;
607  matchedTriggerObjects.emplace_back(trgObj);
608  }
609  }
610  if(matchedObjects < filterElectronN_[i])
611  return false;
612  }
613  if(filterMuonN_[i] > 0) {
614  int matchedObjects = 0;
615  offlineMask.resize(offlineObjects.muons.size());
616  std::fill(offlineMask.begin(), offlineMask.end(), true);
617  for(const Object& trgObj: triggerObjects) {
618  //std::cout << "trigger object id " << trgObj.id << std::endl;
619  if(! ((isL1 && trgObj.id == trigger::TriggerL1Mu)
620  || trgObj.id == trigger::TriggerMuon) )
621  continue;
622  if(deltaRmatch(trgObj.object, offlineObjects.muons, dR, offlineMask, matchedOfflineObjects.muons)) {
623  ++matchedObjects;
624  matchedTriggerObjects.emplace_back(trgObj);
625  }
626  }
627  if(matchedObjects < filterMuonN_[i])
628  return false;
629  }
630  if(filterMET_[i] > 0) {
631  int matchedObjects = 0;
632  offlineMask.resize(offlineObjects.met.size());
633  std::fill(offlineMask.begin(), offlineMask.end(), true);
634  for(const Object& trgObj: triggerObjects) {
635  if(! ((isL1 && (trgObj.id == trigger::TriggerL1ETM || trgObj.id == trigger::TriggerL1ETMHF))
636  || trgObj.id == trigger::TriggerMET) )
637  continue;
638  ++matchedObjects;
639  matchedTriggerObjects.emplace_back(trgObj);
640  }
641  if(matchedObjects < filterMET_[i]){
642  return false;
643  }
644  }
645 
646  // Sort offline objects by pt
647  std::sort(matchedOfflineObjects.taus.begin(), matchedOfflineObjects.taus.end(), [](const LV& a, const LV&b) { return a.pt() > b.pt();});
648  std::sort(matchedOfflineObjects.electrons.begin(), matchedOfflineObjects.electrons.end(), [](const LV& a, const LV&b) { return a.pt() > b.pt();});
649  std::sort(matchedOfflineObjects.muons.begin(), matchedOfflineObjects.muons.end(), [](const LV& a, const LV&b) { return a.pt() > b.pt();});
650  matchedOfflineObjects.met = offlineObjects.met;
651  return true;
652 }
std::vector< LV > electrons
std::vector< int > filterMET_
std::vector< LV > taus
enum start value shifted to 81 so as to avoid clashes with PDG codes
math::XYZTLorentzVectorD LV
std::vector< LV > met
std::vector< int > filterTauN_
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
std::vector< int > filterElectronN_
std::vector< int > filterMuonN_
std::vector< LV > muons

Member Data Documentation

const bool HLTTauDQMPath::doRefAnalysis_
private

Definition at line 104 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

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

Definition at line 108 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath(), and offlineMatching().

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

Definition at line 106 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath(), and lastPassedFilter().

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

Definition at line 111 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

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

Definition at line 110 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath(), and offlineMatching().

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

Definition at line 109 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath(), and offlineMatching().

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

Definition at line 107 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath(), and offlineMatching().

size_t HLTTauDQMPath::firstFilterBeforeL2METIndex_
private

Definition at line 128 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::firstL2METFilterIndex_
private

Definition at line 129 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

const std::string HLTTauDQMPath::hltProcess_
private

Definition at line 103 of file HLTTauDQMPath.h.

Referenced by getFilterObjects().

bool HLTTauDQMPath::isFirstL1Seed_
private

Definition at line 130 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath(), and offlineMatching().

bool HLTTauDQMPath::isValid_
private

Definition at line 131 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

constexpr size_t HLTTauDQMPath::kInvalidIndex = std::numeric_limits<size_t>::max()
static

Definition at line 31 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

constexpr size_t HLTTauDQMPath::kModuleIndex = 2
static

Definition at line 30 of file HLTTauDQMPath.h.

constexpr size_t HLTTauDQMPath::kName = 0
static

Definition at line 28 of file HLTTauDQMPath.h.

constexpr size_t HLTTauDQMPath::kType = 1
static

Definition at line 29 of file HLTTauDQMPath.h.

size_t HLTTauDQMPath::lastFilterBeforeL2ElectronIndex_
private

Definition at line 118 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL2METIndex_
private

Definition at line 126 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL2MuonIndex_
private

Definition at line 122 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL2TauIndex_
private

Definition at line 114 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL3ElectronIndex_
private

Definition at line 120 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL3MuonIndex_
private

Definition at line 124 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL3TauIndex_
private

Definition at line 116 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastL2ElectronFilterIndex_
private

Definition at line 119 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastL2METFilterIndex_
private

Definition at line 127 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastL2MuonFilterIndex_
private

Definition at line 123 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastL2TauFilterIndex_
private

Definition at line 115 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastL3ElectronFilterIndex_
private

Definition at line 121 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastL3MuonFilterIndex_
private

Definition at line 125 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

size_t HLTTauDQMPath::lastL3TauFilterIndex_
private

Definition at line 117 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

const unsigned int HLTTauDQMPath::pathIndex_
private

Definition at line 113 of file HLTTauDQMPath.h.

Referenced by fired(), and lastPassedFilter().

const std::string HLTTauDQMPath::pathName_
private

Definition at line 112 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().