CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes
ZCountingTrigger::TTrigger Class Reference

#include <TTrigger.h>

Public Member Functions

int getTriggerBit (const std::string &iName) const
 
int getTriggerObjectBit (const std::string &iName, const std::string &iObjName) const
 
bool pass (const std::string &iName, const TriggerBits &iTrig) const
 
bool passObj (const std::string &iName, const std::string &iObjName, const TriggerObjects &iTrigObj) const
 
 TTrigger (const std::vector< std::string > &muonTriggerNames, const std::vector< std::string > &muonTriggerObjectNames)
 
 ~TTrigger ()
 

Public Attributes

std::vector
< ZCountingTrigger::TriggerRecord
fRecords
 

Detailed Description

Definition at line 8 of file TTrigger.h.

Constructor & Destructor Documentation

TTrigger::TTrigger ( const std::vector< std::string > &  muonTriggerNames,
const std::vector< std::string > &  muonTriggerObjectNames 
)

Definition at line 25 of file TTrigger.cc.

References fRecords, and mps_fire::i.

26  {
27  for (unsigned int i = 0; i < muonTriggerNames.size(); ++i) {
28  fRecords.push_back(ZCountingTrigger::TriggerRecord(muonTriggerNames.at(i), 0));
29  fRecords.back().objectMap.push_back(std::pair<std::string, int>(muonTriggerObjectNames.at(i), 0));
30  }
31  fRecords.push_back(ZCountingTrigger::TriggerRecord("HLT_Ele35_WPTight_Gsf_v*", 1));
32  fRecords.back().objectMap.push_back(std::pair<std::string, int>("hltEle35noerWPTightGsfTrackIsoFilter", 0));
33  fRecords.push_back(ZCountingTrigger::TriggerRecord("HLT_Ele27_WPTight_Gsf_v*", 2));
34  fRecords.back().objectMap.push_back(std::pair<std::string, int>("hltEle27WPTightGsfTrackIsoFilter", 0));
35 }
std::vector< ZCountingTrigger::TriggerRecord > fRecords
Definition: TTrigger.h:19
ZCountingTrigger::TTrigger::~TTrigger ( )
inline

Definition at line 11 of file TTrigger.h.

11 {}

Member Function Documentation

int TTrigger::getTriggerBit ( const std::string &  iName) const

Definition at line 38 of file TTrigger.cc.

References fRecords.

Referenced by getTriggerObjectBit(), and pass().

38  {
39  int lId = -1;
40  for (unsigned int i0 = 0; i0 < fRecords.size(); i0++) {
41  if (iName == fRecords[i0].hltPattern)
42  lId = i0;
43  }
44  if (lId == -1)
45  edm::LogWarning("ZCounting") << "=== Missing Trigger ==" << iName << std::endl;
46  return lId;
47 }
std::vector< ZCountingTrigger::TriggerRecord > fRecords
Definition: TTrigger.h:19
Log< level::Warning, false > LogWarning
int TTrigger::getTriggerObjectBit ( const std::string &  iName,
const std::string &  iObjName 
) const

Definition at line 50 of file TTrigger.cc.

References first, fRecords, and getTriggerBit().

Referenced by passObj().

50  {
51  int lId = getTriggerBit(iName);
52  if (lId == -1)
53  return -1;
54 
55  for (unsigned int i0 = 0; i0 < fRecords[lId].objectMap.size(); i0++) {
56  if (iObjName != fRecords[lId].objectMap[i0].first)
57  continue;
58  return fRecords[lId].objectMap[i0].second;
59  }
60 
61  return -1;
62 }
int getTriggerBit(const std::string &iName) const
Definition: TTrigger.cc:38
std::vector< ZCountingTrigger::TriggerRecord > fRecords
Definition: TTrigger.h:19
bool TTrigger::pass ( const std::string &  iName,
const TriggerBits iTrig 
) const

Definition at line 65 of file TTrigger.cc.

References getTriggerBit().

Referenced by ZCounting::isElectronTrigger(), and ZCounting::isMuonTrigger().

65  {
66  int lId = getTriggerBit(iName);
67  if (lId == -1)
68  return false;
69 
70  return iTrig[lId];
71 }
int getTriggerBit(const std::string &iName) const
Definition: TTrigger.cc:38
bool TTrigger::passObj ( const std::string &  iName,
const std::string &  iObjName,
const TriggerObjects iTrigObj 
) const

Definition at line 74 of file TTrigger.cc.

References getTriggerObjectBit().

Referenced by ZCounting::isElectronTriggerObj(), and ZCounting::isMuonTriggerObj().

74  {
75  int lId = getTriggerObjectBit(iName, iObjName);
76  if (lId == -1)
77  return false;
78 
79  return iTrigObj[lId];
80 }
int getTriggerObjectBit(const std::string &iName, const std::string &iObjName) const
Definition: TTrigger.cc:50

Member Data Documentation

std::vector<ZCountingTrigger::TriggerRecord> ZCountingTrigger::TTrigger::fRecords

Definition at line 19 of file TTrigger.h.

Referenced by getTriggerBit(), getTriggerObjectBit(), and TTrigger().