LCOV - code coverage report
Current view: top level - HLT/TPCLib - AliHLTTPCDefinitions.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 3 18 16.7 %
Date: 2016-06-14 17:26:59 Functions: 3 21 14.3 %

          Line data    Source code
       1             : // XEmacs -*-C++-*-
       2             : // @(#) $Id$
       3             : 
       4             : #ifndef ALIHLTTPCDEFINITIONS_H
       5             : #define ALIHLTTPCDEFINITIONS_H
       6             : //* This file is property of and copyright by the ALICE HLT Project        * 
       7             : //* ALICE Experiment at CERN, All rights reserved.                         *
       8             : //* See cxx source for full Copyright notice                               *
       9             : 
      10             : #include "AliHLTDataTypes.h"
      11             : #include "Rtypes.h"
      12             : 
      13             : /**
      14             :  * @class AliHLTTPCDefinitions
      15             :  * Data type definitions for the libAliHLTTPC library.
      16             :  * 
      17             :  * @ingroup alihlt_tpc
      18             :  */
      19           0 : class AliHLTTPCDefinitions
      20             : {
      21             : public:
      22             : 
      23             :         static AliHLTUInt8_t GetMinSliceNr( const AliHLTComponentBlockData& block )
      24             :                 {
      25           0 :                 return (AliHLTUInt8_t)( (block.fSpecification & 0x00FF0000) >> 16 );
      26             :                 }
      27             :         static AliHLTUInt8_t GetMinSliceNr( ULong_t spec )
      28             :                 {
      29           0 :                 return (AliHLTUInt8_t)( (spec & 0x00FF0000) >> 16 );
      30             :                 }
      31             :         static AliHLTUInt8_t GetMaxSliceNr( const AliHLTComponentBlockData& block )
      32             :                 {
      33           0 :                 return (AliHLTUInt8_t)( (block.fSpecification & 0xFF000000) >> 24 );
      34             :                 }
      35             :         static AliHLTUInt8_t GetMaxSliceNr( ULong_t spec )
      36             :                 {
      37           0 :                 return (AliHLTUInt8_t)( (spec & 0xFF000000) >> 24 );
      38             :                 }
      39             :         static Int_t GetSingleSliceNr( const AliHLTComponentBlockData& block )
      40             :                 {
      41           0 :                 return GetSingleSliceNr(block.fSpecification);
      42             :                 }
      43             :         static Int_t GetSingleSliceNr( ULong_t spec );
      44             :         static AliHLTUInt8_t GetMinPatchNr( const AliHLTComponentBlockData& block )
      45             :                 {
      46           0 :                 return (AliHLTUInt8_t)( (block.fSpecification & 0x000000FF) );
      47             :                 }
      48             :         static AliHLTUInt8_t GetMinPatchNr( ULong_t spec )
      49             :                 {
      50           0 :                 return (AliHLTUInt8_t)( (spec & 0x000000FF) );
      51             :                 }
      52             :         static AliHLTUInt8_t GetMaxPatchNr( const AliHLTComponentBlockData& block )
      53             :                 {
      54           0 :                 return (AliHLTUInt8_t)( (block.fSpecification & 0x0000FF00) >> 8 );
      55             :                 }
      56             :         static AliHLTUInt8_t GetMaxPatchNr( ULong_t spec )
      57             :                 {
      58           0 :                 return (AliHLTUInt8_t)( (spec & 0x0000FF00) >> 8 );
      59             :                 }
      60             :         static Int_t GetSinglePatchNr( const AliHLTComponentBlockData& block )
      61             :                 {
      62           0 :                 return GetSinglePatchNr(block.fSpecification);
      63             :                 }
      64             :         static Int_t GetSinglePatchNr( ULong_t spec );
      65             :         static AliHLTUInt32_t EncodeDataSpecification( AliHLTUInt8_t minSliceNr, 
      66             :                                                 AliHLTUInt8_t maxSliceNr,
      67             :                                                 AliHLTUInt8_t minPatchNr,
      68             :                                                 AliHLTUInt8_t maxPatchNr )
      69             :                 {
      70           0 :                 return ((maxSliceNr & 0xFF) << 24) | ((minSliceNr & 0xFF) << 16) | ((maxPatchNr & 0xFF) << 8) | ((minPatchNr & 0xFF));
      71             :                 }
      72             :         
      73             :         /**
      74             :          * Converts a slice and patch number to a DDL ID number for TPC.
      75             :          * \param slice  The slice number in the range [0..35] (0..17 for A side and 18..35 for C side).
      76             :          * \param patch  The patch number in the range [0..5].
      77             :          * \returns the DDL ID number of TPC or -1 if the slice or patch was invalid.
      78             :          * \note A side is in the -z axis direction (same side as the muon spectrometer)
      79             :          *       and C side is in the +z axis direction.
      80             :          */
      81             :         static AliHLTInt32_t SlicePatchToDDLId(AliHLTUInt8_t slice, AliHLTUInt8_t patch)
      82             :                 {
      83           0 :                 if (slice > 35 or patch > 5) return -1;
      84           0 :                 return 768 + (patch > 1 ? 72 + 4*slice + patch - 2 : 2*slice + patch);
      85           0 :                 }
      86             :                 
      87             :         /**
      88             :          * Converts a DDL ID number for the TPC to a slice and patch number.
      89             :          * \param [in] ddlid  The DDL ID number to convert.
      90             :          * \param [out] slice  The resultant slice number in the range [0..35].
      91             :          * \param [out] patch  The resultant patch number in the range [0..5].
      92             :          * \returns true if the DDL ID number was valid and slice and patch were set,
      93             :          *     otherwise false for an invalid DDL ID.
      94             :          */
      95             :         static bool DDLIdToSlicePatch(AliHLTInt32_t ddlid, AliHLTUInt8_t& slice, AliHLTUInt8_t& patch);
      96             : 
      97             :   /** DDL entropy encoded data */
      98             :   static const AliHLTComponentDataType fgkDDLEncodedEntropyRawDataType; // see above
      99             :   static const AliHLTComponentDataType& DDLEncodedEntropyRawDataType();
     100             :   /** packed RAW data */
     101             :   static const AliHLTComponentDataType fgkPackedRawDataType;            // see above
     102             :   static const AliHLTComponentDataType& PackedRawDataType();
     103             :   /** unpacked RAW data */
     104             :   static const AliHLTComponentDataType fgkUnpackedRawDataType;          // see above
     105             :   static const AliHLTComponentDataType& UnpackedRawDataType();
     106             :   /** cluster data */
     107             :   static const AliHLTComponentDataType fgkClustersDataType;             // see above
     108             :   static const AliHLTComponentDataType& ClustersDataType();
     109             :   /** raw cluster data (not transformed) */
     110             :   static const AliHLTComponentDataType fgkRawClustersDataType;          // see above
     111             :   static const AliHLTComponentDataType fgkRawClustersDataTypeNotCompressed;          // A copy of the fgkRawClustersDataType, which is used if the DataCompressor failed to compress clusters
     112             :   static const AliHLTComponentDataType& RawClustersDataType();
     113             :   static const AliHLTComponentDataType& RawClustersDataTypeNotCompressed();
     114             :   /** raw cluster data descriptor*/
     115             :   static const AliHLTComponentDataType fgkRawClustersDescriptorDataType;          // see above
     116             :   static const AliHLTComponentDataType& RawClustersDescriptorDataType();
     117             :   /** HW cluster data */
     118             :   static const AliHLTComponentDataType fgkHWClustersDataType;           // see above
     119             :   static const AliHLTComponentDataType& HWClustersDataType();
     120             :   /** HW alternative output cluster data */
     121             :   static const AliHLTComponentDataType fgkAlterClustersDataType;        // see above
     122             :   static const AliHLTComponentDataType& AlterClustersDataType();
     123             :   /** track segments in local coordinates */
     124             :   static const AliHLTComponentDataType fgkTrackSegmentsDataType;        // see above
     125             :   static const AliHLTComponentDataType& TrackSegmentsDataType();
     126             :   /** tracks in global koordinates */
     127             :   static const AliHLTComponentDataType fgkTracksDataType;               // see above
     128             :   static const AliHLTComponentDataType& TracksDataType();
     129             :   /** vertex data structure */
     130             :   static const AliHLTComponentDataType fgkVertexDataType;               // see above
     131             :   static const AliHLTComponentDataType& VertexDataType();
     132             :   
     133             :   //Initialized Fast transform data object
     134             :   static const AliHLTComponentDataType fgkTPCFastTransformDataObjectDataType;   //see above
     135             : 
     136             :   // Cluster & Tracks model data
     137             :   /** data compression descriptor*/
     138             :   static const AliHLTComponentDataType fgkDataCompressionDescriptorDataType;          // see above
     139             :   static const AliHLTComponentDataType& DataCompressionDescriptorDataType();
     140             :   /** cluster tracks model data type */
     141             :   static const AliHLTComponentDataType fgkClusterTracksModelDataType;          // see above
     142             :   static const AliHLTComponentDataType& ClusterTracksModelDataType();
     143             :   /** remaining clusters model data type */
     144             :   static const AliHLTComponentDataType fgkRemainingClustersModelDataType;      // see above
     145             :   static const AliHLTComponentDataType& RemainingClustersModelDataType();
     146             :   /** track clusters compressed data type */
     147             :   static const AliHLTComponentDataType fgkClusterTracksCompressedDataType;     // see above
     148             :   static const AliHLTComponentDataType& ClusterTracksCompressedDataType();
     149             :   /** track cluster ids data type */
     150             :   static const AliHLTComponentDataType& ClusterIdTracksDataType();
     151             :   /** compressed cluster ids data type */
     152             :   static const AliHLTComponentDataType& CompressedClusterIdDataType();
     153             :   /** remaining clusters compressed data type */
     154             :   static const AliHLTComponentDataType fgkRemainingClustersCompressedDataType; // see above
     155             :   static const AliHLTComponentDataType& RemainingClustersCompressedDataType();
     156             :   /** remaining clusters ids data type */
     157             :   static const AliHLTComponentDataType& RemainingClusterIdsDataType();
     158             :   /** Data type to transport optional flags, like split cluster flag */
     159             :   static const AliHLTComponentDataType fgkClustersFlagsDataType;          // see above
     160             :   static const AliHLTComponentDataType& ClustersFlagsDataType();
     161             : 
     162             :   // Calibration data
     163             :   /** pedestal calibration data */
     164             :   static const AliHLTComponentDataType& CalibPedestalDataType();
     165             :   /** signal calibration data */
     166             :   static const AliHLTComponentDataType& CalibPulserDataType();
     167             :   /** central electrode calibration data */
     168             :   static const AliHLTComponentDataType& CalibCEDataType();
     169             : 
     170             :   // offline calbration components
     171             : 
     172             :   /** alignment calibration data */
     173             :   static const AliHLTComponentDataType& OfflineCalibAlignDataType();
     174             :   /** track calibration data */
     175             :   static const AliHLTComponentDataType& OfflineCalibTracksDataType();
     176             :   /** gain calibration data */
     177             :   static const AliHLTComponentDataType& OfflineCalibTracksGainDataType();
     178             :   /** cluster monte carlo information */
     179             :   static const AliHLTComponentDataType fgkAliHLTDataTypeClusterMCInfo;    // see above
     180             :   static const AliHLTComponentDataType& AliHLTDataTypeClusterMCInfo();
     181             : 
     182             :   // ids for the different parameters of a cluster
     183             :   enum AliClusterParameterId_t {
     184             :     kPadRow = 0,
     185             :     kPad,
     186             :     kTime,
     187             :     kSigmaY2,
     188             :     kSigmaZ2,
     189             :     kCharge,
     190             :     kQMax,
     191             :     kResidualPad,
     192             :     kResidualTime,
     193             :     kClusterCount,
     194             :     kLast = kQMax
     195             :   };
     196             : 
     197             :   // helper struct for the definition of cluster parameters
     198             :   struct AliClusterParameter {
     199             :     AliClusterParameterId_t fId; //! id of the parameter
     200             :     const char* fName;           //! name of the parameter
     201             :     int fBitLength;              //! bit length
     202             :     int fOptional;               //! optional parameter
     203             :     int fScale;                  //! scale for conversion to int number
     204             :   };
     205             : 
     206             :   static const AliClusterParameter fgkClusterParameterDefinitions[];
     207             :   static unsigned GetNumberOfClusterParameterDefinitions();
     208             :   static const unsigned fgkMaxClusterDeltaPad;
     209           6 :   static unsigned GetMaxClusterDeltaPad() {return fgkMaxClusterDeltaPad;}
     210             :   static const unsigned fgkMaxClusterDeltaTime;
     211           6 :   static unsigned GetMaxClusterDeltaTime() {return fgkMaxClusterDeltaTime;}
     212             : 
     213             : private:
     214             : 
     215             :   /// Do not allow creation of this class since everything is static.
     216             :   AliHLTTPCDefinitions();
     217             :   virtual ~AliHLTTPCDefinitions();
     218             : 
     219           6 :   ClassDef(AliHLTTPCDefinitions, 0)  // Useful static definitions and methods for TPC
     220             : };
     221             : 
     222             : #endif

Generated by: LCOV version 1.11