]>
Commit | Line | Data |
---|---|---|
71d7c760 | 1 | // XEmacs -*-C++-*- |
2 | // @(#) $Id$ | |
3 | ||
4 | #ifndef ALIHLTTPCDEFINITIONS_H | |
5 | #define ALIHLTTPCDEFINITIONS_H | |
13398559 | 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 * | |
71d7c760 | 9 | |
10 | #include "AliHLTDataTypes.h" | |
96bda103 | 11 | #include "Rtypes.h" |
71d7c760 | 12 | |
13398559 | 13 | /** |
14 | * @class AliHLTTPCDefinitions | |
15 | * Data type definitions for the libAliHLTTPC library. | |
297174de | 16 | * |
17 | * @ingroup alihlt_tpc | |
13398559 | 18 | */ |
71d7c760 | 19 | class AliHLTTPCDefinitions |
96bda103 | 20 | { |
21 | public: | |
71d7c760 | 22 | |
8ede8717 | 23 | static AliHLTUInt8_t GetMinSliceNr( const AliHLTComponentBlockData& block ) |
71d7c760 | 24 | { |
25 | return (AliHLTUInt8_t)( (block.fSpecification & 0x00FF0000) >> 16 ); | |
26 | } | |
a6c02c85 | 27 | static AliHLTUInt8_t GetMinSliceNr( ULong_t spec ) |
28 | { | |
29 | return (AliHLTUInt8_t)( (spec & 0x00FF0000) >> 16 ); | |
30 | } | |
8ede8717 | 31 | static AliHLTUInt8_t GetMaxSliceNr( const AliHLTComponentBlockData& block ) |
71d7c760 | 32 | { |
33 | return (AliHLTUInt8_t)( (block.fSpecification & 0xFF000000) >> 24 ); | |
34 | } | |
a6c02c85 | 35 | static AliHLTUInt8_t GetMaxSliceNr( ULong_t spec ) |
36 | { | |
37 | return (AliHLTUInt8_t)( (spec & 0xFF000000) >> 24 ); | |
38 | } | |
333d8597 | 39 | static Int_t GetSingleSliceNr( const AliHLTComponentBlockData& block ) |
40 | { | |
41 | return GetSingleSliceNr(block.fSpecification); | |
42 | } | |
43 | static Int_t GetSingleSliceNr( ULong_t spec ); | |
8ede8717 | 44 | static AliHLTUInt8_t GetMinPatchNr( const AliHLTComponentBlockData& block ) |
71d7c760 | 45 | { |
46 | return (AliHLTUInt8_t)( (block.fSpecification & 0x000000FF) ); | |
47 | } | |
a6c02c85 | 48 | static AliHLTUInt8_t GetMinPatchNr( ULong_t spec ) |
49 | { | |
50 | return (AliHLTUInt8_t)( (spec & 0x000000FF) ); | |
51 | } | |
8ede8717 | 52 | static AliHLTUInt8_t GetMaxPatchNr( const AliHLTComponentBlockData& block ) |
71d7c760 | 53 | { |
54 | return (AliHLTUInt8_t)( (block.fSpecification & 0x0000FF00) >> 8 ); | |
55 | } | |
a6c02c85 | 56 | static AliHLTUInt8_t GetMaxPatchNr( ULong_t spec ) |
57 | { | |
58 | return (AliHLTUInt8_t)( (spec & 0x0000FF00) >> 8 ); | |
59 | } | |
333d8597 | 60 | static Int_t GetSinglePatchNr( const AliHLTComponentBlockData& block ) |
61 | { | |
62 | return GetSinglePatchNr(block.fSpecification); | |
63 | } | |
64 | static Int_t GetSinglePatchNr( ULong_t spec ); | |
71d7c760 | 65 | static AliHLTUInt32_t EncodeDataSpecification( AliHLTUInt8_t minSliceNr, |
66 | AliHLTUInt8_t maxSliceNr, | |
67 | AliHLTUInt8_t minPatchNr, | |
68 | AliHLTUInt8_t maxPatchNr ) | |
69 | { | |
70 | return ((maxSliceNr & 0xFF) << 24) | ((minSliceNr & 0xFF) << 16) | ((maxPatchNr & 0xFF) << 8) | ((minPatchNr & 0xFF)); | |
71 | } | |
625b072f | 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 | if (slice > 35 or patch > 5) return -1; | |
84 | return 768 + (patch > 1 ? 72 + 4*slice + patch - 2 : 2*slice + patch); | |
85 | } | |
86 | ||
87 | /** | |
88 | * Converts a DDL ID number for the TPC to a slice and patch number. | |
f08578f1 | 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]. | |
625b072f | 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); | |
71d7c760 | 96 | |
9ae1d7d8 | 97 | /** DDL entropy encoded data */ |
98 | static const AliHLTComponentDataType fgkDDLEncodedEntropyRawDataType; // see above | |
4f82526d | 99 | static const AliHLTComponentDataType& DDLEncodedEntropyRawDataType(); |
96bda103 | 100 | /** packed RAW data */ |
28355ac2 | 101 | static const AliHLTComponentDataType fgkPackedRawDataType; // see above |
4f82526d | 102 | static const AliHLTComponentDataType& PackedRawDataType(); |
96bda103 | 103 | /** unpacked RAW data */ |
28355ac2 | 104 | static const AliHLTComponentDataType fgkUnpackedRawDataType; // see above |
4f82526d | 105 | static const AliHLTComponentDataType& UnpackedRawDataType(); |
96bda103 | 106 | /** cluster data */ |
28355ac2 | 107 | static const AliHLTComponentDataType fgkClustersDataType; // see above |
4f82526d | 108 | static const AliHLTComponentDataType& ClustersDataType(); |
5e75f4e0 | 109 | /** raw cluster data (not transformed) */ |
110 | static const AliHLTComponentDataType fgkRawClustersDataType; // see above | |
4f82526d | 111 | static const AliHLTComponentDataType& RawClustersDataType(); |
6af4f584 | 112 | /** HW cluster data */ |
113 | static const AliHLTComponentDataType fgkHWClustersDataType; // see above | |
4f82526d | 114 | static const AliHLTComponentDataType& HWClustersDataType(); |
491d6af5 | 115 | /** HW alternative output cluster data */ |
116 | static const AliHLTComponentDataType fgkAlterClustersDataType; // see above | |
4f82526d | 117 | static const AliHLTComponentDataType& AlterClustersDataType(); |
96bda103 | 118 | /** track segments in local coordinates */ |
28355ac2 | 119 | static const AliHLTComponentDataType fgkTrackSegmentsDataType; // see above |
4f82526d | 120 | static const AliHLTComponentDataType& TrackSegmentsDataType(); |
96bda103 | 121 | /** tracks in global koordinates */ |
28355ac2 | 122 | static const AliHLTComponentDataType fgkTracksDataType; // see above |
4f82526d | 123 | static const AliHLTComponentDataType& TracksDataType(); |
96bda103 | 124 | /** vertex data structure */ |
28355ac2 | 125 | static const AliHLTComponentDataType fgkVertexDataType; // see above |
4f82526d | 126 | static const AliHLTComponentDataType& VertexDataType(); |
ff2f0f94 | 127 | |
128 | // Cluster & Tracks model data | |
129 | /** cluster tracks model data type */ | |
28355ac2 | 130 | static const AliHLTComponentDataType fgkClusterTracksModelDataType; // see above |
4f82526d | 131 | static const AliHLTComponentDataType& ClusterTracksModelDataType(); |
ff2f0f94 | 132 | /** remaining clusters model data type */ |
28355ac2 | 133 | static const AliHLTComponentDataType fgkRemainingClustersModelDataType; // see above |
4f82526d | 134 | static const AliHLTComponentDataType& RemainingClustersModelDataType(); |
29a647c6 | 135 | /** track clusters compressed data type */ |
28355ac2 | 136 | static const AliHLTComponentDataType fgkClusterTracksCompressedDataType; // see above |
4f82526d | 137 | static const AliHLTComponentDataType& ClusterTracksCompressedDataType(); |
29a647c6 | 138 | /** track cluster ids data type */ |
139 | static const AliHLTComponentDataType& ClusterIdTracksDataType(); | |
ff2f0f94 | 140 | /** remaining clusters compressed data type */ |
141 | static const AliHLTComponentDataType fgkRemainingClustersCompressedDataType; // see above | |
4f82526d | 142 | static const AliHLTComponentDataType& RemainingClustersCompressedDataType(); |
29a647c6 | 143 | /** remaining clusters ids data type */ |
144 | static const AliHLTComponentDataType& RemainingClusterIdsDataType(); | |
ff2f0f94 | 145 | |
146 | // Calibration data | |
02d01bbf | 147 | /** pedestal calibration data */ |
d3dbc486 | 148 | static const AliHLTComponentDataType& CalibPedestalDataType(); |
02d01bbf | 149 | /** signal calibration data */ |
d3dbc486 | 150 | static const AliHLTComponentDataType& CalibPulserDataType(); |
28355ac2 | 151 | /** central electrode calibration data */ |
d3dbc486 | 152 | static const AliHLTComponentDataType& CalibCEDataType(); |
71d7c760 | 153 | |
e642ae99 | 154 | // offline calbration components |
155 | ||
156 | /** alignment calibration data */ | |
d3dbc486 | 157 | static const AliHLTComponentDataType& OfflineCalibAlignDataType(); |
e642ae99 | 158 | /** track calibration data */ |
d3dbc486 | 159 | static const AliHLTComponentDataType& OfflineCalibTracksDataType(); |
e642ae99 | 160 | /** gain calibration data */ |
d3dbc486 | 161 | static const AliHLTComponentDataType& OfflineCalibTracksGainDataType(); |
deba5d85 | 162 | /** cluster monte carlo information */ |
163 | static const AliHLTComponentDataType fgkAliHLTDataTypeClusterMCInfo; // see above | |
4f82526d | 164 | static const AliHLTComponentDataType& AliHLTDataTypeClusterMCInfo(); |
e642ae99 | 165 | |
71300445 | 166 | // ids for the different parameters of a cluster |
167 | enum AliClusterParameterId_t { | |
168 | kPadRow = 0, | |
169 | kPad, | |
170 | kTime, | |
171 | kSigmaY2, | |
172 | kSigmaZ2, | |
173 | kCharge, | |
174 | kQMax, | |
b97434b7 | 175 | kResidualPad, |
176 | kResidualTime, | |
b97434b7 | 177 | kClusterCount, |
71300445 | 178 | kLast = kQMax |
179 | }; | |
180 | ||
181 | // helper struct for the definition of cluster parameters | |
182 | struct AliClusterParameter { | |
183 | AliClusterParameterId_t fId; //! id of the parameter | |
184 | const char* fName; //! name of the parameter | |
185 | int fBitLength; //! bit length | |
186 | int fOptional; //! optional parameter | |
187 | int fScale; //! scale for conversion to int number | |
188 | }; | |
189 | ||
190 | static const AliClusterParameter fgkClusterParameterDefinitions[]; | |
191 | static unsigned GetNumberOfClusterParameterDefinitions(); | |
b97434b7 | 192 | static const unsigned fgkMaxClusterDeltaPad; |
193 | static unsigned GetMaxClusterDeltaPad() {return fgkMaxClusterDeltaPad;} | |
194 | static const unsigned fgkMaxClusterDeltaTime; | |
195 | static unsigned GetMaxClusterDeltaTime() {return fgkMaxClusterDeltaTime;} | |
71300445 | 196 | |
625b072f | 197 | private: |
198 | ||
199 | /// Do not allow creation of this class since everything is static. | |
200 | AliHLTTPCDefinitions(); | |
201 | virtual ~AliHLTTPCDefinitions(); | |
202 | ||
203 | ClassDef(AliHLTTPCDefinitions, 0) // Useful static definitions and methods for TPC | |
96bda103 | 204 | }; |
71d7c760 | 205 | |
206 | #endif |