]>
Commit | Line | Data |
---|---|---|
71d7c760 | 1 | // $Id$ |
2 | ||
3 | /************************************************************************** | |
9be2600f | 4 | * This file is property of and copyright by the ALICE HLT Project * |
5 | * ALICE Experiment at CERN, All rights reserved. * | |
71d7c760 | 6 | * * |
9be2600f | 7 | * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> * |
8 | * Timm Steinbeck <timm@kip.uni-heidelberg.de> * | |
9 | * for The ALICE HLT Project. * | |
71d7c760 | 10 | * * |
11 | * Permission to use, copy, modify and distribute this software and its * | |
12 | * documentation strictly for non-commercial purposes is hereby granted * | |
13 | * without fee, provided that the above copyright notice appears in all * | |
14 | * copies and that both the copyright notice and this permission notice * | |
15 | * appear in the supporting documentation. The authors make no claims * | |
16 | * about the suitability of this software for any purpose. It is * | |
17 | * provided "as is" without express or implied warranty. * | |
18 | **************************************************************************/ | |
19 | ||
20 | /////////////////////////////////////////////////////////////////////////////// | |
21 | // // | |
22 | // Definitions for the HLT TPC components // | |
23 | // // | |
24 | /////////////////////////////////////////////////////////////////////////////// | |
25 | ||
26 | #include "AliHLTTPCDefinitions.h" | |
333d8597 | 27 | #include "AliHLTTPCTransform.h" |
28 | #include <cerrno> | |
71d7c760 | 29 | |
96bda103 | 30 | /** ROOT macro for the implementation of ROOT specific class methods */ |
71d7c760 | 31 | ClassImp(AliHLTTPCDefinitions) |
32 | ||
e5c0542d | 33 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkDDLEncodedEntropyRawDataType = AliHLTComponentDataTypeInitializer("DDLENCEN", kAliHLTDataOriginTPC); |
69347e0d | 34 | |
e5c0542d | 35 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkPackedRawDataType = AliHLTComponentDataTypeInitializer("RAWPAKED", kAliHLTDataOriginTPC); |
36 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkUnpackedRawDataType = AliHLTComponentDataTypeInitializer("RAWUNPAK", kAliHLTDataOriginTPC); | |
37 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClustersDataType = AliHLTComponentDataTypeInitializer("CLUSTERS", kAliHLTDataOriginTPC); | |
5e75f4e0 | 38 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRawClustersDataType = AliHLTComponentDataTypeInitializer("CLUSTRAW", kAliHLTDataOriginTPC); |
3ba734d3 | 39 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRawClustersDescriptorDataType = AliHLTComponentDataTypeInitializer("CLRAWDSC", kAliHLTDataOriginTPC); |
6af4f584 | 40 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkHWClustersDataType = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC); |
491d6af5 | 41 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAlterClustersDataType = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC); |
e5c0542d | 42 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkVertexDataType = AliHLTComponentDataTypeInitializer("VERTEX ", kAliHLTDataOriginTPC); |
43 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTrackSegmentsDataType = AliHLTComponentDataTypeInitializer("TRAKSEGS", kAliHLTDataOriginTPC); | |
44 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTracksDataType = AliHLTComponentDataTypeInitializer("TRACKS ", kAliHLTDataOriginTPC); | |
ff2f0f94 | 45 | |
124b5fc8 | 46 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkDataCompressionDescriptorDataType = AliHLTComponentDataTypeInitializer("COMPDESC", kAliHLTDataOriginTPC); |
47 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClusterTracksModelDataType = AliHLTComponentDataTypeInitializer("CLSTRKMD", kAliHLTDataOriginTPC); | |
e5c0542d | 48 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRemainingClustersModelDataType = AliHLTComponentDataTypeInitializer("REMCLSMD", kAliHLTDataOriginTPC); |
49 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClusterTracksCompressedDataType = AliHLTComponentDataTypeInitializer("CLSTRKCM", kAliHLTDataOriginTPC); | |
50 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRemainingClustersCompressedDataType = AliHLTComponentDataTypeInitializer("REMCLSCM", kAliHLTDataOriginTPC); | |
69347e0d | 51 | |
4f82526d | 52 | const AliHLTComponentDataType& AliHLTTPCDefinitions::DDLEncodedEntropyRawDataType() { |
53 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("DDLENCEN", kAliHLTDataOriginTPC); | |
54 | return dt; | |
55 | } | |
56 | const AliHLTComponentDataType& AliHLTTPCDefinitions::PackedRawDataType() { | |
57 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("RAWPAKED", kAliHLTDataOriginTPC); | |
58 | return dt; | |
59 | } | |
60 | const AliHLTComponentDataType& AliHLTTPCDefinitions::UnpackedRawDataType() { | |
61 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("RAWUNPAK", kAliHLTDataOriginTPC); | |
62 | return dt; | |
63 | } | |
64 | const AliHLTComponentDataType& AliHLTTPCDefinitions::ClustersDataType() { | |
65 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLUSTERS", kAliHLTDataOriginTPC); | |
66 | return dt; | |
67 | } | |
68 | const AliHLTComponentDataType& AliHLTTPCDefinitions::RawClustersDataType() { | |
69 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLUSTRAW", kAliHLTDataOriginTPC); | |
70 | return dt; | |
71 | } | |
3ba734d3 | 72 | const AliHLTComponentDataType& AliHLTTPCDefinitions::RawClustersDescriptorDataType() { |
73 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLRAWDSC", kAliHLTDataOriginTPC); | |
74 | return dt; | |
75 | } | |
4f82526d | 76 | const AliHLTComponentDataType& AliHLTTPCDefinitions::HWClustersDataType() { |
77 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC); | |
78 | return dt; | |
79 | } | |
80 | const AliHLTComponentDataType& AliHLTTPCDefinitions::AlterClustersDataType() { | |
81 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC); | |
82 | return dt; | |
83 | } | |
84 | const AliHLTComponentDataType& AliHLTTPCDefinitions::VertexDataType() { | |
85 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("VERTEX ", kAliHLTDataOriginTPC); | |
86 | return dt; | |
87 | } | |
88 | const AliHLTComponentDataType& AliHLTTPCDefinitions::TrackSegmentsDataType() { | |
89 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("TRAKSEGS", kAliHLTDataOriginTPC); | |
90 | return dt; | |
91 | } | |
92 | const AliHLTComponentDataType& AliHLTTPCDefinitions::TracksDataType() { | |
93 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("TRACKS ", kAliHLTDataOriginTPC); | |
94 | return dt; | |
95 | } | |
124b5fc8 | 96 | const AliHLTComponentDataType& AliHLTTPCDefinitions::DataCompressionDescriptorDataType() { |
97 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("COMPDESC", kAliHLTDataOriginTPC); | |
98 | return dt; | |
99 | } | |
4f82526d | 100 | const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterTracksModelDataType() { |
101 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLSTRKMD", kAliHLTDataOriginTPC); | |
102 | return dt; | |
103 | } | |
104 | const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClustersModelDataType() { | |
105 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLSMD", kAliHLTDataOriginTPC); | |
106 | return dt; | |
107 | } | |
108 | const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterTracksCompressedDataType() { | |
109 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLSTRKCM", kAliHLTDataOriginTPC); | |
110 | return dt; | |
111 | } | |
29a647c6 | 112 | const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterIdTracksDataType() { |
113 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLIDSTRK", kAliHLTDataOriginTPC); | |
114 | return dt; | |
115 | } | |
9c559c4d | 116 | const AliHLTComponentDataType& AliHLTTPCDefinitions::CompressedClusterIdDataType() { |
117 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("COMPCLID", kAliHLTDataOriginTPC); | |
118 | return dt; | |
119 | } | |
4f82526d | 120 | const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClustersCompressedDataType() { |
121 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLSCM", kAliHLTDataOriginTPC); | |
122 | return dt; | |
123 | } | |
29a647c6 | 124 | const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClusterIdsDataType() { |
125 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLIDS", kAliHLTDataOriginTPC); | |
126 | return dt; | |
127 | } | |
4f82526d | 128 | |
d3dbc486 | 129 | const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibPedestalDataType() { |
130 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_PED ", kAliHLTDataOriginTPC); | |
131 | return dt; | |
132 | } | |
133 | const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibPulserDataType() { | |
134 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_PULS", kAliHLTDataOriginTPC); | |
135 | return dt; | |
136 | } | |
137 | const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibCEDataType() { | |
138 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_CE ", kAliHLTDataOriginTPC); | |
139 | return dt; | |
140 | } | |
141 | ||
142 | const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibAlignDataType() { | |
143 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALALIGN", kAliHLTDataOriginTPC); | |
144 | return dt; | |
145 | } | |
146 | const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibTracksDataType() { | |
147 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALTRACK", kAliHLTDataOriginTPC); | |
148 | return dt; | |
149 | } | |
150 | ||
151 | const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibTracksGainDataType() { | |
152 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALGAIN ", kAliHLTDataOriginTPC); | |
153 | return dt; | |
154 | } | |
155 | ||
4f82526d | 156 | const AliHLTComponentDataType& AliHLTTPCDefinitions::AliHLTDataTypeClusterMCInfo() { |
157 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLMCINFO", kAliHLTDataOriginTPC); | |
158 | return dt; | |
159 | } | |
deba5d85 | 160 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo = AliHLTComponentDataTypeInitializer("CLMCINFO", kAliHLTDataOriginTPC); |
161 | ||
e642ae99 | 162 | |
71300445 | 163 | const AliHLTTPCDefinitions::AliClusterParameter AliHLTTPCDefinitions::fgkClusterParameterDefinitions[]= { |
61e66346 | 164 | {AliHLTTPCDefinitions::kPadRow, "padrow", 6, 1, 1}, // difference of rows, mostly 0 or 1 |
b97434b7 | 165 | {AliHLTTPCDefinitions::kPad, "pad", 14, 12, 60}, // <100um for 6mm pads |
166 | {AliHLTTPCDefinitions::kTime, "time", 15, 13, 25}, // <100um for 2.5 mm timebin pitch | |
71300445 | 167 | {AliHLTTPCDefinitions::kSigmaY2, "sigmaY2", 8, 5, 25}, |
168 | {AliHLTTPCDefinitions::kSigmaZ2, "sigmaZ2", 8, 5, 10}, | |
169 | {AliHLTTPCDefinitions::kCharge, "charge", 16, 9, 1}, | |
b97434b7 | 170 | {AliHLTTPCDefinitions::kQMax, "qmax", 10, 6, 1}, |
171 | {AliHLTTPCDefinitions::kResidualPad, "respad", 9, 4, 60}, // <100um for 6mm pads, sign stored in separate bit | |
172 | {AliHLTTPCDefinitions::kResidualTime,"restime", 8, 4, 25}, // <100um for 2.5 mm timebin pitch, separate bit for sign | |
b97434b7 | 173 | {AliHLTTPCDefinitions::kClusterCount,"clustercount", 6, 3, 1} // number of clusters on that row |
71300445 | 174 | }; |
175 | ||
176 | unsigned AliHLTTPCDefinitions::GetNumberOfClusterParameterDefinitions() | |
177 | { | |
178 | return sizeof(fgkClusterParameterDefinitions)/sizeof(AliClusterParameter); | |
179 | } | |
180 | ||
b97434b7 | 181 | // NOTE! those values are related to the number of bits in |
182 | // fgkClusterParameterDefinitions | |
183 | const unsigned AliHLTTPCDefinitions::fgkMaxClusterDeltaPad=8; | |
184 | const unsigned AliHLTTPCDefinitions::fgkMaxClusterDeltaTime=10; | |
185 | ||
2a083ac4 | 186 | AliHLTTPCDefinitions::AliHLTTPCDefinitions() |
187 | { | |
96bda103 | 188 | // see header file for class documentation |
189 | // or | |
190 | // refer to README to build package | |
191 | // or | |
192 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
2a083ac4 | 193 | } |
194 | ||
195 | AliHLTTPCDefinitions::~AliHLTTPCDefinitions() | |
196 | { | |
96bda103 | 197 | // see header file for class documentation |
2a083ac4 | 198 | } |
199 | ||
625b072f | 200 | bool AliHLTTPCDefinitions::DDLIdToSlicePatch(AliHLTInt32_t ddlid, AliHLTUInt8_t& slice, AliHLTUInt8_t& patch) |
201 | { | |
202 | // Convert DDL ID to patch and slice numbers. | |
203 | ||
204 | if ((AliHLTUInt32_t(ddlid) >> 8) != 0x3) return false; // Check that detector is TPC. | |
205 | AliHLTUInt32_t ddl = (AliHLTUInt32_t(ddlid) & 0xFF); | |
206 | if (ddl > 215) return false; | |
207 | if (ddl < 72) | |
208 | { | |
209 | slice = ddl / 2; | |
210 | patch = ddl % 2; | |
211 | } | |
212 | else | |
213 | { | |
214 | ddl -= 72; | |
215 | slice = ddl / 4; | |
216 | patch = ddl % 4 + 2; | |
217 | } | |
218 | return true; | |
219 | } | |
71d7c760 | 220 | |
333d8597 | 221 | Int_t AliHLTTPCDefinitions::GetSingleSliceNr( ULong_t spec ) |
222 | { | |
223 | // get the slice number provided that spec encodes a single slice | |
224 | // return -EINVAL if encoded min and max slice differ | |
225 | // return -ERANGE if slice number out of range | |
226 | AliHLTUInt8_t min=GetMinSliceNr(spec); | |
227 | AliHLTUInt8_t max=GetMaxSliceNr(spec); | |
228 | if (min!=max) return -EINVAL; | |
229 | if (max>=AliHLTTPCTransform::GetNSlice()) return -ERANGE; | |
230 | return min; | |
231 | } | |
232 | ||
233 | Int_t AliHLTTPCDefinitions::GetSinglePatchNr( ULong_t spec ) | |
234 | { | |
235 | // get the patch number provided that spec encodes a single patch | |
236 | // return -EINVAL if encoded min and max patch differ | |
237 | // return -ERANGE if patch number out of range | |
238 | AliHLTUInt8_t min=GetMinPatchNr(spec); | |
239 | AliHLTUInt8_t max=GetMaxPatchNr(spec); | |
240 | if (min!=max) return -EINVAL; | |
241 | if (max>=AliHLTTPCTransform::GetNumberOfPatches()) return -ERANGE; | |
242 | return min; | |
243 | } |