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
31 * should be valid C++ symbol names. However, the '-' and '.' characters are allowed
32 * as a special extention. Neither the '-', nor '.' characters can be the first
33 * character of the symbol and there cannot be any spaces between it and the
34 * alphanumeric characters. If there are any spaces then the '-' or '.' character is
35 * treated as the normal C++ minus or dereferencing operator respectively.
36 * For example, "abc-xyz" is a single whole symbol, while "abc - xyz" are two symbols,
37 * abc and xyz, separated by a minus operator.
39 * Merging expressions can use all the symbols defined in the trigger menu symbols table
40 * including all the implicit symbols used in the trigger conditions which are assumed
41 * to be AliHLTTrigger names. If a AliHLTTrigger name is not used in a trigger condition
42 * expression, but one wants to use the trigger domain in a merging expression, then a
43 * predefined symbol must be added to the trigger menu symbol table. As an example, in
44 * the following manner:
46 * AliHLTGlobalTriggerConfig config("test config");
47 * config.AddSymbol("myTriggerName", "bool", "this->Result()", "0", "AliHLTTriggerDecision");
49 * The trigger name "myTriggerName" should be replaced with the actual name of the
50 * AliHLTTrigger from which one wants to use the trigger domain result.
51 * Symbols with the '-' sign are be handled automatically and will be replaced
52 * by their appropriate versions with the minus signs replaced by underscores.
53 * This means that a minus sign in any other location is always treated as an operator.
54 * If uncertain then just put spaces around the minus operator.
56 * \note The following symbol names are reserved and should not be used in either
57 * the trigger condition or merging expressions:
67 * CalculateTriggerDecision
72 class AliHLTTriggerMenuItem : public TObject
77 * Default constructor.
79 AliHLTTriggerMenuItem();
84 virtual ~AliHLTTriggerMenuItem();
87 * Inherited from TObject, this prints the contents of the menu item.
88 * \param option Can be "compact", which will print in the compact format.
90 virtual void Print(Option_t* option = "") const;
93 * Returns the optional comment string.
95 const char* Description() const { return fDescription.Data(); }
98 * Set the optional comment string.
100 void Description(const char* value) { fDescription = value; }
103 * Returns the trigger condition expression.
105 const char* TriggerCondition() const { return fConditionExpr.Data(); }
108 * Set the trigger condition expression.
110 void TriggerCondition(const char* value) { fConditionExpr = value; }
113 * Returns the trigger domain merging expression.
115 const char* MergeExpression() const { return fDomainExpr.Data(); }
118 * Set the trigger domain merging expression.
120 void MergeExpression(const char* value) { fDomainExpr = value; }
123 * Returns the pre-scalar value.
125 UInt_t PreScalar() const { return fPrescalar; }
128 * Set the pre-scalar value. A value of zero turns off the prescalar.
130 void PreScalar(UInt_t value) { fPrescalar = value; }
133 * Returns the priority value.
135 UInt_t Priority() const { return fPriority; }
138 * Set the priority value. Higher values give a higher priority.
140 void Priority(UInt_t value) { fPriority = value; }
144 TString fDescription; /// Optional description or comment string.
145 TString fConditionExpr; /// The trigger condition expression.
146 TString fDomainExpr; /// Trigger domain merging expression.
147 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.
148 UInt_t fPriority; /// Priority of the trigger menu item. Higher values have higher priority.
150 ClassDef(AliHLTTriggerMenuItem, 3) // Trigger menu item for global HLT trigger.
153 #endif // ALIHLTTRIGGERMENUITEM_H