CMS 3D CMS Logo

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

Analysis-level L1 trigger algorithm class. More...

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

Public Member Functions

void addConditionKey (unsigned conditionKey)
 Add a new trigger condition collection index. More...
 
const std::string & alias () const
 Get L1 algorithm alias. More...
 
unsigned bit () const
 Get L1 algorithm bit number. More...
 
const std::vector< unsigned > & conditionKeys () const
 Get all trigger condition collection indeces. More...
 
bool decision () const
 
bool decisionAfterMask () const
 Get L1 algorithm decision, considering the mask. More...
 
bool decisionBeforeMask () const
 Get L1 algorithm decision, not considering the mask. More...
 
bool gtlResult () const
 Get L1 algorithm GTL result. More...
 
bool hasConditionKey (unsigned conditionKey) const
 Checks, if a certain trigger condition collection index is assigned. More...
 
const std::string & logicalExpression () const
 Get L1 algorithm logical expression. More...
 
bool mask () const
 Get L1 algorithm mask. More...
 
const std::string & name () const
 Get L1 algorithm name. More...
 
unsigned prescale () const
 Get L1 algorithm pre-scale. More...
 
void setAlias (const std::string &alias)
 Set L1 algorithm alias. More...
 
void setBit (unsigned bit)
 Set L1 algorithm bit number. More...
 
void setDecisionAfterMas (bool decisionAfterMask)
 Set L1 algorithm decision, considering the mask. More...
 
void setDecisionBeforeMask (bool decisionBeforeMask)
 Set L1 algorithm decision, not considering the mask. More...
 
void setGtlResult (bool gtlResult)
 Set L1 algorithm GTL result. More...
 
void setLogicalExpression (const std::string &expression)
 Set L1 algorithm logical expression. More...
 
void setMask (bool mask)
 Set L1 algorithm mask. More...
 
void setName (const std::string &name)
 Methods. More...
 
void setPrescale (unsigned prescale)
 Set L1 algorithm pre-scale. More...
 
void setTechTrigger (bool tech)
 Set flag for technical L1 algorithms. More...
 
bool techTrigger () const
 Get flag for technical L1 algorithms. More...
 
 TriggerAlgorithm ()
 Constructors and Destructor. More...
 
 TriggerAlgorithm (const std::string &name)
 Constructor from algorithm name only. More...
 
 TriggerAlgorithm (const std::string &name, const std::string &alias, bool tech, unsigned bit, bool gtlResult, unsigned prescale, bool mask, bool decisionBeforeMask, bool decisionAfterMask)
 
 TriggerAlgorithm (const std::string &name, const std::string &alias, bool tech, unsigned bit, unsigned prescale, bool mask, bool decisionBeforeMask, bool decisionAfterMask)
 Constructors from values. More...
 
virtual ~TriggerAlgorithm ()
 Destructor. More...
 

Private Attributes

std::string alias_
 L1 algorithm alias. More...
 
unsigned bit_
 L1 algorithm bit number. More...
 
std::vector< unsigned > conditionKeys_
 
bool decisionAfterMask_
 L1 algorithm decision, considering the mask. More...
 
bool decisionBeforeMask_
 L1 algorithm decision, not considering the mask. More...
 
bool gtlResult_
 L1 algorithm result as determined on the GTL board. More...
 
std::string logic_
 L1 algorithm logival expression. More...
 
bool mask_
 L1 algorithm mask. More...
 
std::string name_
 Data Members. More...
 
unsigned prescale_
 L1 algorithm pre-scale. More...
 
bool tech_
 Flag for technical L1 algorithms. More...
 

Detailed Description

Analysis-level L1 trigger algorithm class.

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

Author
Volker Adler

Definition at line 31 of file TriggerAlgorithm.h.

Constructor & Destructor Documentation

◆ TriggerAlgorithm() [1/4]

TriggerAlgorithm::TriggerAlgorithm ( )

Constructors and Destructor.

Default constructor

Definition at line 11 of file TriggerAlgorithm.cc.

12  : name_(),
13  alias_(),
14  logic_(),
15  tech_(),
16  bit_(),
17  gtlResult_(),
18  prescale_(),
19  mask_(),
22  conditionKeys_.clear();
23 }

References conditionKeys_.

◆ TriggerAlgorithm() [2/4]

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

Constructor from algorithm name only.

Definition at line 26 of file TriggerAlgorithm.cc.

27  : name_(name),
28  alias_(),
29  logic_(),
30  tech_(),
31  bit_(),
32  gtlResult_(),
33  prescale_(),
34  mask_(),
37  conditionKeys_.clear();
38 }

References conditionKeys_.

◆ TriggerAlgorithm() [3/4]

TriggerAlgorithm::TriggerAlgorithm ( const std::string &  name,
const std::string &  alias,
bool  tech,
unsigned  bit,
unsigned  prescale,
bool  mask,
bool  decisionBeforeMask,
bool  decisionAfterMask 
)

Constructors from values.

Definition at line 41 of file TriggerAlgorithm.cc.

49  : name_(name),
50  alias_(alias),
51  logic_(),
52  tech_(tech),
53  bit_(bit),
54  gtlResult_(),
56  mask_(mask),
59  conditionKeys_.clear();
60 }

References conditionKeys_.

◆ TriggerAlgorithm() [4/4]

TriggerAlgorithm::TriggerAlgorithm ( const std::string &  name,
const std::string &  alias,
bool  tech,
unsigned  bit,
bool  gtlResult,
unsigned  prescale,
bool  mask,
bool  decisionBeforeMask,
bool  decisionAfterMask 
)

Definition at line 61 of file TriggerAlgorithm.cc.

70  : name_(name),
71  alias_(alias),
72  logic_(),
73  tech_(tech),
74  bit_(bit),
77  mask_(mask),
80  conditionKeys_.clear();
81 }

References conditionKeys_.

◆ ~TriggerAlgorithm()

virtual pat::TriggerAlgorithm::~TriggerAlgorithm ( )
inlinevirtual

Destructor.

Definition at line 85 of file TriggerAlgorithm.h.

85 {};

Member Function Documentation

◆ addConditionKey()

void pat::TriggerAlgorithm::addConditionKey ( unsigned  conditionKey)
inline

Add a new trigger condition collection index.

Definition at line 110 of file TriggerAlgorithm.h.

110  {
111  if (!hasConditionKey(conditionKey))
112  conditionKeys_.push_back(conditionKey);
113  };

References conditionKeys_, and hasConditionKey().

Referenced by pat::PATTriggerProducer::produce().

◆ alias()

const std::string& pat::TriggerAlgorithm::alias ( ) const
inline

Get L1 algorithm alias.

Definition at line 117 of file TriggerAlgorithm.h.

117 { return alias_; };

References alias_.

Referenced by setAlias().

◆ bit()

unsigned pat::TriggerAlgorithm::bit ( ) const
inline

Get L1 algorithm bit number.

Definition at line 123 of file TriggerAlgorithm.h.

123 { return bit_; };

References bit_.

Referenced by setBit().

◆ conditionKeys()

const std::vector<unsigned>& pat::TriggerAlgorithm::conditionKeys ( ) const
inline

Get all trigger condition collection indeces.

Definition at line 138 of file TriggerAlgorithm.h.

138 { return conditionKeys_; };

References conditionKeys_.

Referenced by hasConditionKey().

◆ decision()

bool pat::TriggerAlgorithm::decision ( ) const
inline

Get L1 algorithm decision as applied, identical to L1 algorithm decision, considering the mask

Definition at line 136 of file TriggerAlgorithm.h.

136 { return decisionAfterMask(); };

References decisionAfterMask().

Referenced by pat::PATTriggerProducer::produce().

◆ decisionAfterMask()

bool pat::TriggerAlgorithm::decisionAfterMask ( ) const
inline

Get L1 algorithm decision, considering the mask.

Definition at line 133 of file TriggerAlgorithm.h.

133 { return decisionAfterMask_; };

References decisionAfterMask_.

Referenced by decision(), and setDecisionAfterMas().

◆ decisionBeforeMask()

bool pat::TriggerAlgorithm::decisionBeforeMask ( ) const
inline

Get L1 algorithm decision, not considering the mask.

Definition at line 131 of file TriggerAlgorithm.h.

131 { return decisionBeforeMask_; };

References decisionBeforeMask_.

Referenced by setDecisionBeforeMask().

◆ gtlResult()

bool pat::TriggerAlgorithm::gtlResult ( ) const
inline

Get L1 algorithm GTL result.

Definition at line 125 of file TriggerAlgorithm.h.

125 { return gtlResult_; };

References gtlResult_.

Referenced by setGtlResult().

◆ hasConditionKey()

bool TriggerAlgorithm::hasConditionKey ( unsigned  conditionKey) const

Checks, if a certain trigger condition collection index is assigned.

Definition at line 86 of file TriggerAlgorithm.cc.

86  {
87  for (size_t iO = 0; iO < conditionKeys().size(); ++iO) {
88  if (conditionKeys().at(iO) == conditionKey) {
89  return true;
90  }
91  }
92  return false;
93 }

References conditionKeys().

Referenced by addConditionKey().

◆ logicalExpression()

const std::string& pat::TriggerAlgorithm::logicalExpression ( ) const
inline

Get L1 algorithm logical expression.

Definition at line 119 of file TriggerAlgorithm.h.

119 { return logic_; };

References logic_.

◆ mask()

bool pat::TriggerAlgorithm::mask ( ) const
inline

Get L1 algorithm mask.

Definition at line 129 of file TriggerAlgorithm.h.

129 { return mask_; };

References mask_.

Referenced by setMask().

◆ name()

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

Get L1 algorithm name.

Definition at line 115 of file TriggerAlgorithm.h.

115 { return name_; };

References name_.

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

◆ prescale()

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

Get L1 algorithm pre-scale.

Definition at line 127 of file TriggerAlgorithm.h.

127 { return prescale_; };

References prescale_.

Referenced by setPrescale().

◆ setAlias()

void pat::TriggerAlgorithm::setAlias ( const std::string &  alias)
inline

Set L1 algorithm alias.

Definition at line 92 of file TriggerAlgorithm.h.

92 { alias_ = alias; };

References alias(), and alias_.

◆ setBit()

void pat::TriggerAlgorithm::setBit ( unsigned  bit)
inline

Set L1 algorithm bit number.

Definition at line 98 of file TriggerAlgorithm.h.

98 { bit_ = bit; };

References bit(), and bit_.

◆ setDecisionAfterMas()

void pat::TriggerAlgorithm::setDecisionAfterMas ( bool  decisionAfterMask)
inline

Set L1 algorithm decision, considering the mask.

Definition at line 108 of file TriggerAlgorithm.h.

References decisionAfterMask(), and decisionAfterMask_.

◆ setDecisionBeforeMask()

void pat::TriggerAlgorithm::setDecisionBeforeMask ( bool  decisionBeforeMask)
inline

Set L1 algorithm decision, not considering the mask.

Definition at line 106 of file TriggerAlgorithm.h.

References decisionBeforeMask(), and decisionBeforeMask_.

◆ setGtlResult()

void pat::TriggerAlgorithm::setGtlResult ( bool  gtlResult)
inline

Set L1 algorithm GTL result.

Definition at line 100 of file TriggerAlgorithm.h.

100 { gtlResult_ = gtlResult; };

References gtlResult(), and gtlResult_.

Referenced by pat::PATTriggerProducer::produce().

◆ setLogicalExpression()

void pat::TriggerAlgorithm::setLogicalExpression ( const std::string &  expression)
inline

Set L1 algorithm logical expression.

Definition at line 94 of file TriggerAlgorithm.h.

94 { logic_ = expression; };

References logic_.

Referenced by pat::PATTriggerProducer::produce().

◆ setMask()

void pat::TriggerAlgorithm::setMask ( bool  mask)
inline

Set L1 algorithm mask.

Definition at line 104 of file TriggerAlgorithm.h.

104 { mask_ = mask; };

References mask(), and mask_.

◆ setName()

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

Methods.

Set L1 algorithm name

Definition at line 90 of file TriggerAlgorithm.h.

90 { name_ = name; };

References name(), and name_.

◆ setPrescale()

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

Set L1 algorithm pre-scale.

Definition at line 102 of file TriggerAlgorithm.h.

102 { prescale_ = prescale; };

References prescale(), and prescale_.

◆ setTechTrigger()

void pat::TriggerAlgorithm::setTechTrigger ( bool  tech)
inline

Set flag for technical L1 algorithms.

Definition at line 96 of file TriggerAlgorithm.h.

96 { tech_ = tech; };

References tech_.

◆ techTrigger()

bool pat::TriggerAlgorithm::techTrigger ( ) const
inline

Get flag for technical L1 algorithms.

Definition at line 121 of file TriggerAlgorithm.h.

121 { return tech_; };

References tech_.

Member Data Documentation

◆ alias_

std::string pat::TriggerAlgorithm::alias_
private

L1 algorithm alias.

Definition at line 37 of file TriggerAlgorithm.h.

Referenced by alias(), and setAlias().

◆ bit_

unsigned pat::TriggerAlgorithm::bit_
private

L1 algorithm bit number.

Definition at line 43 of file TriggerAlgorithm.h.

Referenced by bit(), and setBit().

◆ conditionKeys_

std::vector<unsigned> pat::TriggerAlgorithm::conditionKeys_
private

Indeces of trigger conditions in pat::TriggerConditionCollection in event as produced together with the pat::TriggerAlgorithmCollection

Definition at line 56 of file TriggerAlgorithm.h.

Referenced by addConditionKey(), conditionKeys(), and TriggerAlgorithm().

◆ decisionAfterMask_

bool pat::TriggerAlgorithm::decisionAfterMask_
private

L1 algorithm decision, considering the mask.

Definition at line 53 of file TriggerAlgorithm.h.

Referenced by decisionAfterMask(), and setDecisionAfterMas().

◆ decisionBeforeMask_

bool pat::TriggerAlgorithm::decisionBeforeMask_
private

L1 algorithm decision, not considering the mask.

Definition at line 51 of file TriggerAlgorithm.h.

Referenced by decisionBeforeMask(), and setDecisionBeforeMask().

◆ gtlResult_

bool pat::TriggerAlgorithm::gtlResult_
private

L1 algorithm result as determined on the GTL board.

Definition at line 45 of file TriggerAlgorithm.h.

Referenced by gtlResult(), and setGtlResult().

◆ logic_

std::string pat::TriggerAlgorithm::logic_
private

L1 algorithm logival expression.

Definition at line 39 of file TriggerAlgorithm.h.

Referenced by logicalExpression(), and setLogicalExpression().

◆ mask_

bool pat::TriggerAlgorithm::mask_
private

L1 algorithm mask.

Definition at line 49 of file TriggerAlgorithm.h.

Referenced by mask(), and setMask().

◆ name_

std::string pat::TriggerAlgorithm::name_
private

Data Members.

L1 algorithm name

Definition at line 35 of file TriggerAlgorithm.h.

Referenced by name(), and setName().

◆ prescale_

unsigned pat::TriggerAlgorithm::prescale_
private

L1 algorithm pre-scale.

Definition at line 47 of file TriggerAlgorithm.h.

Referenced by prescale(), and setPrescale().

◆ tech_

bool pat::TriggerAlgorithm::tech_
private

Flag for technical L1 algorithms.

Definition at line 41 of file TriggerAlgorithm.h.

Referenced by setTechTrigger(), and techTrigger().

pat::TriggerAlgorithm::decisionAfterMask_
bool decisionAfterMask_
L1 algorithm decision, considering the mask.
Definition: TriggerAlgorithm.h:53
pat::TriggerAlgorithm::prescale
unsigned prescale() const
Get L1 algorithm pre-scale.
Definition: TriggerAlgorithm.h:127
pat::TriggerAlgorithm::logic_
std::string logic_
L1 algorithm logival expression.
Definition: TriggerAlgorithm.h:39
pat::TriggerAlgorithm::tech_
bool tech_
Flag for technical L1 algorithms.
Definition: TriggerAlgorithm.h:41
pat::TriggerAlgorithm::conditionKeys
const std::vector< unsigned > & conditionKeys() const
Get all trigger condition collection indeces.
Definition: TriggerAlgorithm.h:138
pat::TriggerAlgorithm::name_
std::string name_
Data Members.
Definition: TriggerAlgorithm.h:35
pat::TriggerAlgorithm::gtlResult
bool gtlResult() const
Get L1 algorithm GTL result.
Definition: TriggerAlgorithm.h:125
pat::TriggerAlgorithm::bit_
unsigned bit_
L1 algorithm bit number.
Definition: TriggerAlgorithm.h:43
pat::TriggerAlgorithm::bit
unsigned bit() const
Get L1 algorithm bit number.
Definition: TriggerAlgorithm.h:123
pat::TriggerAlgorithm::alias
const std::string & alias() const
Get L1 algorithm alias.
Definition: TriggerAlgorithm.h:117
pat::TriggerAlgorithm::alias_
std::string alias_
L1 algorithm alias.
Definition: TriggerAlgorithm.h:37
pat::TriggerAlgorithm::prescale_
unsigned prescale_
L1 algorithm pre-scale.
Definition: TriggerAlgorithm.h:47
pat::TriggerAlgorithm::mask_
bool mask_
L1 algorithm mask.
Definition: TriggerAlgorithm.h:49
pat::TriggerAlgorithm::mask
bool mask() const
Get L1 algorithm mask.
Definition: TriggerAlgorithm.h:129
prescale
Definition: PrescaleEventFilter.cc:32
pat::TriggerAlgorithm::conditionKeys_
std::vector< unsigned > conditionKeys_
Definition: TriggerAlgorithm.h:56
pat::TriggerAlgorithm::decisionBeforeMask
bool decisionBeforeMask() const
Get L1 algorithm decision, not considering the mask.
Definition: TriggerAlgorithm.h:131
pat::TriggerAlgorithm::decisionBeforeMask_
bool decisionBeforeMask_
L1 algorithm decision, not considering the mask.
Definition: TriggerAlgorithm.h:51
pat::TriggerAlgorithm::name
const std::string & name() const
Get L1 algorithm name.
Definition: TriggerAlgorithm.h:115
pat::TriggerAlgorithm::hasConditionKey
bool hasConditionKey(unsigned conditionKey) const
Checks, if a certain trigger condition collection index is assigned.
Definition: TriggerAlgorithm.cc:86
pat::TriggerAlgorithm::decisionAfterMask
bool decisionAfterMask() const
Get L1 algorithm decision, considering the mask.
Definition: TriggerAlgorithm.h:133
pat::TriggerAlgorithm::gtlResult_
bool gtlResult_
L1 algorithm result as determined on the GTL board.
Definition: TriggerAlgorithm.h:45