CMS 3D CMS Logo

TriggerTools.h
Go to the documentation of this file.
1 #ifndef DQMOFFLINE_LUMI_TRIGGERTOOLS_H
2 #define DQMOFFLINE_LUMI_TRIGGERTOOLS_H
3 
11 
12 #include <bitset>
13 
14 const unsigned int kNTrigBit = 128;
15 typedef std::bitset<kNTrigBit> TriggerBits;
16 const unsigned int kNTrigObjectBit = 256;
17 typedef std::bitset<kNTrigObjectBit> TriggerObjectBits;
18 
19 class TriggerTools {
20 public:
23 
24  void readEvent(const edm::Event &iEvent);
25 
28  void setDRMAX(const double _drMax) { DRMAX = _drMax; }
29 
31  Record rec;
32  rec.hltPattern = name;
33  records.push_back(rec);
34  }
36  Record rec;
37  rec.hltPattern = name;
38  rec.hltObjName = objName;
39  records.push_back(rec);
40  }
41 
42  void initHLTObjects(const HLTConfigProvider &hltConfigProvider_);
43 
44  bool pass() const;
45  bool passObj(const double eta, const double phi) const;
46 
47 private:
48  struct Record {
49  std::string hltPattern; // HLT path name/pattern (wildcards allowed: *,?)
50  std::string hltPathName = ""; // HLT path name in trigger menu
51  unsigned int hltPathIndex = (unsigned int)-1; // HLT path index in trigger menu
52  std::string hltObjName = ""; // trigger object name in trigger menu
53  };
54  std::vector<Record> records;
55 
58 
61 
63 
64  // initialization from HLT menu; needs to be called on every change in HLT menu
65  void initPathNames(const std::vector<std::string> &triggerNames);
66 
68 
69  // Matching parameter
70  double DRMAX = 0.1;
71 };
72 
73 #endif
void setDRMAX(const double _drMax)
Definition: TriggerTools.h:28
unsigned int hltPathIndex
Definition: TriggerTools.h:51
const unsigned int kNTrigBit
Definition: TriggerTools.h:14
void initHLTObjects(const HLTConfigProvider &hltConfigProvider_)
Definition: TriggerTools.cc:35
std::bitset< kNTrigObjectBit > TriggerObjectBits
Definition: TriggerTools.h:17
double DRMAX
Definition: TriggerTools.h:70
void setTriggerEventToken(edm::EDGetTokenT< trigger::TriggerEvent > token)
Definition: TriggerTools.h:27
edm::ParameterSetID fTriggerNamesID
Definition: TriggerTools.h:62
edm::Handle< edm::TriggerResults > hTrgRes
Definition: TriggerTools.h:59
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::TriggerResults > fHLTTag_token
Definition: TriggerTools.h:56
edm::EDGetTokenT< trigger::TriggerEvent > fHLTObjTag_token
Definition: TriggerTools.h:57
std::vector< Record > records
Definition: TriggerTools.h:54
edm::Handle< trigger::TriggerEvent > hTrgEvt
Definition: TriggerTools.h:60
void addTriggerRecord(const std::string &name, const std::string &objName)
Definition: TriggerTools.h:35
void setTriggerResultsToken(edm::EDGetTokenT< edm::TriggerResults > token)
Definition: TriggerTools.h:26
bool pass() const
bool passObj(const double eta, const double phi) const
std::string hltObjName
Definition: TriggerTools.h:52
void addTriggerRecord(const std::string &name)
Definition: TriggerTools.h:30
TriggerBits triggerBits
Definition: TriggerTools.h:67
std::bitset< kNTrigBit > TriggerBits
Definition: TriggerTools.h:15
void initPathNames(const std::vector< std::string > &triggerNames)
Definition: TriggerTools.cc:10
void readEvent(const edm::Event &iEvent)
Definition: TriggerTools.cc:90
std::string hltPathName
Definition: TriggerTools.h:50
std::string hltPattern
Definition: TriggerTools.h:49
const unsigned int kNTrigObjectBit
Definition: TriggerTools.h:16