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