CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerHelper.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_PatUtils_TriggerHelper_h
2 #define PhysicsTools_PatUtils_TriggerHelper_h
3 
4 
5 // -*- C++ -*-
6 //
7 // Package: PatUtils
8 // Class: pat::helper::TriggerHelper
9 //
10 // $Id: TriggerHelper.h,v 1.7 2011/04/05 19:41:33 vadler Exp $
11 //
25 #include <string>
26 
30 
31 
32 namespace pat {
33 
34  namespace helper {
35 
37 
38  public:
39 
41 
44 
47 
49 
52  TriggerObjectRef triggerMatchObject( const reco::CandidateBaseRef & candRef, const TriggerObjectMatch * matchResult, const edm::Event & event, const TriggerEvent & triggerEvent ) const;
54  TriggerObjectRef triggerMatchObject( const reco::CandidateBaseRef & candRef, const std::string & labelMatcher , const edm::Event & event, const TriggerEvent & triggerEvent ) const;
57  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;
59  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;
61  TriggerObjectMatchMap triggerMatchObjects( const reco::CandidateBaseRef & candRef, const edm::Event & event, const TriggerEvent & triggerEvent ) const;
63  template< class C > TriggerObjectMatchMap triggerMatchObjects( const edm::Handle< C > & candCollHandle, const size_t iCand, const edm::Event & event, const TriggerEvent & triggerEvent ) const;
66  reco::CandidateBaseRefVector triggerMatchCandidates( const pat::TriggerObjectRef & objectRef, const TriggerObjectMatch * matchResult, const edm::Event & event, const TriggerEvent & triggerEvent ) const;
68  reco::CandidateBaseRefVector triggerMatchCandidates( const pat::TriggerObjectRef & objectRef, const std::string & labelMatcher , const edm::Event & event, const TriggerEvent & triggerEvent ) const;
71  reco::CandidateBaseRefVector triggerMatchCandidates( const edm::Handle< TriggerObjectCollection > & trigCollHandle, const size_t iTrig, const TriggerObjectMatch * matchResult, const edm::Event & event, const TriggerEvent & triggerEvent ) const;
73  reco::CandidateBaseRefVector triggerMatchCandidates( const edm::Handle< TriggerObjectCollection > & trigCollHandle, const size_t iTrig, const std::string & labelMatcher , const edm::Event & event, const TriggerEvent & triggerEvent ) const;
74 
75  };
76 
77  // Method Templates
78 
79  // Get a reference to the trigger objects matched to a certain physics object given by a collection and index for a certain matcher module
80  template< class C > TriggerObjectRef TriggerMatchHelper::triggerMatchObject( const edm::Handle< C > & candCollHandle, const size_t iCand, const TriggerObjectMatch * matchResult, const edm::Event & event, const TriggerEvent & triggerEvent ) const
81  {
82  const reco::CandidateBaseRef candRef( edm::Ref< C >( candCollHandle, iCand ) );
83  return triggerMatchObject( candRef, matchResult, event, triggerEvent );
84  }
85  template< class C > TriggerObjectRef TriggerMatchHelper::triggerMatchObject( const edm::Handle< C > & candCollHandle, const size_t iCand, const std::string & labelMatcher, const edm::Event & event, const TriggerEvent & triggerEvent ) const
86  {
87  return triggerMatchObject( candCollHandle, iCand, triggerEvent.triggerObjectMatchResult( labelMatcher ), event, triggerEvent );
88  }
89 
90  // Get a table of references to all trigger objects matched to a certain physics object given by a collection and index
91  template< class C > TriggerObjectMatchMap TriggerMatchHelper::triggerMatchObjects( const edm::Handle< C > & candCollHandle, const size_t iCand, const edm::Event & event, const TriggerEvent & triggerEvent ) const
92  {
93  const reco::CandidateBaseRef candRef( edm::Ref< C >( candCollHandle, iCand ) );
94  return triggerMatchObjects( candRef, event, triggerEvent );
95  }
96 
97  }
98 
99 }
100 
101 
102 #endif
TriggerObjectRef triggerMatchObject(const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
Methods.
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...
std::map< std::string, TriggerObjectRef > TriggerObjectMatchMap
Container to store match references from different producers (for one PAT object) ...
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
Analysis-level trigger event class.
Definition: TriggerEvent.h:44
TriggerMatchHelper()
Constructors and Destructor.
Definition: TriggerHelper.h:43
reco::CandidateBaseRefVector triggerMatchCandidates(const pat::TriggerObjectRef &objectRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const