]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/trigger/AliHLTGlobalTriggerConfig.h
Updates for unit testing software triggers.
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTGlobalTriggerConfig.h
CommitLineData
c580e182 1//-*- Mode: C++ -*-
81d62bb4 2// $Id$
52f67e50 3#ifndef ALIHLTGLOBALTRIGGERCONFIG_H
4#define ALIHLTGLOBALTRIGGERCONFIG_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 AliHLTGlobalTriggerConfig.h
10/// @author Artur Szostak <artursz@iafrica.com>
11/// @date 28 Dec 2008
12/// @brief Declaration of the AliHLTGlobalTriggerConfig class.
13
14#include "TObject.h"
15
16class AliHLTComponentDataType;
17class AliHLTTriggerMenu;
acc7214e 18class AliHLTTriggerDomain;
52f67e50 19
20/**
21 * \class AliHLTGlobalTriggerConfig
22 * This class is a user interface class used to make it easy to create HLT global
23 * trigger configurations (trigger menus).
81d62bb4 24 *
25 * \note The following symbol names are reserved and should not be used in any
26 * of the trigger conditions, merging expressions or trigger menu symbols:
27 * _domain_
28 * _description_
29 * _item_result_
30 * _group_result_
31 * _previous_match_
32 * _trigger_matched_
52f67e50 33 */
34class AliHLTGlobalTriggerConfig
35{
36 public:
37
38 /**
39 * Default constructor.
40 */
41 AliHLTGlobalTriggerConfig(const char* name = NULL);
42
43 /**
44 * Default destructor.
45 */
46 virtual ~AliHLTGlobalTriggerConfig();
47
4d40957a 48 /**
49 * Inherited from TObject, this prints the contents of the current trigger menu
50 * being manipulated. Specifically fgMenu.
51 * \param option This is passed on to the printing routine of the trigger menu.
52 */
53 virtual void Print(Option_t* option = "") const;
54
52f67e50 55 /**
56 * Creates a new trigger menu. If a trigger menu is already active then the existing
57 * one is replaced with the new menu.
58 * \param name The name of the new trigger menu.
59 */
60 static void NewMenu(const char* name);
61
62 /**
63 * Deletes the current trigger menu.
64 */
65 static void Clear();
66
67 /**
68 * Returns the current trigger menu.
69 */
70 static const AliHLTTriggerMenu* Menu() { return fgMenu; }
71
e8b1e4ab 72 /**
73 * Adds a new constant symbol to the current trigger menu.
74 * This is useful to add symbols that are used as constants in the trigger
75 * menu condition or merging expressions.
76 * \param name The name of the symbol. It must be a valid C++ variable name.
77 * \param type The data type of the symbol. It must be a valid C++ data type.
78 * \param defaultExpr The default value to use for the symbol. It must be a
79 * valid C++ expression.
80 */
81 static void AddSymbol(
82 const char* name, const char* type, const char* defaultExpr
83 );
84
52f67e50 85 /**
86 * Adds a new symbol to the current trigger menu.
87 * \param name The name of the symbol. It must be a valid C++ variable name.
88 * \param type The data type of the symbol. It must be a valid C++ data type.
89 * \param assignExpr The assignment expression for the symbol. It must be a
90 * valid C++ expression. The 'this' keyword is used as a place holder for
91 * the object found in the data block.
92 * \param defaultExpr The default value to use for the symbol. It must be a
93 * valid C++ expression.
94 * \param className The class name of the object found in the data block from
95 * which to fetch the symbol's value.
96 */
97 static void AddSymbol(
98 const char* name, const char* type, const char* assignExpr,
99 const char* defaultExpr, const char* className = "TObject"
100 );
101
102 /**
103 * Adds a new symbol to the current trigger menu.
104 * \param name The name of the symbol. It must be a valid C++ variable name.
105 * \param type The data type of the symbol. It must be a valid C++ data type.
106 * \param assignExpr The assignment expression for the symbol. It must be a
107 * valid C++ expression. The 'this' keyword is used as a place holder for
108 * the object found in the data block.
109 * \param defaultExpr The default value to use for the symbol. It must be a
110 * valid C++ expression.
111 * \param className The class name of the object found in the data block from
112 * which to fetch the symbol's value.
113 * \param blockType The data block type and origin from which to fetch the
114 * symbol's value.
115 */
116 static void AddSymbol(
117 const char* name, const char* type, const char* assignExpr,
118 const char* defaultExpr, const char* className,
119 const AliHLTComponentDataType& blockType
120 );
121
122 /**
123 * Adds a new symbol to the current trigger menu.
124 * \param name The name of the symbol. It must be a valid C++ variable name.
125 * \param type The data type of the symbol. It must be a valid C++ data type.
126 * \param assignExpr The assignment expression for the symbol. It must be a
127 * valid C++ expression. The 'this' keyword is used as a place holder for
128 * the object found in the data block.
129 * \param defaultExpr The default value to use for the symbol. It must be a
130 * valid C++ expression.
131 * \param className The class name of the object found in the data block from
132 * which to fetch the symbol's value.
133 * \param blockType The data block type and origin from which to fetch the
134 * symbol's value.
135 * \param spec The data block specification to use.
136 */
137 static void AddSymbol(
138 const char* name, const char* type, const char* assignExpr,
139 const char* defaultExpr, const char* className,
140 const AliHLTComponentDataType& blockType, UInt_t spec
141 );
142
143 /**
144 * Adds a new symbol to the current trigger menu.
145 * \param name The name of the symbol. It must be a valid C++ variable name.
146 * \param type The data type of the symbol. It must be a valid C++ data type.
147 * \param assignExpr The assignment expression for the symbol. It must be a
148 * valid C++ expression. The 'this' keyword is used as a place holder for
149 * the object found in the data block.
150 * \param defaultExpr The default value to use for the symbol. It must be a
151 * valid C++ expression.
152 * \param className The class name of the object found in the data block from
153 * which to fetch the symbol's value.
154 * \param blockType The data block type string of the data block. The value
155 * kAliHLTAnyDataTypeID can be used to specify the any type wild card value.
156 * \param origin The origin of the data block, such as the detector name.
157 * The value kAliHLTDataOriginAny can be used to specify the any origin
158 * wild card value.
159 */
160 static void AddSymbol(
161 const char* name, const char* type, const char* assignExpr,
162 const char* defaultExpr, const char* className,
163 const char* blockType, const char* origin
164 );
165
166 /**
167 * Adds a new symbol to the current trigger menu.
168 * \param name The name of the symbol. It must be a valid C++ variable name.
169 * \param type The data type of the symbol. It must be a valid C++ data type.
170 * \param assignExpr The assignment expression for the symbol. It must be a
171 * valid C++ expression. The 'this' keyword is used as a place holder for
172 * the object found in the data block.
173 * \param defaultExpr The default value to use for the symbol. It must be a
174 * valid C++ expression.
175 * \param className The class name of the object found in the data block from
176 * which to fetch the symbol's value.
177 * \param blockType The data block type string of the data block. The value
178 * kAliHLTAnyDataTypeID can be used to specify the any type wild card value.
179 * \param origin The origin of the data block, such as the detector name.
180 * The value kAliHLTDataOriginAny can be used to specify the any origin
181 * wild card value.
182 * \param spec The data block specification to use.
183 */
184 static void AddSymbol(
185 const char* name, const char* type, const char* assignExpr,
186 const char* defaultExpr, const char* className,
187 const char* blockType, const char* origin, UInt_t spec
188 );
189
81d62bb4 190 /**
191 * Adds a new trigger menu item to the current trigger menu with a particular priority.
192 * \param priority The priority group this entry should be part of. Higher numbers
193 * indicate higher priorities.
194 * \param conditionExpr The trigger condition expression. It must be a valid
195 * C++ expression, where the symbol names must be either defined in the
196 * menu or the names of AliHLTTrigger components.
197 * \param domainExpr The trigger domain merging expression. It must be a
198 * valid C++ expression, where the symbol names must be either defined in
199 * the menu or the names of AliHLTTrigger components.
200 * \param prescalar The prescalar value to use (Zero if not used).
201 * \param description Optional description string which will be used in the
202 * global result.
203 */
204 static void AddItem(
205 UInt_t priority, const char* conditionExpr, const char* domainExpr,
206 UInt_t prescalar, const char* description = NULL
207 );
208
52f67e50 209 /**
210 * Adds a new trigger menu item to the current trigger menu.
211 * \param conditionExpr The trigger condition expression. It must be a valid
212 * C++ expression, where the symbol names must be either defined in the
213 * menu or the names of AliHLTTrigger components.
214 * \param domainExpr The trigger domain merging expression. It must be a
215 * valid C++ expression, where the symbol names must be either defined in
216 * the menu or the names of AliHLTTrigger components.
217 * \param prescalar The prescalar value to use (Zero if not used).
218 * \param description Optional description string which will be used in the
219 * global result.
220 */
221 static void AddItem(
222 const char* conditionExpr, const char* domainExpr, UInt_t prescalar,
223 const char* description = NULL
224 );
225
81d62bb4 226 /**
227 * Adds a new trigger menu item to the current trigger menu with a particular priority.
228 * \param priority The priority group this entry should be part of. Higher numbers
229 * indicate higher priorities.
230 * \param conditionExpr The trigger condition expression. It must be a valid
231 * C++ expression, where the symbol names must be either defined in the
232 * menu or the names of AliHLTTrigger components.
233 * \param domainExpr The trigger domain merging expression. It must be a
234 * valid C++ expression, where the symbol names must be either defined in
235 * the menu or the names of AliHLTTrigger components.
236 * \param description Optional description string which will be used in the
237 * global result.
238 */
239 static void AddItem(
240 UInt_t priority, const char* conditionExpr, const char* domainExpr,
241 const char* description = NULL
242 );
243
52f67e50 244 /**
245 * Adds a new trigger menu item to the current trigger menu.
246 * \param conditionExpr The trigger condition expression. It must be a valid
247 * C++ expression, where the symbol names must be either defined in the
248 * menu or the names of AliHLTTrigger components.
249 * \param domainExpr The trigger domain merging expression. It must be a
250 * valid C++ expression, where the symbol names must be either defined in
251 * the menu or the names of AliHLTTrigger components.
252 * \param description Optional description string which will be used in the
253 * global result.
254 */
255 static void AddItem(
256 const char* conditionExpr, const char* domainExpr,
257 const char* description = NULL
258 );
259
acc7214e 260 /**
261 * Sets the default trigger description string that should be used by the global
262 * trigger component for trigger decisions that have a negative (false) trigger
263 * result.
264 * \param description The trigger description string to use.
265 */
266 static void SetDefaultTriggerDescription(const char* description);
267
268 /**
269 * This method sets the default trigger domain to use by the global trigger
270 * component or trigger decisions that have a negative (false) trigger result.
271 * \param domain The new value of the default trigger domain.
272 */
273 static void SetDefaultTriggerDomain(const AliHLTTriggerDomain& domain);
274
275 /**
276 * Fetches the default trigger domain that will be used by the global trigger
277 * component or trigger decisions that have a negative (false) trigger result.
278 * \returns The default trigger domain for the current trigger menu.
279 */
280 static AliHLTTriggerDomain& DefaultTriggerDomain();
281
81d62bb4 282 /**
283 * This method sets the default operator used to merge trigger conditions from
284 * the same trigger menu priority group.
285 * The trigger menu normally uses the 'or' operator.
286 * \param op The new default operator to use.
287 */
288 static void SetDefaultConditionOperator(const char* op);
289
290 /**
291 * This method sets the default operator used to merge trigger domains from
292 * the same trigger menu priority group that get matched.
293 * The trigger menu normally uses the '|' operator.
294 * \param op The new default operator to use.
295 */
296 static void SetDefaultDomainOperator(const char* op);
297
52f67e50 298 private:
299
300 /// Not implemented. Do not allow copying of this object.
301 AliHLTGlobalTriggerConfig(const AliHLTGlobalTriggerConfig& obj);
302 /// Not implemented. Do not allow copying of this object.
303 AliHLTGlobalTriggerConfig& operator = (const AliHLTGlobalTriggerConfig& obj);
304
305 static AliHLTTriggerMenu* fgMenu; /// Trigger menu which is created by this interface class.
306
307 ClassDef(AliHLTGlobalTriggerConfig, 0) // Interface class used to construct a global HLT trigger menu configuration.
308};
309
310#endif // ALIHLTGLOBALTRIGGERCONFIG_H
311