]>
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); |
6af4f584 | 39 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkHWClustersDataType = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC); |
491d6af5 | 40 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAlterClustersDataType = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC); |
e5c0542d | 41 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkVertexDataType = AliHLTComponentDataTypeInitializer("VERTEX ", kAliHLTDataOriginTPC); |
42 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTrackSegmentsDataType = AliHLTComponentDataTypeInitializer("TRAKSEGS", kAliHLTDataOriginTPC); | |
43 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTracksDataType = AliHLTComponentDataTypeInitializer("TRACKS ", kAliHLTDataOriginTPC); | |
ff2f0f94 | 44 | |
e5c0542d | 45 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClusterTracksModelDataType = AliHLTComponentDataTypeInitializer("CLSTRKMD", kAliHLTDataOriginTPC); |
46 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRemainingClustersModelDataType = AliHLTComponentDataTypeInitializer("REMCLSMD", kAliHLTDataOriginTPC); | |
47 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClusterTracksCompressedDataType = AliHLTComponentDataTypeInitializer("CLSTRKCM", kAliHLTDataOriginTPC); | |
48 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRemainingClustersCompressedDataType = AliHLTComponentDataTypeInitializer("REMCLSCM", kAliHLTDataOriginTPC); | |
69347e0d | 49 | |
4f82526d | 50 | const AliHLTComponentDataType& AliHLTTPCDefinitions::DDLEncodedEntropyRawDataType() { |
51 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("DDLENCEN", kAliHLTDataOriginTPC); | |
52 | return dt; | |
53 | } | |
54 | const AliHLTComponentDataType& AliHLTTPCDefinitions::PackedRawDataType() { | |
55 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("RAWPAKED", kAliHLTDataOriginTPC); | |
56 | return dt; | |
57 | } | |
58 | const AliHLTComponentDataType& AliHLTTPCDefinitions::UnpackedRawDataType() { | |
59 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("RAWUNPAK", kAliHLTDataOriginTPC); | |
60 | return dt; | |
61 | } | |
62 | const AliHLTComponentDataType& AliHLTTPCDefinitions::ClustersDataType() { | |
63 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLUSTERS", kAliHLTDataOriginTPC); | |
64 | return dt; | |
65 | } | |
66 | const AliHLTComponentDataType& AliHLTTPCDefinitions::RawClustersDataType() { | |
67 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLUSTRAW", kAliHLTDataOriginTPC); | |
68 | return dt; | |
69 | } | |
70 | const AliHLTComponentDataType& AliHLTTPCDefinitions::HWClustersDataType() { | |
71 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC); | |
72 | return dt; | |
73 | } | |
74 | const AliHLTComponentDataType& AliHLTTPCDefinitions::AlterClustersDataType() { | |
75 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC); | |
76 | return dt; | |
77 | } | |
78 | const AliHLTComponentDataType& AliHLTTPCDefinitions::VertexDataType() { | |
79 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("VERTEX ", kAliHLTDataOriginTPC); | |
80 | return dt; | |
81 | } | |
82 | const AliHLTComponentDataType& AliHLTTPCDefinitions::TrackSegmentsDataType() { | |
83 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("TRAKSEGS", kAliHLTDataOriginTPC); | |
84 | return dt; | |
85 | } | |
86 | const AliHLTComponentDataType& AliHLTTPCDefinitions::TracksDataType() { | |
87 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("TRACKS ", kAliHLTDataOriginTPC); | |
88 | return dt; | |
89 | } | |
90 | ||
91 | const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterTracksModelDataType() { | |
92 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLSTRKMD", kAliHLTDataOriginTPC); | |
93 | return dt; | |
94 | } | |
95 | const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClustersModelDataType() { | |
96 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLSMD", kAliHLTDataOriginTPC); | |
97 | return dt; | |
98 | } | |
99 | const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterTracksCompressedDataType() { | |
100 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLSTRKCM", kAliHLTDataOriginTPC); | |
101 | return dt; | |
102 | } | |
29a647c6 | 103 | const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterIdTracksDataType() { |
104 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLIDSTRK", kAliHLTDataOriginTPC); | |
105 | return dt; | |
106 | } | |
4f82526d | 107 | const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClustersCompressedDataType() { |
108 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLSCM", kAliHLTDataOriginTPC); | |
109 | return dt; | |
110 | } | |
29a647c6 | 111 | const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClusterIdsDataType() { |
112 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLIDS", kAliHLTDataOriginTPC); | |
113 | return dt; | |
114 | } | |
4f82526d | 115 | |
d3dbc486 | 116 | const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibPedestalDataType() { |
117 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_PED ", kAliHLTDataOriginTPC); | |
118 | return dt; | |
119 | } | |
120 | const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibPulserDataType() { | |
121 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_PULS", kAliHLTDataOriginTPC); | |
122 | return dt; | |
123 | } | |
124 | const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibCEDataType() { | |
125 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_CE ", kAliHLTDataOriginTPC); | |
126 | return dt; | |
127 | } | |
128 | ||
129 | const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibAlignDataType() { | |
130 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALALIGN", kAliHLTDataOriginTPC); | |
131 | return dt; | |
132 | } | |
133 | const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibTracksDataType() { | |
134 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALTRACK", kAliHLTDataOriginTPC); | |
135 | return dt; | |
136 | } | |
137 | ||
138 | const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibTracksGainDataType() { | |
139 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALGAIN ", kAliHLTDataOriginTPC); | |
140 | return dt; | |
141 | } | |
142 | ||
4f82526d | 143 | const AliHLTComponentDataType& AliHLTTPCDefinitions::AliHLTDataTypeClusterMCInfo() { |
144 | static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLMCINFO", kAliHLTDataOriginTPC); | |
145 | return dt; | |
146 | } | |
deba5d85 | 147 | const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo = AliHLTComponentDataTypeInitializer("CLMCINFO", kAliHLTDataOriginTPC); |
148 | ||
e642ae99 | 149 | |
71300445 | 150 | const AliHLTTPCDefinitions::AliClusterParameter AliHLTTPCDefinitions::fgkClusterParameterDefinitions[]= { |
61e66346 | 151 | {AliHLTTPCDefinitions::kPadRow, "padrow", 6, 1, 1}, // difference of rows, mostly 0 or 1 |
b97434b7 | 152 | {AliHLTTPCDefinitions::kPad, "pad", 14, 12, 60}, // <100um for 6mm pads |
153 | {AliHLTTPCDefinitions::kTime, "time", 15, 13, 25}, // <100um for 2.5 mm timebin pitch | |
71300445 | 154 | {AliHLTTPCDefinitions::kSigmaY2, "sigmaY2", 8, 5, 25}, |
155 | {AliHLTTPCDefinitions::kSigmaZ2, "sigmaZ2", 8, 5, 10}, | |
156 | {AliHLTTPCDefinitions::kCharge, "charge", 16, 9, 1}, | |
b97434b7 | 157 | {AliHLTTPCDefinitions::kQMax, "qmax", 10, 6, 1}, |
158 | {AliHLTTPCDefinitions::kResidualPad, "respad", 9, 4, 60}, // <100um for 6mm pads, sign stored in separate bit | |
159 | {AliHLTTPCDefinitions::kResidualTime,"restime", 8, 4, 25}, // <100um for 2.5 mm timebin pitch, separate bit for sign | |
b97434b7 | 160 | {AliHLTTPCDefinitions::kClusterCount,"clustercount", 6, 3, 1} // number of clusters on that row |
71300445 | 161 | }; |
162 | ||
163 | unsigned AliHLTTPCDefinitions::GetNumberOfClusterParameterDefinitions() | |
164 | { | |
165 | return sizeof(fgkClusterParameterDefinitions)/sizeof(AliClusterParameter); | |
166 | } | |
167 | ||
b97434b7 | 168 | // NOTE! those values are related to the number of bits in |
169 | // fgkClusterParameterDefinitions | |
170 | const unsigned AliHLTTPCDefinitions::fgkMaxClusterDeltaPad=8; | |
171 | const unsigned AliHLTTPCDefinitions::fgkMaxClusterDeltaTime=10; | |
172 | ||
2a083ac4 | 173 | AliHLTTPCDefinitions::AliHLTTPCDefinitions() |
174 | { | |
96bda103 | 175 | // see header file for class documentation |
176 | // or | |
177 | // refer to README to build package | |
178 | // or | |
179 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt | |
2a083ac4 | 180 | } |
181 | ||
182 | AliHLTTPCDefinitions::~AliHLTTPCDefinitions() | |
183 | { | |
96bda103 | 184 | // see header file for class documentation |
2a083ac4 | 185 | } |
186 | ||
625b072f | 187 | bool AliHLTTPCDefinitions::DDLIdToSlicePatch(AliHLTInt32_t ddlid, AliHLTUInt8_t& slice, AliHLTUInt8_t& patch) |
188 | { | |
189 | // Convert DDL ID to patch and slice numbers. | |
190 | ||
191 | if ((AliHLTUInt32_t(ddlid) >> 8) != 0x3) return false; // Check that detector is TPC. | |
192 | AliHLTUInt32_t ddl = (AliHLTUInt32_t(ddlid) & 0xFF); | |
193 | if (ddl > 215) return false; | |
194 | if (ddl < 72) | |
195 | { | |
196 | slice = ddl / 2; | |
197 | patch = ddl % 2; | |
198 | } | |
199 | else | |
200 | { | |
201 | ddl -= 72; | |
202 | slice = ddl / 4; | |
203 | patch = ddl % 4 + 2; | |
204 | } | |
205 | return true; | |
206 | } | |
71d7c760 | 207 | |
333d8597 | 208 | Int_t AliHLTTPCDefinitions::GetSingleSliceNr( ULong_t spec ) |
209 | { | |
210 | // get the slice number provided that spec encodes a single slice | |
211 | // return -EINVAL if encoded min and max slice differ | |
212 | // return -ERANGE if slice number out of range | |
213 | AliHLTUInt8_t min=GetMinSliceNr(spec); | |
214 | AliHLTUInt8_t max=GetMaxSliceNr(spec); | |
215 | if (min!=max) return -EINVAL; | |
216 | if (max>=AliHLTTPCTransform::GetNSlice()) return -ERANGE; | |
217 | return min; | |
218 | } | |
219 | ||
220 | Int_t AliHLTTPCDefinitions::GetSinglePatchNr( ULong_t spec ) | |
221 | { | |
222 | // get the patch number provided that spec encodes a single patch | |
223 | // return -EINVAL if encoded min and max patch differ | |
224 | // return -ERANGE if patch number out of range | |
225 | AliHLTUInt8_t min=GetMinPatchNr(spec); | |
226 | AliHLTUInt8_t max=GetMaxPatchNr(spec); | |
227 | if (min!=max) return -EINVAL; | |
228 | if (max>=AliHLTTPCTransform::GetNumberOfPatches()) return -ERANGE; | |
229 | return min; | |
230 | } |