]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/trigger/AliHLTGlobalTriggerConfig.h
Finished code for global HLT trigger and the trigger menu implementation.
[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
17 /**
18  * \class AliHLTGlobalTriggerConfig
19  * This class is a user interface class used to make it easy to create HLT global
20  * trigger configurations (trigger menus).
21  */
22 class AliHLTGlobalTriggerConfig
23 {
24  public:
25   
26   /**
27    * Default constructor.
28    */
29   AliHLTGlobalTriggerConfig(const char* name = NULL);
30   
31   /**
32    * Default destructor.
33    */
34   virtual ~AliHLTGlobalTriggerConfig();
35   
36   /**
37    * Creates a new trigger menu. If a trigger menu is already active then the existing
38    * one is replaced with the new menu.
39    * \param name  The name of the new trigger menu.
40    */
41   static void NewMenu(const char* name);
42   
43   /**
44    * Deletes the current trigger menu.
45    */
46   static void Clear();
47   
48   /**
49    * Returns the current trigger menu.
50    */
51   static const AliHLTTriggerMenu* Menu() { return fgMenu; }
52   
53   /**
54    * Adds a new symbol to the current trigger menu.
55    * \param  name  The name of the symbol. It must be a valid C++ variable name.
56    * \param  type  The data type of the symbol. It must be a valid C++ data type.
57    * \param  assignExpr  The assignment expression for the symbol. It must be a
58    *     valid C++ expression. The 'this' keyword is used as a place holder for
59    *     the object found in the data block.
60    * \param  defaultExpr  The default value to use for the symbol. It must be a
61    *     valid C++ expression.
62    * \param className  The class name of the object found in the data block from
63    *     which to fetch the symbol's value.
64    */
65   static void AddSymbol(
66       const char* name, const char* type, const char* assignExpr,
67       const char* defaultExpr, const char* className = "TObject"
68     );
69   
70   /**
71    * Adds a new symbol to the current trigger menu.
72    * \param  name  The name of the symbol. It must be a valid C++ variable name.
73    * \param  type  The data type of the symbol. It must be a valid C++ data type.
74    * \param  assignExpr  The assignment expression for the symbol. It must be a
75    *     valid C++ expression. The 'this' keyword is used as a place holder for
76    *     the object found in the data block.
77    * \param  defaultExpr  The default value to use for the symbol. It must be a
78    *     valid C++ expression.
79    * \param className  The class name of the object found in the data block from
80    *     which to fetch the symbol's value.
81    * \param blockType  The data block type and origin from which to fetch the
82    *     symbol's value.
83    */
84   static void AddSymbol(
85       const char* name, const char* type, const char* assignExpr,
86       const char* defaultExpr, const char* className,
87       const AliHLTComponentDataType& blockType
88     );
89   
90   /**
91    * Adds a new symbol to the current trigger menu.
92    * \param  name  The name of the symbol. It must be a valid C++ variable name.
93    * \param  type  The data type of the symbol. It must be a valid C++ data type.
94    * \param  assignExpr  The assignment expression for the symbol. It must be a
95    *     valid C++ expression. The 'this' keyword is used as a place holder for
96    *     the object found in the data block.
97    * \param  defaultExpr  The default value to use for the symbol. It must be a
98    *     valid C++ expression.
99    * \param className  The class name of the object found in the data block from
100    *     which to fetch the symbol's value.
101    * \param blockType  The data block type and origin from which to fetch the
102    *     symbol's value.
103    * \param spec  The data block specification to use.
104    */
105   static void AddSymbol(
106       const char* name, const char* type, const char* assignExpr,
107       const char* defaultExpr, const char* className,
108       const AliHLTComponentDataType& blockType, UInt_t spec
109     );
110   
111   /**
112    * Adds a new symbol to the current trigger menu.
113    * \param  name  The name of the symbol. It must be a valid C++ variable name.
114    * \param  type  The data type of the symbol. It must be a valid C++ data type.
115    * \param  assignExpr  The assignment expression for the symbol. It must be a
116    *     valid C++ expression. The 'this' keyword is used as a place holder for
117    *     the object found in the data block.
118    * \param  defaultExpr  The default value to use for the symbol. It must be a
119    *     valid C++ expression.
120    * \param className  The class name of the object found in the data block from
121    *     which to fetch the symbol's value.
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
126    *    wild card value.
127    */
128   static void AddSymbol(
129       const char* name, const char* type, const char* assignExpr,
130       const char* defaultExpr, const char* className,
131       const char* blockType, const char* origin
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    * \param spec  The data block specification to use.
151    */
152   static void AddSymbol(
153       const char* name, const char* type, const char* assignExpr,
154       const char* defaultExpr, const char* className,
155       const char* blockType, const char* origin, UInt_t spec
156     );
157   
158   /**
159    * Adds a new trigger menu item to the current trigger menu.
160    * \param  conditionExpr  The trigger condition expression. It must be a valid
161    *     C++ expression, where the symbol names must be either defined in the
162    *     menu or the names of AliHLTTrigger components.
163    * \param  domainExpr  The trigger domain merging expression. It must be a
164    *     valid C++ expression, where the symbol names must be either defined in
165    *     the menu or the names of AliHLTTrigger components.
166    * \param  prescalar  The prescalar value to use (Zero if not used).
167    * \param  description  Optional description string which will be used in the
168    *     global result.
169    */
170   static void AddItem(
171       const char* conditionExpr, const char* domainExpr, UInt_t prescalar,
172       const char* description = NULL
173     );
174   
175   /**
176    * Adds a new trigger menu item to the current trigger menu.
177    * \param  conditionExpr  The trigger condition expression. It must be a valid
178    *     C++ expression, where the symbol names must be either defined in the
179    *     menu or the names of AliHLTTrigger components.
180    * \param  domainExpr  The trigger domain merging expression. It must be a
181    *     valid C++ expression, where the symbol names must be either defined in
182    *     the menu or the names of AliHLTTrigger components.
183    * \param  description  Optional description string which will be used in the
184    *     global result.
185    */
186   static void AddItem(
187       const char* conditionExpr, const char* domainExpr,
188       const char* description = NULL
189     );
190   
191  private:
192   
193   /// Not implemented. Do not allow copying of this object.
194   AliHLTGlobalTriggerConfig(const AliHLTGlobalTriggerConfig& obj);
195   /// Not implemented. Do not allow copying of this object.
196   AliHLTGlobalTriggerConfig& operator = (const AliHLTGlobalTriggerConfig& obj);
197   
198   static AliHLTTriggerMenu* fgMenu;  /// Trigger menu which is created by this interface class.
199   
200   ClassDef(AliHLTGlobalTriggerConfig, 0) // Interface class used to construct a global HLT trigger menu configuration.
201 };
202
203 #endif // ALIHLTGLOBALTRIGGERCONFIG_H
204