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