]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/BASE/AliHLTTriggerMenuItem.h
Removing unuseful print and putting some important one
[u/mrichter/AliRoot.git] / HLT / BASE / AliHLTTriggerMenuItem.h
1 //-*- Mode: C++ -*-
2 // $Id$
3 #ifndef ALIHLTTRIGGERMENUITEM_H
4 #define ALIHLTTRIGGERMENUITEM_H
5 /* This file is property of and copyright by the ALICE HLT Project        *
6  * ALICE Experiment at CERN, All rights reserved.                         *
7  * See cxx source for full Copyright notice                               */
8
9 /// @file   AliHLTTriggerMenuItem.h
10 /// @author Artur Szostak <artursz@iafrica.com>
11 /// @date   19 Dec 2008
12 /// @brief  Declaration of the AliHLTTriggerMenuItem class.
13
14 #include "TObject.h"
15 #include "TString.h"
16 #include "TArrayL.h"
17
18 /**
19  * \class AliHLTTriggerMenuItem
20  * A trigger menu item is used to store the information for a single entry in the
21  * HLT global trigger menu AliHLTTriggerMenu.
22  * It stores information about the trigger condition, trigger domain merging
23  * expression, trigger priority and the prescalar to apply.
24  * The trigger condition is an expression which indicates what must be true
25  * for the trigger menu entry to be fired. A fired item will then use the trigger
26  * domain merging expression for the computation of the final global trigger domain.
27  * All expressions must be valid C++.
28  *
29  * The symbols used in the trigger condition expressions are assumed to be AliHLTTrigger
30  * names, unless they are predefined in the trigger menu symbols table. All symbols should
31  * be valid C++ symbol names. However, the '-' character is allowed as a special extention.
32  * The '-' character must not be the first character of the symbol and there cannot be
33  * any spaces between it and the alphanumeric characters. If there are any spaces then
34  * the '-' character is treated as the normal C++ minus operator. For example,
35  * "abc-xyz" is a single whole symbol, while "abc - xyz" are two symbols, abc and xyz,
36  * separated by a minus operator.
37  *
38  * Merging expressions can use all the symbols defined in the trigger menu symbols table
39  * including all the implicit symbols used in the trigger conditions which are assumed
40  * to be AliHLTTrigger names. If a AliHLTTrigger name is not used in a trigger condition
41  * expression, but one wants to use the trigger domain in a merging expression, then a
42  * predefined symbol must be added to the trigger menu symbol table. As an example, in
43  * the following manner:
44  * \code
45  * AliHLTGlobalTriggerConfig config("test config");
46  * config.AddSymbol("myTriggerName", "bool", "this->Result()", "0", "AliHLTTriggerDecision");
47  * \endcode
48  * The trigger name "myTriggerName" should be replaced with the actual name of the
49  * AliHLTTrigger from which one wants to use the trigger domain result.
50  * Symbols with the '-' sign are be handled automatically and will be replaced
51  * by their appropriate versions with the minus signs replaced by underscores.
52  * This means that a minus sign in any other location is always treated as an operator.
53  * If uncertain then just put spaces around the minus operator.
54  *
55  * \note The following symbol names are reserved and should not be used in either
56  * the trigger condition or merging expressions:
57  *   _domain_
58  *   _description_
59  *   _item_result_
60  *   _group_result_
61  *   _previous_match_
62  *   _trigger_matched_
63  *   FillFromMenu
64  *   NewEvent
65  *   Add
66  *   CalculateTriggerDecision
67  *   GetCounters
68  *   SetCounters
69  *   CreateNew
70  */
71 class AliHLTTriggerMenuItem : public TObject
72 {
73  public:
74   
75   /**
76    * Default constructor.
77    */
78   AliHLTTriggerMenuItem();
79   
80   /**
81    * Default destructor.
82    */
83   virtual ~AliHLTTriggerMenuItem();
84   
85   /**
86    * Inherited from TObject, this prints the contents of the menu item.
87    * \param option  Can be "compact", which will print in the compact format.
88    */
89   virtual void Print(Option_t* option = "") const;
90   
91   /**
92    * Returns the optional comment string.
93    */
94   const char* Description() const { return fDescription.Data(); }
95   
96   /**
97    * Set the optional comment string.
98    */
99   void Description(const char* value) { fDescription = value; }
100   
101   /**
102    * Returns the trigger condition expression.
103    */
104   const char* TriggerCondition() const { return fConditionExpr.Data(); }
105   
106   /**
107    * Set the trigger condition expression.
108    */
109   void TriggerCondition(const char* value) { fConditionExpr = value; }
110   
111   /**
112    * Returns the trigger domain merging expression.
113    */
114   const char* MergeExpression() const { return fDomainExpr.Data(); }
115   
116   /**
117    * Set the trigger domain merging expression.
118    */
119   void MergeExpression(const char* value) { fDomainExpr = value; }
120   
121   /**
122    * Returns the pre-scalar value.
123    */
124   UInt_t PreScalar() const { return fPrescalar; }
125   
126   /**
127    * Set the pre-scalar value. A value of zero turns off the prescalar.
128    */
129   void PreScalar(UInt_t value) { fPrescalar = value; }
130   
131   /**
132    * Returns the priority value.
133    */
134   UInt_t Priority() const { return fPriority; }
135   
136   /**
137    * Set the priority value. Higher values give a higher priority.
138    */
139   void Priority(UInt_t value) { fPriority = value; }
140
141  private:
142   
143   TString fDescription;  /// Optional description or comment string.
144   TString fConditionExpr;  /// The trigger condition expression.
145   TString fDomainExpr;  /// Trigger domain merging expression.
146   UInt_t fPrescalar;  /// Pre-scalar value used to optionally reduce the trigger rate. Every modulus n'th event is triggered, where n equals the pre-scalar value.
147   UInt_t fPriority;  /// Priority of the trigger menu item. Higher values have higher priority.
148   
149   ClassDef(AliHLTTriggerMenuItem, 3) // Trigger menu item for global HLT trigger.
150 };
151
152 #endif // ALIHLTTRIGGERMENUITEM_H
153