CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
16 namespace trigger {
17  class TriggerEvent;
18  class TriggerObject;
19 }
21 
23 public:
25  typedef std::vector<LV> LVColl;
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;
32 
33  struct Object {
35  const int id; // from TriggerTypeDefs.h
36  };
37 
38  HLTTauDQMPath(const std::string& pathName, const 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 { if(i < filterTauN_.size()) return filterTauN_[i]; else return 0;}
56  int getFilterNElectrons(size_t i) const {if(i < filterElectronN_.size()) return filterElectronN_[i]; else return 0;}
57  int getFilterNMuons(size_t i) const {if(i < filterMuonN_.size()) return filterMuonN_[i]; else return 0;}
58  int getFilterMET(size_t i) const {if(i < filterMET_.size()) return filterMET_[i]; else return 0;}
59  int getFilterLevel(size_t i) const {if(i < filterLevel_.size()) return filterLevel_[i]; else return 0;}
60 
61  bool isFirstFilterL1Seed() const { return isFirstL1Seed_; }
62  const std::string& getLastFilterName() const { return std::get<kName>(filterIndices_.back()); }
63 
64  bool hasL2Taus() const { return lastL2TauFilterIndex_ != kInvalidIndex; }
65  bool hasL3Taus() const { return lastL3TauFilterIndex_ != kInvalidIndex; }
68  bool hasL2Muons() const { return lastL2MuonFilterIndex_ != kInvalidIndex; }
69  bool hasL3Muons() const { return lastL3MuonFilterIndex_ != kInvalidIndex; }
70  bool hasL2CaloMET() const { return lastL2METFilterIndex_ != kInvalidIndex; }
75 
80 
85 
90 
91  // index (to edm::TriggerResults) of a filter
92  size_t getFilterIndex(size_t i) const { return std::get<kModuleIndex>(filterIndices_[i]); }
93 
94  // Get objects associated to a filter, i is the "internal" index
95  void getFilterObjects(const trigger::TriggerEvent& triggerEvent, size_t i, std::vector<Object>& retval) const;
96 
97  // i = filter index
98  bool offlineMatching(size_t i, const std::vector<Object>& triggerObjects, const HLTTauDQMOfflineObjects& offlineObjects, double dR, std::vector<Object>& matchedTriggerObjects, HLTTauDQMOfflineObjects& matchedOfflineObjects) const;
99 
100  bool goodOfflineEvent(size_t i, const HLTTauDQMOfflineObjects& offlineObjects) const;
101 
102 private:
104  const bool doRefAnalysis_;
105 
106  std::vector<FilterIndex> filterIndices_;
107  std::vector<int> filterTauN_;
108  std::vector<int> filterElectronN_;
109  std::vector<int> filterMuonN_;
110  std::vector<int> filterMET_;
111  std::vector<int> filterLevel_;
113  const unsigned int pathIndex_;
131  bool isValid_;
132 };
133 
134 
135 #endif
size_t getLastL2TauFilterIndex() const
Definition: HLTTauDQMPath.h:72
const std::string pathName_
int getFilterLevel(size_t i) const
Definition: HLTTauDQMPath.h:59
int i
Definition: DBlmapReader.cc:9
bool hasL3Electrons() const
Definition: HLTTauDQMPath.h:67
bool goodOfflineEvent(size_t i, const HLTTauDQMOfflineObjects &offlineObjects) const
size_t lastL3ElectronFilterIndex_
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
std::vector< int > filterMET_
size_t getLastL3ElectronFilterIndex() const
Definition: HLTTauDQMPath.h:79
size_t lastFilterBeforeL2METIndex_
size_t getLastL3MuonFilterIndex() const
Definition: HLTTauDQMPath.h:84
bool isValid() const
Definition: HLTTauDQMPath.h:41
std::tuple< std::string, std::string, size_t > FilterIndex
Definition: HLTTauDQMPath.h:26
bool hasL2Muons() const
Definition: HLTTauDQMPath.h:68
int lastPassedFilter(const edm::TriggerResults &triggerResults) const
const unsigned int getPathIndex() const
Definition: HLTTauDQMPath.h:50
size_t lastFilterBeforeL3ElectronIndex_
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:56
size_t getLastFilterBeforeL2CaloMETIndex() const
Definition: HLTTauDQMPath.h:86
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:55
bool isFirstFilterL1Seed() const
Definition: HLTTauDQMPath.h:61
size_t lastFilterBeforeL3MuonIndex_
#define constexpr
std::vector< LV > LVColl
Definition: HLTTauDQMPath.h:25
std::vector< int > filterLevel_
const std::string hltProcess_
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
size_t getLastFilterBeforeL3TauIndex() const
Definition: HLTTauDQMPath.h:73
tuple TriggerResults
Definition: old-fu_pass.py:28
void getFilterObjects(const trigger::TriggerEvent &triggerEvent, size_t i, std::vector< Object > &retval) const
const std::string & getFilterType(size_t i) const
Definition: HLTTauDQMPath.h:54
bool hasL2CaloMET() const
Definition: HLTTauDQMPath.h:70
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:57
const unsigned int pathIndex_
size_t lastFilterBeforeL2TauIndex_
static constexpr size_t kName
Definition: HLTTauDQMPath.h:28
size_t getLastFilterBeforeL3ElectronIndex() const
Definition: HLTTauDQMPath.h:78
size_t filtersSize() const
Definition: HLTTauDQMPath.h:52
size_t getLastFilterBeforeL2MuonIndex() const
Definition: HLTTauDQMPath.h:81
const std::string & getLastFilterName() const
Definition: HLTTauDQMPath.h:62
size_t getLastL2CaloMETFilterIndex() const
Definition: HLTTauDQMPath.h:87
size_t getLastL2MuonFilterIndex() const
Definition: HLTTauDQMPath.h:82
size_t lastFilterBeforeL3TauIndex_
bool hasL3Taus() const
Definition: HLTTauDQMPath.h:65
static std::string const triggerResults
Definition: EdmProvDump.cc:40
size_t getLastFilterBeforeL3MuonIndex() const
Definition: HLTTauDQMPath.h:83
size_t getLastL3TauFilterIndex() const
Definition: HLTTauDQMPath.h:74
size_t lastFilterBeforeL2ElectronIndex_
size_t getFirstL2CaloMETFilterIndex() const
Definition: HLTTauDQMPath.h:89
bool offlineMatching(size_t i, const std::vector< Object > &triggerObjects, const HLTTauDQMOfflineObjects &offlineObjects, double dR, std::vector< Object > &matchedTriggerObjects, HLTTauDQMOfflineObjects &matchedOfflineObjects) const
std::vector< int > filterTauN_
math::XYZTLorentzVectorD LV
Definition: HLTTauDQMPath.h:24
size_t lastL2MuonFilterIndex_
std::vector< FilterIndex > filterIndices_
size_t getFilterIndex(size_t i) const
Definition: HLTTauDQMPath.h:92
const bool doRefAnalysis_
bool hasL3Muons() const
Definition: HLTTauDQMPath.h:69
const std::string & getFilterName(size_t i) const
Definition: HLTTauDQMPath.h:53
size_t lastL3TauFilterIndex_
bool fired(const edm::TriggerResults &triggerResults) const
size_t getLastL2ElectronFilterIndex() const
Definition: HLTTauDQMPath.h:77
static constexpr size_t kType
Definition: HLTTauDQMPath.h:29
size_t lastL2TauFilterIndex_
size_t getLastFilterBeforeL2TauIndex() const
Definition: HLTTauDQMPath.h:71
int getFilterMET(size_t i) const
Definition: HLTTauDQMPath.h:58
size_t getLastFilterBeforeL2ElectronIndex() const
Definition: HLTTauDQMPath.h:76
const std::string & getPathName() const
Definition: HLTTauDQMPath.h:49
HLTTauDQMPath(const std::string &pathName, const std::string &hltProcess, bool doRefAnalysis, const HLTConfigProvider &HLTCP)
std::vector< int > filterElectronN_
size_t lastL3MuonFilterIndex_
bool hasL2Taus() const
Definition: HLTTauDQMPath.h:64
size_t getFirstFilterBeforeL2CaloMETIndex() const
Definition: HLTTauDQMPath.h:88
size_t lastL2ElectronFilterIndex_
size_t firstFilterBeforeL2METIndex_
bool hasL2Electrons() const
Definition: HLTTauDQMPath.h:66
std::vector< int > filterMuonN_
static constexpr size_t kModuleIndex
Definition: HLTTauDQMPath.h:30
const trigger::TriggerObject & object
Definition: HLTTauDQMPath.h:34
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:31
size_t lastL2METFilterIndex_
size_t lastFilterBeforeL2MuonIndex_
size_t firstL2METFilterIndex_