1 #ifndef ALIHLTGLOBALTRIGGERCOMPONENT_H
2 #define ALIHLTGLOBALTRIGGERCOMPONENT_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 */
7 /// @file AliHLTGlobalTriggerComponent.h
8 /// @author Artur Szostak <artursz@iafrica.com>
10 /// @brief Declaration of the AliHLTGlobalTriggerComponent component class.
12 #include "AliHLTTrigger.h"
14 class AliHLTTriggerMenu;
15 class AliHLTGlobalTrigger;
19 * \class AliHLTGlobalTriggerComponent
20 * This class applies the global HLT trigger to all trigger information produced
21 * by components deriving from AliHLTTrigger.
22 * Any information delivered by other components in data blocks that contain
23 * TObjects can also be used for the trigger algorithm. In such cases a symbol
24 * needs to be defined in the global trigger menu which can then be used inside
25 * the trigger condition expressions.
27 * <h2>General properties:</h2>
29 * Component ID: \b HLTGlobalTrigger <br>
30 * Library: \b libAliHLTTrigger.so <br>
31 * Input Data Types: ::kAliHLTAnyDataType <br>
32 * Output Data Types: kAliHLTDataTypeTObject|kAliHLTDataOriginOut <br>
34 * <h2>Mandatory arguments:</h2>
36 * <h2>Optional arguments:</h2>
37 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
38 * \li -config <i>filename</i> <br>
39 * Indicates the configuration macro file to use for the global HLT trigger menu.
40 * \li -includepath <i>path</i> <br>
41 * Indicates the include path to use if the automatically generated code that
42 * implements the global HLT trigger requires non-standard includes.
43 * \li -include <i>filename</i> <br>
44 * Indicates a file name that should be included in the automatically generated
45 * trigger implementation code.
47 * If specified the automatically generated class will contain extra debugging
48 * code and the ACLiC system will have debugging compilation turned on.
49 * \li -usecode <i>filename</i> <i>classname</i> <br>
50 * Used to force the component to use an existing class for the global HLT trigger
51 * class implementation, with the name of <i>classname</i> and found in the file
54 * <h2>Configuration:</h2>
55 * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
56 * Configuration by component arguments.
58 * <h2>Default CDB entries:</h2>
61 * <h2>Performance:</h2>
64 * <h2>Memory consumption:</h2>
67 * <h2>Output size:</h2>
70 * \ingroup alihlt_trigger_components
72 class AliHLTGlobalTriggerComponent : public AliHLTTrigger
76 AliHLTGlobalTriggerComponent();
77 virtual ~AliHLTGlobalTriggerComponent();
80 * Inherited from AliHLTTrigger.
81 * @return string containing the global trigger name.
83 virtual const char* GetTriggerName() const { return "HLTGlobalTrigger"; };
86 * Get a ratio by how much the data volume is shrunk or enhanced.
87 * The method returns a size proportional to the trigger name string length
88 * for constBase, and 1 for inputMultiplier.
89 * @param constBase <i>[out]</i>: additive part, independent of the
91 * @param inputMultiplier <i>[out]</i>: multiplication ratio
93 virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
96 * Initialise the component.
97 * \param argc The number of arguments in argv.
98 * \param argv Array of component argument strings.
99 * \returns Zero on success and negative number on failure.
101 virtual Int_t DoInit(int argc, const char** argv);
104 * Cleanup the component.
105 * \returns Zero on success and negative number on failure.
107 virtual Int_t DoDeinit();
110 * Spawn function creates a new object.
111 * @return new class instance.
113 virtual AliHLTComponent* Spawn();
118 * Applies the global HLT trigger.
119 * @return Zero is returned on success and a negative error code on failure.
121 virtual int DoTrigger();
125 /// Not implemented. Do not allow copying of this object.
126 AliHLTGlobalTriggerComponent(const AliHLTGlobalTriggerComponent& obj);
127 /// Not implemented. Do not allow copying of this object.
128 AliHLTGlobalTriggerComponent& operator = (const AliHLTGlobalTriggerComponent& obj);
131 * Generates the code for the global trigger to apply the given trigger menu.
132 * The code will then be compiled on the fly and loaded. The name of the new
133 * class is returned so that a new instance of the class can be created via:
135 * AliHLTGlobalTrigger::CreateNew(name)
137 * where name is the name of the generated class as returned by this method.
138 * \param menu <i>in</i> The trigger menu to create the global trigger class from.
139 * \param name <i>out</i> The name of the generated class.
140 * \param includePaths <i>in</i> The list of include path strings.
141 * \param includeFiles <i>in</i> The list of include file strings.
142 * \returns The error code suitable to return in DoInit. Zero on success.
145 const AliHLTTriggerMenu* menu, TString& name,
146 const TClonesArray& includePaths, const TClonesArray& includeFiles
150 * Loads the code for the generated HLT global trigger class. The code is compiled
151 * on the fly if possible, otherwise the CINT interpreter is used to interpret
153 * \param filename The name of the file containing the code for the global trigger class.
154 * \param includePaths <i>in</i> The list of include path strings.
155 * \returns The error code suitable to return in DoInit. Zero on success.
157 int LoadTriggerClass(const char* filename, const TClonesArray& includePaths);
160 * Searches for the specified symbol name in the given list.
161 * \param name The name of the symbol to find.
162 * \param list The list to search for the symbol in.
163 * \returns The position (index) of the symbol found or -1 if it was not found.
165 int FindSymbol(const char* name, const TClonesArray& list);
168 * Builds the list of symbols to use in the custom global trigger menu
169 * implementation class.
170 * \param menu The trigger menu to create the global trigger class from.
171 * \param list The list to fill with symbols.
172 * \returns The error code suitable to return in DoInit. Zero on success.
174 int BuildSymbolList(const AliHLTTriggerMenu* menu, TClonesArray& list);
176 AliHLTGlobalTrigger* fTrigger; //! Trigger object which implements the global trigger menu.
177 bool fDebugMode; //! Indicates if the generated global trigger class should be in debug mode.
179 ClassDef(AliHLTGlobalTriggerComponent, 0) // Global HLT trigger component class which produces the final trigger decision and readout list.
182 #endif // ALIHLTGLOBALTRIGGERCOMPONENT_H