CMS 3D CMS Logo

HLTTauDQMPath.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 #ifndef DQMOffline_Trigger_HLTTauDQMPath_h
3 #define DQMOffline_Trigger_HLTTauDQMPath_h
4 
6 
7 #include <tuple>
8 #include <vector>
9 #include <string>
10 
11 class HLTConfigProvider;
12 namespace edm {
13  class ParameterSet;
14  class TriggerResults;
15 } // namespace edm
16 namespace trigger {
17  class TriggerEvent;
18  class TriggerObject;
19 } // namespace trigger
21 
23 public:
25  using LVColl = std::vector<LV>;
26  typedef std::tuple<std::string, std::string, size_t> FilterIndex;
27 
28  constexpr static size_t kName = 0;
29  constexpr static size_t kType = 1;
30  constexpr static size_t kModuleIndex = 2;
31  constexpr static size_t kInvalidIndex = std::numeric_limits<size_t>::max();
32 
33  struct Object {
35  const int id; // from TriggerTypeDefs.h
36  };
37 
38  HLTTauDQMPath(std::string pathName, std::string hltProcess, bool doRefAnalysis, const HLTConfigProvider& HLTCP);
40 
41  bool isValid() const { return isValid_; }
42 
43  bool fired(const edm::TriggerResults& triggerResults) const;
44 
45  // index (to getFilterName, getFilterIndex) of the last passed filter
46  // -1, if the first filter rejects the event
48 
49  const std::string& getPathName() const { return pathName_; }
50  const unsigned int getPathIndex() const { return pathIndex_; }
51 
52  size_t filtersSize() const { return filterIndices_.size(); }
53  const std::string& getFilterName(size_t i) const { return std::get<kName>(filterIndices_[i]); }
54  const std::string& getFilterType(size_t i) const { return std::get<kType>(filterIndices_[i]); }
55  int getFilterNTaus(size_t i) const {
56  if (i < filterTauN_.size())
57  return filterTauN_[i];
58  else
59  return 0;
60  }
61  int getFilterNElectrons(size_t i) const {
62  if (i < filterElectronN_.size())
63  return filterElectronN_[i];
64  else
65  return 0;
66  }
67  int getFilterNMuons(size_t i) const {
68  if (i < filterMuonN_.size())
69  return filterMuonN_[i];
70  else
71  return 0;
72  }
73  int getFilterMET(size_t i) const {
74  if (i < filterMET_.size())
75  return filterMET_[i];
76  else
77  return 0;
78  }
79  int getFilterLevel(size_t i) const {
80  if (i < filterLevel_.size())
81  return filterLevel_[i];
82  else
83  return 0;
84  }
85 
86  bool isFirstFilterL1Seed() const { return isFirstL1Seed_; }
87  const std::string& getLastFilterName() const { return std::get<kName>(filterIndices_.back()); }
88 
89  bool hasL2Taus() const { return lastL2TauFilterIndex_ != kInvalidIndex; }
90  bool hasL3Taus() const { return lastL3TauFilterIndex_ != kInvalidIndex; }
93  bool hasL2Muons() const { return lastL2MuonFilterIndex_ != kInvalidIndex; }
94  bool hasL3Muons() const { return lastL3MuonFilterIndex_ != kInvalidIndex; }
95  bool hasL2CaloMET() const { return lastL2METFilterIndex_ != kInvalidIndex; }
100 
105 
110 
115 
116  // index (to edm::TriggerResults) of a filter
117  size_t getFilterIndex(size_t i) const { return std::get<kModuleIndex>(filterIndices_[i]); }
118 
119  // Get objects associated to a filter, i is the "internal" index
120  void getFilterObjects(const trigger::TriggerEvent& triggerEvent, size_t i, std::vector<Object>& retval) const;
121 
122  // i = filter index
123  bool offlineMatching(size_t i,
124  const std::vector<Object>& triggerObjects,
125  const HLTTauDQMOfflineObjects& offlineObjects,
126  double dR,
127  std::vector<Object>& matchedTriggerObjects,
128  HLTTauDQMOfflineObjects& matchedOfflineObjects) const;
129 
130  bool goodOfflineEvent(size_t i, const HLTTauDQMOfflineObjects& offlineObjects) const;
131 
132 private:
134  const bool doRefAnalysis_;
135 
136  std::vector<FilterIndex> filterIndices_;
137  std::vector<int> filterTauN_;
138  std::vector<int> filterElectronN_;
139  std::vector<int> filterMuonN_;
140  std::vector<int> filterMET_;
141  std::vector<int> filterLevel_;
143  const unsigned int pathIndex_;
161  bool isValid_;
162 };
163 
164 #endif
bool hasL2Muons() const
Definition: HLTTauDQMPath.h:93
const std::string pathName_
const unsigned int getPathIndex() const
Definition: HLTTauDQMPath.h:50
bool hasL2Taus() const
Definition: HLTTauDQMPath.h:89
size_t lastL3ElectronFilterIndex_
size_t getLastFilterBeforeL3MuonIndex() const
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
size_t getLastFilterBeforeL2ElectronIndex() const
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
std::vector< int > filterMET_
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:61
const std::string & getFilterType(size_t i) const
Definition: HLTTauDQMPath.h:54
size_t lastFilterBeforeL2METIndex_
std::vector< LV > LVColl
Definition: HLTTauDQMPath.h:25
std::tuple< std::string, std::string, size_t > FilterIndex
Definition: HLTTauDQMPath.h:26
size_t getLastFilterBeforeL3TauIndex() const
Definition: HLTTauDQMPath.h:98
size_t lastFilterBeforeL3ElectronIndex_
math::XYZTLorentzVectorD LV
Definition: HLTTauDQMPath.h:24
const std::string & getPathName() const
Definition: HLTTauDQMPath.h:49
bool hasL3Muons() const
Definition: HLTTauDQMPath.h:94
size_t getLastL2ElectronFilterIndex() const
size_t getLastL3TauFilterIndex() const
Definition: HLTTauDQMPath.h:99
size_t lastFilterBeforeL3MuonIndex_
std::vector< int > filterLevel_
const std::string hltProcess_
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
size_t getLastFilterBeforeL2TauIndex() const
Definition: HLTTauDQMPath.h:96
bool hasL3Taus() const
Definition: HLTTauDQMPath.h:90
const unsigned int pathIndex_
size_t lastFilterBeforeL2TauIndex_
static constexpr size_t kName
Definition: HLTTauDQMPath.h:28
size_t filtersSize() const
Definition: HLTTauDQMPath.h:52
size_t getLastL3MuonFilterIndex() const
bool isValid() const
Definition: HLTTauDQMPath.h:41
size_t getLastFilterBeforeL3ElectronIndex() const
bool hasL2CaloMET() const
Definition: HLTTauDQMPath.h:95
int getFilterMET(size_t i) const
Definition: HLTTauDQMPath.h:73
size_t lastFilterBeforeL3TauIndex_
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:67
static std::string const triggerResults
Definition: EdmProvDump.cc:47
size_t getLastL2MuonFilterIndex() const
size_t getFirstL2CaloMETFilterIndex() const
size_t getLastL2CaloMETFilterIndex() const
size_t getFilterIndex(size_t i) const
int getFilterLevel(size_t i) const
Definition: HLTTauDQMPath.h:79
size_t lastFilterBeforeL2ElectronIndex_
std::vector< int > filterTauN_
size_t lastL2MuonFilterIndex_
std::vector< FilterIndex > filterIndices_
size_t getLastL3ElectronFilterIndex() const
HLTTauDQMPath(std::string pathName, std::string hltProcess, bool doRefAnalysis, const HLTConfigProvider &HLTCP)
bool hasL2Electrons() const
Definition: HLTTauDQMPath.h:91
const std::string & getLastFilterName() const
Definition: HLTTauDQMPath.h:87
bool hasL3Electrons() const
Definition: HLTTauDQMPath.h:92
const bool doRefAnalysis_
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:55
size_t lastL3TauFilterIndex_
void getFilterObjects(const trigger::TriggerEvent &triggerEvent, size_t i, std::vector< Object > &retval) const
static constexpr size_t kType
Definition: HLTTauDQMPath.h:29
size_t lastL2TauFilterIndex_
bool goodOfflineEvent(size_t i, const HLTTauDQMOfflineObjects &offlineObjects) const
size_t getLastFilterBeforeL2CaloMETIndex() const
size_t getLastFilterBeforeL2MuonIndex() const
HLT enums.
size_t getLastL2TauFilterIndex() const
Definition: HLTTauDQMPath.h:97
std::vector< int > filterElectronN_
size_t lastL3MuonFilterIndex_
bool isFirstFilterL1Seed() const
Definition: HLTTauDQMPath.h:86
size_t lastL2ElectronFilterIndex_
size_t firstFilterBeforeL2METIndex_
int lastPassedFilter(const edm::TriggerResults &triggerResults) const
const std::string & getFilterName(size_t i) const
Definition: HLTTauDQMPath.h:53
std::vector< int > filterMuonN_
static constexpr size_t kModuleIndex
Definition: HLTTauDQMPath.h:30
bool fired(const edm::TriggerResults &triggerResults) const
const trigger::TriggerObject & object
Definition: HLTTauDQMPath.h:34
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
size_t getFirstFilterBeforeL2CaloMETIndex() const
size_t lastL2METFilterIndex_
bool offlineMatching(size_t i, const std::vector< Object > &triggerObjects, const HLTTauDQMOfflineObjects &offlineObjects, double dR, std::vector< Object > &matchedTriggerObjects, HLTTauDQMOfflineObjects &matchedOfflineObjects) const
size_t lastFilterBeforeL2MuonIndex_
size_t firstL2METFilterIndex_