3 #ifndef ALIHLTTRIGGERMENUSYMBOL_H
4 #define ALIHLTTRIGGERMENUSYMBOL_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 AliHLTTriggerMenuSymbol.h
10 /// @author Artur Szostak <artursz@iafrica.com>
12 /// @brief Declaration of the AliHLTTriggerMenuSymbol class.
16 #include "AliHLTDataTypes.h"
17 #include "AliHLTDomainEntry.h"
20 * \class AliHLTTriggerMenuSymbol
21 * The trigger menu symbol is used to either label a TObject variable found in
22 * one of the input data blocks or create a constant object that can be used in
23 * various trigger menu expressions.
24 * It essentially represents a C++ variable with a name and type. This is filled
25 * with the information found in an input TObject, as specified by the
26 * <i>AssignExpression()</i> method. If nothing can be assigned because an
27 * appropriate TObject cannot be found, then a default value is used.
28 * The correct TObject is found by searching for a TObject with a matching class
29 * type as given by <i>ObjectClass()</i> from the input data blocks. The input
30 * data block must also have the data block type and specification match those
31 * given in the <i>BlockType()</i> method.
33 * The symbol name should normally be a valid C++ symbol name. This normally
34 * excludes the minus sign from being used in the name. However, since CTP trigger
35 * names use the minus sign extensively, the minus sign is also allowed in HLT
36 * trigger menu symbol names. This is implicitly converted to an underscore in the
37 * name. However, the original name with minus signs is retained and available
38 * with the <i>RealName()</i> method. In addition, the <i>RealName</i> is used
39 * for display purposes.
40 * \note Trigger menu symbols names that use minus signs are synonymous to those
41 * that use understores in the same locations. For this reason it is better to use
42 * one or the other form, but not both at the same time.
43 * \note The following symbol names are reserved and should not be used:
53 * CalculateTriggerDecision
58 class AliHLTTriggerMenuSymbol : public TObject
63 * Default constructor.
65 AliHLTTriggerMenuSymbol();
70 virtual ~AliHLTTriggerMenuSymbol();
73 * Inherited from TObject, this prints the contents of the symbol.
74 * \param option Can be "compact", which will print in the compact format.
76 virtual void Print(Option_t* option = "") const;
79 * Returns the real name which can differ from the symbol name
80 * by '-' characters instead of '_'. This approach has been introduced
81 * to allow trigger and item names containing '-' characters and thus
82 * violating the C++ naming conventions.
84 const char* RealName() const;
87 * Returns the valid C++ symbol name.
89 const char* Name() const { return fName.Data(); }
92 * Set the symbol name. It can contain '-' characters.
94 void Name(const char* value);
97 * Returns the symbol data type.
99 const char* Type() const { return fType.Data(); }
102 * Set the symbol data type.
104 void Type(const char* value) { fType = value; }
107 * Returns the data block type and specification from which the symbol is fetched.
109 const AliHLTDomainEntry& BlockType() const { return fBlockType; }
112 * Set the data block type and specification from which the symbol is fetched.
113 * \param type The data block type and origin to use.
115 void BlockType(const AliHLTComponentDataType& type)
117 fBlockType = AliHLTDomainEntry(type);
121 * Set the data block type and specification from which the symbol is fetched.
122 * \param blocktype The data block type string of the data block. The value
123 * kAliHLTAnyDataTypeID can be used to specify the any type wild card value.
124 * \param origin The origin of the data block, such as the detector name.
125 * The value kAliHLTDataOriginAny can be used to specify the any origin
128 void BlockType(const char* blocktype, const char* origin)
130 fBlockType = AliHLTDomainEntry(blocktype, origin);
134 * Set the data block type and specification from which the symbol is fetched.
135 * \param type The data block type and origin to use.
136 * \param spec The data block specification to use.
138 void BlockType(const AliHLTComponentDataType& type, UInt_t spec)
140 fBlockType = AliHLTDomainEntry(type, spec);
144 * Set the data block type and specification from which the symbol is fetched.
145 * \param blocktype The data block type string of the data block. The value
146 * kAliHLTAnyDataTypeID can be used to specify the any type wild card value.
147 * \param origin The origin of the data block, such as the detector name.
148 * The value kAliHLTDataOriginAny can be used to specify the any origin
150 * \param spec The data block specification to use.
152 void BlockType(const char* blocktype, const char* origin, UInt_t spec)
154 fBlockType = AliHLTDomainEntry(blocktype, origin, spec);
158 * Returns the class name of the object in the data block.
160 const char* ObjectClass() const { return fClass.Data(); }
163 * Set the class name of the object in the data block.
165 void ObjectClass(const char* value) { fClass = value; }
168 * Returns the expression to assign the symbol value.
170 const char* AssignExpression() const { return fAssignExpr.Data(); }
173 * Set the expression to assign the symbol value.
174 * The keyword 'this' is used as the place holder of the object in the matched
175 * data block. For example if we want to get a public attribute names xyz from
176 * the object to assign to the symbol we would write the assignment expression
179 void AssignExpression(const char* value) { fAssignExpr = value; }
182 * Returns the default value expression.
184 const char* DefaultValue() const { return fDefaultValue.Data(); }
187 * Set the default value expression.
189 void DefaultValue(const char* value) { fDefaultValue = value; }
193 TString fName; /// The name of the symbol (Must be a valid C++ variable name but can contain the '-' character as an extention).
194 TString fType; /// The data type of the symbol (Must be a valid C++ type name).
195 AliHLTDomainEntry fBlockType; /// The data block type and specification this symbol is fetched from.
196 TString fClass; /// The class name of the object to read from (Must be a valid C++ class name).
197 TString fAssignExpr; /// The expression to assign to the symbol (Must be a valid C++ expression).
198 TString fDefaultValue; /// The default value this symbol is set to (this must be a valid C++ expression).
199 TString fRealName; /// The name of the symbol, differs from fName by replaced '-' chars.
201 ClassDef(AliHLTTriggerMenuSymbol, 4) // Trigger menu item for global HLT trigger.
204 #endif // ALIHLTTRIGGERMENUSYMBOL_H