CMS 3D CMS Logo

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 (bool decision, const std::string &expression)
 
void addL1Seed (const L1Seed &seed)
 Add a new L1 seed. More...
 
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 36 of file TriggerPath.h.

Constructor & Destructor Documentation

◆ TriggerPath() [1/3]

TriggerPath::TriggerPath ( )

Constructors and Desctructor.

Default constructor

Definition at line 11 of file TriggerPath.cc.

13  modules_.clear();
14  filterIndices_.clear();
15 }

References filterIndices_, and modules_.

◆ TriggerPath() [2/3]

TriggerPath::TriggerPath ( const std::string &  name)

Constructor from path name only.

Definition at line 18 of file TriggerPath.cc.

20  modules_.clear();
21  filterIndices_.clear();
22 }

References filterIndices_, and modules_.

◆ TriggerPath() [3/3]

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 25 of file TriggerPath.cc.

33  : name_(name),
34  index_(index),
36  run_(run),
37  accept_(accept),
38  error_(error),
41  modules_.clear();
42  filterIndices_.clear();
43 }

References filterIndices_, and modules_.

◆ ~TriggerPath()

virtual pat::TriggerPath::~TriggerPath ( )
inlinevirtual

Destructor.

Definition at line 87 of file TriggerPath.h.

87 {};

Member Function Documentation

◆ acceptedL1Seeds()

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

Get names of all succeeding L1 seeds.

Definition at line 147 of file TriggerPath.h.

147 { return l1Seeds(true); };

References l1Seeds().

◆ addFilterIndex()

void pat::TriggerPath::addFilterIndex ( const unsigned  index)
inline

Add a new trigger fillter collection index.

Definition at line 110 of file TriggerPath.h.

110 { filterIndices_.push_back(index); };

References filterIndices_, and index().

◆ addL1Seed() [1/2]

void pat::TriggerPath::addL1Seed ( bool  decision,
const std::string &  expression 
)
inline

Definition at line 113 of file TriggerPath.h.

113 { l1Seeds_.push_back(L1Seed(decision, expression)); };

References l1Seeds_.

◆ addL1Seed() [2/2]

void pat::TriggerPath::addL1Seed ( const L1Seed seed)
inline

Add a new L1 seed.

Definition at line 112 of file TriggerPath.h.

112 { l1Seeds_.push_back(seed); };

References l1Seeds_, and SurveyInfoScenario_cff::seed.

◆ addModule()

void pat::TriggerPath::addModule ( const std::string &  name)
inline

Add a new module label.

Definition at line 108 of file TriggerPath.h.

108 { modules_.push_back(name); };

References modules_, and name().

◆ failedL1Seeds()

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

Get names of all failing L1 seeds.

Definition at line 149 of file TriggerPath.h.

149 { return l1Seeds(false); };

References l1Seeds().

◆ filterIndices()

const std::vector<unsigned>& pat::TriggerPath::filterIndices ( ) const
inline

Get all trigger fillter collection indeces.

Definition at line 137 of file TriggerPath.h.

137 { return filterIndices_; };

References filterIndices_.

◆ index()

unsigned pat::TriggerPath::index ( ) const
inline

Get the path index.

Definition at line 117 of file TriggerPath.h.

117 { return index_; };

References index_.

Referenced by addFilterIndex(), BeautifulSoup.PageElement::insert(), and setIndex().

◆ indexModule()

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 48 of file TriggerPath.cc.

48  {
49  if (modules_.begin() == modules_.end())
50  return -1;
51  return (std::find(modules_.begin(), modules_.end(), name) - modules_.begin());
52 }

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

◆ l1Seeds() [1/2]

const L1SeedCollection& pat::TriggerPath::l1Seeds ( ) const
inline

Get all L1 seeds.

Definition at line 143 of file TriggerPath.h.

143 { return l1Seeds_; };

References l1Seeds_.

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

◆ l1Seeds() [2/2]

std::vector< std::string > TriggerPath::l1Seeds ( const bool  decision) const

Get names of all L1 seeds with a certain decision.

Definition at line 55 of file TriggerPath.cc.

55  {
56  std::vector<std::string> seeds;
57  for (L1SeedCollection::const_iterator iSeed = l1Seeds().begin(); iSeed != l1Seeds().end(); ++iSeed) {
58  if (iSeed->first == decision)
59  seeds.push_back(iSeed->second);
60  }
61  return seeds;
62 }

References begin, l1Seeds(), and InitialStep_cff::seeds.

◆ l3Filters()

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 130 of file TriggerPath.h.

130 { return l3Filters_; };

References l3Filters_.

Referenced by setL3Filters().

◆ lastActiveFilterSlot()

unsigned pat::TriggerPath::lastActiveFilterSlot ( ) const
inline

Get the index of the last active filter.

Definition at line 127 of file TriggerPath.h.

127 { return lastActiveFilterSlot_; };

References lastActiveFilterSlot_.

Referenced by setLastActiveFilterSlot().

◆ modules()

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

Get all module labels.

Definition at line 135 of file TriggerPath.h.

135 { return modules_; };

References modules_.

◆ name()

const std::string& pat::TriggerPath::name ( ) const
inline

Get the path name.

Definition at line 115 of file TriggerPath.h.

115 { return name_; };

References name_.

Referenced by config.CFG::__str__(), addModule(), validation.Sample::digest(), indexModule(), VIDSelectorBase.VIDSelectorBase::initialize(), and setName().

◆ prescale()

unsigned pat::TriggerPath::prescale ( ) const
inline

Get the path pre-scale.

Definition at line 119 of file TriggerPath.h.

119 { return prescale_; };

References prescale_.

Referenced by setPrescale().

◆ setAccept()

void pat::TriggerPath::setAccept ( bool  accept)
inline

Set the success flag.

Definition at line 100 of file TriggerPath.h.

100 { accept_ = accept; };

References accept(), and accept_.

◆ setError()

void pat::TriggerPath::setError ( bool  error)
inline

Set the error flag.

Definition at line 102 of file TriggerPath.h.

102 { error_ = error; };

References relativeConstraints::error, and error_.

◆ setIndex()

void pat::TriggerPath::setIndex ( unsigned  index)
inline

Set the path index.

Definition at line 94 of file TriggerPath.h.

94 { index_ = index; };

References index(), and index_.

◆ setL3Filters()

void pat::TriggerPath::setL3Filters ( unsigned  l3Filters)
inline

Set the number of modules identified as L3 filter.

Definition at line 106 of file TriggerPath.h.

106 { l3Filters_ = l3Filters; };

References l3Filters(), and l3Filters_.

◆ setLastActiveFilterSlot()

void pat::TriggerPath::setLastActiveFilterSlot ( unsigned  lastActiveFilterSlot)
inline

Set the index of the last active filter.

Definition at line 104 of file TriggerPath.h.

References lastActiveFilterSlot(), and lastActiveFilterSlot_.

◆ setName()

void pat::TriggerPath::setName ( const std::string &  name)
inline

Methods.

Set the path name

Definition at line 92 of file TriggerPath.h.

92 { name_ = name; };

References name(), and name_.

◆ setPrescale()

void pat::TriggerPath::setPrescale ( unsigned  prescale)
inline

Set the path pre-scale.

Definition at line 96 of file TriggerPath.h.

96 { prescale_ = prescale; };

References prescale(), and prescale_.

◆ setRun()

void pat::TriggerPath::setRun ( bool  run)
inline

Set the run flag.

Definition at line 98 of file TriggerPath.h.

98 { run_ = run; };

References writedatasetfile::run, and run_.

◆ wasAccept()

bool pat::TriggerPath::wasAccept ( ) const
inline

Get the success flag.

Definition at line 123 of file TriggerPath.h.

123 { return accept_; };

References accept_.

Referenced by WPlusJetsEventSelector::operator()().

◆ wasError()

bool pat::TriggerPath::wasError ( ) const
inline

Get the error flag.

Definition at line 125 of file TriggerPath.h.

125 { return error_; };

References error_.

◆ wasRun()

bool pat::TriggerPath::wasRun ( ) const
inline

Get the run flag.

Definition at line 121 of file TriggerPath.h.

121 { return run_; };

References run_.

◆ xTrigger()

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 133 of file TriggerPath.h.

133 { return (l3Filters_ > 2); };

References l3Filters_.

Member Data Documentation

◆ accept_

bool pat::TriggerPath::accept_
private

Did path succeed?

Definition at line 48 of file TriggerPath.h.

Referenced by setAccept(), and wasAccept().

◆ error_

bool pat::TriggerPath::error_
private

Was path in error?

Definition at line 50 of file TriggerPath.h.

Referenced by setError(), and wasError().

◆ filterIndices_

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 60 of file TriggerPath.h.

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

◆ index_

unsigned pat::TriggerPath::index_
private

Path index in trigger table.

Definition at line 42 of file TriggerPath.h.

Referenced by index(), and setIndex().

◆ l1Seeds_

L1SeedCollection pat::TriggerPath::l1Seeds_
private

List of L1 seeds and their decisions.

Definition at line 67 of file TriggerPath.h.

Referenced by addL1Seed(), and l1Seeds().

◆ l3Filters_

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 65 of file TriggerPath.h.

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

◆ lastActiveFilterSlot_

unsigned pat::TriggerPath::lastActiveFilterSlot_
private

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

Definition at line 62 of file TriggerPath.h.

Referenced by lastActiveFilterSlot(), and setLastActiveFilterSlot().

◆ modules_

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 55 of file TriggerPath.h.

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

◆ name_

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

Data Members.

Path name

Definition at line 40 of file TriggerPath.h.

Referenced by name(), and setName().

◆ prescale_

unsigned pat::TriggerPath::prescale_
private

Pre-scale.

Definition at line 44 of file TriggerPath.h.

Referenced by prescale(), and setPrescale().

◆ run_

bool pat::TriggerPath::run_
private

Was path run?

Definition at line 46 of file TriggerPath.h.

Referenced by setRun(), and wasRun().

pat::TriggerPath::run_
bool run_
Was path run?
Definition: TriggerPath.h:46
pat::TriggerPath::index
unsigned index() const
Get the path index.
Definition: TriggerPath.h:117
pat::TriggerPath::lastActiveFilterSlot
unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:127
pat::TriggerPath::name_
std::string name_
Data Members.
Definition: TriggerPath.h:40
pat::TriggerPath::l3Filters
unsigned l3Filters() const
Definition: TriggerPath.h:130
pat::L1Seed
std::pair< bool, std::string > L1Seed
Pair to store decision and name of L1 seeds.
Definition: TriggerPath.h:32
pat::TriggerPath::l3Filters_
unsigned l3Filters_
Definition: TriggerPath.h:65
pat::TriggerPath::filterIndices_
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:60
pat::TriggerPath::prescale_
unsigned prescale_
Pre-scale.
Definition: TriggerPath.h:44
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
relativeConstraints.error
error
Definition: relativeConstraints.py:53
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
pat::TriggerPath::prescale
unsigned prescale() const
Get the path pre-scale.
Definition: TriggerPath.h:119
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:232
pat::TriggerPath::modules_
std::vector< std::string > modules_
Definition: TriggerPath.h:55
pat::TriggerPath::name
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:115
pat::TriggerPath::lastActiveFilterSlot_
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:62
prescale
Definition: PrescaleEventFilter.cc:32
writedatasetfile.run
run
Definition: writedatasetfile.py:27
pat::TriggerPath::index_
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:42
pat::TriggerPath::l1Seeds
const L1SeedCollection & l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:143
pat::TriggerPath::error_
bool error_
Was path in error?
Definition: TriggerPath.h:50
begin
#define begin
Definition: vmac.h:32
pat::TriggerPath::accept_
bool accept_
Did path succeed?
Definition: TriggerPath.h:48
SurveyInfoScenario_cff.seed
seed
Definition: SurveyInfoScenario_cff.py:295
pat::TriggerPath::l1Seeds_
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:67