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, size_t> FilterIndex;
27 
28  constexpr static size_t kName = 0;
29  constexpr static size_t kModuleIndex = 1;
31 
32  struct Object {
34  const int id; // from TriggerTypeDefs.h
35  };
36 
37  HLTTauDQMPath(const std::string& pathName, const std::string& hltProcess, bool doRefAnalysis, const HLTConfigProvider& HLTCP);
39 
40  bool isValid() const { return isValid_; }
41 
42  bool fired(const edm::TriggerResults& triggerResults) const;
43 
44  // index (to getFilterName, getFilterIndex) of the last passed filter
45  // -1, if the first filter rejects the event
47 
48  const std::string& getPathName() const { return pathName_; }
49  const unsigned int getPathIndex() const { return pathIndex_; }
50 
51  size_t filtersSize() const { return filterIndices_.size(); }
52  const std::string& getFilterName(size_t i) const { return std::get<kName>(filterIndices_[i]); }
53  int getFilterNTaus(size_t i) const { return filterTauN_[i]; }
54  int getFilterNElectrons(size_t i) const {return filterElectronN_[i]; }
55  int getFilterNMuons(size_t i) const {return filterMuonN_[i]; }
56 
57  bool isFirstFilterL1Seed() const { return isFirstL1Seed_; }
58  const std::string& getLastFilterName() const { return std::get<kName>(filterIndices_.back()); }
59 
60  bool hasL2Taus() const { return lastL2TauFilterIndex_ != kInvalidIndex; }
61  bool hasL3Taus() const { return lastL3TauFilterIndex_ != kInvalidIndex; }
66 
67  // index (to edm::TriggerResults) of a filter
68  size_t getFilterIndex(size_t i) const { return std::get<kModuleIndex>(filterIndices_[i]); }
69 
70  // Get objects associated to a filter, i is the "internal" index
71  void getFilterObjects(const trigger::TriggerEvent& triggerEvent, size_t i, std::vector<Object>& retval) const;
72 
73  // i = filter index
74  bool offlineMatching(size_t i, const std::vector<Object>& triggerObjects, const HLTTauDQMOfflineObjects& offlineObjects, double dR, std::vector<Object>& matchedTriggerObjects, HLTTauDQMOfflineObjects& matchedOfflineObjects) const;
75 
76  bool goodOfflineEvent(size_t i, const HLTTauDQMOfflineObjects& offlineObjects) const;
77 
78 private:
80  const bool doRefAnalysis_;
81 
82  std::vector<FilterIndex> filterIndices_;
83  std::vector<int> filterTauN_;
84  std::vector<int> filterElectronN_;
85  std::vector<int> filterMuonN_;
87  const unsigned int pathIndex_;
93  bool isValid_;
94 };
95 
96 
97 #endif
size_t getLastL2TauFilterIndex() const
Definition: HLTTauDQMPath.h:63
const std::string pathName_
Definition: HLTTauDQMPath.h:86
int i
Definition: DBlmapReader.cc:9
std::tuple< std::string, size_t > FilterIndex
Definition: HLTTauDQMPath.h:26
bool goodOfflineEvent(size_t i, const HLTTauDQMOfflineObjects &offlineObjects) const
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
bool isValid() const
Definition: HLTTauDQMPath.h:40
int lastPassedFilter(const edm::TriggerResults &triggerResults) const
const unsigned int getPathIndex() const
Definition: HLTTauDQMPath.h:49
int getFilterNElectrons(size_t i) const
Definition: HLTTauDQMPath.h:54
int getFilterNTaus(size_t i) const
Definition: HLTTauDQMPath.h:53
bool isFirstFilterL1Seed() const
Definition: HLTTauDQMPath.h:57
#define constexpr
std::vector< LV > LVColl
Definition: HLTTauDQMPath.h:25
const std::string hltProcess_
Definition: HLTTauDQMPath.h:79
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:22
size_t getLastFilterBeforeL3TauIndex() const
Definition: HLTTauDQMPath.h:64
tuple TriggerResults
Definition: old-fu_pass.py:28
void getFilterObjects(const trigger::TriggerEvent &triggerEvent, size_t i, std::vector< Object > &retval) const
int getFilterNMuons(size_t i) const
Definition: HLTTauDQMPath.h:55
const unsigned int pathIndex_
Definition: HLTTauDQMPath.h:87
size_t lastFilterBeforeL2TauIndex_
Definition: HLTTauDQMPath.h:88
static constexpr size_t kName
Definition: HLTTauDQMPath.h:28
size_t filtersSize() const
Definition: HLTTauDQMPath.h:51
const std::string & getLastFilterName() const
Definition: HLTTauDQMPath.h:58
size_t lastFilterBeforeL3TauIndex_
Definition: HLTTauDQMPath.h:90
bool hasL3Taus() const
Definition: HLTTauDQMPath.h:61
static std::string const triggerResults
Definition: EdmProvDump.cc:40
size_t getLastL3TauFilterIndex() const
Definition: HLTTauDQMPath.h:65
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_
Definition: HLTTauDQMPath.h:83
math::XYZTLorentzVectorD LV
Definition: HLTTauDQMPath.h:24
std::vector< FilterIndex > filterIndices_
Definition: HLTTauDQMPath.h:82
size_t getFilterIndex(size_t i) const
Definition: HLTTauDQMPath.h:68
const bool doRefAnalysis_
Definition: HLTTauDQMPath.h:80
const std::string & getFilterName(size_t i) const
Definition: HLTTauDQMPath.h:52
size_t lastL3TauFilterIndex_
Definition: HLTTauDQMPath.h:91
bool fired(const edm::TriggerResults &triggerResults) const
size_t lastL2TauFilterIndex_
Definition: HLTTauDQMPath.h:89
size_t getLastFilterBeforeL2TauIndex() const
Definition: HLTTauDQMPath.h:62
const std::string & getPathName() const
Definition: HLTTauDQMPath.h:48
HLTTauDQMPath(const std::string &pathName, const std::string &hltProcess, bool doRefAnalysis, const HLTConfigProvider &HLTCP)
std::vector< int > filterElectronN_
Definition: HLTTauDQMPath.h:84
bool hasL2Taus() const
Definition: HLTTauDQMPath.h:60
std::vector< int > filterMuonN_
Definition: HLTTauDQMPath.h:85
static constexpr size_t kModuleIndex
Definition: HLTTauDQMPath.h:29
const trigger::TriggerObject & object
Definition: HLTTauDQMPath.h:33
static constexpr size_t kInvalidIndex
Definition: HLTTauDQMPath.h:30