]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/trigger/AliHLTGlobalTriggerComponent.h
- coverity fixes
[u/mrichter/AliRoot.git] / HLT / trigger / AliHLTGlobalTriggerComponent.h
index 33421d47fbdc6b1fdec5f2b250d9097db68634a9..1df5f363e53c0f1fe4884642d36cd37f69192b6c 100644 (file)
 /// @brief  Declaration of the AliHLTGlobalTriggerComponent component class.
 
 #include "AliHLTTrigger.h"
+#include "AliHLTTriggerDecision.h"
 #include "TClonesArray.h"
 
 class AliHLTTriggerMenu;
 class AliHLTGlobalTrigger;
+class AliRawDataHeader;
 
 /**
  * \class AliHLTGlobalTriggerComponent
@@ -63,10 +65,31 @@ class AliHLTGlobalTrigger;
  *      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] <br>
+ * \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>
  * Configured from CDB but can be overridden with the -config argument.
@@ -111,7 +134,7 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
   /**
    * 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;
   
@@ -119,9 +142,8 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
    * 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);
   
@@ -186,14 +208,21 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
   
   /**
    * 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
@@ -206,11 +235,11 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
    * 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(
@@ -222,8 +251,8 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
    * 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);
@@ -255,9 +284,9 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
   /**
    * 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.
@@ -266,13 +295,22 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
 
   /**
    * 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
@@ -283,6 +321,7 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
   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 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
@@ -292,6 +331,12 @@ class AliHLTGlobalTriggerComponent : public AliHLTTrigger
   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.