CMS 3D CMS Logo

Public Member Functions

pat::helper::TriggerMatchHelper Class Reference

#include <TriggerHelper.h>

List of all members.

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
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
 TriggerMatchHelper ()
 Constructors and Destructor.
TriggerObjectRef triggerMatchObject (const reco::CandidateBaseRef &candRef, const std::string &labelMatcher, const edm::Event &event, const TriggerEvent &triggerEvent) const
 ... by matcher module label
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
TriggerObjectRef triggerMatchObject (const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
 Methods.
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 >
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.
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.
 ~TriggerMatchHelper ()
 Destructor.

Detailed Description

Definition at line 36 of file TriggerHelper.h.


Constructor & Destructor Documentation

pat::helper::TriggerMatchHelper::TriggerMatchHelper ( ) [inline]

Constructors and Destructor.

Default constructor

Definition at line 43 of file TriggerHelper.h.

{};
pat::helper::TriggerMatchHelper::~TriggerMatchHelper ( ) [inline]

Destructor.

Definition at line 46 of file TriggerHelper.h.

{};

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

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

{
  reco::CandidateBaseRefVector theCands;
  if ( matchResult ) {
    edm::AssociativeIterator< reco::CandidateBaseRef, TriggerObjectMatch > it( *matchResult, edm::EdmEventItemGetter< reco::CandidateBaseRef >( event ) ), itEnd( it.end() );
    while ( it != itEnd ) {
      if ( it->first.isNonnull() && it->second.isNonnull() && it->second.isAvailable() ) {
        if ( it->second == objectRef ) {
          theCands.push_back( it->first );
        }
      }
      ++it;
    }
  }
  return theCands;
}
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 78 of file TriggerHelper.cc.

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

{
  return triggerMatchCandidates( objectRef, triggerEvent.triggerObjectMatchResult( labelMatcher ), event, triggerEvent );
}
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 87 of file TriggerHelper.cc.

{
  return triggerMatchCandidates( TriggerObjectRef( trigCollHandle, iTrig ), matchResult, event, triggerEvent );
}
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 93 of file TriggerHelper.cc.

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

{
  return triggerMatchCandidates( TriggerObjectRef( trigCollHandle, iTrig ), triggerEvent.triggerObjectMatchResult( labelMatcher ), event, triggerEvent );
}
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 80 of file TriggerHelper.h.

References triggerMatchObject().

    {
      const reco::CandidateBaseRef candRef( edm::Ref< C >( candCollHandle, iCand ) );
      return triggerMatchObject( candRef, matchResult, event, triggerEvent );
    }
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 85 of file TriggerHelper.h.

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

    {
      return triggerMatchObject( candCollHandle, iCand, triggerEvent.triggerObjectMatchResult( labelMatcher ), event, triggerEvent );
    }
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 39 of file TriggerHelper.cc.

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

{
  return triggerMatchObject( candRef, triggerEvent.triggerObjectMatchResult( labelMatcher ), event, triggerEvent );
}
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 22 of file TriggerHelper.cc.

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

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

{
  if ( matchResult ) {
    edm::AssociativeIterator< reco::CandidateBaseRef, TriggerObjectMatch > it( *matchResult, edm::EdmEventItemGetter< reco::CandidateBaseRef >( event ) ), itEnd( it.end() );
    while ( it != itEnd ) {
      if ( it->first.isNonnull() && it->second.isNonnull() && it->second.isAvailable() ) {
        if ( it->first.id() == candRef.id() && it->first.key() == candRef.key() ) {
          return TriggerObjectRef( it->second );
        }
      }
      ++it;
    }
  }
  return TriggerObjectRef();
}
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 46 of file TriggerHelper.cc.

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

Referenced by triggerMatchObjects().

{
  TriggerObjectMatchMap theContainer;
  const std::vector< std::string > matchers( triggerEvent.triggerMatchers() );
  for ( size_t iMatch = 0; iMatch < matchers.size(); ++iMatch ) {
    theContainer[ matchers.at( iMatch ) ] = triggerMatchObject( candRef, matchers.at( iMatch ), event, triggerEvent );
  }
  return theContainer;
}
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 91 of file TriggerHelper.h.

References triggerMatchObjects().

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