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 */
9 /// @file AliHLTTriggerMenuItem.h
10 /// @author Artur Szostak <artursz@iafrica.com>
12 /// @brief Declaration of the AliHLTTriggerMenuItem class.
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++.
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.
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:
45 * AliHLTGlobalTriggerConfig config("test config");
46 * config.AddSymbol("myTriggerName", "bool", "this->Result()", "0", "AliHLTTriggerDecision");
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.
55 * \note The following symbol names are reserved and should not be used in either
56 * the trigger condition or merging expressions:
66 * CalculateTriggerDecision
71 class AliHLTTriggerMenuItem : public TObject
76 * Default constructor.
78 AliHLTTriggerMenuItem();
83 virtual ~AliHLTTriggerMenuItem();
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.
89 virtual void Print(Option_t* option = "") const;
92 * Returns the optional comment string.
94 const char* Description() const { return fDescription.Data(); }
97 * Set the optional comment string.
99 void Description(const char* value) { fDescription = value; }
102 * Returns the trigger condition expression.
104 const char* TriggerCondition() const { return fConditionExpr.Data(); }
107 * Set the trigger condition expression.
109 void TriggerCondition(const char* value) { fConditionExpr = value; }
112 * Returns the trigger domain merging expression.
114 const char* MergeExpression() const { return fDomainExpr.Data(); }
117 * Set the trigger domain merging expression.
119 void MergeExpression(const char* value) { fDomainExpr = value; }
122 * Returns the pre-scalar value.
124 UInt_t PreScalar() const { return fPrescalar; }
127 * Set the pre-scalar value. A value of zero turns off the prescalar.
129 void PreScalar(UInt_t value) { fPrescalar = value; }
132 * Returns the priority value.
134 UInt_t Priority() const { return fPriority; }
137 * Set the priority value. Higher values give a higher priority.
139 void Priority(UInt_t value) { fPriority = value; }
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.
149 ClassDef(AliHLTTriggerMenuItem, 3) // Trigger menu item for global HLT trigger.
152 #endif // ALIHLTTRIGGERMENUITEM_H