CMS 3D CMS Logo

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::TriggerRecordfRecords
 

Detailed Description

Definition at line 8 of file TTrigger.h.

Constructor & Destructor Documentation

◆ TTrigger()

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

Definition at line 25 of file TTrigger.cc.

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 }

References fRecords, and mps_fire::i.

◆ ~TTrigger()

ZCountingTrigger::TTrigger::~TTrigger ( )
inline

Definition at line 11 of file TTrigger.h.

11 {}

Member Function Documentation

◆ getTriggerBit()

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

Definition at line 38 of file TTrigger.cc.

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 }

References fRecords.

Referenced by getTriggerObjectBit(), and pass().

◆ getTriggerObjectBit()

int TTrigger::getTriggerObjectBit ( const std::string &  iName,
const std::string &  iObjName 
) const

Definition at line 50 of file TTrigger.cc.

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 }

References dqmdumpme::first, fRecords, and getTriggerBit().

Referenced by passObj().

◆ pass()

bool TTrigger::pass ( const std::string &  iName,
const TriggerBits iTrig 
) const

Definition at line 65 of file TTrigger.cc.

65  {
66  int lId = getTriggerBit(iName);
67  if (lId == -1)
68  return false;
69 
70  return iTrig[lId];
71 }

References getTriggerBit().

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

◆ passObj()

bool TTrigger::passObj ( const std::string &  iName,
const std::string &  iObjName,
const TriggerObjects iTrigObj 
) const

Definition at line 74 of file TTrigger.cc.

74  {
75  int lId = getTriggerObjectBit(iName, iObjName);
76  if (lId == -1)
77  return false;
78 
79  return iTrigObj[lId];
80 }

References getTriggerObjectBit().

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

Member Data Documentation

◆ fRecords

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

Definition at line 19 of file TTrigger.h.

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

mps_fire.i
i
Definition: mps_fire.py:355
ZCountingTrigger::TriggerRecord
Definition: TriggerRecord.h:10
dqmdumpme.first
first
Definition: dqmdumpme.py:55
edm::LogWarning
Definition: MessageLogger.h:141
ZCountingTrigger::TTrigger::getTriggerObjectBit
int getTriggerObjectBit(const std::string &iName, const std::string &iObjName) const
Definition: TTrigger.cc:50
ZCountingTrigger::TTrigger::getTriggerBit
int getTriggerBit(const std::string &iName) const
Definition: TTrigger.cc:38
ZCountingTrigger::TTrigger::fRecords
std::vector< ZCountingTrigger::TriggerRecord > fRecords
Definition: TTrigger.h:19