]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/trigger/AliHLTGlobalTriggerConfig.h
CMake: removing qpythia from the depedencies
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTGlobalTriggerConfig.h
1 //-*- Mode: C++ -*-
2 // $Id$
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
16 class AliHLTComponentDataType;
17 class AliHLTTriggerMenu;
18 class AliHLTTriggerDomain;
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).
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_
33  */
34 class 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   
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   
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   
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   
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   
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    * \param  defaultResult  The default result to use for the global trigger decision
204    *     if this item's trigger condition is matched.
205    */
206   static void AddItem(
207       UInt_t priority, const char* conditionExpr, const char* domainExpr,
208       UInt_t prescalar, const char* description = NULL, bool defaultResult = true
209     );
210   
211   /**
212    * Adds a new trigger menu item to the current trigger menu with a particular priority.
213    * \param  priority  The priority group this entry should be part of. Higher numbers
214    *     indicate higher priorities.
215    * \param  conditionExpr  The trigger condition expression. It must be a valid
216    *     C++ expression, where the symbol names must be either defined in the
217    *     menu or the names of AliHLTTrigger components.
218    * \param  domainExpr  The trigger domain merging expression. It must be a
219    *     valid C++ expression, where the symbol names must be either defined in
220    *     the menu or the names of AliHLTTrigger components.
221    * \param  description  Optional description string which will be used in the
222    *     global result.
223    * \param  scaledown  The scale-down factor to use as a percentage in the range [0..100].
224    * \param  defaultResult  The default result to use for the global trigger decision
225    *     if this item's trigger condition is matched.
226    */
227   static void AddItem(
228       UInt_t priority, const char* conditionExpr, const char* domainExpr,
229       const char* description = NULL, Double_t scaledown = 100, bool defaultResult = true
230     );
231   
232   /**
233    * Adds a new trigger menu item to the current trigger menu.
234    * \param  conditionExpr  The trigger condition expression. It must be a valid
235    *     C++ expression, where the symbol names must be either defined in the
236    *     menu or the names of AliHLTTrigger components.
237    * \param  domainExpr  The trigger domain merging expression. It must be a
238    *     valid C++ expression, where the symbol names must be either defined in
239    *     the menu or the names of AliHLTTrigger components.
240    * \param  prescalar  The prescalar value to use (Zero if not used).
241    * \param  description  Optional description string which will be used in the
242    *     global result.
243    */
244   static void AddItem(
245       const char* conditionExpr, const char* domainExpr, UInt_t prescalar,
246       const char* description = NULL
247     );
248   
249   /**
250    * Adds a new trigger menu item to the current trigger menu.
251    * \param  conditionExpr  The trigger condition expression. It must be a valid
252    *     C++ expression, where the symbol names must be either defined in the
253    *     menu or the names of AliHLTTrigger components.
254    * \param  domainExpr  The trigger domain merging expression. It must be a
255    *     valid C++ expression, where the symbol names must be either defined in
256    *     the menu or the names of AliHLTTrigger components.
257    * \param  description  Optional description string which will be used in the
258    *     global result.
259    */
260   static void AddItem(
261       const char* conditionExpr, const char* domainExpr,
262       const char* description = NULL
263     );
264   
265   /**
266    * Sets the default trigger description string that should be used by the global
267    * trigger component for trigger decisions that have a negative (false) trigger
268    * result.
269    * \param  description  The trigger description string to use.
270    */
271   static void SetDefaultTriggerDescription(const char* description);
272   
273   /**
274    * This method sets the default trigger domain to use by the global trigger
275    * component or trigger decisions that have a negative (false) trigger result.
276    * \param  domain  The new value of the default trigger domain.
277    */
278   static void SetDefaultTriggerDomain(const AliHLTTriggerDomain& domain);
279   
280   /**
281    * Fetches the default trigger domain that will be used by the global trigger
282    * component or trigger decisions that have a negative (false) trigger result.
283    * \returns The default trigger domain for the current trigger menu.
284    */
285   static AliHLTTriggerDomain& DefaultTriggerDomain();
286   
287   /**
288    * This method sets the default operator used to merge trigger conditions from
289    * the same trigger menu priority group.
290    * The trigger menu normally uses the 'or' operator.
291    * \param  op  The new default operator to use.
292    */
293   static void SetDefaultConditionOperator(const char* op);
294   
295   /**
296    * This method sets the default operator used to merge trigger domains from
297    * the same trigger menu priority group that get matched.
298    * The trigger menu normally uses the '|' operator.
299    * \param  op  The new default operator to use.
300    */
301   static void SetDefaultDomainOperator(const char* op);
302   
303   /**
304    * Set the default result for the global trigger if no item is matched.
305    */
306   static void SetDefaultResult(bool value);
307   
308  private:
309   
310   /// Not implemented. Do not allow copying of this object.
311   AliHLTGlobalTriggerConfig(const AliHLTGlobalTriggerConfig& obj);
312   /// Not implemented. Do not allow copying of this object.
313   AliHLTGlobalTriggerConfig& operator = (const AliHLTGlobalTriggerConfig& obj);
314   
315   static AliHLTTriggerMenu* fgMenu;  /// Trigger menu which is created by this interface class.
316   
317   ClassDef(AliHLTGlobalTriggerConfig, 0) // Interface class used to construct a global HLT trigger menu configuration.
318 };
319
320 #endif // ALIHLTGLOBALTRIGGERCONFIG_H
321