CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 351 of file HLTTauDQMPath.cc.

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

355  : hltProcess_(std::move(hltProcess)),
356  doRefAnalysis_(doRefAnalysis),
371 
372  isFirstL1Seed_(false),
373  isValid_(false) {
374 #ifdef EDM_ML_DEBUG
375  std::stringstream ss;
376  ss << "HLTTauDQMPath: " << pathName_ << "\n";
377 #endif
378  // Get the filters
379  HLTPath thePath(pathName_);
380  filterIndices_ = thePath.interestingFilters(HLTCP, doRefAnalysis_);
381  if (filterIndices_.empty()) {
382  edm::LogInfo("HLTTauDQMOffline") << "HLTTauDQMPath: " << pathName_ << " no interesting filters found";
383  return;
384  }
385  isFirstL1Seed_ = HLTCP.moduleType(std::get<kName>(filterIndices_[0])) == "HLTL1TSeed";
386 #ifdef EDM_ML_DEBUG
387  ss << " Interesting filters (preceded by the module index in the path)";
388 #endif
389  // Set the filter multiplicity counts
390  filterTauN_.clear();
391  filterElectronN_.clear();
392  filterMuonN_.clear();
393  filterMET_.clear();
394  filterTauN_.reserve(filterIndices_.size());
395  filterElectronN_.reserve(filterIndices_.size());
396  filterMuonN_.reserve(filterIndices_.size());
397  filterMET_.reserve(filterIndices_.size());
398  filterLevel_.reserve(filterIndices_.size());
399 #ifdef EDM_ML_DEBUG
400  size_t i(0);
401 #endif
402  for (auto& filterIndice : filterIndices_) {
403  const std::string& filterName = std::get<kName>(filterIndice);
404  const std::string& moduleType = HLTCP.moduleType(filterName);
405 
406  TauLeptonMultiplicity n = inferTauLeptonMultiplicity(HLTCP, filterName, moduleType, pathName_);
407  filterTauN_.push_back(n.tau);
408  filterElectronN_.push_back(n.electron);
409  filterMuonN_.push_back(n.muon);
410  filterMET_.push_back(n.met);
411  filterLevel_.push_back(n.level);
412 
413 #ifdef EDM_ML_DEBUG
414  ss << "\n " << i << " " << std::get<kModuleIndex>(filterIndice) << " " << filterName << " " << moduleType
415  << " ntau " << n.tau << " nele " << n.electron << " nmu " << n.muon;
416  i++;
417 #endif
418  }
419 #ifdef EDM_ML_DEBUG
420  LogDebug("HLTTauDQMOffline") << ss.str();
421 #endif
422 
423  // Find the position of tau producer, use filters with taus before
424  // it for L2 tau efficiency, and filters with taus after it for L3
425  // tau efficiency. Here we have to take into account that for
426  // reference-matched case filterIndices_ contains only those filters
427  // that have saveTags=True, while for searching the first L3 tau
428  // filter we have to consider all filters
429  const size_t firstL3TauFilterIndex = thePath.firstL3TauFilterIndex(HLTCP);
430  if (firstL3TauFilterIndex == kInvalidIndex) {
431  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 tau producer as input in path " << pathName_;
432  }
433  const size_t firstL3ElectronFilterIndex = thePath.firstL3ElectronFilterIndex(HLTCP);
434  if (firstL3ElectronFilterIndex == kInvalidIndex) {
435  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 electron producer as input in path "
436  << pathName_;
437  }
438  const size_t firstL3MuonFilterIndex = thePath.firstL3MuonFilterIndex(HLTCP);
439  if (firstL3MuonFilterIndex == kInvalidIndex) {
440  edm::LogInfo("HLTTauDQMOffline") << "Did not find a filter with L3 muon producer as input in path " << pathName_;
441  }
442 
459  /*
460  size_t i = 0;
461  for(; i<filtersSize() && getFilterIndex(i) < firstL3TauFilterIndex; ++i) {
462  if(lastL2TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
463  lastFilterBeforeL2TauIndex_ = i;
464  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
465  lastL2TauFilterIndex_ = i;
466  }
467  lastFilterBeforeL3TauIndex_ = i-1;
468  for(; i<filtersSize(); ++i) {
469  if(lastL3TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
470  lastFilterBeforeL3TauIndex_ = i;
471  if(getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
472  lastL3TauFilterIndex_ = i;
473  }
474 */
475  for (size_t i = 0; i < filtersSize(); ++i) {
476  // Tau
477  if (getFilterLevel(i) == 2 && getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
481 
482  // if(lastFilterBeforeL3TauIndex_ < 2 && lastL3TauFilterIndex_ == kInvalidIndex && getFilterNTaus(i) == 0)
483  // lastFilterBeforeL3TauIndex_ = i;
484  if (getFilterLevel(i) == 3 && getFilterNTaus(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
488 
489  // Electron
492  if (getFilterLevel(i) == 2 && getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
494 
495  if (getFilterLevel(i) == 3 && getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
499  /*
500  if(lastL2ElectronFilterIndex_ == kInvalidIndex && getFilterNElectrons(i) == 0)
501  lastFilterBeforeL2ElectronIndex_ = i;
502  if(getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
503  lastL2ElectronFilterIndex_ = i;
504 
505  if(lastFilterBeforeL3ElectronIndex_ == 0 && lastL3ElectronFilterIndex_ == kInvalidIndex && getFilterNElectrons(i) == 0)
506  lastFilterBeforeL3ElectronIndex_ = i;
507  if(getFilterNElectrons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNMuons(i) == 0)
508  lastL3ElectronFilterIndex_ = i;
509 */
510  // Muon
513  if (getFilterLevel(i) == 2 && getFilterNMuons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNElectrons(i) == 0)
515 
516  if (getFilterLevel(i) == 3 && getFilterNMuons(i) > 0 && getFilterNTaus(i) == 0 && getFilterNElectrons(i) == 0)
520 
521  // MET
524  if (getFilterMET(i) > 0 && getFilterNElectrons(i) == 0 && getFilterNMuons(i) == 0)
526 
530  getFilterNMuons(i) == 0)
532  }
533  // lastFilterBeforeL3TauIndex_ = firstL3TauFilterIndex - 1;
534  // lastFilterBeforeL3ElectronIndex_ = firstL3ElectronFilterIndex - 1;
535  // lastFilterBeforeL3MuonIndex_ = firstL3MuonFilterIndex - 1;
536  LogDebug("HLTTauDQMOffline") << "lastFilterBeforeL2 " << lastFilterBeforeL2TauIndex_ << " lastL2TauFilter "
537  << lastL2TauFilterIndex_ << " lastFilterBeforeL3 " << lastFilterBeforeL3TauIndex_
538  << " lastL3TauFilter " << lastL3TauFilterIndex_;
539  isValid_ = true;
540 }
const std::string pathName_
int getFilterLevel(size_t i) const
Definition: HLTTauDQMPath.h:79
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:61
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:67
const unsigned int pathIndex_
size_t lastFilterBeforeL2TauIndex_
def move
Definition: eostools.py:511
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_
Log< level::Info, false > LogInfo
const bool doRefAnalysis_
size_t lastL3TauFilterIndex_
size_t lastL2TauFilterIndex_
int getFilterMET(size_t i) const
Definition: HLTTauDQMPath.h:73
std::vector< int > filterElectronN_
size_t lastL3MuonFilterIndex_
size_t lastL2ElectronFilterIndex_
size_t firstFilterBeforeL2METIndex_
std::vector< int > filterMuonN_
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
size_t lastL2METFilterIndex_
#define LogDebug(id)
size_t lastFilterBeforeL2MuonIndex_
size_t firstL2METFilterIndex_
HLTTauDQMPath::~HLTTauDQMPath ( )
default

Member Function Documentation

size_t HLTTauDQMPath::filtersSize ( ) const
inline

Definition at line 52 of file HLTTauDQMPath.h.

References filterIndices_.

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

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

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

544 { return triggerResults.accept(pathIndex_); }
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 117 of file HLTTauDQMPath.h.

References filterIndices_, and mps_fire::i.

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

Definition at line 79 of file HLTTauDQMPath.h.

References filterLevel_.

Referenced by HLTTauDQMPath().

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

Definition at line 73 of file HLTTauDQMPath.h.

References filterMET_.

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_
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_
int HLTTauDQMPath::getFilterNElectrons ( size_t  i) const
inline

Definition at line 61 of file HLTTauDQMPath.h.

References filterElectronN_.

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_
int HLTTauDQMPath::getFilterNMuons ( size_t  i) const
inline

Definition at line 67 of file HLTTauDQMPath.h.

References filterMuonN_.

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_
int HLTTauDQMPath::getFilterNTaus ( size_t  i) const
inline

Definition at line 55 of file HLTTauDQMPath.h.

References filterTauN_.

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_
void HLTTauDQMPath::getFilterObjects ( const trigger::TriggerEvent triggerEvent,
size_t  i,
std::vector< Object > &  retval 
) const

Definition at line 565 of file HLTTauDQMPath.cc.

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

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

567  {
568  trigger::size_type filterIndex = triggerEvent.filterIndex(edm::InputTag(getFilterName(i), "", hltProcess_));
569  if (filterIndex != triggerEvent.sizeFilters()) {
570  const trigger::Keys& keys = triggerEvent.filterKeys(filterIndex);
571  const trigger::Vids& ids = triggerEvent.filterIds(filterIndex);
572  const trigger::TriggerObjectCollection& triggerObjects = triggerEvent.getObjects();
573  for (size_t i = 0; i < keys.size(); ++i) {
574  const trigger::TriggerObject& object = triggerObjects[keys[i]];
575  retval.emplace_back(Object{object, ids[i]});
576  }
577  }
578 }
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:146
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:118
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:132
uint16_t size_type
const std::string hltProcess_
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:117
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:101
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
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_
size_t HLTTauDQMPath::getFirstFilterBeforeL2CaloMETIndex ( ) const
inline

Definition at line 113 of file HLTTauDQMPath.h.

References firstFilterBeforeL2METIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t firstFilterBeforeL2METIndex_
size_t HLTTauDQMPath::getFirstL2CaloMETFilterIndex ( ) const
inline

Definition at line 114 of file HLTTauDQMPath.h.

References firstL2METFilterIndex_.

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

Definition at line 111 of file HLTTauDQMPath.h.

References lastFilterBeforeL2METIndex_.

111 { return lastFilterBeforeL2METIndex_; }
size_t lastFilterBeforeL2METIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2ElectronIndex ( ) const
inline

Definition at line 101 of file HLTTauDQMPath.h.

References lastFilterBeforeL2ElectronIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2ElectronIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2MuonIndex ( ) const
inline

Definition at line 106 of file HLTTauDQMPath.h.

References lastFilterBeforeL2MuonIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2MuonIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2TauIndex ( ) const
inline

Definition at line 96 of file HLTTauDQMPath.h.

References lastFilterBeforeL2TauIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2TauIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL3ElectronIndex ( ) const
inline

Definition at line 103 of file HLTTauDQMPath.h.

References lastFilterBeforeL3ElectronIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3ElectronIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL3MuonIndex ( ) const
inline

Definition at line 108 of file HLTTauDQMPath.h.

References lastFilterBeforeL3MuonIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3MuonIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL3TauIndex ( ) const
inline

Definition at line 98 of file HLTTauDQMPath.h.

References lastFilterBeforeL3TauIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3TauIndex_
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_
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_
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_
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_
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_
size_t HLTTauDQMPath::getLastL3ElectronFilterIndex ( ) const
inline
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_
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_
const unsigned int HLTTauDQMPath::getPathIndex ( ) const
inline

Definition at line 50 of file HLTTauDQMPath.h.

References pathIndex_.

50 { return pathIndex_; }
const unsigned int pathIndex_
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_
bool HLTTauDQMPath::goodOfflineEvent ( size_t  i,
const HLTTauDQMOfflineObjects offlineObjects 
) const

Definition at line 668 of file HLTTauDQMPath.cc.

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

Referenced by HLTTauDQMPathSummaryPlotter::analyze().

668  {
669  return (static_cast<size_t>(getFilterNTaus(i)) <= offlineObjects.taus.size() &&
670  static_cast<size_t>(getFilterNElectrons(i)) <= offlineObjects.electrons.size() &&
671  static_cast<size_t>(getFilterNMuons(i)) <= offlineObjects.muons.size());
672 }
std::vector< LV > electrons
std::vector< LV > taus
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:61
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:55
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:67
std::vector< LV > muons
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_
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
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
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
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
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
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
bool HLTTauDQMPath::isFirstFilterL1Seed ( ) const
inline

Definition at line 86 of file HLTTauDQMPath.h.

References isFirstL1Seed_.

Referenced by HLTTauDQMPathPlotter::analyze().

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

Definition at line 546 of file HLTTauDQMPath.cc.

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

Referenced by HLTTauDQMPathPlotter::analyze().

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

References a, b, HLTTauDQMOfflineObjects::electrons, PVValHelper::fill(), filterElectronN_, filterMET_, filterMuonN_, filterTauN_, isFirstL1Seed_, HLTTauDQMOfflineObjects::met, HLTTauDQMOfflineObjects::muons, 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().

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

const bool HLTTauDQMPath::doRefAnalysis_
private

Definition at line 134 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

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

Definition at line 138 of file HLTTauDQMPath.h.

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

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

Definition at line 141 of file HLTTauDQMPath.h.

Referenced by getFilterLevel(), and HLTTauDQMPath().

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

Definition at line 140 of file HLTTauDQMPath.h.

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

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

Definition at line 139 of file HLTTauDQMPath.h.

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

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

Definition at line 137 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::firstFilterBeforeL2METIndex_
private

Definition at line 158 of file HLTTauDQMPath.h.

Referenced by getFirstFilterBeforeL2CaloMETIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::firstL2METFilterIndex_
private

Definition at line 159 of file HLTTauDQMPath.h.

Referenced by getFirstL2CaloMETFilterIndex(), and HLTTauDQMPath().

const std::string HLTTauDQMPath::hltProcess_
private

Definition at line 133 of file HLTTauDQMPath.h.

Referenced by getFilterObjects().

bool HLTTauDQMPath::isFirstL1Seed_
private

Definition at line 160 of file HLTTauDQMPath.h.

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

bool HLTTauDQMPath::isValid_
private

Definition at line 161 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath(), and isValid().

constexpr size_t HLTTauDQMPath::kInvalidIndex = std::numeric_limits<size_t>::max()
static
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 148 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2ElectronIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL2METIndex_
private

Definition at line 156 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2CaloMETIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL2MuonIndex_
private

Definition at line 152 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2MuonIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL2TauIndex_
private

Definition at line 144 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2TauIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL3ElectronIndex_
private

Definition at line 150 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL3ElectronIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL3MuonIndex_
private

Definition at line 154 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL3MuonIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL3TauIndex_
private

Definition at line 146 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL3TauIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastL2ElectronFilterIndex_
private

Definition at line 149 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL2METFilterIndex_
private

Definition at line 157 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL2MuonFilterIndex_
private

Definition at line 153 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL2TauFilterIndex_
private

Definition at line 145 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL3ElectronFilterIndex_
private

Definition at line 151 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL3MuonFilterIndex_
private

Definition at line 155 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL3TauFilterIndex_
private

Definition at line 147 of file HLTTauDQMPath.h.

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

const unsigned int HLTTauDQMPath::pathIndex_
private

Definition at line 143 of file HLTTauDQMPath.h.

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

const std::string HLTTauDQMPath::pathName_
private

Definition at line 142 of file HLTTauDQMPath.h.

Referenced by getPathName(), and HLTTauDQMPath().