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

◆ FilterIndex

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

Definition at line 26 of file HLTTauDQMPath.h.

◆ LV

Definition at line 24 of file HLTTauDQMPath.h.

◆ LVColl

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

Definition at line 25 of file HLTTauDQMPath.h.

Constructor & Destructor Documentation

◆ HLTTauDQMPath()

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

Definition at line 361 of file HLTTauDQMPath.cc.

References doRefAnalysis_, filterElectronN_, filterIndices_, filterLevel_, filterMET_, filterMuonN_, pdwgDoubleElectron_cfi::filterName, filtersSize(), filterTauN_, firstFilterBeforeL2METIndex_, firstL2METFilterIndex_, getFilterLevel(), getFilterMET(), getFilterNElectrons(), getFilterNMuons(), getFilterNTaus(), pwdgSkimBPark_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(), dqmiodumpmetadata::n, pathName_, contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

366  doRefAnalysis_(doRefAnalysis),
381 
382  isFirstL1Seed_(false),
383  isValid_(false) {
384 #ifdef EDM_ML_DEBUG
385  std::stringstream ss;
386  ss << "HLTTauDQMPath: " << pathName_ << "\n";
387 #endif
388  // Get the filters
389  HLTPath thePath(pathName_);
390  filterIndices_ = thePath.interestingFilters(HLTCP, doRefAnalysis_);
391  if (filterIndices_.empty()) {
392  edm::LogInfo("HLTTauDQMOffline") << "HLTTauDQMPath: " << pathName_ << " no interesting filters found";
393  return;
394  }
395  isFirstL1Seed_ = HLTCP.moduleType(std::get<kName>(filterIndices_[0])) == "HLTL1TSeed";
396 #ifdef EDM_ML_DEBUG
397  ss << " Interesting filters (preceded by the module index in the path)";
398 #endif
399  // Set the filter multiplicity counts
400  filterTauN_.clear();
401  filterElectronN_.clear();
402  filterMuonN_.clear();
403  filterMET_.clear();
404  filterTauN_.reserve(filterIndices_.size());
405  filterElectronN_.reserve(filterIndices_.size());
406  filterMuonN_.reserve(filterIndices_.size());
407  filterMET_.reserve(filterIndices_.size());
408  filterLevel_.reserve(filterIndices_.size());
409 #ifdef EDM_ML_DEBUG
410  size_t i(0);
411 #endif
412  for (auto& filterIndice : filterIndices_) {
413  const std::string& filterName = std::get<kName>(filterIndice);
414  const std::string& moduleType = HLTCP.moduleType(filterName);
415 
416  TauLeptonMultiplicity n = inferTauLeptonMultiplicity(HLTCP, filterName, moduleType, pathName_);
417  if (n.level > 0) {
418  filterTauN_.push_back(n.tau);
419  filterElectronN_.push_back(n.electron);
420  filterMuonN_.push_back(n.muon);
421  filterMET_.push_back(n.met);
422  filterLevel_.push_back(n.level);
423  }
424 
425 #ifdef EDM_ML_DEBUG
426  ss << "\n " << i << " " << std::get<kModuleIndex>(filterIndice) << " " << filterName << " " << moduleType
427  << " ntau " << n.tau << " nele " << n.electron << " nmu " << n.muon;
428  i++;
429 #endif
430  }
431 #ifdef EDM_ML_DEBUG
432  LogDebug("HLTTauDQMOffline") << ss.str();
433 #endif
434 
435  // Find the position of tau producer, use filters with taus before
436  // it for L2 tau efficiency, and filters with taus after it for L3
437  // tau efficiency. Here we have to take into account that for
438  // reference-matched case filterIndices_ contains only those filters
439  // that have saveTags=True, while for searching the first L3 tau
440  // filter we have to consider all filters
441  const size_t firstL3TauFilterIndex = thePath.firstL3TauFilterIndex(HLTCP);
442  if (firstL3TauFilterIndex == kInvalidIndex) {
443  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 tau producer as input in path " << pathName_;
444  }
445  const size_t firstL3ElectronFilterIndex = thePath.firstL3ElectronFilterIndex(HLTCP);
446  if (firstL3ElectronFilterIndex == kInvalidIndex) {
447  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 electron producer as input in path "
448  << pathName_;
449  }
450  const size_t firstL3MuonFilterIndex = thePath.firstL3MuonFilterIndex(HLTCP);
451  if (firstL3MuonFilterIndex == kInvalidIndex) {
452  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 muon producer as input in path " << pathName_;
453  }
454 
471  /*
472  size_t i = 0;
473  for(; i<filtersSize() && getFilterIndex(i) < firstL3TauFilterIndex; ++i) {
474  if(lastL2TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
475  lastFilterBeforeL2TauIndex_ = i;
476  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
477  lastL2TauFilterIndex_ = i;
478  }
479  lastFilterBeforeL3TauIndex_ = i-1;
480  for(; i<filtersSize(); ++i) {
481  if(lastL3TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
482  lastFilterBeforeL3TauIndex_ = i;
483  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
484  lastL3TauFilterIndex_ = i;
485  }
486 */
487  for (size_t i = 0; i < filtersSize(); ++i) {
488  // Tau
489  if (getFilterLevel(i) == 2 && getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
493 
494  // if(lastFilterBeforeL3TauIndex_ < 2 && lastL3TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
495  // lastFilterBeforeL3TauIndex_ = i;
496  if (getFilterLevel(i) == 3 && getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
500 
501  // Electron
504  if (getFilterLevel(i) == 2 && getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
506 
507  if (getFilterLevel(i) == 3 && getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
511  /*
512  if(lastL2ElectronFilterIndex_ == kInvalidIndex && getFilterNElectrons(i) == 0)
513  lastFilterBeforeL2ElectronIndex_ = i;
514  if(getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
515  lastL2ElectronFilterIndex_ = i;
516 
517  if(lastFilterBeforeL3ElectronIndex_ == 0 && lastL3ElectronFilterIndex_ == kInvalidIndex && getFilterNElectrons(i) == 0)
518  lastFilterBeforeL3ElectronIndex_ = i;
519  if(getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
520  lastL3ElectronFilterIndex_ = i;
521 */
522  // Muon
525  if (getFilterLevel(i) == 2 && getFilterNMuons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNElectrons(i) == 0)
527 
528  if (getFilterLevel(i) == 3 && getFilterNMuons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNElectrons(i) == 0)
532 
533  // MET
536  if (getFilterMET(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
538 
542  getFilterNMuons(i) == 0)
544  }
545  // lastFilterBeforeL3TauIndex_ = firstL3TauFilterIndex - 1;
546  // lastFilterBeforeL3ElectronIndex_ = firstL3ElectronFilterIndex - 1;
547  // lastFilterBeforeL3MuonIndex_ = firstL3MuonFilterIndex - 1;
548  LogDebug("HLTTauDQMOffline") << "lastFilterBeforeL2 " << lastFilterBeforeL2TauIndex_ << " lastL2TauFilter "
549  << lastL2TauFilterIndex_ << " lastFilterBeforeL3 " << lastFilterBeforeL3TauIndex_
550  << " lastL3TauFilter " << lastL3TauFilterIndex_;
551  isValid_ = true;
552 }
const std::string pathName_
size_t lastL3ElectronFilterIndex_
std::vector< int > filterMET_
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:61
size_t lastFilterBeforeL2METIndex_
const std::string moduleType(const std::string &module) const
C++ class name of module.
size_t lastFilterBeforeL3ElectronIndex_
size_t lastFilterBeforeL3MuonIndex_
std::vector< int > filterLevel_
const std::string hltProcess_
const unsigned int pathIndex_
size_t lastFilterBeforeL2TauIndex_
size_t filtersSize() const
Definition: HLTTauDQMPath.h:52
int getFilterMET(size_t i) const
Definition: HLTTauDQMPath.h:73
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
size_t lastFilterBeforeL3TauIndex_
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:67
int getFilterLevel(size_t i) const
Definition: HLTTauDQMPath.h:79
size_t lastFilterBeforeL2ElectronIndex_
std::vector< int > filterTauN_
size_t lastL2MuonFilterIndex_
std::vector< FilterIndex > filterIndices_
Log< level::Info, false > LogInfo
const bool doRefAnalysis_
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:55
size_t lastL3TauFilterIndex_
size_t lastL2TauFilterIndex_
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_
#define LogDebug(id)
size_t lastFilterBeforeL2MuonIndex_
size_t firstL2METFilterIndex_

◆ ~HLTTauDQMPath()

HLTTauDQMPath::~HLTTauDQMPath ( )
default

Member Function Documentation

◆ filtersSize()

size_t HLTTauDQMPath::filtersSize ( ) const
inline

Definition at line 52 of file HLTTauDQMPath.h.

References filterIndices_.

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

52 { return filterIndices_.size(); }
std::vector< FilterIndex > filterIndices_

◆ fired()

bool HLTTauDQMPath::fired ( const edm::TriggerResults triggerResults) const

Definition at line 556 of file HLTTauDQMPath.cc.

References pathIndex_, and triggerResults.

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

556 { return triggerResults.accept(pathIndex_); }
const unsigned int pathIndex_
static std::string const triggerResults
Definition: EdmProvDump.cc:47

◆ getFilterIndex()

size_t HLTTauDQMPath::getFilterIndex ( size_t  i) const
inline

Definition at line 117 of file HLTTauDQMPath.h.

References filterIndices_, and mps_fire::i.

117 { return std::get<kModuleIndex>(filterIndices_[i]); }
std::vector< FilterIndex > filterIndices_

◆ getFilterLevel()

int HLTTauDQMPath::getFilterLevel ( size_t  i) const
inline

Definition at line 79 of file HLTTauDQMPath.h.

References filterLevel_, and mps_fire::i.

Referenced by HLTTauDQMPath().

79  {
80  if (i < filterLevel_.size())
81  return filterLevel_[i];
82  else
83  return 0;
84  }
std::vector< int > filterLevel_

◆ getFilterMET()

int HLTTauDQMPath::getFilterMET ( size_t  i) const
inline

Definition at line 73 of file HLTTauDQMPath.h.

References filterMET_, and mps_fire::i.

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

73  {
74  if (i < filterMET_.size())
75  return filterMET_[i];
76  else
77  return 0;
78  }
std::vector< int > filterMET_

◆ getFilterName()

const std::string& HLTTauDQMPath::getFilterName ( size_t  i) const
inline

Definition at line 53 of file HLTTauDQMPath.h.

References filterIndices_, and mps_fire::i.

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

53 { return std::get<kName>(filterIndices_[i]); }
std::vector< FilterIndex > filterIndices_

◆ getFilterNElectrons()

int HLTTauDQMPath::getFilterNElectrons ( size_t  i) const
inline

Definition at line 61 of file HLTTauDQMPath.h.

References filterElectronN_, and mps_fire::i.

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

61  {
62  if (i < filterElectronN_.size())
63  return filterElectronN_[i];
64  else
65  return 0;
66  }
std::vector< int > filterElectronN_

◆ getFilterNMuons()

int HLTTauDQMPath::getFilterNMuons ( size_t  i) const
inline

Definition at line 67 of file HLTTauDQMPath.h.

References filterMuonN_, and mps_fire::i.

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

67  {
68  if (i < filterMuonN_.size())
69  return filterMuonN_[i];
70  else
71  return 0;
72  }
std::vector< int > filterMuonN_

◆ getFilterNTaus()

int HLTTauDQMPath::getFilterNTaus ( size_t  i) const
inline

Definition at line 55 of file HLTTauDQMPath.h.

References filterTauN_, and mps_fire::i.

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

55  {
56  if (i < filterTauN_.size())
57  return filterTauN_[i];
58  else
59  return 0;
60  }
std::vector< int > filterTauN_

◆ getFilterObjects()

void HLTTauDQMPath::getFilterObjects ( const trigger::TriggerEvent triggerEvent,
size_t  i,
std::vector< Object > &  retval 
) const

Definition at line 577 of file HLTTauDQMPath.cc.

References getFilterName(), hltProcess_, mps_fire::i, relativeConstraints::keys, resolutioncreator_cfi::object, PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchMonitor_cfi::triggerObjects.

Referenced by HLTTauDQMPathPlotter::analyze().

579  {
580  trigger::size_type filterIndex = triggerEvent.filterIndex(edm::InputTag(getFilterName(i), "", hltProcess_));
581  if (filterIndex != triggerEvent.sizeFilters()) {
582  const trigger::Keys& keys = triggerEvent.filterKeys(filterIndex);
583  const trigger::Vids& ids = triggerEvent.filterIds(filterIndex);
585  for (size_t i = 0; i < keys.size(); ++i) {
586  const trigger::TriggerObject& object = triggerObjects[keys[i]];
587  retval.emplace_back(Object{object, ids[i]});
588  }
589  }
590 }
uint16_t size_type
const std::string hltProcess_
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
std::vector< size_type > Keys
const std::string & getFilterName(size_t i) const
Definition: HLTTauDQMPath.h:53
std::vector< int > Vids

◆ getFilterType()

const std::string& HLTTauDQMPath::getFilterType ( size_t  i) const
inline

Definition at line 54 of file HLTTauDQMPath.h.

References filterIndices_, and mps_fire::i.

Referenced by HLTTauDQMPathPlotter::analyze().

54 { return std::get<kType>(filterIndices_[i]); }
std::vector< FilterIndex > filterIndices_

◆ getFirstFilterBeforeL2CaloMETIndex()

size_t HLTTauDQMPath::getFirstFilterBeforeL2CaloMETIndex ( ) const
inline

Definition at line 113 of file HLTTauDQMPath.h.

References firstFilterBeforeL2METIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t firstFilterBeforeL2METIndex_

◆ getFirstL2CaloMETFilterIndex()

size_t HLTTauDQMPath::getFirstL2CaloMETFilterIndex ( ) const
inline

Definition at line 114 of file HLTTauDQMPath.h.

References firstL2METFilterIndex_.

114 { return firstL2METFilterIndex_; }
size_t firstL2METFilterIndex_

◆ getLastFilterBeforeL2CaloMETIndex()

size_t HLTTauDQMPath::getLastFilterBeforeL2CaloMETIndex ( ) const
inline

Definition at line 111 of file HLTTauDQMPath.h.

References lastFilterBeforeL2METIndex_.

111 { return lastFilterBeforeL2METIndex_; }
size_t lastFilterBeforeL2METIndex_

◆ getLastFilterBeforeL2ElectronIndex()

size_t HLTTauDQMPath::getLastFilterBeforeL2ElectronIndex ( ) const
inline

Definition at line 101 of file HLTTauDQMPath.h.

References lastFilterBeforeL2ElectronIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2ElectronIndex_

◆ getLastFilterBeforeL2MuonIndex()

size_t HLTTauDQMPath::getLastFilterBeforeL2MuonIndex ( ) const
inline

Definition at line 106 of file HLTTauDQMPath.h.

References lastFilterBeforeL2MuonIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2MuonIndex_

◆ getLastFilterBeforeL2TauIndex()

size_t HLTTauDQMPath::getLastFilterBeforeL2TauIndex ( ) const
inline

Definition at line 96 of file HLTTauDQMPath.h.

References lastFilterBeforeL2TauIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2TauIndex_

◆ getLastFilterBeforeL3ElectronIndex()

size_t HLTTauDQMPath::getLastFilterBeforeL3ElectronIndex ( ) const
inline

Definition at line 103 of file HLTTauDQMPath.h.

References lastFilterBeforeL3ElectronIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3ElectronIndex_

◆ getLastFilterBeforeL3MuonIndex()

size_t HLTTauDQMPath::getLastFilterBeforeL3MuonIndex ( ) const
inline

Definition at line 108 of file HLTTauDQMPath.h.

References lastFilterBeforeL3MuonIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3MuonIndex_

◆ getLastFilterBeforeL3TauIndex()

size_t HLTTauDQMPath::getLastFilterBeforeL3TauIndex ( ) const
inline

Definition at line 98 of file HLTTauDQMPath.h.

References lastFilterBeforeL3TauIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3TauIndex_

◆ getLastFilterName()

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

Definition at line 87 of file HLTTauDQMPath.h.

References filterIndices_.

87 { return std::get<kName>(filterIndices_.back()); }
std::vector< FilterIndex > filterIndices_

◆ getLastL2CaloMETFilterIndex()

size_t HLTTauDQMPath::getLastL2CaloMETFilterIndex ( ) const
inline

Definition at line 112 of file HLTTauDQMPath.h.

References lastL2METFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

112 { return lastL2METFilterIndex_; }
size_t lastL2METFilterIndex_

◆ getLastL2ElectronFilterIndex()

size_t HLTTauDQMPath::getLastL2ElectronFilterIndex ( ) const
inline

Definition at line 102 of file HLTTauDQMPath.h.

References lastL2ElectronFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

102 { return lastL2ElectronFilterIndex_; }
size_t lastL2ElectronFilterIndex_

◆ getLastL2MuonFilterIndex()

size_t HLTTauDQMPath::getLastL2MuonFilterIndex ( ) const
inline

Definition at line 107 of file HLTTauDQMPath.h.

References lastL2MuonFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

107 { return lastL2MuonFilterIndex_; }
size_t lastL2MuonFilterIndex_

◆ getLastL2TauFilterIndex()

size_t HLTTauDQMPath::getLastL2TauFilterIndex ( ) const
inline

Definition at line 97 of file HLTTauDQMPath.h.

References lastL2TauFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

97 { return lastL2TauFilterIndex_; }
size_t lastL2TauFilterIndex_

◆ getLastL3ElectronFilterIndex()

size_t HLTTauDQMPath::getLastL3ElectronFilterIndex ( ) const
inline

◆ getLastL3MuonFilterIndex()

size_t HLTTauDQMPath::getLastL3MuonFilterIndex ( ) const
inline

Definition at line 109 of file HLTTauDQMPath.h.

References lastL3MuonFilterIndex_.

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

109 { return lastL3MuonFilterIndex_; }
size_t lastL3MuonFilterIndex_

◆ getLastL3TauFilterIndex()

size_t HLTTauDQMPath::getLastL3TauFilterIndex ( ) const
inline

Definition at line 99 of file HLTTauDQMPath.h.

References lastL3TauFilterIndex_.

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

99 { return lastL3TauFilterIndex_; }
size_t lastL3TauFilterIndex_

◆ getPathIndex()

const unsigned int HLTTauDQMPath::getPathIndex ( ) const
inline

Definition at line 50 of file HLTTauDQMPath.h.

References pathIndex_.

50 { return pathIndex_; }
const unsigned int pathIndex_

◆ getPathName()

const std::string& HLTTauDQMPath::getPathName ( ) const
inline

Definition at line 49 of file HLTTauDQMPath.h.

References pathName_.

Referenced by HLTTauDQMPathPlotter::bookHistograms().

49 { return pathName_; }
const std::string pathName_

◆ goodOfflineEvent()

bool HLTTauDQMPath::goodOfflineEvent ( size_t  i,
const HLTTauDQMOfflineObjects offlineObjects 
) const

Definition at line 680 of file HLTTauDQMPath.cc.

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

680  {
681  return (static_cast<size_t>(getFilterNTaus(i)) <= offlineObjects.taus.size() &&
682  static_cast<size_t>(getFilterNElectrons(i)) <= offlineObjects.electrons.size() &&
683  static_cast<size_t>(getFilterNMuons(i)) <= offlineObjects.muons.size());
684 }
std::vector< LV > electrons
std::vector< LV > taus
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:61
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:67
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:55
std::vector< LV > muons

◆ hasL2CaloMET()

bool HLTTauDQMPath::hasL2CaloMET ( ) const
inline

Definition at line 95 of file HLTTauDQMPath.h.

References kInvalidIndex, and lastL2METFilterIndex_.

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

static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
size_t lastL2METFilterIndex_

◆ hasL2Electrons()

bool HLTTauDQMPath::hasL2Electrons ( ) const
inline

Definition at line 91 of file HLTTauDQMPath.h.

References kInvalidIndex, and lastL2ElectronFilterIndex_.

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

size_t lastL2ElectronFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31

◆ hasL2Muons()

bool HLTTauDQMPath::hasL2Muons ( ) const
inline

Definition at line 93 of file HLTTauDQMPath.h.

References kInvalidIndex, and lastL2MuonFilterIndex_.

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

size_t lastL2MuonFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31

◆ hasL2Taus()

bool HLTTauDQMPath::hasL2Taus ( ) const
inline

Definition at line 89 of file HLTTauDQMPath.h.

References kInvalidIndex, and lastL2TauFilterIndex_.

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

size_t lastL2TauFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31

◆ hasL3Electrons()

bool HLTTauDQMPath::hasL3Electrons ( ) const
inline

Definition at line 92 of file HLTTauDQMPath.h.

References kInvalidIndex, and lastL3ElectronFilterIndex_.

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

size_t lastL3ElectronFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31

◆ hasL3Muons()

bool HLTTauDQMPath::hasL3Muons ( ) const
inline

Definition at line 94 of file HLTTauDQMPath.h.

References kInvalidIndex, and lastL3MuonFilterIndex_.

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

size_t lastL3MuonFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31

◆ hasL3Taus()

bool HLTTauDQMPath::hasL3Taus ( ) const
inline

Definition at line 90 of file HLTTauDQMPath.h.

References kInvalidIndex, and lastL3TauFilterIndex_.

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

size_t lastL3TauFilterIndex_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31

◆ isFirstFilterL1Seed()

bool HLTTauDQMPath::isFirstFilterL1Seed ( ) const
inline

Definition at line 86 of file HLTTauDQMPath.h.

References isFirstL1Seed_.

Referenced by HLTTauDQMPathPlotter::analyze().

86 { return isFirstL1Seed_; }

◆ isValid()

bool HLTTauDQMPath::isValid ( void  ) const
inline

◆ lastPassedFilter()

int HLTTauDQMPath::lastPassedFilter ( const edm::TriggerResults triggerResults) const

Definition at line 558 of file HLTTauDQMPath.cc.

References filterIndices_, fired(), mps_fire::i, pathIndex_, and triggerResults.

Referenced by HLTTauDQMPathPlotter::analyze().

558  {
559  if (fired(triggerResults)) {
560  //std::cout << "Event passed" << std::endl;
561  return filterIndices_.size() - 1;
562  }
563 
564  unsigned int firstFailedFilter = triggerResults.index(pathIndex_);
565  int lastPassedFilter = -1;
566  for (size_t i = 0; i < filterIndices_.size(); ++i) {
567  if (std::get<kModuleIndex>(filterIndices_[i]) < firstFailedFilter) {
569  } else {
570  //std::cout << "Decision-making filter " << firstFailedFilter << " this " << std::get<kModuleIndex>(filterIndices_[i]) << std::endl;
571  break;
572  }
573  }
574  return lastPassedFilter;
575 }
const unsigned int pathIndex_
static std::string const triggerResults
Definition: EdmProvDump.cc:47
std::vector< FilterIndex > filterIndices_
int lastPassedFilter(const edm::TriggerResults &triggerResults) const
bool fired(const edm::TriggerResults &triggerResults) const

◆ offlineMatching()

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 592 of file HLTTauDQMPath.cc.

References a, b, HGC3DClusterGenMatchSelector_cfi::dR, HLTTauDQMOfflineObjects::electrons, ntuplemaker::fill, filterElectronN_, filterMET_, filterMuonN_, filterTauN_, mps_fire::i, 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, triggerMatchMonitor_cfi::triggerObjects, trigger::TriggerPhoton, and trigger::TriggerTau.

Referenced by HLTTauDQMPathPlotter::analyze().

597  {
598  bool isL1 = (i == 0 && isFirstL1Seed_);
599  std::vector<bool> offlineMask;
600  if (filterTauN_[i] > 0) {
601  int matchedObjects = 0;
602  offlineMask.resize(offlineObjects.taus.size());
603  std::fill(offlineMask.begin(), offlineMask.end(), true);
604  for (const Object& trgObj : triggerObjects) {
605  //std::cout << "trigger object id " << isL1 << " " << trgObj.id << " " << trigger::TriggerL1Tau << " "<< trigger::TriggerTau << std::endl;
606  if (!((isL1 && trgObj.id == trigger::TriggerL1Tau) || trgObj.id == trigger::TriggerTau))
607  continue;
608  if (deltaRmatch(trgObj.object, offlineObjects.taus, dR, offlineMask, matchedOfflineObjects.taus)) {
609  ++matchedObjects;
610  matchedTriggerObjects.emplace_back(trgObj);
611  //std::cout << "trigger object DR match" << std::endl;
612  }
613  }
614  if (matchedObjects < filterTauN_[i])
615  return false;
616  }
617  if (filterElectronN_[i] > 0) {
618  int matchedObjects = 0;
619  offlineMask.resize(offlineObjects.electrons.size());
620  std::fill(offlineMask.begin(), offlineMask.end(), true);
621  for (const Object& trgObj : triggerObjects) {
622  //std::cout << "trigger object id " << trgObj.id << std::endl;
623  if (!((isL1 && (trgObj.id == trigger::TriggerL1EG)) || trgObj.id == trigger::TriggerElectron ||
624  trgObj.id == trigger::TriggerPhoton))
625  continue;
626  if (deltaRmatch(trgObj.object, offlineObjects.electrons, dR, offlineMask, matchedOfflineObjects.electrons)) {
627  ++matchedObjects;
628  matchedTriggerObjects.emplace_back(trgObj);
629  }
630  }
631  if (matchedObjects < filterElectronN_[i])
632  return false;
633  }
634  if (filterMuonN_[i] > 0) {
635  int matchedObjects = 0;
636  offlineMask.resize(offlineObjects.muons.size());
637  std::fill(offlineMask.begin(), offlineMask.end(), true);
638  for (const Object& trgObj : triggerObjects) {
639  //std::cout << "trigger object id " << trgObj.id << std::endl;
640  if (!((isL1 && trgObj.id == trigger::TriggerL1Mu) || trgObj.id == trigger::TriggerMuon))
641  continue;
642  if (deltaRmatch(trgObj.object, offlineObjects.muons, dR, offlineMask, matchedOfflineObjects.muons)) {
643  ++matchedObjects;
644  matchedTriggerObjects.emplace_back(trgObj);
645  }
646  }
647  if (matchedObjects < filterMuonN_[i])
648  return false;
649  }
650  if (filterMET_[i] > 0) {
651  int matchedObjects = 0;
652  offlineMask.resize(offlineObjects.met.size());
653  std::fill(offlineMask.begin(), offlineMask.end(), true);
654  for (const Object& trgObj : triggerObjects) {
655  if (!((isL1 && (trgObj.id == trigger::TriggerL1ETM || trgObj.id == trigger::TriggerL1ETMHF)) ||
656  trgObj.id == trigger::TriggerMET))
657  continue;
658  ++matchedObjects;
659  matchedTriggerObjects.emplace_back(trgObj);
660  }
661  if (matchedObjects < filterMET_[i]) {
662  return false;
663  }
664  }
665 
666  // Sort offline objects by pt
667  std::sort(matchedOfflineObjects.taus.begin(), matchedOfflineObjects.taus.end(), [](const LV& a, const LV& b) {
668  return a.pt() > b.pt();
669  });
670  std::sort(matchedOfflineObjects.electrons.begin(),
671  matchedOfflineObjects.electrons.end(),
672  [](const LV& a, const LV& b) { return a.pt() > b.pt(); });
673  std::sort(matchedOfflineObjects.muons.begin(), matchedOfflineObjects.muons.end(), [](const LV& a, const LV& b) {
674  return a.pt() > b.pt();
675  });
676  matchedOfflineObjects.met = offlineObjects.met;
677  return true;
678 }
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

◆ doRefAnalysis_

const bool HLTTauDQMPath::doRefAnalysis_
private

Definition at line 134 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

◆ filterElectronN_

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

Definition at line 138 of file HLTTauDQMPath.h.

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

◆ filterIndices_

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

◆ filterLevel_

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

Definition at line 141 of file HLTTauDQMPath.h.

Referenced by getFilterLevel(), and HLTTauDQMPath().

◆ filterMET_

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

Definition at line 140 of file HLTTauDQMPath.h.

Referenced by getFilterMET(), HLTTauDQMPath(), and offlineMatching().

◆ filterMuonN_

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

Definition at line 139 of file HLTTauDQMPath.h.

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

◆ filterTauN_

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

Definition at line 137 of file HLTTauDQMPath.h.

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

◆ firstFilterBeforeL2METIndex_

size_t HLTTauDQMPath::firstFilterBeforeL2METIndex_
private

Definition at line 158 of file HLTTauDQMPath.h.

Referenced by getFirstFilterBeforeL2CaloMETIndex(), and HLTTauDQMPath().

◆ firstL2METFilterIndex_

size_t HLTTauDQMPath::firstL2METFilterIndex_
private

Definition at line 159 of file HLTTauDQMPath.h.

Referenced by getFirstL2CaloMETFilterIndex(), and HLTTauDQMPath().

◆ hltProcess_

const std::string HLTTauDQMPath::hltProcess_
private

Definition at line 133 of file HLTTauDQMPath.h.

Referenced by getFilterObjects().

◆ isFirstL1Seed_

bool HLTTauDQMPath::isFirstL1Seed_
private

Definition at line 160 of file HLTTauDQMPath.h.

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

◆ isValid_

bool HLTTauDQMPath::isValid_
private

Definition at line 161 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath(), and isValid().

◆ kInvalidIndex

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

◆ kModuleIndex

constexpr size_t HLTTauDQMPath::kModuleIndex = 2
static

Definition at line 30 of file HLTTauDQMPath.h.

◆ kName

constexpr size_t HLTTauDQMPath::kName = 0
static

Definition at line 28 of file HLTTauDQMPath.h.

◆ kType

constexpr size_t HLTTauDQMPath::kType = 1
static

Definition at line 29 of file HLTTauDQMPath.h.

◆ lastFilterBeforeL2ElectronIndex_

size_t HLTTauDQMPath::lastFilterBeforeL2ElectronIndex_
private

Definition at line 148 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2ElectronIndex(), and HLTTauDQMPath().

◆ lastFilterBeforeL2METIndex_

size_t HLTTauDQMPath::lastFilterBeforeL2METIndex_
private

Definition at line 156 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2CaloMETIndex(), and HLTTauDQMPath().

◆ lastFilterBeforeL2MuonIndex_

size_t HLTTauDQMPath::lastFilterBeforeL2MuonIndex_
private

Definition at line 152 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2MuonIndex(), and HLTTauDQMPath().

◆ lastFilterBeforeL2TauIndex_

size_t HLTTauDQMPath::lastFilterBeforeL2TauIndex_
private

Definition at line 144 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2TauIndex(), and HLTTauDQMPath().

◆ lastFilterBeforeL3ElectronIndex_

size_t HLTTauDQMPath::lastFilterBeforeL3ElectronIndex_
private

Definition at line 150 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL3ElectronIndex(), and HLTTauDQMPath().

◆ lastFilterBeforeL3MuonIndex_

size_t HLTTauDQMPath::lastFilterBeforeL3MuonIndex_
private

Definition at line 154 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL3MuonIndex(), and HLTTauDQMPath().

◆ lastFilterBeforeL3TauIndex_

size_t HLTTauDQMPath::lastFilterBeforeL3TauIndex_
private

Definition at line 146 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL3TauIndex(), and HLTTauDQMPath().

◆ lastL2ElectronFilterIndex_

size_t HLTTauDQMPath::lastL2ElectronFilterIndex_
private

Definition at line 149 of file HLTTauDQMPath.h.

Referenced by getLastL2ElectronFilterIndex(), hasL2Electrons(), and HLTTauDQMPath().

◆ lastL2METFilterIndex_

size_t HLTTauDQMPath::lastL2METFilterIndex_
private

Definition at line 157 of file HLTTauDQMPath.h.

Referenced by getLastL2CaloMETFilterIndex(), hasL2CaloMET(), and HLTTauDQMPath().

◆ lastL2MuonFilterIndex_

size_t HLTTauDQMPath::lastL2MuonFilterIndex_
private

Definition at line 153 of file HLTTauDQMPath.h.

Referenced by getLastL2MuonFilterIndex(), hasL2Muons(), and HLTTauDQMPath().

◆ lastL2TauFilterIndex_

size_t HLTTauDQMPath::lastL2TauFilterIndex_
private

Definition at line 145 of file HLTTauDQMPath.h.

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

◆ lastL3ElectronFilterIndex_

size_t HLTTauDQMPath::lastL3ElectronFilterIndex_
private

Definition at line 151 of file HLTTauDQMPath.h.

Referenced by getLastL3ElectronFilterIndex(), hasL3Electrons(), and HLTTauDQMPath().

◆ lastL3MuonFilterIndex_

size_t HLTTauDQMPath::lastL3MuonFilterIndex_
private

Definition at line 155 of file HLTTauDQMPath.h.

Referenced by getLastL3MuonFilterIndex(), hasL3Muons(), and HLTTauDQMPath().

◆ lastL3TauFilterIndex_

size_t HLTTauDQMPath::lastL3TauFilterIndex_
private

Definition at line 147 of file HLTTauDQMPath.h.

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

◆ pathIndex_

const unsigned int HLTTauDQMPath::pathIndex_
private

Definition at line 143 of file HLTTauDQMPath.h.

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

◆ pathName_

const std::string HLTTauDQMPath::pathName_
private

Definition at line 142 of file HLTTauDQMPath.h.

Referenced by getPathName(), and HLTTauDQMPath().