CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
pat::helper::TriggerMatchHelper Class Reference

#include <TriggerHelper.h>

Public Member Functions

reco::CandidateBaseRefVector triggerMatchCandidates (const pat::TriggerObjectRef &objectRef, 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 edm::Handle< TriggerObjectCollection > &trigCollHandle, const size_t iTrig, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
 
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...
 
 TriggerMatchHelper ()
 Constructors and Destructor. More...
 
TriggerObjectRef triggerMatchObject (const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
 Methods. More...
 
TriggerObjectRef triggerMatchObject (const reco::CandidateBaseRef &candRef, 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
 
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...
 
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...
 
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...
 
 ~TriggerMatchHelper ()
 Destructor. More...
 

Detailed Description

Definition at line 35 of file TriggerHelper.h.

Constructor & Destructor Documentation

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

Constructors and Destructor.

Default constructor

Definition at line 42 of file TriggerHelper.h.

42 {};
pat::helper::TriggerMatchHelper::~TriggerMatchHelper ( )
inline

Destructor.

Definition at line 45 of file TriggerHelper.h.

45 {};

Member Function Documentation

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 59 of file TriggerHelper.cc.

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

60 {
62  if ( matchResult ) {
64  while ( it != itEnd ) {
65  if ( it->first.isNonnull() && it->second.isNonnull() && it->second.isAvailable() ) {
66  if ( it->second == objectRef ) {
67  theCands.push_back( it->first );
68  }
69  }
70  ++it;
71  }
72  }
73  return theCands;
74 }
Helper class that fetches some type of Ref given ProductID and index, using the edm::Event.
void push_back(const RefToBase< T > &)
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 77 of file TriggerHelper.cc.

References event(), and pat::TriggerEvent::triggerObjectMatchResult().

78 {
79  return triggerMatchCandidates( objectRef, triggerEvent.triggerObjectMatchResult( labelMatcher ), event, triggerEvent );
80 }
const TriggerObjectMatch * triggerObjectMatchResult(const std::string &labelMatcher) const
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
reco::CandidateBaseRefVector triggerMatchCandidates(const pat::TriggerObjectRef &objectRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
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 86 of file TriggerHelper.cc.

87 {
88  return triggerMatchCandidates( TriggerObjectRef( trigCollHandle, iTrig ), matchResult, event, triggerEvent );
89 }
edm::Ref< TriggerObjectCollection > TriggerObjectRef
Persistent reference to an item in a TriggerObjectCollection.
reco::CandidateBaseRefVector triggerMatchCandidates(const pat::TriggerObjectRef &objectRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
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 92 of file TriggerHelper.cc.

References event(), and pat::TriggerEvent::triggerObjectMatchResult().

93 {
94  return triggerMatchCandidates( TriggerObjectRef( trigCollHandle, iTrig ), triggerEvent.triggerObjectMatchResult( labelMatcher ), event, triggerEvent );
95 }
edm::Ref< TriggerObjectCollection > TriggerObjectRef
Persistent reference to an item in a TriggerObjectCollection.
const TriggerObjectMatch * triggerObjectMatchResult(const std::string &labelMatcher) const
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
reco::CandidateBaseRefVector triggerMatchCandidates(const pat::TriggerObjectRef &objectRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
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 21 of file TriggerHelper.cc.

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

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

22 {
23  if ( matchResult ) {
25  while ( it != itEnd ) {
26  if ( it->first.isNonnull() && it->second.isNonnull() && it->second.isAvailable() ) {
27  if ( it->first.id() == candRef.id() && it->first.key() == candRef.key() ) {
28  return TriggerObjectRef( it->second );
29  }
30  }
31  ++it;
32  }
33  }
34  return TriggerObjectRef();
35 }
ProductID id() const
Definition: RefToBase.h:242
size_t key() const
Definition: RefToBase.h:250
Helper class that fetches some type of Ref given ProductID and index, using the edm::Event.
edm::Ref< TriggerObjectCollection > TriggerObjectRef
Persistent reference to an item in a TriggerObjectCollection.
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 38 of file TriggerHelper.cc.

References event(), and pat::TriggerEvent::triggerObjectMatchResult().

39 {
40  return triggerMatchObject( candRef, triggerEvent.triggerObjectMatchResult( labelMatcher ), event, triggerEvent );
41 }
TriggerObjectRef triggerMatchObject(const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
Methods.
const TriggerObjectMatch * triggerObjectMatchResult(const std::string &labelMatcher) const
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
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 79 of file TriggerHelper.h.

References triggerMatchObject().

80  {
81  const reco::CandidateBaseRef candRef( edm::Ref< C >( candCollHandle, iCand ) );
82  return triggerMatchObject( candRef, matchResult, event, triggerEvent );
83  }
TriggerObjectRef triggerMatchObject(const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
Methods.
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 84 of file TriggerHelper.h.

References event(), triggerMatchObject(), and pat::TriggerEvent::triggerObjectMatchResult().

85  {
86  return triggerMatchObject( candCollHandle, iCand, triggerEvent.triggerObjectMatchResult( labelMatcher ), event, triggerEvent );
87  }
TriggerObjectRef triggerMatchObject(const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
Methods.
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
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 45 of file TriggerHelper.cc.

References event(), and pat::TriggerEvent::triggerMatchers().

Referenced by triggerMatchObjects().

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 }
TriggerObjectRef triggerMatchObject(const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
Methods.
std::vector< std::string > triggerMatchers() const
Get a list of all linked trigger matches.
std::map< std::string, TriggerObjectRef > TriggerObjectMatchMap
Container to store match references from different producers (for one PAT object) ...
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
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 90 of file TriggerHelper.h.

References triggerMatchObjects().

91  {
92  const reco::CandidateBaseRef candRef( edm::Ref< C >( candCollHandle, iCand ) );
93  return triggerMatchObjects( candRef, event, triggerEvent );
94  }
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...