CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
pat::TriggerPath Class Reference

#include <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...
 
template<typename T = unsigned int>
T 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 (double 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, double 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 ()=default
 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...
 
double prescale_
 Pre-scale. More...
 
bool run_
 Was path run? More...
 

Detailed Description

Definition at line 37 of file TriggerPath.h.

Constructor & Destructor Documentation

◆ TriggerPath() [1/3]

pat::TriggerPath::TriggerPath ( )

Constructors and Desctructor.

Default constructor

Definition at line 6 of file TriggerPath.cc.

References filterIndices_, and modules_.

8  modules_.clear();
9  filterIndices_.clear();
10 }
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:61
bool accept_
Did path succeed?
Definition: TriggerPath.h:49
std::vector< std::string > modules_
Definition: TriggerPath.h:56
bool run_
Was path run?
Definition: TriggerPath.h:47
std::string name_
Data Members.
Definition: TriggerPath.h:41
unsigned l3Filters_
Definition: TriggerPath.h:66
double prescale_
Pre-scale.
Definition: TriggerPath.h:45
bool error_
Was path in error?
Definition: TriggerPath.h:51
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:63
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:43

◆ TriggerPath() [2/3]

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

Constructor from path name only.

Definition at line 13 of file TriggerPath.cc.

References filterIndices_, and modules_.

15  modules_.clear();
16  filterIndices_.clear();
17 }
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:61
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:116
bool accept_
Did path succeed?
Definition: TriggerPath.h:49
std::vector< std::string > modules_
Definition: TriggerPath.h:56
bool run_
Was path run?
Definition: TriggerPath.h:47
std::string name_
Data Members.
Definition: TriggerPath.h:41
unsigned l3Filters_
Definition: TriggerPath.h:66
double prescale_
Pre-scale.
Definition: TriggerPath.h:45
bool error_
Was path in error?
Definition: TriggerPath.h:51
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:63
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:43

◆ TriggerPath() [3/3]

pat::TriggerPath::TriggerPath ( const std::string &  name,
unsigned  index,
double  prescale,
bool  run,
bool  accept,
bool  error,
unsigned  lastActiveFilterSlot,
unsigned  l3Filters = 0 
)

Constructor from values.

Definition at line 20 of file TriggerPath.cc.

References filterIndices_, and modules_.

28  : name_(name),
29  index_(index),
31  run_(run),
32  accept_(accept),
33  error_(error),
36  modules_.clear();
37  filterIndices_.clear();
38 }
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:61
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:116
bool accept_
Did path succeed?
Definition: TriggerPath.h:49
std::vector< std::string > modules_
Definition: TriggerPath.h:56
bool run_
Was path run?
Definition: TriggerPath.h:47
unsigned index() const
Get the path index.
Definition: TriggerPath.h:118
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
std::string name_
Data Members.
Definition: TriggerPath.h:41
unsigned l3Filters() const
Definition: TriggerPath.h:137
unsigned l3Filters_
Definition: TriggerPath.h:66
double prescale_
Pre-scale.
Definition: TriggerPath.h:45
bool error_
Was path in error?
Definition: TriggerPath.h:51
unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:134
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:63
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:43

◆ ~TriggerPath()

virtual pat::TriggerPath::~TriggerPath ( )
virtualdefault

Destructor.

Member Function Documentation

◆ acceptedL1Seeds()

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

Get names of all succeeding L1 seeds.

Definition at line 154 of file TriggerPath.h.

References l1Seeds().

154 { return l1Seeds(true); };
const L1SeedCollection & l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:150

◆ addFilterIndex()

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

Add a new trigger fillter collection index.

Definition at line 111 of file TriggerPath.h.

References filterIndices_, and index().

111 { filterIndices_.push_back(index); };
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:61
unsigned index() const
Get the path index.
Definition: TriggerPath.h:118

◆ addL1Seed() [1/2]

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

Add a new L1 seed.

Definition at line 113 of file TriggerPath.h.

References l1Seeds_, and fileCollector::seed.

113 { l1Seeds_.push_back(seed); };
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:68

◆ addL1Seed() [2/2]

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

Definition at line 114 of file TriggerPath.h.

References l1tGTMenu_hadr_metSeeds_cff::expression, and l1Seeds_.

114 { l1Seeds_.push_back(L1Seed(decision, expression)); };
std::pair< bool, std::string > L1Seed
Pair to store decision and name of L1 seeds.
Definition: TriggerPath.h:33
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:68

◆ addModule()

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

Add a new module label.

Definition at line 109 of file TriggerPath.h.

References modules_, and name().

109 { modules_.push_back(name); };
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:116
std::vector< std::string > modules_
Definition: TriggerPath.h:56

◆ failedL1Seeds()

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

Get names of all failing L1 seeds.

Definition at line 156 of file TriggerPath.h.

References l1Seeds().

156 { return l1Seeds(false); };
const L1SeedCollection & l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:150

◆ filterIndices()

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

Get all trigger fillter collection indeces.

Definition at line 144 of file TriggerPath.h.

References filterIndices_.

144 { return filterIndices_; };
std::vector< unsigned > filterIndices_
Definition: TriggerPath.h:61

◆ index()

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

Get the path index.

Definition at line 118 of file TriggerPath.h.

References index_.

Referenced by addFilterIndex(), and setIndex().

118 { return index_; };
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:43

◆ indexModule()

int pat::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 43 of file TriggerPath.cc.

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

43  {
44  if (modules_.begin() == modules_.end())
45  return -1;
46  return (std::find(modules_.begin(), modules_.end(), name) - modules_.begin());
47 }
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:116
std::vector< std::string > modules_
Definition: TriggerPath.h:56
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19

◆ l1Seeds() [1/2]

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

Get all L1 seeds.

Definition at line 150 of file TriggerPath.h.

References l1Seeds_.

Referenced by acceptedL1Seeds(), and failedL1Seeds().

150 { return l1Seeds_; };
L1SeedCollection l1Seeds_
List of L1 seeds and their decisions.
Definition: TriggerPath.h:68

◆ l1Seeds() [2/2]

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

Get names of all L1 seeds with a certain decision.

Definition at line 50 of file TriggerPath.cc.

References HLT_FULL_cff::seeds.

50  {
51  std::vector<std::string> seeds;
52  for (L1SeedCollection::const_iterator iSeed = l1Seeds().begin(); iSeed != l1Seeds().end(); ++iSeed) {
53  if (iSeed->first == decision)
54  seeds.push_back(iSeed->second);
55  }
56  return seeds;
57 }
const L1SeedCollection & l1Seeds() const
Get all L1 seeds.
Definition: TriggerPath.h:150

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

References l3Filters_.

Referenced by setL3Filters().

137 { return l3Filters_; };
unsigned l3Filters_
Definition: TriggerPath.h:66

◆ lastActiveFilterSlot()

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

Get the index of the last active filter.

Definition at line 134 of file TriggerPath.h.

References lastActiveFilterSlot_.

Referenced by setLastActiveFilterSlot().

134 { return lastActiveFilterSlot_; };
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:63

◆ modules()

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

Get all module labels.

Definition at line 142 of file TriggerPath.h.

References modules_.

142 { return modules_; };
std::vector< std::string > modules_
Definition: TriggerPath.h:56

◆ name()

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

Get the path name.

Definition at line 116 of file TriggerPath.h.

References name_.

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

116 { return name_; };
std::string name_
Data Members.
Definition: TriggerPath.h:41

◆ prescale()

template<typename T = unsigned int>
T pat::TriggerPath::prescale ( ) const
inline

Get the path pre-scale.

Definition at line 121 of file TriggerPath.h.

References prescale_.

Referenced by setPrescale().

121  {
122  static_assert(std::is_same_v<T, double>,
123  "\n\tPlease use prescale<double>"
124  "\n\t(other types for prescales are not supported anymore by pat::TriggerPath");
125  return prescale_;
126  };
double prescale_
Pre-scale.
Definition: TriggerPath.h:45

◆ setAccept()

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

Set the success flag.

Definition at line 101 of file TriggerPath.h.

References accept(), and accept_.

101 { accept_ = accept; };
bool accept_
Did path succeed?
Definition: TriggerPath.h:49
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31

◆ setError()

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

Set the error flag.

Definition at line 103 of file TriggerPath.h.

References relativeConstraints::error, and error_.

103 { error_ = error; };
bool error_
Was path in error?
Definition: TriggerPath.h:51

◆ setIndex()

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

Set the path index.

Definition at line 95 of file TriggerPath.h.

References index(), and index_.

95 { index_ = index; };
unsigned index() const
Get the path index.
Definition: TriggerPath.h:118
unsigned index_
Path index in trigger table.
Definition: TriggerPath.h:43

◆ setL3Filters()

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

Set the number of modules identified as L3 filter.

Definition at line 107 of file TriggerPath.h.

References l3Filters(), and l3Filters_.

107 { l3Filters_ = l3Filters; };
unsigned l3Filters() const
Definition: TriggerPath.h:137
unsigned l3Filters_
Definition: TriggerPath.h:66

◆ setLastActiveFilterSlot()

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

Set the index of the last active filter.

Definition at line 105 of file TriggerPath.h.

References lastActiveFilterSlot(), and lastActiveFilterSlot_.

unsigned lastActiveFilterSlot() const
Get the index of the last active filter.
Definition: TriggerPath.h:134
unsigned lastActiveFilterSlot_
Index of the last active filter in the list of modules.
Definition: TriggerPath.h:63

◆ setName()

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

Methods.

Set the path name

Definition at line 93 of file TriggerPath.h.

References name(), and name_.

93 { name_ = name; };
const std::string & name() const
Get the path name.
Definition: TriggerPath.h:116
std::string name_
Data Members.
Definition: TriggerPath.h:41

◆ setPrescale()

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

Set the path pre-scale.

Definition at line 97 of file TriggerPath.h.

References prescale(), and prescale_.

97 { prescale_ = prescale; };
T prescale() const
Get the path pre-scale.
Definition: TriggerPath.h:121
double prescale_
Pre-scale.
Definition: TriggerPath.h:45

◆ setRun()

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

Set the run flag.

Definition at line 99 of file TriggerPath.h.

References writedatasetfile::run, and run_.

99 { run_ = run; };
bool run_
Was path run?
Definition: TriggerPath.h:47

◆ wasAccept()

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

Get the success flag.

Definition at line 130 of file TriggerPath.h.

References accept_.

Referenced by WPlusJetsEventSelector::operator()().

130 { return accept_; };
bool accept_
Did path succeed?
Definition: TriggerPath.h:49

◆ wasError()

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

Get the error flag.

Definition at line 132 of file TriggerPath.h.

References error_.

132 { return error_; };
bool error_
Was path in error?
Definition: TriggerPath.h:51

◆ wasRun()

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

Get the run flag.

Definition at line 128 of file TriggerPath.h.

References run_.

128 { return run_; };
bool run_
Was path run?
Definition: TriggerPath.h:47

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

References l3Filters_.

140 { return (l3Filters_ > 2); };
unsigned l3Filters_
Definition: TriggerPath.h:66

Member Data Documentation

◆ accept_

bool pat::TriggerPath::accept_
private

Did path succeed?

Definition at line 49 of file TriggerPath.h.

Referenced by setAccept(), and wasAccept().

◆ error_

bool pat::TriggerPath::error_
private

Was path in error?

Definition at line 51 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 61 of file TriggerPath.h.

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

◆ index_

unsigned pat::TriggerPath::index_
private

Path index in trigger table.

Definition at line 43 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 68 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 66 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 63 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 56 of file TriggerPath.h.

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

◆ name_

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

Data Members.

Path name

Definition at line 41 of file TriggerPath.h.

Referenced by name(), and setName().

◆ prescale_

double pat::TriggerPath::prescale_
private

Pre-scale.

Definition at line 45 of file TriggerPath.h.

Referenced by prescale(), and setPrescale().

◆ run_

bool pat::TriggerPath::run_
private

Was path run?

Definition at line 47 of file TriggerPath.h.

Referenced by setRun(), and wasRun().