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 *
10 #include "AliHLTDataTypes.h"
14 * @class AliHLTTPCDefinitions
15 * Data type definitions for the libAliHLTTPC library.
19 class AliHLTTPCDefinitions
23 static AliHLTUInt8_t GetMinSliceNr( const AliHLTComponentBlockData& block )
25 return (AliHLTUInt8_t)( (block.fSpecification & 0x00FF0000) >> 16 );
27 static AliHLTUInt8_t GetMinSliceNr( ULong_t spec )
29 return (AliHLTUInt8_t)( (spec & 0x00FF0000) >> 16 );
31 static AliHLTUInt8_t GetMaxSliceNr( const AliHLTComponentBlockData& block )
33 return (AliHLTUInt8_t)( (block.fSpecification & 0xFF000000) >> 24 );
35 static AliHLTUInt8_t GetMaxSliceNr( ULong_t spec )
37 return (AliHLTUInt8_t)( (spec & 0xFF000000) >> 24 );
39 static Int_t GetSingleSliceNr( const AliHLTComponentBlockData& block )
41 return GetSingleSliceNr(block.fSpecification);
43 static Int_t GetSingleSliceNr( ULong_t spec );
44 static AliHLTUInt8_t GetMinPatchNr( const AliHLTComponentBlockData& block )
46 return (AliHLTUInt8_t)( (block.fSpecification & 0x000000FF) );
48 static AliHLTUInt8_t GetMinPatchNr( ULong_t spec )
50 return (AliHLTUInt8_t)( (spec & 0x000000FF) );
52 static AliHLTUInt8_t GetMaxPatchNr( const AliHLTComponentBlockData& block )
54 return (AliHLTUInt8_t)( (block.fSpecification & 0x0000FF00) >> 8 );
56 static AliHLTUInt8_t GetMaxPatchNr( ULong_t spec )
58 return (AliHLTUInt8_t)( (spec & 0x0000FF00) >> 8 );
60 static Int_t GetSinglePatchNr( const AliHLTComponentBlockData& block )
62 return GetSinglePatchNr(block.fSpecification);
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 )
70 return ((maxSliceNr & 0xFF) << 24) | ((minSliceNr & 0xFF) << 16) | ((maxPatchNr & 0xFF) << 8) | ((minPatchNr & 0xFF));
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.
81 static AliHLTInt32_t SlicePatchToDDLId(AliHLTUInt8_t slice, AliHLTUInt8_t patch)
83 if (slice > 35 or patch > 5) return -1;
84 return 768 + (patch > 1 ? 72 + 4*slice + patch - 2 : 2*slice + patch);
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.
95 static bool DDLIdToSlicePatch(AliHLTInt32_t ddlid, AliHLTUInt8_t& slice, AliHLTUInt8_t& patch);
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();
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& RawClustersDataType();
112 /** raw cluster data descriptor*/
113 static const AliHLTComponentDataType fgkRawClustersDescriptorDataType; // see above
114 static const AliHLTComponentDataType& RawClustersDescriptorDataType();
115 /** HW cluster data */
116 static const AliHLTComponentDataType fgkHWClustersDataType; // see above
117 static const AliHLTComponentDataType& HWClustersDataType();
118 /** HW alternative output cluster data */
119 static const AliHLTComponentDataType fgkAlterClustersDataType; // see above
120 static const AliHLTComponentDataType& AlterClustersDataType();
121 /** track segments in local coordinates */
122 static const AliHLTComponentDataType fgkTrackSegmentsDataType; // see above
123 static const AliHLTComponentDataType& TrackSegmentsDataType();
124 /** tracks in global koordinates */
125 static const AliHLTComponentDataType fgkTracksDataType; // see above
126 static const AliHLTComponentDataType& TracksDataType();
127 /** vertex data structure */
128 static const AliHLTComponentDataType fgkVertexDataType; // see above
129 static const AliHLTComponentDataType& VertexDataType();
131 // Cluster & Tracks model data
132 /** data compression descriptor*/
133 static const AliHLTComponentDataType fgkDataCompressionDescriptorDataType; // see above
134 static const AliHLTComponentDataType& DataCompressionDescriptorDataType();
135 /** cluster tracks model data type */
136 static const AliHLTComponentDataType fgkClusterTracksModelDataType; // see above
137 static const AliHLTComponentDataType& ClusterTracksModelDataType();
138 /** remaining clusters model data type */
139 static const AliHLTComponentDataType fgkRemainingClustersModelDataType; // see above
140 static const AliHLTComponentDataType& RemainingClustersModelDataType();
141 /** track clusters compressed data type */
142 static const AliHLTComponentDataType fgkClusterTracksCompressedDataType; // see above
143 static const AliHLTComponentDataType& ClusterTracksCompressedDataType();
144 /** track cluster ids data type */
145 static const AliHLTComponentDataType& ClusterIdTracksDataType();
146 /** compressed cluster ids data type */
147 static const AliHLTComponentDataType& CompressedClusterIdDataType();
148 /** remaining clusters compressed data type */
149 static const AliHLTComponentDataType fgkRemainingClustersCompressedDataType; // see above
150 static const AliHLTComponentDataType& RemainingClustersCompressedDataType();
151 /** remaining clusters ids data type */
152 static const AliHLTComponentDataType& RemainingClusterIdsDataType();
155 /** pedestal calibration data */
156 static const AliHLTComponentDataType& CalibPedestalDataType();
157 /** signal calibration data */
158 static const AliHLTComponentDataType& CalibPulserDataType();
159 /** central electrode calibration data */
160 static const AliHLTComponentDataType& CalibCEDataType();
162 // offline calbration components
164 /** alignment calibration data */
165 static const AliHLTComponentDataType& OfflineCalibAlignDataType();
166 /** track calibration data */
167 static const AliHLTComponentDataType& OfflineCalibTracksDataType();
168 /** gain calibration data */
169 static const AliHLTComponentDataType& OfflineCalibTracksGainDataType();
170 /** cluster monte carlo information */
171 static const AliHLTComponentDataType fgkAliHLTDataTypeClusterMCInfo; // see above
172 static const AliHLTComponentDataType& AliHLTDataTypeClusterMCInfo();
174 // ids for the different parameters of a cluster
175 enum AliClusterParameterId_t {
189 // helper struct for the definition of cluster parameters
190 struct AliClusterParameter {
191 AliClusterParameterId_t fId; //! id of the parameter
192 const char* fName; //! name of the parameter
193 int fBitLength; //! bit length
194 int fOptional; //! optional parameter
195 int fScale; //! scale for conversion to int number
198 static const AliClusterParameter fgkClusterParameterDefinitions[];
199 static unsigned GetNumberOfClusterParameterDefinitions();
200 static const unsigned fgkMaxClusterDeltaPad;
201 static unsigned GetMaxClusterDeltaPad() {return fgkMaxClusterDeltaPad;}
202 static const unsigned fgkMaxClusterDeltaTime;
203 static unsigned GetMaxClusterDeltaTime() {return fgkMaxClusterDeltaTime;}
207 /// Do not allow creation of this class since everything is static.
208 AliHLTTPCDefinitions();
209 virtual ~AliHLTTPCDefinitions();
211 ClassDef(AliHLTTPCDefinitions, 0) // Useful static definitions and methods for TPC