CMS 3D CMS Logo

List of all members | Static Public Member Functions
ZCountingTrigger::TriggerTools Class Reference

#include <TriggerTools.h>

Static Public Member Functions

static TriggerObjects matchHLT (const double eta, const double phi, const std::vector< TriggerRecord > &triggerRecords, const trigger::TriggerEvent &triggerEvent)
 

Detailed Description

Definition at line 11 of file TriggerTools.h.

Member Function Documentation

◆ matchHLT()

TriggerObjects TriggerTools::matchHLT ( const double  eta,
const double  phi,
const std::vector< TriggerRecord > &  triggerRecords,
const trigger::TriggerEvent triggerEvent 
)
static

Definition at line 9 of file TriggerTools.cc.

12  {
13  const double dRMax = 0.2;
14 
15  TriggerObjects matchBits;
16  for (unsigned int irec = 0; irec < triggerRecords.size(); irec++) {
17  for (unsigned int iobj = 0; iobj < triggerRecords[irec].objectMap.size(); iobj++) {
18  const std::string& filterName = triggerRecords[irec].objectMap[iobj].first;
19  const unsigned int filterBit = triggerRecords[irec].objectMap[iobj].second;
20 
21  edm::InputTag filterTag(filterName, "", "HLT");
22  // filterIndex must be less than the size of trgEvent or you get a CMSException: _M_range_check
23  if (triggerEvent.filterIndex(filterTag) < triggerEvent.sizeFilters()) {
24  const trigger::TriggerObjectCollection& toc(triggerEvent.getObjects());
25  const trigger::Keys& keys(triggerEvent.filterKeys(triggerEvent.filterIndex(filterTag)));
26 
27  for (unsigned int hlto = 0; hlto < keys.size(); hlto++) {
28  trigger::size_type hltf = keys[hlto];
29  const trigger::TriggerObject& tobj(toc[hltf]);
30  if (reco::deltaR(eta, phi, tobj.eta(), tobj.phi()) < dRMax) {
31  matchBits[filterBit] = true;
32  }
33  }
34  }
35  }
36  }
37 
38  return matchBits;
39 }

References reco::deltaR(), metBenchmark_cfi::dRMax, trigger::TriggerObject::eta(), PVValHelper::eta, pdwgDoubleElectron_cfi::filterName, relativeConstraints::keys, trigger::TriggerObject::phi(), AlCaHLTBitMon_QueryRunRegistry::string, and PDWG_DiPhoton_SD_cff::triggerEvent.

relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
PVValHelper::eta
Definition: PVValidationHelpers.h:70
trigger::TriggerObject
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
TriggerObjects
std::bitset< kNTrigObjectBit > TriggerObjects
Definition: TriggerDefs.h:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
trigger::TriggerObjectCollection
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
Definition: TriggerObject.h:75
trigger::Keys
std::vector< size_type > Keys
Definition: TriggerTypeDefs.h:19
PDWG_DiPhoton_SD_cff.triggerEvent
triggerEvent
Definition: PDWG_DiPhoton_SD_cff.py:39
pdwgDoubleElectron_cfi.filterName
filterName
Definition: pdwgDoubleElectron_cfi.py:7
DDAxes::phi
metBenchmark_cfi.dRMax
dRMax
Definition: metBenchmark_cfi.py:18
reco::deltaR
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
edm::InputTag
Definition: InputTag.h:15