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 // $Id: TriggerAlgorithm.h,v 1.5 2013/06/11 13:24:49 vadler Exp $
11 //
25 #include <string>
26 #include <vector>
27 
32 
33 
34 namespace pat {
35 
37 
39 
47  bool tech_;
49  unsigned bit_;
51  bool gtlResult_;
53  unsigned prescale_;
55  bool mask_;
62  std::vector< unsigned > conditionKeys_;
63 
64  public:
65 
67 
73  TriggerAlgorithm( const std::string & name, const std::string & alias, bool tech, unsigned bit, unsigned prescale, bool mask, bool decisionBeforeMask, bool decisionAfterMask ); // for backward compatibility
74  TriggerAlgorithm( const std::string & name, const std::string & alias, bool tech, unsigned bit, bool gtlResult, unsigned prescale, bool mask, bool decisionBeforeMask, bool decisionAfterMask );
75 
77  virtual ~TriggerAlgorithm() {};
78 
80 
82  void setName( const std::string & name ) { name_ = name; };
84  void setAlias( const std::string & alias ) { alias_ = alias; };
86  void setLogicalExpression( const std::string & expression ) { logic_ = expression; };
88  void setTechTrigger( bool tech ) { tech_ = tech; };
90  void setBit( unsigned bit ) { bit_ = bit; };
94  void setPrescale( unsigned prescale ) { prescale_ = prescale; };
96  void setMask( bool mask ) { mask_ = mask; };
102  void addConditionKey( unsigned conditionKey ) { if ( ! hasConditionKey( conditionKey ) ) conditionKeys_.push_back( conditionKey ); };
104  const std::string & name() const { return name_; };
106  const std::string & alias() const { return alias_; };
108  const std::string & logicalExpression() const { return logic_; };
110  bool techTrigger() const { return tech_; };
112  unsigned bit() const { return bit_; };
114  bool gtlResult() const { return gtlResult_; };
116  unsigned prescale() const { return prescale_; };
118  bool mask() const { return mask_; };
120  bool decisionBeforeMask() const { return decisionBeforeMask_; };
122  bool decisionAfterMask() const { return decisionAfterMask_; };
125  bool decision() const { return decisionAfterMask(); };
127  const std::vector< unsigned > & conditionKeys() const { return conditionKeys_; };
129  bool hasConditionKey( unsigned conditionKey ) const;
130 
131  };
132 
133 
135  typedef std::vector< TriggerAlgorithm > TriggerAlgorithmCollection;
144 
145 }
146 
147 
148 #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.