CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | 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
 
typedef math::XYZTLorentzVectorD LV
 
typedef std::vector< LVLVColl
 

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 (const std::string &pathName, const 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.

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

Definition at line 25 of file HLTTauDQMPath.h.

Constructor & Destructor Documentation

HLTTauDQMPath::HLTTauDQMPath ( const std::string &  pathName,
const 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, 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.

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

Definition at line 534 of file HLTTauDQMPath.cc.

534 {}

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

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

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

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

Definition at line 92 of file HLTTauDQMPath.h.

References filterIndices_, and i.

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

Definition at line 59 of file HLTTauDQMPath.h.

References filterLevel_.

Referenced by HLTTauDQMPath().

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

Definition at line 58 of file HLTTauDQMPath.h.

References filterMET_.

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

58 {if(i < filterMET_.size()) return filterMET_[i]; else return 0;}
int i
Definition: DBlmapReader.cc:9
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 i.

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

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

Definition at line 56 of file HLTTauDQMPath.h.

References filterElectronN_.

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

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

Definition at line 57 of file HLTTauDQMPath.h.

References filterMuonN_.

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

57 {if(i < filterMuonN_.size()) return filterMuonN_[i]; else return 0;}
int i
Definition: DBlmapReader.cc:9
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 { if(i < filterTauN_.size()) return filterTauN_[i]; else return 0;}
int i
Definition: DBlmapReader.cc:9
std::vector< int > filterTauN_
void HLTTauDQMPath::getFilterObjects ( const trigger::TriggerEvent triggerEvent,
size_t  i,
std::vector< Object > &  retval 
) const

Definition at line 562 of file HLTTauDQMPath.cc.

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

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

562  {
563  trigger::size_type filterIndex = triggerEvent.filterIndex(edm::InputTag(getFilterName(i), "", hltProcess_));
564  if(filterIndex != triggerEvent.sizeFilters()) {
565  const trigger::Keys& keys = triggerEvent.filterKeys(filterIndex);
566  const trigger::Vids& ids = triggerEvent.filterIds(filterIndex);
567  const trigger::TriggerObjectCollection& triggerObjects = triggerEvent.getObjects();
568  for(size_t i=0; i<keys.size(); ++i) {
569  const trigger::TriggerObject& object = triggerObjects[keys[i]];
570  retval.emplace_back(Object{object, ids[i]});
571  }
572  }
573 }
int i
Definition: DBlmapReader.cc:9
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:135
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:111
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:123
uint16_t size_type
const std::string hltProcess_
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:110
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:98
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:81
std::vector< size_type > Keys
const std::string & getFilterName(size_t i) const
Definition: HLTTauDQMPath.h:53
list object
Definition: dbtoconf.py:77
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 i.

Referenced by HLTTauDQMPathPlotter::analyze().

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

Definition at line 88 of file HLTTauDQMPath.h.

References firstFilterBeforeL2METIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t firstFilterBeforeL2METIndex_
size_t HLTTauDQMPath::getFirstL2CaloMETFilterIndex ( ) const
inline

Definition at line 89 of file HLTTauDQMPath.h.

References firstL2METFilterIndex_.

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

Definition at line 86 of file HLTTauDQMPath.h.

References lastFilterBeforeL2METIndex_.

size_t lastFilterBeforeL2METIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2ElectronIndex ( ) const
inline

Definition at line 76 of file HLTTauDQMPath.h.

References lastFilterBeforeL2ElectronIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2ElectronIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2MuonIndex ( ) const
inline

Definition at line 81 of file HLTTauDQMPath.h.

References lastFilterBeforeL2MuonIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2MuonIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL2TauIndex ( ) const
inline

Definition at line 71 of file HLTTauDQMPath.h.

References lastFilterBeforeL2TauIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL2TauIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL3ElectronIndex ( ) const
inline

Definition at line 78 of file HLTTauDQMPath.h.

References lastFilterBeforeL3ElectronIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3ElectronIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL3MuonIndex ( ) const
inline

Definition at line 83 of file HLTTauDQMPath.h.

References lastFilterBeforeL3MuonIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastFilterBeforeL3MuonIndex_
size_t HLTTauDQMPath::getLastFilterBeforeL3TauIndex ( ) const
inline

Definition at line 73 of file HLTTauDQMPath.h.

References lastFilterBeforeL3TauIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

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

Definition at line 62 of file HLTTauDQMPath.h.

References filterIndices_.

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

Definition at line 87 of file HLTTauDQMPath.h.

References lastL2METFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

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

Definition at line 77 of file HLTTauDQMPath.h.

References lastL2ElectronFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

size_t lastL2ElectronFilterIndex_
size_t HLTTauDQMPath::getLastL2MuonFilterIndex ( ) const
inline

Definition at line 82 of file HLTTauDQMPath.h.

References lastL2MuonFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

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

Definition at line 72 of file HLTTauDQMPath.h.

References lastL2TauFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

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

Definition at line 84 of file HLTTauDQMPath.h.

References lastL3MuonFilterIndex_.

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

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

Definition at line 74 of file HLTTauDQMPath.h.

References lastL3TauFilterIndex_.

Referenced by HLTTauDQMPathPlotter::analyze().

74 { 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 655 of file HLTTauDQMPath.cc.

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

Referenced by HLTTauDQMPathSummaryPlotter::analyze().

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

Definition at line 70 of file HLTTauDQMPath.h.

References 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 66 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 68 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 64 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 67 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 69 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 65 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 61 of file HLTTauDQMPath.h.

References isFirstL1Seed_.

Referenced by HLTTauDQMPathPlotter::analyze().

61 { return isFirstL1Seed_; }
bool HLTTauDQMPath::isValid ( void  ) const
inline

Definition at line 41 of file HLTTauDQMPath.h.

References isValid_.

Referenced by HLTTauDQMPathPlotter::HLTTauDQMPathPlotter(), and core.AutoHandle.AutoHandle::ReallyLoad().

41 { return isValid_; }
int HLTTauDQMPath::lastPassedFilter ( const edm::TriggerResults triggerResults) const

Definition at line 541 of file HLTTauDQMPath.cc.

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

Referenced by HLTTauDQMPathPlotter::analyze().

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

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

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

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

Member Data Documentation

const bool HLTTauDQMPath::doRefAnalysis_
private

Definition at line 104 of file HLTTauDQMPath.h.

Referenced by HLTTauDQMPath().

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

Definition at line 108 of file HLTTauDQMPath.h.

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

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

Definition at line 111 of file HLTTauDQMPath.h.

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

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

Definition at line 110 of file HLTTauDQMPath.h.

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

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

Definition at line 109 of file HLTTauDQMPath.h.

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

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

Definition at line 107 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::firstFilterBeforeL2METIndex_
private

Definition at line 128 of file HLTTauDQMPath.h.

Referenced by getFirstFilterBeforeL2CaloMETIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::firstL2METFilterIndex_
private

Definition at line 129 of file HLTTauDQMPath.h.

Referenced by getFirstL2CaloMETFilterIndex(), and HLTTauDQMPath().

const std::string HLTTauDQMPath::hltProcess_
private

Definition at line 103 of file HLTTauDQMPath.h.

Referenced by getFilterObjects().

bool HLTTauDQMPath::isFirstL1Seed_
private

Definition at line 130 of file HLTTauDQMPath.h.

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

bool HLTTauDQMPath::isValid_
private

Definition at line 131 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 118 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2ElectronIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL2METIndex_
private

Definition at line 126 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2CaloMETIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL2MuonIndex_
private

Definition at line 122 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2MuonIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL2TauIndex_
private

Definition at line 114 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL2TauIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL3ElectronIndex_
private

Definition at line 120 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL3ElectronIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL3MuonIndex_
private

Definition at line 124 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL3MuonIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastFilterBeforeL3TauIndex_
private

Definition at line 116 of file HLTTauDQMPath.h.

Referenced by getLastFilterBeforeL3TauIndex(), and HLTTauDQMPath().

size_t HLTTauDQMPath::lastL2ElectronFilterIndex_
private

Definition at line 119 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL2METFilterIndex_
private

Definition at line 127 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL2MuonFilterIndex_
private

Definition at line 123 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL2TauFilterIndex_
private

Definition at line 115 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL3ElectronFilterIndex_
private

Definition at line 121 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL3MuonFilterIndex_
private

Definition at line 125 of file HLTTauDQMPath.h.

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

size_t HLTTauDQMPath::lastL3TauFilterIndex_
private

Definition at line 117 of file HLTTauDQMPath.h.

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

const unsigned int HLTTauDQMPath::pathIndex_
private

Definition at line 113 of file HLTTauDQMPath.h.

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

const std::string HLTTauDQMPath::pathName_
private

Definition at line 112 of file HLTTauDQMPath.h.

Referenced by getPathName(), and HLTTauDQMPath().