CMS 3D CMS Logo

TriggerAlgorithm.h
Go to the documentation of this file.
1 #ifndef DataFormats_PatCandidates_TriggerAlgorithm_h
2 #define DataFormats_PatCandidates_TriggerAlgorithm_h
3 
4 // -*- C++ -*-
5 //
6 // Package: PatCandidates
7 // Class: pat::TriggerAlgorithm
8 //
9 //
21 #include <string>
22 #include <vector>
23 
28 
29 namespace pat {
30 
33 
41  bool tech_;
43  unsigned bit_;
45  bool gtlResult_;
47  unsigned prescale_;
49  bool mask_;
56  std::vector<unsigned> conditionKeys_;
57 
58  public:
60 
67  const std::string& alias,
68  bool tech,
69  unsigned bit,
70  unsigned prescale,
71  bool mask,
72  bool decisionBeforeMask,
73  bool decisionAfterMask); // for backward compatibility
75  const std::string& alias,
76  bool tech,
77  unsigned bit,
78  bool gtlResult,
79  unsigned prescale,
80  bool mask,
81  bool decisionBeforeMask,
82  bool decisionAfterMask);
83 
85  virtual ~TriggerAlgorithm(){};
86 
88 
90  void setName(const std::string& name) { name_ = name; };
92  void setAlias(const std::string& alias) { alias_ = alias; };
94  void setLogicalExpression(const std::string& expression) { logic_ = expression; };
96  void setTechTrigger(bool tech) { tech_ = tech; };
98  void setBit(unsigned bit) { bit_ = bit; };
100  void setGtlResult(bool gtlResult) { gtlResult_ = gtlResult; };
102  void setPrescale(unsigned prescale) { prescale_ = prescale; };
104  void setMask(bool mask) { mask_ = mask; };
106  void setDecisionBeforeMask(bool decisionBeforeMask) { decisionBeforeMask_ = decisionBeforeMask; };
108  void setDecisionAfterMas(bool decisionAfterMask) { decisionAfterMask_ = decisionAfterMask; };
110  void addConditionKey(unsigned conditionKey) {
111  if (!hasConditionKey(conditionKey))
112  conditionKeys_.push_back(conditionKey);
113  };
115  const std::string& name() const { return name_; };
117  const std::string& alias() const { return alias_; };
119  const std::string& logicalExpression() const { return logic_; };
121  bool techTrigger() const { return tech_; };
123  unsigned bit() const { return bit_; };
125  bool gtlResult() const { return gtlResult_; };
127  unsigned prescale() const { return prescale_; };
129  bool mask() const { return mask_; };
131  bool decisionBeforeMask() const { return decisionBeforeMask_; };
133  bool decisionAfterMask() const { return decisionAfterMask_; };
136  bool decision() const { return decisionAfterMask(); };
138  const std::vector<unsigned>& conditionKeys() const { return conditionKeys_; };
140  bool hasConditionKey(unsigned conditionKey) const;
141  };
142 
144  typedef std::vector<TriggerAlgorithm> TriggerAlgorithmCollection;
153 
154 } // namespace pat
155 
156 #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.
edm::Ref< TriggerAlgorithmCollection > TriggerAlgorithmRef
Persistent reference to an item in a TriggerAlgorithmCollection.
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.
std::string logic_
L1 algorithm logival expression.
std::vector< TriggerAlgorithm > TriggerAlgorithmCollection
Collection of TriggerAlgorithm.
edm::RefVector< TriggerAlgorithmCollection > TriggerAlgorithmRefVector
Vector of persistent references to items in the same TriggerAlgorithmCollection.
void setGtlResult(bool gtlResult)
Set L1 algorithm GTL result.
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.
Definition: HeavyIon.h:7
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.
edm::RefVectorIterator< TriggerAlgorithmCollection > TriggerAlgorithmRefVectorIterator
Const iterator over vector of persistent references to items in the same TriggerAlgorithmCollection.
bool mask_
L1 algorithm mask.
void setLogicalExpression(const std::string &expression)
Set L1 algorithm logical expression.
void setPrescale(unsigned prescale)
Set L1 algorithm pre-scale.
unsigned bit() const
Get L1 algorithm bit number.
std::vector< unsigned > conditionKeys_
void setDecisionAfterMas(bool decisionAfterMask)
Set L1 algorithm decision, considering the mask.
bool decisionBeforeMask_
L1 algorithm decision, not considering the mask.
const std::vector< unsigned > & conditionKeys() const
Get all trigger condition collection indeces.
unsigned prescale_
L1 algorithm pre-scale.
edm::RefProd< TriggerAlgorithmCollection > TriggerAlgorithmRefProd
Persistent reference to a TriggerAlgorithmCollection product.
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.