/// @brief Declaration of the AliHLTGlobalTriggerComponent component class.
#include "AliHLTTrigger.h"
+#include "AliHLTTriggerDecision.h"
#include "TClonesArray.h"
class AliHLTTriggerMenu;
class AliHLTGlobalTrigger;
+class AliRawDataHeader;
/**
* \class AliHLTGlobalTriggerComponent
* Component ID: \b HLTGlobalTrigger <br>
* Library: \b libAliHLTTrigger.so <br>
* Input Data Types: ::kAliHLTAnyDataType <br>
- * Output Data Types: kAliHLTDataTypeTObject|kAliHLTDataOriginOut <br>
+ * Output Data Types: kAliHLTDataTypeGlobalTrigger and kAliHLTDataTypeReadoutList <br>
*
* <h2>Mandatory arguments:</h2>
+ * None.
*
* <h2>Optional arguments:</h2>
* <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
* <i>filename</i>.
* \li -skipctp <br>
* Indicates that the CTP data should not be added to the global HLT trigger decision.
+ * \li -forward-input <br>
+ * Forward the input objects instead of adding them to the global HLT trigger decision.
+ * This will also add a short info on the input objects and decisions, like
+ * -include-input=short, to switch off -include-input=none can be placed after the
+ * parameter
+ * \li -include-input[=none,short,objects,both] <br>
+ * Steer adding of input objects to the global HLT trigger decision.
+ * Options: none - include nothing, short - include a short TNames array,
+ * objects - include objects, by default on
+ * both - include both objects and short info
+ * \li -process-all-events <br>
+ * Indicates that all events should be processed with the global trigger logic and
+ * not just the data events. The default is not to process just the data events.
+ * \li -monitoring[=n] <br>
+ * enable monitoring trigger once every n seconds, enable for every event if
+ * parameter n is omitted
+ * \li -dont-make-software-triggers <br>
+ * This option prevents the Common Data Header from being interpreted to generate
+ * software event input triggers for the trigger menu. Normally the following default
+ * triggers are available in the trigger menu:
+ * START_OF_DATA - start of data event.
+ * END_OF_DATA - end of data event.
+ * SOFTWARE - general software trigger.
+ * CALIBRATION - calibration trigger.
+ * With this option these will not be automatically generated by the global trigger.
+ * \li -randomseed <i>number</i> <br>
+ * Specifies the random number seed to give to the internal random number generator.
+ * This is only useful for debugging to generate reproducible number sequences.
+ * The random numbers are only used if a trigger is scaled down using the scale down
+ * option in a trigger menu item. The seed is normally randomly chosen by default.
*
* <h2>Configuration:</h2>
- * <!-- NOTE: ignore the \li. <i> and </i>: it's just doxygen formatting -->
- * Configuration by component arguments.
+ * Configured from CDB but can be overridden with the -config argument.
*
* <h2>Default CDB entries:</h2>
* HLT/ConfigHLT/HLTGlobalTrigger - Contains the global trigger menu.
/**
* Inherited from AliHLTTrigger.
* This returns kAliHLTDataTypeGlobalTrigger by default.
- * @param list <i>[out]</i>: The list of data types to be filled.
+ * @param [out] list The list of data types to be filled.
*/
virtual void GetOutputDataTypes(AliHLTComponentDataTypeList& list) const;
* Get a ratio by how much the data volume is shrunk or enhanced.
* The method returns a size proportional to the trigger name string length
* for constBase, and 1 for inputMultiplier.
- * @param constBase <i>[out]</i>: additive part, independent of the
- * input data volume
- * @param inputMultiplier <i>[out]</i>: multiplication ratio
+ * @param [out] constBase Additive part, independent of the input data volume.
+ * @param [out] inputMultiplier Multiplication ratio.
*/
virtual void GetOutputDataSize(unsigned long& constBase, double& inputMultiplier);
*/
virtual AliHLTComponent* Spawn();
+ enum StatusBits {
+ kForwardInput = BIT(14), // forward input objects instead of adding them to the decision object
+ kIncludeInput = BIT(15), // include input objects in the decision object
+ kIncludeShort = BIT(16), // include short description of input objects: name, title, decision
+ kSkipCTP = BIT(17), // skip CTP data object in the decision object
+ };
+
+ void SetBit(AliHLTUInt32_t f, bool set) {
+ if (set) SetBit(f);
+ else ResetBit(f);
+ }
+ void SetBit(AliHLTUInt32_t f) { fBits |= f; }
+ void ResetBit(AliHLTUInt32_t f) { fBits &= ~f; }
+ bool TestBit(AliHLTUInt32_t f) const { return (bool) ((fBits & f) != 0); }
+
protected:
/**
/**
* Loads a trigger menu object from the CDB.
- * \param cdbPath <i>in</i> The path in the CDB to load the trigger menu object from.
- * \param menu <i>out</i> A pointer that gets filled with the new trigger menu object.
+ * \param [in] cdbPath The path in the CDB to load the trigger menu object from.
+ * \param [out] menu A pointer that gets filled with the new trigger menu object.
* \returns Zero if the trigger menu object was found and the pointer to it
* set in the <i>menu</i> variable. If a non-zero error code is returned then
* the <i>menu</i> variable is not changed at all.
*/
int LoadTriggerMenu(const char* cdbPath, const AliHLTTriggerMenu*& menu);
+ /**
+ * Generates a file name for the generated on the fly code using a GUID.
+ * \param [out] name The name of the class to use.
+ * \param [out] filename The name of the file containing the code.
+ */
+ void GenerateFileName(TString& name, TString& filename);
+
/**
* Generates the code for the global trigger to apply the given trigger menu.
* The code will then be compiled on the fly and loaded. The name of the new
* The name of the generated code file is stored in the variable fCodeFileName
* and the fDeleteCodeFile is set to true.
*
- * \param menu <i>in</i> The trigger menu to create the global trigger class from.
- * \param name <i>out</i> The name of the generated class.
- * \param filename <i>out</i> The name of the generated file containing the code.
- * \param includePaths <i>in</i> The list of include path strings.
- * \param includeFiles <i>in</i> The list of include file strings.
+ * \param [in] menu The trigger menu to create the global trigger class from.
+ * \param [out] name The name of the generated class.
+ * \param [out] filename The name of the generated file containing the code.
+ * \param [in] includePaths The list of include path strings.
+ * \param [in] includeFiles The list of include file strings.
* \returns The error code suitable to return in DoInit. Zero on success.
*/
int GenerateTrigger(
* Loads the code for the generated HLT global trigger class. The code is compiled
* on the fly if possible, otherwise the CINT interpreter is used to interpret
* the class.
- * \param filename The name of the file containing the code for the global trigger class.
- * \param includePaths <i>in</i> The list of include path strings.
+ * \param [in] filename The name of the file containing the code for the global trigger class.
+ * \param [in] includePaths The list of include path strings.
* \returns The error code suitable to return in DoInit. Zero on success.
*/
int LoadTriggerClass(const char* filename, const TClonesArray& includePaths);
/**
* Extracts the trailing operator in a C++ expression and returns the found
* operator in a separate output string.
- * [in/out] \param expr The C++ expression to check. The trailing operator
+ * \param [in,out] expr The C++ expression to check. The trailing operator
* is removed from the expression if found.
- * [out] \param op The output variable which will be filled with the
+ * \param [out] op The output variable which will be filled with the
* operator found in the expression.
* \return true if the trailing operator was found in the expression and
* false otherwise.
/**
* Add trigger decisions according to the active CTP trigger classes
- * An internal TclonesArray holds the trigger decisions to be added. The trigger
+ * An internal TClonesArray holds the trigger decisions to be added. The trigger
* decisions are updated according to the active CTP trigger mask.
* \param pTrigger The instance of the global trigger
* \param pCTPData Instance of the CTP data
* \param trigData Current trigger data, if NULL, the active trigger data from the CTP data is used
*/
int AddCTPDecisions(AliHLTGlobalTrigger* pTrigger, const AliHLTCTPData* pCTPData, const AliHLTComponentTriggerData* trigData);
+
+ /**
+ * This method handles the software trigger by checking the Common Data Header
+ * and filling fSoftwareTrigger with appropriate information for one of the
+ * following triggers: START_OF_DATA, END_OF_DATA, SOFTWARE or CALIBRATION, if
+ * it is indicated in the CDH L1 trigger message.
+ * \returns true if the trigger decision object was filled and false otherwise.
+ */
+ bool FillSoftwareTrigger();
/**
* Print some statistics based on the trigger counters
AliHLTGlobalTrigger* fTrigger; //! Trigger object which implements the global trigger menu.
bool fDebugMode; //! Indicates if the generated global trigger class should be in debug mode.
bool fRuntimeCompile; //! Indicates if the generated global trigger class should be compiled
- bool fSkipCTPCounters; //! Indicates whether to ship CTP info with the trigger decision
bool fDeleteCodeFile; //! If true then the code file indicated by fCodeFileName should be deleted during DoDeinit.
+ bool fMakeSoftwareTriggers; //! Indicates if the software triggers should be filled automatically or not.
TString fCodeFileName; //! base file name of the generated code for the global trigger
TString fClassName; //! The generated/loaded trigger class name.
TClonesArray* fCTPDecisions; //! AliHLTTriggerDecision objects for the CTP classes
TClonesArray fIncludePaths; //! Paths specified by the -includepath command line option.
TClonesArray fIncludeFiles; //! Files specified by the -include command line option.
TString fLibStateAtLoad; //! This stores the loaded libraries just before we tell CINT to load the interpreted file.
+ AliHLTUInt32_t fBits; //! Status bits
+ bool fDataEventsOnly; //! Flag indicating if only data events are processed with trigger logic.
+ int fMonitorPeriod; //! Period of the monitoring trigger in s, -1 means monitoring trigger off
+ UInt_t fUniqueID; //! Unique ID for the decision output objects.
+ AliHLTTriggerDecision fSoftwareTrigger; //! Software or calibration trigger decision object to be added to trigger logic.
+ AliHLTUInt64_t fTotalEventCounter; //! Counts the total number of events handled.
+ const AliRawDataHeader* fCDH; //! The extracted CDH from the trigger data passed by the framework.
static const char* fgkTriggerMenuCDBPath; //! The path string to read the trigger menu from the CDB.