CMS 3D CMS Logo

List of all members | Public Member Functions
pat::helper::TriggerMatchHelper Class Reference

#include <TriggerHelper.h>

Public Member Functions

reco::CandidateBaseRefVector triggerMatchCandidates (const edm::Handle< TriggerObjectCollection > &trigCollHandle, const size_t iTrig, const std::string &labelMatcher, const edm::Event &event, const TriggerEvent &triggerEvent) const
 ... by matcher module label More...
 
reco::CandidateBaseRefVector triggerMatchCandidates (const edm::Handle< TriggerObjectCollection > &trigCollHandle, const size_t iTrig, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
 
reco::CandidateBaseRefVector triggerMatchCandidates (const pat::TriggerObjectRef &objectRef, const std::string &labelMatcher, const edm::Event &event, const TriggerEvent &triggerEvent) const
 ... by matcher module label More...
 
reco::CandidateBaseRefVector triggerMatchCandidates (const pat::TriggerObjectRef &objectRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
 
 TriggerMatchHelper ()
 Constructors and Destructor. More...
 
template<class C >
TriggerObjectRef triggerMatchObject (const edm::Handle< C > &candCollHandle, const size_t iCand, const std::string &labelMatcher, const edm::Event &event, const TriggerEvent &triggerEvent) const
 ... by matcher module label More...
 
template<class C >
TriggerObjectRef triggerMatchObject (const edm::Handle< C > &candCollHandle, const size_t iCand, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
 
TriggerObjectRef triggerMatchObject (const reco::CandidateBaseRef &candRef, const std::string &labelMatcher, const edm::Event &event, const TriggerEvent &triggerEvent) const
 ... by matcher module label More...
 
TriggerObjectRef triggerMatchObject (const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
 Methods. More...
 
template<class C >
TriggerObjectMatchMap triggerMatchObjects (const edm::Handle< C > &candCollHandle, const size_t iCand, const edm::Event &event, const TriggerEvent &triggerEvent) const
 Get a table of references to all trigger objects matched to a certain physics object given by a collection and index. More...
 
TriggerObjectMatchMap triggerMatchObjects (const reco::CandidateBaseRef &candRef, const edm::Event &event, const TriggerEvent &triggerEvent) const
 Get a table of references to all trigger objects matched to a certain physics object given by a reference. More...
 
 ~TriggerMatchHelper ()
 Destructor. More...
 

Detailed Description

Definition at line 32 of file TriggerHelper.h.

Constructor & Destructor Documentation

◆ TriggerMatchHelper()

pat::helper::TriggerMatchHelper::TriggerMatchHelper ( )
inline

Constructors and Destructor.

Default constructor

Definition at line 37 of file TriggerHelper.h.

37 {};

◆ ~TriggerMatchHelper()

pat::helper::TriggerMatchHelper::~TriggerMatchHelper ( )
inline

Destructor.

Definition at line 40 of file TriggerHelper.h.

40 {};

Member Function Documentation

◆ triggerMatchCandidates() [1/4]

reco::CandidateBaseRefVector TriggerMatchHelper::triggerMatchCandidates ( const edm::Handle< TriggerObjectCollection > &  trigCollHandle,
const size_t  iTrig,
const std::string &  labelMatcher,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

... by matcher module label

Definition at line 99 of file TriggerHelper.cc.

104  {
105  return triggerMatchCandidates(TriggerObjectRef(trigCollHandle, iTrig),
106  triggerEvent.triggerObjectMatchResult(labelMatcher),
107  event,
108  triggerEvent);
109 }

References event(), PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchCandidates().

◆ triggerMatchCandidates() [2/4]

reco::CandidateBaseRefVector TriggerMatchHelper::triggerMatchCandidates ( const edm::Handle< TriggerObjectCollection > &  trigCollHandle,
const size_t  iTrig,
const TriggerObjectMatch matchResult,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

Get a vector of references to the phyics objects matched to a certain trigger object given by a collection and index for a certain matcher module ... by resulting association

Definition at line 89 of file TriggerHelper.cc.

94  {
95  return triggerMatchCandidates(TriggerObjectRef(trigCollHandle, iTrig), matchResult, event, triggerEvent);
96 }

References PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchCandidates().

◆ triggerMatchCandidates() [3/4]

reco::CandidateBaseRefVector TriggerMatchHelper::triggerMatchCandidates ( const pat::TriggerObjectRef objectRef,
const std::string &  labelMatcher,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

... by matcher module label

Definition at line 79 of file TriggerHelper.cc.

82  {
83  return triggerMatchCandidates(objectRef, triggerEvent.triggerObjectMatchResult(labelMatcher), event, triggerEvent);
84 }

References event(), PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchCandidates().

◆ triggerMatchCandidates() [4/4]

reco::CandidateBaseRefVector TriggerMatchHelper::triggerMatchCandidates ( const pat::TriggerObjectRef objectRef,
const TriggerObjectMatch matchResult,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

Get a vector of references to the phyics objects matched to a certain trigger object given by a reference for a certain matcher module ... by resulting association

Definition at line 58 of file TriggerHelper.cc.

61  {
63  if (matchResult) {
64  auto it = edm::makeAssociativeIterator<reco::CandidateBaseRef>(*matchResult, event);
65  auto itEnd = it.end();
66  while (it != itEnd) {
67  if (it->first.isNonnull() && it->second.isNonnull() && it->second.isAvailable()) {
68  if (it->second == objectRef) {
69  theCands.push_back(it->first);
70  }
71  }
72  ++it;
73  }
74  }
75  return theCands;
76 }

References edm::RefToBaseVector< T >::push_back().

Referenced by triggerMatchCandidates().

◆ triggerMatchObject() [1/4]

template<class C >
TriggerObjectRef pat::helper::TriggerMatchHelper::triggerMatchObject ( const edm::Handle< C > &  candCollHandle,
const size_t  iCand,
const std::string &  labelMatcher,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

... by matcher module label

Definition at line 119 of file TriggerHelper.h.

123  {
124  return triggerMatchObject(
125  candCollHandle, iCand, triggerEvent.triggerObjectMatchResult(labelMatcher), event, triggerEvent);
126  }

References event(), PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchObject().

◆ triggerMatchObject() [2/4]

template<class C >
TriggerObjectRef pat::helper::TriggerMatchHelper::triggerMatchObject ( const edm::Handle< C > &  candCollHandle,
const size_t  iCand,
const TriggerObjectMatch matchResult,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

Get a reference to the trigger objects matched to a certain physics object given by a collection and index for a certain matcher module ... by resulting association

Definition at line 110 of file TriggerHelper.h.

114  {
115  const reco::CandidateBaseRef candRef(edm::Ref<C>(candCollHandle, iCand));
116  return triggerMatchObject(candRef, matchResult, event, triggerEvent);
117  }

References PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchObject().

◆ triggerMatchObject() [3/4]

TriggerObjectRef TriggerMatchHelper::triggerMatchObject ( const reco::CandidateBaseRef candRef,
const std::string &  labelMatcher,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

... by matcher module label

Definition at line 36 of file TriggerHelper.cc.

39  {
40  return triggerMatchObject(candRef, triggerEvent.triggerObjectMatchResult(labelMatcher), event, triggerEvent);
41 }

References event(), PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchObject().

◆ triggerMatchObject() [4/4]

TriggerObjectRef TriggerMatchHelper::triggerMatchObject ( const reco::CandidateBaseRef candRef,
const TriggerObjectMatch matchResult,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

Methods.

Get a reference to the trigger objects matched to a certain physics object given by a reference for a certain matcher module ... by resulting association

Definition at line 16 of file TriggerHelper.cc.

19  {
20  if (matchResult) {
21  auto it = edm::makeAssociativeIterator<reco::CandidateBaseRef>(*matchResult, event);
22  auto itEnd = it.end();
23  while (it != itEnd) {
24  if (it->first.isNonnull() && it->second.isNonnull() && it->second.isAvailable()) {
25  if (it->first.id() == candRef.id() && it->first.key() == candRef.key()) {
26  return TriggerObjectRef(it->second);
27  }
28  }
29  ++it;
30  }
31  }
32  return TriggerObjectRef();
33 }

References edm::RefToBase< T >::id(), and edm::RefToBase< T >::key().

Referenced by PatTriggerTagAndProbe::analyze(), triggerMatchObject(), and triggerMatchObjects().

◆ triggerMatchObjects() [1/2]

template<class C >
TriggerObjectMatchMap pat::helper::TriggerMatchHelper::triggerMatchObjects ( const edm::Handle< C > &  candCollHandle,
const size_t  iCand,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

Get a table of references to all trigger objects matched to a certain physics object given by a collection and index.

Definition at line 130 of file TriggerHelper.h.

133  {
134  const reco::CandidateBaseRef candRef(edm::Ref<C>(candCollHandle, iCand));
135  return triggerMatchObjects(candRef, event, triggerEvent);
136  }

References PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchObjects().

◆ triggerMatchObjects() [2/2]

TriggerObjectMatchMap TriggerMatchHelper::triggerMatchObjects ( const reco::CandidateBaseRef candRef,
const edm::Event event,
const TriggerEvent triggerEvent 
) const

Get a table of references to all trigger objects matched to a certain physics object given by a reference.

Definition at line 44 of file TriggerHelper.cc.

46  {
47  TriggerObjectMatchMap theContainer;
48  const std::vector<std::string> matchers(triggerEvent.triggerMatchers());
49  for (size_t iMatch = 0; iMatch < matchers.size(); ++iMatch) {
50  theContainer[matchers.at(iMatch)] = triggerMatchObject(candRef, matchers.at(iMatch), event, triggerEvent);
51  }
52  return theContainer;
53 }

References event(), PDWG_DiPhoton_SD_cff::triggerEvent, and triggerMatchObject().

Referenced by triggerMatchObjects().

edm::RefToBase::key
size_t key() const
Definition: RefToBase.h:219
edm::Ref
Definition: AssociativeIterator.h:58
edm::RefToBaseVector::push_back
void push_back(const RefToBase< T > &)
Definition: RefToBaseVector.h:217
pat::helper::TriggerMatchHelper::triggerMatchCandidates
reco::CandidateBaseRefVector triggerMatchCandidates(const pat::TriggerObjectRef &objectRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
Definition: TriggerHelper.cc:58
pat::TriggerObjectMatchMap
std::map< std::string, TriggerObjectRef > TriggerObjectMatchMap
Container to store match references from different producers (for one PAT object)
Definition: TriggerObject.h:177
PDWG_DiPhoton_SD_cff.triggerEvent
triggerEvent
Definition: PDWG_DiPhoton_SD_cff.py:39
edm::RefToBaseVector
Definition: EDProductfwd.h:29
edm::RefToBase::id
ProductID id() const
Definition: RefToBase.h:214
pat::helper::TriggerMatchHelper::triggerMatchObjects
TriggerObjectMatchMap triggerMatchObjects(const reco::CandidateBaseRef &candRef, const edm::Event &event, const TriggerEvent &triggerEvent) const
Get a table of references to all trigger objects matched to a certain physics object given by a refer...
Definition: TriggerHelper.cc:44
edm::RefToBase< Candidate >
pat::helper::TriggerMatchHelper::triggerMatchObject
TriggerObjectRef triggerMatchObject(const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
Methods.
Definition: TriggerHelper.cc:16
event
Definition: event.py:1
pat::TriggerObjectRef
edm::Ref< TriggerObjectCollection > TriggerObjectRef
Persistent reference to an item in a TriggerObjectCollection.
Definition: TriggerObject.h:175
event
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of "!*" before the partial wildcard feature was incorporated). The per-event "cost" of each negative criterion with multiple relevant triggers is about the same as ! *was in the past