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 353 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.

358  doRefAnalysis_(doRefAnalysis),
373 
374  isFirstL1Seed_(false),
375  isValid_(false) {
376 #ifdef EDM_ML_DEBUG
377  std::stringstream ss;
378  ss << "HLTTauDQMPath: " << pathName_ << "\n";
379 #endif
380  // Get the filters
381  HLTPath thePath(pathName_);
382  filterIndices_ = thePath.interestingFilters(HLTCP, doRefAnalysis_);
383  if (filterIndices_.empty()) {
384  edm::LogInfo("HLTTauDQMOffline") << "HLTTauDQMPath: " << pathName_ << " no interesting filters found";
385  return;
386  }
387  isFirstL1Seed_ = HLTCP.moduleType(std::get<kName>(filterIndices_[0])) == "HLTL1TSeed";
388 #ifdef EDM_ML_DEBUG
389  ss << " Interesting filters (preceded by the module index in the path)";
390 #endif
391  // Set the filter multiplicity counts
392  filterTauN_.clear();
393  filterElectronN_.clear();
394  filterMuonN_.clear();
395  filterMET_.clear();
396  filterTauN_.reserve(filterIndices_.size());
397  filterElectronN_.reserve(filterIndices_.size());
398  filterMuonN_.reserve(filterIndices_.size());
399  filterMET_.reserve(filterIndices_.size());
400  filterLevel_.reserve(filterIndices_.size());
401 #ifdef EDM_ML_DEBUG
402  size_t i(0);
403 #endif
404  for (auto& filterIndice : filterIndices_) {
405  const std::string& filterName = std::get<kName>(filterIndice);
406  const std::string& moduleType = HLTCP.moduleType(filterName);
407 
408  TauLeptonMultiplicity n = inferTauLeptonMultiplicity(HLTCP, filterName, moduleType, pathName_);
409  filterTauN_.push_back(n.tau);
410  filterElectronN_.push_back(n.electron);
411  filterMuonN_.push_back(n.muon);
412  filterMET_.push_back(n.met);
413  filterLevel_.push_back(n.level);
414 
415 #ifdef EDM_ML_DEBUG
416  ss << "\n " << i << " " << std::get<kModuleIndex>(filterIndice) << " " << filterName << " " << moduleType
417  << " ntau " << n.tau << " nele " << n.electron << " nmu " << n.muon;
418  i++;
419 #endif
420  }
421 #ifdef EDM_ML_DEBUG
422  LogDebug("HLTTauDQMOffline") << ss.str();
423 #endif
424 
425  // Find the position of tau producer, use filters with taus before
426  // it for L2 tau efficiency, and filters with taus after it for L3
427  // tau efficiency. Here we have to take into account that for
428  // reference-matched case filterIndices_ contains only those filters
429  // that have saveTags=True, while for searching the first L3 tau
430  // filter we have to consider all filters
431  const size_t firstL3TauFilterIndex = thePath.firstL3TauFilterIndex(HLTCP);
432  if (firstL3TauFilterIndex == kInvalidIndex) {
433  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 tau producer as input in path " << pathName_;
434  }
435  const size_t firstL3ElectronFilterIndex = thePath.firstL3ElectronFilterIndex(HLTCP);
436  if (firstL3ElectronFilterIndex == kInvalidIndex) {
437  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 electron producer as input in path "
438  << pathName_;
439  }
440  const size_t firstL3MuonFilterIndex = thePath.firstL3MuonFilterIndex(HLTCP);
441  if (firstL3MuonFilterIndex == kInvalidIndex) {
442  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 muon producer as input in path " << pathName_;
443  }
444 
461  /*
462  size_t i = 0;
463  for(; i<filtersSize() && getFilterIndex(i) < firstL3TauFilterIndex; ++i) {
464  if(lastL2TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
465  lastFilterBeforeL2TauIndex_ = i;
466  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
467  lastL2TauFilterIndex_ = i;
468  }
469  lastFilterBeforeL3TauIndex_ = i-1;
470  for(; i<filtersSize(); ++i) {
471  if(lastL3TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
472  lastFilterBeforeL3TauIndex_ = i;
473  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
474  lastL3TauFilterIndex_ = i;
475  }
476 */
477  for (size_t i = 0; i < filtersSize(); ++i) {
478  // Tau
479  if (getFilterLevel(i) == 2 && getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
483 
484  // if(lastFilterBeforeL3TauIndex_ < 2 && lastL3TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
485  // lastFilterBeforeL3TauIndex_ = i;
486  if (getFilterLevel(i) == 3 && getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
490 
491  // Electron
494  if (getFilterLevel(i) == 2 && getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
496 
497  if (getFilterLevel(i) == 3 && getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
501  /*
502  if(lastL2ElectronFilterIndex_ == kInvalidIndex && getFilterNElectrons(i) == 0)
503  lastFilterBeforeL2ElectronIndex_ = i;
504  if(getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
505  lastL2ElectronFilterIndex_ = i;
506 
507  if(lastFilterBeforeL3ElectronIndex_ == 0 && lastL3ElectronFilterIndex_ == kInvalidIndex && getFilterNElectrons(i) == 0)
508  lastFilterBeforeL3ElectronIndex_ = i;
509  if(getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
510  lastL3ElectronFilterIndex_ = i;
511 */
512  // Muon
515  if (getFilterLevel(i) == 2 && getFilterNMuons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNElectrons(i) == 0)
517 
518  if (getFilterLevel(i) == 3 && getFilterNMuons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNElectrons(i) == 0)
522 
523  // MET
526  if (getFilterMET(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
528 
532  getFilterNMuons(i) == 0)
534  }
535  // lastFilterBeforeL3TauIndex_ = firstL3TauFilterIndex - 1;
536  // lastFilterBeforeL3ElectronIndex_ = firstL3ElectronFilterIndex - 1;
537  // lastFilterBeforeL3MuonIndex_ = firstL3MuonFilterIndex - 1;
538  LogDebug("HLTTauDQMOffline") << "lastFilterBeforeL2 " << lastFilterBeforeL2TauIndex_ << " lastL2TauFilter "
539  << lastL2TauFilterIndex_ << " lastFilterBeforeL3 " << lastFilterBeforeL3TauIndex_
540  << " lastL3TauFilter " << lastL3TauFilterIndex_;
541  isValid_ = true;
542 }
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 546 of file HLTTauDQMPath.cc.

References pathIndex_, and triggerResults.

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

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

◆ 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 567 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().

569  {
570  trigger::size_type filterIndex = triggerEvent.filterIndex(edm::InputTag(getFilterName(i), "", hltProcess_));
571  if (filterIndex != triggerEvent.sizeFilters()) {
572  const trigger::Keys& keys = triggerEvent.filterKeys(filterIndex);
573  const trigger::Vids& ids = triggerEvent.filterIds(filterIndex);
575  for (size_t i = 0; i < keys.size(); ++i) {
576  const trigger::TriggerObject& object = triggerObjects[keys[i]];
577  retval.emplace_back(Object{object, ids[i]});
578  }
579  }
580 }
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 670 of file HLTTauDQMPath.cc.

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

670  {
671  return (static_cast<size_t>(getFilterNTaus(i)) <= offlineObjects.taus.size() &&
672  static_cast<size_t>(getFilterNElectrons(i)) <= offlineObjects.electrons.size() &&
673  static_cast<size_t>(getFilterNMuons(i)) <= offlineObjects.muons.size());
674 }
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 548 of file HLTTauDQMPath.cc.

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

Referenced by HLTTauDQMPathPlotter::analyze().

548  {
549  if (fired(triggerResults)) {
550  //std::cout << "Event passed" << std::endl;
551  return filterIndices_.size() - 1;
552  }
553 
554  unsigned int firstFailedFilter = triggerResults.index(pathIndex_);
555  int lastPassedFilter = -1;
556  for (size_t i = 0; i < filterIndices_.size(); ++i) {
557  if (std::get<kModuleIndex>(filterIndices_[i]) < firstFailedFilter) {
559  } else {
560  //std::cout << "Decision-making filter " << firstFailedFilter << " this " << std::get<kModuleIndex>(filterIndices_[i]) << std::endl;
561  break;
562  }
563  }
564  return lastPassedFilter;
565 }
const unsigned int pathIndex_
static std::string const triggerResults
Definition: EdmProvDump.cc:44
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 582 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().

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