]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/MUON/OnlineAnalysis/AliHLTMUONHitReconstructorComponent.h
Refactoring code to pull common functionality for loading CDB configuration entries...
[u/mrichter/AliRoot.git] / HLT / MUON / OnlineAnalysis / AliHLTMUONHitReconstructorComponent.h
index 82cbbdc4a52aa55c7342256f0780a9047e14b6fd..4a496797e610397c95e6f3d0496275524fa94ab2 100644 (file)
@@ -8,7 +8,7 @@
 
 ///
 ///  @file   AliHLTMUONHitReconstructorComponent.h
-///  @author Indranil Das <indra.das@saha.ac.in> | <indra.ehep@gmail.com>
+///  @author Indranil Das <indra.das@saha.ac.in> | <indra.ehep@gmail.com>, Artur Szostak <artursz@iafrica.com>
 ///  @date   28 May 2007
 ///  @brief  Hit Reconstruction processing component for the dimuon HLT.
 ///
@@ -26,6 +26,93 @@ extern "C" struct AliHLTMUONHitRecoLutRow;
 /**
  * @class AliHLTMUONHitReconstructorComponent
  * @brief A processing component for the dHLT tracker DDL reconstruction.
+ *
+ * This is the hit reconstruction component which forms part of the online dHLT
+ * reconstruction algorithm. It processes the raw DDL data from a dimuon spectrometer
+ * tracker station, applies simple 3 pad cluster finding and then a centre of gravity
+ * calculation to reconstruct the hit coordinate.
+ *
+ * <h2>General properties:</h2>
+ *
+ * Component ID: \b MUONHitReconstructor <br>
+ * Library: \b libAliHLTMUON.so  <br>
+ * Input Data Types: ('DDL_RAW ', 'MUON') <br>
+ * Output Data Types: ('RECHITS ', 'MUON') <br>
+ *
+ * <h2>Mandatory arguments:</h2>
+ * \li -ddl <i>number</i> <br>
+ *      This indicates the DDL from which the component is expect to receive data
+ *      and for which it should load the appropriate electronics mapping lookup
+ *      table.
+ *      The <i>number</i> should be in the range [13..20], following local dimuon
+ *      spectrometer DDL numbering. If either the -ddlid, -lut or -delaysetup
+ *      arguments are used, then -ddl becomes optional. <br>
+ * \li -ddlid <i>number</i> <br>
+ *      This indicates the DDL by equipment ID, from which the component is expect
+ *      to receive data and for which it should load the appropriate electronics
+ *      mapping lookup table.
+ *      The <i>number</i> should be in the range [2572..2579].
+ *      If either the -ddl, -lut or -delaysetup arguments are used, then -ddlid
+ *      becomes optional. <br>
+ * \li -delaysetup <br>
+ *      Specifying this option causes the component to initialise the lookup table
+ *      and DC cut parameters from CDB only after receiving the first event to
+ *      process in DoEvent.
+ *      If -ddl or -ddlid were not used, then the DDL number will be taken from
+ *      the first block's specification during runtime from the first
+ *      event (Start-of-Run event).
+ *      Using the -lut or -dccut arguments will override loading from CDB for a
+ *      delayed setup. <br>
+ *
+ * <h2>Optional arguments:</h2>
+ * \li -lut <i>filename</i> <br>
+ *      A pree-built lookup table for the electronics mapping and calibration
+ *      information can be loaded with this argument. The file should have been
+ *      generated with the GenerateLookupTable method. The location of the file
+ *      is given by the parameter <i>filename</i> <br>
+ * \li -cdb <br>
+ *      Indicates that the component should load from CDB. This option is implicit
+ *      if the -cdbpath is given. It will also override the -lut option.<br>
+ * \li -cdbpath <i>path</i> <br>
+ *      Specifies the CDB path to use, given by <i>path</i>. This option will override
+ *      the CDB path automatically set by the HLT framework. <br>
+ * \li -run <i>number</i> <br>
+ *      Specifies the run number to use, given by <i>number</i>. This option will
+ *      override the current run number automatically set by the HLT framework. <br>
+ * \li -dccut <i>number</i> <br>
+ *      Used to override the DC cut parameter in the CDB with the value given by
+ *      <i>number</i>. <br>
+ * \li -warn_on_unexpected_block <br>
+ *      This will cause the component to generate warnings when it receives data block
+ *      types it does not know how to handle. Without this option the component only
+ *      generates debug messages when they are compiled in. <br>
+ * \li -tryrecover <br>
+ *      This is a special option to the raw data decoder to turn on logic which will
+ *      try and recover from corrupt raw DDL data. This is off by default. <br>
+ *
+ * <h2>Standard configuration:</h2>
+ * This component should normally be configured with either of the two sets of
+ * options in the XML configuration. <br>
+ * \li -delaysetup <br>
+ * \li -ddlid ${DDL_ID} <br>
+ *
+ * <h2>Default CDB entries:</h2>
+ * The component loads electronics mapping and calibration information from the MUON
+ * subdirectory in the CDB, MUON/Calib and MUON/Align.
+ * The DC cut parameter is stored in a TMap under HLT/ConfigMUON/HitReconstructor
+ * with a default value of 50 ADC channels.
+ *
+ * <h2>Performance:</h2>
+ * Can achieve about 2kHz processing rate for nominal event sizes containing
+ * 150 tracks per event.
+ *
+ * <h2>Memory consumption:</h2>
+ * The lookup table requires about 3.5 MBytes of memory.
+ *
+ * <h2>Output size:</h2>
+ * Output size is about 10% of incoming raw input data for nominal p+p events.
+ *
+ * @ingroup alihlt_dimuon_component
  */
 class AliHLTMUONHitReconstructorComponent : public AliHLTMUONProcessor
 {
@@ -64,6 +151,8 @@ protected:
        // capabilities of the component.
 
        virtual int DoInit(int argc, const char** argv);
+       virtual int Reconfigure(const char* cdbEntry, const char* componentId);
+       virtual int ReadPreprocessorValues(const char* modules);
        virtual int DoDeinit();
        virtual int DoEvent(
                        const AliHLTComponentEventData& evtData,
@@ -86,7 +175,8 @@ private:
        
        void FreeMemory();
        int ReadLookUpTable(const char* lutpath);
-       int ReadCDB(const char* cdbpath, Int_t run);
+       int ReadLutFromCDB();
+       int ReadDCCutFromCDB(const char* path = NULL);
        
        AliHLTMUONHitReconstructor* fHitRec;  ///< Internal class instance implementing the hit reconstruction algorithm.
        AliHLTInt32_t fDDL;  ///< DDL number in the range [12..19]. Set to -1 for invalid/unspecified value.
@@ -94,6 +184,7 @@ private:
        AliHLTMUONHitRecoLutRow* fLut;  ///< The lookup table used by the hit reconstruction algorithm (Owned by this component however).
        IdManuChannelToEntry fIdToEntry; ///< id to line mapping.
        bool fWarnForUnexpecedBlock;  ///< Flag indicating if we should log a warning if we got a block of an unexpected type.
+       bool fDelaySetup;  ///< Indicates if the component should delay loading and initialising from the CDB to the start of run event.
        
        ClassDef(AliHLTMUONHitReconstructorComponent, 0) // Hit reconstructor component for dHLT tracker DDL raw data.
 };