]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/trigger/AliHLTGlobalTriggerConfig.h
Adding convenient print method to global trigger configuration helper class.
[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    * Inherited from TObject, this prints the contents of the current trigger menu
38    * being manipulated. Specifically fgMenu.
39    * \param option  This is passed on to the printing routine of the trigger menu.
40    */
41   virtual void Print(Option_t* option = "") const;
42   
43   /**
44    * Creates a new trigger menu. If a trigger menu is already active then the existing
45    * one is replaced with the new menu.
46    * \param name  The name of the new trigger menu.
47    */
48   static void NewMenu(const char* name);
49   
50   /**
51    * Deletes the current trigger menu.
52    */
53   static void Clear();
54   
55   /**
56    * Returns the current trigger menu.
57    */
58   static const AliHLTTriggerMenu* Menu() { return fgMenu; }
59   
60   /**
61    * Adds a new symbol to the current trigger menu.
62    * \param  name  The name of the symbol. It must be a valid C++ variable name.
63    * \param  type  The data type of the symbol. It must be a valid C++ data type.
64    * \param  assignExpr  The assignment expression for the symbol. It must be a
65    *     valid C++ expression. The 'this' keyword is used as a place holder for
66    *     the object found in the data block.
67    * \param  defaultExpr  The default value to use for the symbol. It must be a
68    *     valid C++ expression.
69    * \param className  The class name of the object found in the data block from
70    *     which to fetch the symbol's value.
71    */
72   static void AddSymbol(
73       const char* name, const char* type, const char* assignExpr,
74       const char* defaultExpr, const char* className = "TObject"
75     );
76   
77   /**
78    * Adds a new symbol to the current trigger menu.
79    * \param  name  The name of the symbol. It must be a valid C++ variable name.
80    * \param  type  The data type of the symbol. It must be a valid C++ data type.
81    * \param  assignExpr  The assignment expression for the symbol. It must be a
82    *     valid C++ expression. The 'this' keyword is used as a place holder for
83    *     the object found in the data block.
84    * \param  defaultExpr  The default value to use for the symbol. It must be a
85    *     valid C++ expression.
86    * \param className  The class name of the object found in the data block from
87    *     which to fetch the symbol's value.
88    * \param blockType  The data block type and origin from which to fetch the
89    *     symbol's value.
90    */
91   static void AddSymbol(
92       const char* name, const char* type, const char* assignExpr,
93       const char* defaultExpr, const char* className,
94       const AliHLTComponentDataType& blockType
95     );
96   
97   /**
98    * Adds a new symbol to the current trigger menu.
99    * \param  name  The name of the symbol. It must be a valid C++ variable name.
100    * \param  type  The data type of the symbol. It must be a valid C++ data type.
101    * \param  assignExpr  The assignment expression for the symbol. It must be a
102    *     valid C++ expression. The 'this' keyword is used as a place holder for
103    *     the object found in the data block.
104    * \param  defaultExpr  The default value to use for the symbol. It must be a
105    *     valid C++ expression.
106    * \param className  The class name of the object found in the data block from
107    *     which to fetch the symbol's value.
108    * \param blockType  The data block type and origin from which to fetch the
109    *     symbol's value.
110    * \param spec  The data block specification to use.
111    */
112   static void AddSymbol(
113       const char* name, const char* type, const char* assignExpr,
114       const char* defaultExpr, const char* className,
115       const AliHLTComponentDataType& blockType, UInt_t spec
116     );
117   
118   /**
119    * Adds a new symbol to the current trigger menu.
120    * \param  name  The name of the symbol. It must be a valid C++ variable name.
121    * \param  type  The data type of the symbol. It must be a valid C++ data type.
122    * \param  assignExpr  The assignment expression for the symbol. It must be a
123    *     valid C++ expression. The 'this' keyword is used as a place holder for
124    *     the object found in the data block.
125    * \param  defaultExpr  The default value to use for the symbol. It must be a
126    *     valid C++ expression.
127    * \param className  The class name of the object found in the data block from
128    *     which to fetch the symbol's value.
129    * \param blockType  The data block type string of the data block. The value
130    *    kAliHLTAnyDataTypeID can be used to specify the any type wild card value.
131    * \param origin  The origin of the data block, such as the detector name.
132    *    The value kAliHLTDataOriginAny can be used to specify the any origin
133    *    wild card value.
134    */
135   static void AddSymbol(
136       const char* name, const char* type, const char* assignExpr,
137       const char* defaultExpr, const char* className,
138       const char* blockType, const char* origin
139     );
140   
141   /**
142    * Adds a new symbol to the current trigger menu.
143    * \param  name  The name of the symbol. It must be a valid C++ variable name.
144    * \param  type  The data type of the symbol. It must be a valid C++ data type.
145    * \param  assignExpr  The assignment expression for the symbol. It must be a
146    *     valid C++ expression. The 'this' keyword is used as a place holder for
147    *     the object found in the data block.
148    * \param  defaultExpr  The default value to use for the symbol. It must be a
149    *     valid C++ expression.
150    * \param className  The class name of the object found in the data block from
151    *     which to fetch the symbol's value.
152    * \param blockType  The data block type string of the data block. The value
153    *    kAliHLTAnyDataTypeID can be used to specify the any type wild card value.
154    * \param origin  The origin of the data block, such as the detector name.
155    *    The value kAliHLTDataOriginAny can be used to specify the any origin
156    *    wild card value.
157    * \param spec  The data block specification to use.
158    */
159   static void AddSymbol(
160       const char* name, const char* type, const char* assignExpr,
161       const char* defaultExpr, const char* className,
162       const char* blockType, const char* origin, UInt_t spec
163     );
164   
165   /**
166    * Adds a new trigger menu item to the current trigger menu.
167    * \param  conditionExpr  The trigger condition expression. It must be a valid
168    *     C++ expression, where the symbol names must be either defined in the
169    *     menu or the names of AliHLTTrigger components.
170    * \param  domainExpr  The trigger domain merging expression. It must be a
171    *     valid C++ expression, where the symbol names must be either defined in
172    *     the menu or the names of AliHLTTrigger components.
173    * \param  prescalar  The prescalar value to use (Zero if not used).
174    * \param  description  Optional description string which will be used in the
175    *     global result.
176    */
177   static void AddItem(
178       const char* conditionExpr, const char* domainExpr, UInt_t prescalar,
179       const char* description = NULL
180     );
181   
182   /**
183    * Adds a new trigger menu item to the current trigger menu.
184    * \param  conditionExpr  The trigger condition expression. It must be a valid
185    *     C++ expression, where the symbol names must be either defined in the
186    *     menu or the names of AliHLTTrigger components.
187    * \param  domainExpr  The trigger domain merging expression. It must be a
188    *     valid C++ expression, where the symbol names must be either defined in
189    *     the menu or the names of AliHLTTrigger components.
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,
195       const char* description = NULL
196     );
197   
198  private:
199   
200   /// Not implemented. Do not allow copying of this object.
201   AliHLTGlobalTriggerConfig(const AliHLTGlobalTriggerConfig& obj);
202   /// Not implemented. Do not allow copying of this object.
203   AliHLTGlobalTriggerConfig& operator = (const AliHLTGlobalTriggerConfig& obj);
204   
205   static AliHLTTriggerMenu* fgMenu;  /// Trigger menu which is created by this interface class.
206   
207   ClassDef(AliHLTGlobalTriggerConfig, 0) // Interface class used to construct a global HLT trigger menu configuration.
208 };
209
210 #endif // ALIHLTGLOBALTRIGGERCONFIG_H
211