]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/trigger/AliHLTGlobalTriggerConfig.h
dding default trigger description and trigger domain parameters for AliHLTTriggerMenu...
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTGlobalTriggerConfig.h
1 #ifndef ALIHLTGLOBALTRIGGERCONFIG_H
2 #define ALIHLTGLOBALTRIGGERCONFIG_H
3 /* This file is property of and copyright by the ALICE HLT Project        *
4  * ALICE Experiment at CERN, All rights reserved.                         *
5  * See cxx source for full Copyright notice                               */
6
7 /// @file   AliHLTGlobalTriggerConfig.h
8 /// @author Artur Szostak <artursz@iafrica.com>
9 /// @date   28 Dec 2008
10 /// @brief  Declaration of the AliHLTGlobalTriggerConfig class.
11
12 #include "TObject.h"
13
14 class AliHLTComponentDataType;
15 class AliHLTTriggerMenu;
16 class AliHLTTriggerDomain;
17
18 /**
19  * \class AliHLTGlobalTriggerConfig
20  * This class is a user interface class used to make it easy to create HLT global
21  * trigger configurations (trigger menus).
22  */
23 class AliHLTGlobalTriggerConfig
24 {
25  public:
26   
27   /**
28    * Default constructor.
29    */
30   AliHLTGlobalTriggerConfig(const char* name = NULL);
31   
32   /**
33    * Default destructor.
34    */
35   virtual ~AliHLTGlobalTriggerConfig();
36   
37   /**
38    * Inherited from TObject, this prints the contents of the current trigger menu
39    * being manipulated. Specifically fgMenu.
40    * \param option  This is passed on to the printing routine of the trigger menu.
41    */
42   virtual void Print(Option_t* option = "") const;
43   
44   /**
45    * Creates a new trigger menu. If a trigger menu is already active then the existing
46    * one is replaced with the new menu.
47    * \param name  The name of the new trigger menu.
48    */
49   static void NewMenu(const char* name);
50   
51   /**
52    * Deletes the current trigger menu.
53    */
54   static void Clear();
55   
56   /**
57    * Returns the current trigger menu.
58    */
59   static const AliHLTTriggerMenu* Menu() { return fgMenu; }
60   
61   /**
62    * Adds a new symbol to the current trigger menu.
63    * \param  name  The name of the symbol. It must be a valid C++ variable name.
64    * \param  type  The data type of the symbol. It must be a valid C++ data type.
65    * \param  assignExpr  The assignment expression for the symbol. It must be a
66    *     valid C++ expression. The 'this' keyword is used as a place holder for
67    *     the object found in the data block.
68    * \param  defaultExpr  The default value to use for the symbol. It must be a
69    *     valid C++ expression.
70    * \param className  The class name of the object found in the data block from
71    *     which to fetch the symbol's value.
72    */
73   static void AddSymbol(
74       const char* name, const char* type, const char* assignExpr,
75       const char* defaultExpr, const char* className = "TObject"
76     );
77   
78   /**
79    * Adds a new symbol to the current trigger menu.
80    * \param  name  The name of the symbol. It must be a valid C++ variable name.
81    * \param  type  The data type of the symbol. It must be a valid C++ data type.
82    * \param  assignExpr  The assignment expression for the symbol. It must be a
83    *     valid C++ expression. The 'this' keyword is used as a place holder for
84    *     the object found in the data block.
85    * \param  defaultExpr  The default value to use for the symbol. It must be a
86    *     valid C++ expression.
87    * \param className  The class name of the object found in the data block from
88    *     which to fetch the symbol's value.
89    * \param blockType  The data block type and origin from which to fetch the
90    *     symbol's value.
91    */
92   static void AddSymbol(
93       const char* name, const char* type, const char* assignExpr,
94       const char* defaultExpr, const char* className,
95       const AliHLTComponentDataType& blockType
96     );
97   
98   /**
99    * Adds a new symbol to the current trigger menu.
100    * \param  name  The name of the symbol. It must be a valid C++ variable name.
101    * \param  type  The data type of the symbol. It must be a valid C++ data type.
102    * \param  assignExpr  The assignment expression for the symbol. It must be a
103    *     valid C++ expression. The 'this' keyword is used as a place holder for
104    *     the object found in the data block.
105    * \param  defaultExpr  The default value to use for the symbol. It must be a
106    *     valid C++ expression.
107    * \param className  The class name of the object found in the data block from
108    *     which to fetch the symbol's value.
109    * \param blockType  The data block type and origin from which to fetch the
110    *     symbol's value.
111    * \param spec  The data block specification to use.
112    */
113   static void AddSymbol(
114       const char* name, const char* type, const char* assignExpr,
115       const char* defaultExpr, const char* className,
116       const AliHLTComponentDataType& blockType, UInt_t spec
117     );
118   
119   /**
120    * Adds a new symbol to the current trigger menu.
121    * \param  name  The name of the symbol. It must be a valid C++ variable name.
122    * \param  type  The data type of the symbol. It must be a valid C++ data type.
123    * \param  assignExpr  The assignment expression for the symbol. It must be a
124    *     valid C++ expression. The 'this' keyword is used as a place holder for
125    *     the object found in the data block.
126    * \param  defaultExpr  The default value to use for the symbol. It must be a
127    *     valid C++ expression.
128    * \param className  The class name of the object found in the data block from
129    *     which to fetch the symbol's value.
130    * \param blockType  The data block type string of the data block. The value
131    *    kAliHLTAnyDataTypeID can be used to specify the any type wild card value.
132    * \param origin  The origin of the data block, such as the detector name.
133    *    The value kAliHLTDataOriginAny can be used to specify the any origin
134    *    wild card value.
135    */
136   static void AddSymbol(
137       const char* name, const char* type, const char* assignExpr,
138       const char* defaultExpr, const char* className,
139       const char* blockType, const char* origin
140     );
141   
142   /**
143    * Adds a new symbol to the current trigger menu.
144    * \param  name  The name of the symbol. It must be a valid C++ variable name.
145    * \param  type  The data type of the symbol. It must be a valid C++ data type.
146    * \param  assignExpr  The assignment expression for the symbol. It must be a
147    *     valid C++ expression. The 'this' keyword is used as a place holder for
148    *     the object found in the data block.
149    * \param  defaultExpr  The default value to use for the symbol. It must be a
150    *     valid C++ expression.
151    * \param className  The class name of the object found in the data block from
152    *     which to fetch the symbol's value.
153    * \param blockType  The data block type string of the data block. The value
154    *    kAliHLTAnyDataTypeID can be used to specify the any type wild card value.
155    * \param origin  The origin of the data block, such as the detector name.
156    *    The value kAliHLTDataOriginAny can be used to specify the any origin
157    *    wild card value.
158    * \param spec  The data block specification to use.
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, UInt_t spec
164     );
165   
166   /**
167    * Adds a new trigger menu item to the current trigger menu.
168    * \param  conditionExpr  The trigger condition expression. It must be a valid
169    *     C++ expression, where the symbol names must be either defined in the
170    *     menu or the names of AliHLTTrigger components.
171    * \param  domainExpr  The trigger domain merging expression. It must be a
172    *     valid C++ expression, where the symbol names must be either defined in
173    *     the menu or the names of AliHLTTrigger components.
174    * \param  prescalar  The prescalar value to use (Zero if not used).
175    * \param  description  Optional description string which will be used in the
176    *     global result.
177    */
178   static void AddItem(
179       const char* conditionExpr, const char* domainExpr, UInt_t prescalar,
180       const char* description = NULL
181     );
182   
183   /**
184    * Adds a new trigger menu item to the current trigger menu.
185    * \param  conditionExpr  The trigger condition expression. It must be a valid
186    *     C++ expression, where the symbol names must be either defined in the
187    *     menu or the names of AliHLTTrigger components.
188    * \param  domainExpr  The trigger domain merging expression. It must be a
189    *     valid C++ expression, where the symbol names must be either defined in
190    *     the menu or the names of AliHLTTrigger components.
191    * \param  description  Optional description string which will be used in the
192    *     global result.
193    */
194   static void AddItem(
195       const char* conditionExpr, const char* domainExpr,
196       const char* description = NULL
197     );
198   
199   /**
200    * Sets the default trigger description string that should be used by the global
201    * trigger component for trigger decisions that have a negative (false) trigger
202    * result.
203    * \param  description  The trigger description string to use.
204    */
205   static void SetDefaultTriggerDescription(const char* description);
206   
207   /**
208    * This method sets the default trigger domain to use by the global trigger
209    * component or trigger decisions that have a negative (false) trigger result.
210    * \param  domain  The new value of the default trigger domain.
211    */
212   static void SetDefaultTriggerDomain(const AliHLTTriggerDomain& domain);
213   
214   /**
215    * Fetches the default trigger domain that will be used by the global trigger
216    * component or trigger decisions that have a negative (false) trigger result.
217    * \returns The default trigger domain for the current trigger menu.
218    */
219   static AliHLTTriggerDomain& DefaultTriggerDomain();
220   
221  private:
222   
223   /// Not implemented. Do not allow copying of this object.
224   AliHLTGlobalTriggerConfig(const AliHLTGlobalTriggerConfig& obj);
225   /// Not implemented. Do not allow copying of this object.
226   AliHLTGlobalTriggerConfig& operator = (const AliHLTGlobalTriggerConfig& obj);
227   
228   static AliHLTTriggerMenu* fgMenu;  /// Trigger menu which is created by this interface class.
229   
230   ClassDef(AliHLTGlobalTriggerConfig, 0) // Interface class used to construct a global HLT trigger menu configuration.
231 };
232
233 #endif // ALIHLTGLOBALTRIGGERCONFIG_H
234