CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerAlgorithm.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_TriggerAlgorithm_h
2 #define DataFormats_PatCandidates_TriggerAlgorithm_h
3 
4 
5 // -*- C++ -*-
6 //
7 // Package: PatCandidates
8 // Class: pat::TriggerAlgorithm
9 //
10 //
23 #include <string>
24 #include <vector>
25 
30 
31 
32 namespace pat {
33 
35 
37 
45  bool tech_;
47  unsigned bit_;
49  bool gtlResult_;
51  unsigned prescale_;
53  bool mask_;
60  std::vector< unsigned > conditionKeys_;
61 
62  public:
63 
65 
71  TriggerAlgorithm( const std::string & name, const std::string & alias, bool tech, unsigned bit, unsigned prescale, bool mask, bool decisionBeforeMask, bool decisionAfterMask ); // for backward compatibility
72  TriggerAlgorithm( const std::string & name, const std::string & alias, bool tech, unsigned bit, bool gtlResult, unsigned prescale, bool mask, bool decisionBeforeMask, bool decisionAfterMask );
73 
75  virtual ~TriggerAlgorithm() {};
76 
78 
80  void setName( const std::string & name ) { name_ = name; };
82  void setAlias( const std::string & alias ) { alias_ = alias; };
84  void setLogicalExpression( const std::string & expression ) { logic_ = expression; };
86  void setTechTrigger( bool tech ) { tech_ = tech; };
88  void setBit( unsigned bit ) { bit_ = bit; };
92  void setPrescale( unsigned prescale ) { prescale_ = prescale; };
94  void setMask( bool mask ) { mask_ = mask; };
100  void addConditionKey( unsigned conditionKey ) { if ( ! hasConditionKey( conditionKey ) ) conditionKeys_.push_back( conditionKey ); };
102  const std::string & name() const { return name_; };
104  const std::string & alias() const { return alias_; };
106  const std::string & logicalExpression() const { return logic_; };
108  bool techTrigger() const { return tech_; };
110  unsigned bit() const { return bit_; };
112  bool gtlResult() const { return gtlResult_; };
114  unsigned prescale() const { return prescale_; };
116  bool mask() const { return mask_; };
118  bool decisionBeforeMask() const { return decisionBeforeMask_; };
120  bool decisionAfterMask() const { return decisionAfterMask_; };
123  bool decision() const { return decisionAfterMask(); };
125  const std::vector< unsigned > & conditionKeys() const { return conditionKeys_; };
127  bool hasConditionKey( unsigned conditionKey ) const;
128 
129  };
130 
131 
133  typedef std::vector< TriggerAlgorithm > TriggerAlgorithmCollection;
142 
143 }
144 
145 
146 #endif
bool decisionBeforeMask() const
Get L1 algorithm decision, not considering the mask.
Analysis-level L1 trigger algorithm class.
bool mask() const
Get L1 algorithm mask.
const std::string & alias() const
Get L1 algorithm alias.
bool gtlResult_
L1 algorithm result as determined on the GTL board.
bool decisionAfterMask() const
Get L1 algorithm decision, considering the mask.
bool techTrigger() const
Get flag for technical L1 algorithms.
const std::vector< unsigned > & conditionKeys() const
Get all trigger condition collection indeces.
std::string logic_
L1 algorithm logival expression.
std::vector< unsigned > conditionKeys_
void setGtlResult(bool gtlResult)
Set L1 algorithm GTL result.
edm::RefVectorIterator< TriggerAlgorithmCollection > TriggerAlgorithmRefVectorIterator
Const iterator over vector of persistent references to items in the same TriggerAlgorithmCollection.
std::string name_
Data Members.
unsigned bit_
L1 algorithm bit number.
void setBit(unsigned bit)
Set L1 algorithm bit number.
bool tech_
Flag for technical L1 algorithms.
void setMask(bool mask)
Set L1 algorithm mask.
edm::RefVector< TriggerAlgorithmCollection > TriggerAlgorithmRefVector
Vector of persistent references to items in the same TriggerAlgorithmCollection.
std::vector< TriggerAlgorithm > TriggerAlgorithmCollection
Collection of TriggerAlgorithm.
std::string alias_
L1 algorithm alias.
const std::string & logicalExpression() const
Get L1 algorithm logical expression.
void setDecisionBeforeMask(bool decisionBeforeMask)
Set L1 algorithm decision, not considering the mask.
unsigned prescale() const
Get L1 algorithm pre-scale.
bool gtlResult() const
Get L1 algorithm GTL result.
bool hasConditionKey(unsigned conditionKey) const
Checks, if a certain trigger condition collection index is assigned.
const std::string & name() const
Get L1 algorithm name.
virtual ~TriggerAlgorithm()
Destructor.
bool mask_
L1 algorithm mask.
void setLogicalExpression(const std::string &expression)
Set L1 algorithm logical expression.
edm::Ref< TriggerAlgorithmCollection > TriggerAlgorithmRef
Persistent reference to an item in a TriggerAlgorithmCollection.
void setPrescale(unsigned prescale)
Set L1 algorithm pre-scale.
unsigned bit() const
Get L1 algorithm bit number.
edm::RefProd< TriggerAlgorithmCollection > TriggerAlgorithmRefProd
Persistent reference to a TriggerAlgorithmCollection product.
void setDecisionAfterMas(bool decisionAfterMask)
Set L1 algorithm decision, considering the mask.
bool decisionBeforeMask_
L1 algorithm decision, not considering the mask.
unsigned prescale_
L1 algorithm pre-scale.
void addConditionKey(unsigned conditionKey)
Add a new trigger condition collection index.
void setTechTrigger(bool tech)
Set flag for technical L1 algorithms.
void setName(const std::string &name)
Methods.
TriggerAlgorithm()
Constructors and Destructor.
void setAlias(const std::string &alias)
Set L1 algorithm alias.
bool decisionAfterMask_
L1 algorithm decision, considering the mask.