CMS 3D CMS Logo

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

Analysis-level HLTrigger path class. More...

#include "DataFormats/PatCandidates/interface/TriggerPath.h"

Public Member Functions

std::vector< std::string > acceptedL1Seeds () const
 Get names of all succeeding L1 seeds. More...
 
void addFilterIndex (const unsigned index)
 Add a new trigger fillter collection index. More...
 
void addL1Seed (const L1Seed &seed)
 Add a new L1 seed. More...
 
void addL1Seed (bool decision, const std::string &expression)
 
void addModule (const std::string &name)
 Add a new module label. More...
 
std::vector< std::string > failedL1Seeds () const
 Get names of all failing L1 seeds. More...
 
const std::vector< unsigned > & filterIndices () const
 Get all trigger fillter collection indeces. More...
 
unsigned index () const
 Get the path index. More...
 
int indexModule (const std::string &name) const
 
const L1SeedCollectionl1Seeds () const
 Get all L1 seeds. More...
 
std::vector< std::string > l1Seeds (const bool decision) const
 Get names of all L1 seeds with a certain decision. More...
 
unsigned l3Filters () const
 
unsigned lastActiveFilterSlot () const
 Get the index of the last active filter. More...
 
const std::vector< std::string > & modules () const
 Get all module labels. More...
 
const std::string & name () const
 Get the path name. More...
 
unsigned prescale () const
 Get the path pre-scale. More...
 
void setAccept (bool accept)
 Set the success flag. More...
 
void setError (bool error)
 Set the error flag. More...
 
void setIndex (unsigned index)
 Set the path index. More...
 
void setL3Filters (unsigned l3Filters)
 Set the number of modules identified as L3 filter. More...
 
void setLastActiveFilterSlot (unsigned lastActiveFilterSlot)
 Set the index of the last active filter. More...
 
void setName (const std::string &name)
 Methods. More...
 
void setPrescale (unsigned prescale)
 Set the path pre-scale. More...
 
void setRun (bool run)
 Set the run flag. More...
 
 TriggerPath ()
 Constructors and Desctructor. More...
 
 TriggerPath (const std::string &name)
 Constructor from path name only. More...
 
 TriggerPath (const std::string &name, unsigned index, unsigned prescale, bool run, bool accept, bool error, unsigned lastActiveFilterSlot, unsigned l3Filters=0)
 Constructor from values. More...
 
bool wasAccept () const
 Get the success flag. More...
 
bool wasError () const
 Get the error flag. More...
 
bool wasRun () const
 Get the run flag. More...
 
bool xTrigger () const
 
virtual ~TriggerPath ()
 Destructor. More...
 

Private Attributes

bool accept_
 Did path succeed? More...
 
bool error_
 Was path in error? More...
 
std::vector< unsigned > filterIndices_
 
unsigned index_
 Path index in trigger table. More...
 
L1SeedCollection l1Seeds_
 List of L1 seeds and their decisions. More...
 
unsigned l3Filters_
 
unsigned lastActiveFilterSlot_
 Index of the last active filter in the list of modules. More...
 
std::vector< std::string > modules_
 
std::string name_
 Data Members. More...
 
unsigned prescale_
 Pre-scale. More...
 
bool run_
 Was path run? More...
 

Detailed Description

Analysis-level HLTrigger path class.

TriggerPath implements a container for trigger paths' information within the 'pat' namespace. For detailed information, consult https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATTrigger#TriggerPath

Author
Volker Adler

Definition at line 39 of file TriggerPath.h.

Constructor & Destructor Documentation

TriggerPath::TriggerPath ( )

Constructors and Desctructor.

Default constructor

Definition at line 15 of file TriggerPath.cc.

References filterIndices_, and modules_.

15  :
16  name_(),
17  index_(),
18  prescale_(),
19  run_(),
20  accept_(),
21  error_(),
23  l3Filters_( 0 )
24 {
25  modules_.clear();
26  filterIndices_.clear();
27 }
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:48
bool accept_
Did path succeed?
Definition: TriggerPath.h:52
bool run_
Was path run?
Definition: TriggerPath.h:50
std::vector< std::string > modules_
Definition: TriggerPath.h:59
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:64
std::string name_
Data Members.
Definition: TriggerPath.h:44
unsigned l3Filters_
Definition: TriggerPath.h:69
bool error_
Was path in error?
Definition: TriggerPath.h:54
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:66
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:46
TriggerPath::TriggerPath ( const std::string &  name)

Constructor from path name only.

Definition at line 31 of file TriggerPath.cc.

References filterIndices_, and modules_.

31  :
32  name_( name ),
33  index_(),
34  prescale_(),
35  run_(),
36  accept_(),
37  error_(),
39  l3Filters_( 0 )
40 {
41  modules_.clear();
42  filterIndices_.clear();
43 }
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:48
bool accept_
Did path succeed?
Definition: TriggerPath.h:52
bool run_
Was path run?
Definition: TriggerPath.h:50
std::vector< std::string > modules_
Definition: TriggerPath.h:59
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:64
std::string name_
Data Members.
Definition: TriggerPath.h:44
unsigned l3Filters_
Definition: TriggerPath.h:69
bool error_
Was path in error?
Definition: TriggerPath.h:54
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:113
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:66
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:46
TriggerPath::TriggerPath ( const std::string &  name,
unsigned  index,
unsigned  prescale,
bool  run,
bool  accept,
bool  error,
unsigned  lastActiveFilterSlot,
unsigned  l3Filters = 0 
)

Constructor from values.

Definition at line 47 of file TriggerPath.cc.

References filterIndices_, and modules_.

47  :
48  name_( name ),
49  index_( index ),
51  run_( run ),
52  accept_( accept ),
53  error_( error ),
56 {
57  modules_.clear();
58  filterIndices_.clear();
59 }
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:48
bool accept_
Did path succeed?
Definition: TriggerPath.h:52
bool run_
Was path run?
Definition: TriggerPath.h:50
std::vector< std::string > modules_
Definition: TriggerPath.h:59
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:64
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:26
std::string name_
Data Members.
Definition: TriggerPath.h:44
unsigned l3Filters_
Definition: TriggerPath.h:69
unsigned prescale() const
Get the path pre-scale.
Definition: TriggerPath.h:117
unsigned l3Filters() const
Definition: TriggerPath.h:128
bool error_
Was path in error?
Definition: TriggerPath.h:54
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:113
unsigned index() const
Get the path index.
Definition: TriggerPath.h:115
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:66
unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:125
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:46
virtual pat::TriggerPath::~TriggerPath ( )
inlinevirtual

Destructor.

Definition at line 85 of file TriggerPath.h.

85 {};

Member Function Documentation

std::vector< std::string > pat::TriggerPath::acceptedL1Seeds ( ) const
inline

Get names of all succeeding L1 seeds.

Definition at line 145 of file TriggerPath.h.

References l1Seeds().

145 { return l1Seeds( true ); };
const L1SeedCollection & l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:141
void pat::TriggerPath::addFilterIndex ( const unsigned  index)
inline

Add a new trigger fillter collection index.

Definition at line 108 of file TriggerPath.h.

References filterIndices_.

108 { filterIndices_.push_back( index ); };
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:64
unsigned index() const
Get the path index.
Definition: TriggerPath.h:115
void pat::TriggerPath::addL1Seed ( const L1Seed seed)
inline

Add a new L1 seed.

Definition at line 110 of file TriggerPath.h.

References l1Seeds_.

110 { l1Seeds_.push_back( seed ); };
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:71
void pat::TriggerPath::addL1Seed ( bool  decision,
const std::string &  expression 
)
inline

Definition at line 111 of file TriggerPath.h.

References l1Seeds_.

111 { l1Seeds_.push_back( L1Seed( decision, expression ) ); };
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:71
std::pair< bool, std::string > L1Seed
Pair to store decision and name of L1 seeds.
Definition: TriggerPath.h:35
void pat::TriggerPath::addModule ( const std::string &  name)
inline

Add a new module label.

Definition at line 106 of file TriggerPath.h.

References modules_.

106 { modules_.push_back( name ); };
std::vector< std::string > modules_
Definition: TriggerPath.h:59
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:113
std::vector< std::string > pat::TriggerPath::failedL1Seeds ( ) const
inline

Get names of all failing L1 seeds.

Definition at line 147 of file TriggerPath.h.

References l1Seeds().

147 { return l1Seeds( false ); };
const L1SeedCollection & l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:141
const std::vector< unsigned >& pat::TriggerPath::filterIndices ( ) const
inline

Get all trigger fillter collection indeces.

Definition at line 135 of file TriggerPath.h.

References filterIndices_.

135 { return filterIndices_; };
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:64
unsigned pat::TriggerPath::index ( ) const
inline

Get the path index.

Definition at line 115 of file TriggerPath.h.

References index_.

Referenced by BeautifulSoup.PageElement::_invert(), and setIndex().

115 { return index_; };
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:46
int TriggerPath::indexModule ( const std::string &  name) const

Get the index of a certain module; returns size of 'modules_' ( modules().size() ) if name is unknown and -1 if list of modules is not filled

Definition at line 66 of file TriggerPath.cc.

References spr::find(), modules_, and name().

67 {
68  if ( modules_.begin() == modules_.end() ) return -1;
69  return ( std::find( modules_.begin(), modules_.end(), name ) - modules_.begin() );
70 }
std::vector< std::string > modules_
Definition: TriggerPath.h:59
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:113
const L1SeedCollection& pat::TriggerPath::l1Seeds ( ) const
inline

Get all L1 seeds.

Definition at line 141 of file TriggerPath.h.

References l1Seeds_.

Referenced by acceptedL1Seeds(), failedL1Seeds(), and l1Seeds().

141 { return l1Seeds_; };
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:71
std::vector< std::string > TriggerPath::l1Seeds ( const bool  decision) const

Get names of all L1 seeds with a certain decision.

Definition at line 74 of file TriggerPath.cc.

References begin, and l1Seeds().

75 {
76 
77  std::vector< std::string > seeds;
78  for ( L1SeedCollection::const_iterator iSeed = l1Seeds().begin(); iSeed != l1Seeds().end(); ++iSeed ) {
79  if ( iSeed->first == decision ) seeds.push_back( iSeed->second );
80  }
81  return seeds;
82 
83 }
const L1SeedCollection & l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:141
#define begin
Definition: vmac.h:30
unsigned pat::TriggerPath::l3Filters ( ) const
inline

Get the number of modules identified as L3 filter available starting from CMSSW_4_2_3

Definition at line 128 of file TriggerPath.h.

References l3Filters_.

Referenced by setL3Filters().

128 { return l3Filters_; };
unsigned l3Filters_
Definition: TriggerPath.h:69
unsigned pat::TriggerPath::lastActiveFilterSlot ( ) const
inline

Get the index of the last active filter.

Definition at line 125 of file TriggerPath.h.

References lastActiveFilterSlot_.

Referenced by setLastActiveFilterSlot().

125 { return lastActiveFilterSlot_; };
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:66
const std::vector< std::string >& pat::TriggerPath::modules ( ) const
inline

Get all module labels.

Definition at line 133 of file TriggerPath.h.

References modules_.

133 { return modules_; };
std::vector< std::string > modules_
Definition: TriggerPath.h:59
const std::string& pat::TriggerPath::name ( ) const
inline
unsigned pat::TriggerPath::prescale ( ) const
inline

Get the path pre-scale.

Definition at line 117 of file TriggerPath.h.

References prescale_.

Referenced by setPrescale().

117 { return prescale_; };
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:48
void pat::TriggerPath::setAccept ( bool  accept)
inline

Set the success flag.

Definition at line 98 of file TriggerPath.h.

References accept(), and accept_.

98 { accept_ = accept; };
bool accept_
Did path succeed?
Definition: TriggerPath.h:52
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:26
void pat::TriggerPath::setError ( bool  error)
inline

Set the error flag.

Definition at line 100 of file TriggerPath.h.

References relativeConstraints::error, and error_.

100 { error_ = error; };
bool error_
Was path in error?
Definition: TriggerPath.h:54
void pat::TriggerPath::setIndex ( unsigned  index)
inline

Set the path index.

Definition at line 92 of file TriggerPath.h.

References index(), and index_.

92 { index_ = index; };
unsigned index() const
Get the path index.
Definition: TriggerPath.h:115
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:46
void pat::TriggerPath::setL3Filters ( unsigned  l3Filters)
inline

Set the number of modules identified as L3 filter.

Definition at line 104 of file TriggerPath.h.

References l3Filters(), and l3Filters_.

104 { l3Filters_ = l3Filters; };
unsigned l3Filters_
Definition: TriggerPath.h:69
unsigned l3Filters() const
Definition: TriggerPath.h:128
void pat::TriggerPath::setLastActiveFilterSlot ( unsigned  lastActiveFilterSlot)
inline

Set the index of the last active filter.

Definition at line 102 of file TriggerPath.h.

References lastActiveFilterSlot(), and lastActiveFilterSlot_.

unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:66
unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:125
void pat::TriggerPath::setName ( const std::string &  name)
inline

Methods.

Set the path name

Definition at line 90 of file TriggerPath.h.

References name(), and name_.

Referenced by Vispa.Gui.PortWidget.PortWidget::__init__(), and Vispa.Views.PropertyView.Property::__init__().

90 { name_ = name; };
std::string name_
Data Members.
Definition: TriggerPath.h:44
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:113
void pat::TriggerPath::setPrescale ( unsigned  prescale)
inline

Set the path pre-scale.

Definition at line 94 of file TriggerPath.h.

References prescale(), and prescale_.

94 { prescale_ = prescale; };
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:48
unsigned prescale() const
Get the path pre-scale.
Definition: TriggerPath.h:117
void pat::TriggerPath::setRun ( bool  run)
inline

Set the run flag.

Definition at line 96 of file TriggerPath.h.

References DTTTrigCorrFirst::run, and run_.

96 { run_ = run; };
bool run_
Was path run?
Definition: TriggerPath.h:50
bool pat::TriggerPath::wasAccept ( ) const
inline

Get the success flag.

Definition at line 121 of file TriggerPath.h.

References accept_.

Referenced by WPlusJetsEventSelector::operator()().

121 { return accept_; };
bool accept_
Did path succeed?
Definition: TriggerPath.h:52
bool pat::TriggerPath::wasError ( ) const
inline

Get the error flag.

Definition at line 123 of file TriggerPath.h.

References error_.

123 { return error_; };
bool error_
Was path in error?
Definition: TriggerPath.h:54
bool pat::TriggerPath::wasRun ( ) const
inline

Get the run flag.

Definition at line 119 of file TriggerPath.h.

References run_.

119 { return run_; };
bool run_
Was path run?
Definition: TriggerPath.h:50
bool pat::TriggerPath::xTrigger ( ) const
inline

Determines, if the path is a x-trigger, based on the number of modules identified as L3 filter available starting from CMSSW_4_2_3

Definition at line 131 of file TriggerPath.h.

References l3Filters_.

131 { return ( l3Filters_ > 2 ); };
unsigned l3Filters_
Definition: TriggerPath.h:69

Member Data Documentation

bool pat::TriggerPath::accept_
private

Did path succeed?

Definition at line 52 of file TriggerPath.h.

Referenced by setAccept(), and wasAccept().

bool pat::TriggerPath::error_
private

Was path in error?

Definition at line 54 of file TriggerPath.h.

Referenced by setError(), and wasError().

std::vector< unsigned > pat::TriggerPath::filterIndices_
private

Indeces of trigger filters in pat::TriggerFilterCollection in event as produced together with the pat::TriggerPathCollection; also filled in correct order by PATTriggerProducer; indices of active filters in filter collection

Definition at line 64 of file TriggerPath.h.

Referenced by addFilterIndex(), filterIndices(), and TriggerPath().

unsigned pat::TriggerPath::index_
private

Path index in trigger table.

Definition at line 46 of file TriggerPath.h.

Referenced by index(), and setIndex().

L1SeedCollection pat::TriggerPath::l1Seeds_
private

List of L1 seeds and their decisions.

Definition at line 71 of file TriggerPath.h.

Referenced by addL1Seed(), and l1Seeds().

unsigned pat::TriggerPath::l3Filters_
private

Number of modules identified as L3 filters by the 'saveTags' parameter available starting from CMSSW_4_2_3

Definition at line 69 of file TriggerPath.h.

Referenced by l3Filters(), setL3Filters(), and xTrigger().

unsigned pat::TriggerPath::lastActiveFilterSlot_
private

Index of the last active filter in the list of modules.

Definition at line 66 of file TriggerPath.h.

Referenced by lastActiveFilterSlot(), and setLastActiveFilterSlot().

std::vector< std::string > pat::TriggerPath::modules_
private

List of all module labels in the path filled in correct order by PATTriggerProducer; modules not necessarily in filter collection; consumes disc space

Definition at line 59 of file TriggerPath.h.

Referenced by addModule(), indexModule(), modules(), and TriggerPath().

std::string pat::TriggerPath::name_
private

Data Members.

Path name

Definition at line 44 of file TriggerPath.h.

Referenced by name(), and setName().

unsigned pat::TriggerPath::prescale_
private

Pre-scale.

Definition at line 48 of file TriggerPath.h.

Referenced by prescale(), and setPrescale().

bool pat::TriggerPath::run_
private

Was path run?

Definition at line 50 of file TriggerPath.h.

Referenced by setRun(), and wasRun().