3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * Timm Steinbeck <timm@kip.uni-heidelberg.de> *
9 * for The ALICE HLT Project. *
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 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // Definitions for the HLT TPC components //
24 ///////////////////////////////////////////////////////////////////////////////
26 #include "AliHLTTPCDefinitions.h"
27 #include "AliHLTTPCTransform.h"
30 /** ROOT macro for the implementation of ROOT specific class methods */
31 ClassImp(AliHLTTPCDefinitions)
33 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkDDLEncodedEntropyRawDataType = AliHLTComponentDataTypeInitializer("DDLENCEN", kAliHLTDataOriginTPC);
35 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkPackedRawDataType = AliHLTComponentDataTypeInitializer("RAWPAKED", kAliHLTDataOriginTPC);
36 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkUnpackedRawDataType = AliHLTComponentDataTypeInitializer("RAWUNPAK", kAliHLTDataOriginTPC);
37 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClustersDataType = AliHLTComponentDataTypeInitializer("CLUSTERS", kAliHLTDataOriginTPC);
38 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRawClustersDataType = AliHLTComponentDataTypeInitializer("CLUSTRAW", kAliHLTDataOriginTPC);
39 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRawClustersDescriptorDataType = AliHLTComponentDataTypeInitializer("CLRAWDSC", kAliHLTDataOriginTPC);
40 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkHWClustersDataType = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC);
41 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAlterClustersDataType = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC);
42 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkVertexDataType = AliHLTComponentDataTypeInitializer("VERTEX ", kAliHLTDataOriginTPC);
43 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTrackSegmentsDataType = AliHLTComponentDataTypeInitializer("TRAKSEGS", kAliHLTDataOriginTPC);
44 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTracksDataType = AliHLTComponentDataTypeInitializer("TRACKS ", kAliHLTDataOriginTPC);
46 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkDataCompressionDescriptorDataType = AliHLTComponentDataTypeInitializer("COMPDESC", kAliHLTDataOriginTPC);
47 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClusterTracksModelDataType = AliHLTComponentDataTypeInitializer("CLSTRKMD", kAliHLTDataOriginTPC);
48 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRemainingClustersModelDataType = AliHLTComponentDataTypeInitializer("REMCLSMD", kAliHLTDataOriginTPC);
49 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkClusterTracksCompressedDataType = AliHLTComponentDataTypeInitializer("CLSTRKCM", kAliHLTDataOriginTPC);
50 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkRemainingClustersCompressedDataType = AliHLTComponentDataTypeInitializer("REMCLSCM", kAliHLTDataOriginTPC);
52 const AliHLTComponentDataType& AliHLTTPCDefinitions::DDLEncodedEntropyRawDataType() {
53 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("DDLENCEN", kAliHLTDataOriginTPC);
56 const AliHLTComponentDataType& AliHLTTPCDefinitions::PackedRawDataType() {
57 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("RAWPAKED", kAliHLTDataOriginTPC);
60 const AliHLTComponentDataType& AliHLTTPCDefinitions::UnpackedRawDataType() {
61 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("RAWUNPAK", kAliHLTDataOriginTPC);
64 const AliHLTComponentDataType& AliHLTTPCDefinitions::ClustersDataType() {
65 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLUSTERS", kAliHLTDataOriginTPC);
68 const AliHLTComponentDataType& AliHLTTPCDefinitions::RawClustersDataType() {
69 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLUSTRAW", kAliHLTDataOriginTPC);
72 const AliHLTComponentDataType& AliHLTTPCDefinitions::RawClustersDescriptorDataType() {
73 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLRAWDSC", kAliHLTDataOriginTPC);
76 const AliHLTComponentDataType& AliHLTTPCDefinitions::HWClustersDataType() {
77 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC);
80 const AliHLTComponentDataType& AliHLTTPCDefinitions::AlterClustersDataType() {
81 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC);
84 const AliHLTComponentDataType& AliHLTTPCDefinitions::VertexDataType() {
85 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("VERTEX ", kAliHLTDataOriginTPC);
88 const AliHLTComponentDataType& AliHLTTPCDefinitions::TrackSegmentsDataType() {
89 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("TRAKSEGS", kAliHLTDataOriginTPC);
92 const AliHLTComponentDataType& AliHLTTPCDefinitions::TracksDataType() {
93 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("TRACKS ", kAliHLTDataOriginTPC);
96 const AliHLTComponentDataType& AliHLTTPCDefinitions::DataCompressionDescriptorDataType() {
97 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("COMPDESC", kAliHLTDataOriginTPC);
100 const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterTracksModelDataType() {
101 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLSTRKMD", kAliHLTDataOriginTPC);
104 const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClustersModelDataType() {
105 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLSMD", kAliHLTDataOriginTPC);
108 const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterTracksCompressedDataType() {
109 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLSTRKCM", kAliHLTDataOriginTPC);
112 const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterIdTracksDataType() {
113 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLIDSTRK", kAliHLTDataOriginTPC);
116 const AliHLTComponentDataType& AliHLTTPCDefinitions::CompressedClusterIdDataType() {
117 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("COMPCLID", kAliHLTDataOriginTPC);
120 const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClustersCompressedDataType() {
121 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLSCM", kAliHLTDataOriginTPC);
124 const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClusterIdsDataType() {
125 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLIDS", kAliHLTDataOriginTPC);
129 const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibPedestalDataType() {
130 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_PED ", kAliHLTDataOriginTPC);
133 const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibPulserDataType() {
134 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_PULS", kAliHLTDataOriginTPC);
137 const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibCEDataType() {
138 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_CE ", kAliHLTDataOriginTPC);
142 const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibAlignDataType() {
143 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALALIGN", kAliHLTDataOriginTPC);
146 const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibTracksDataType() {
147 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALTRACK", kAliHLTDataOriginTPC);
151 const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibTracksGainDataType() {
152 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALGAIN ", kAliHLTDataOriginTPC);
156 const AliHLTComponentDataType& AliHLTTPCDefinitions::AliHLTDataTypeClusterMCInfo() {
157 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLMCINFO", kAliHLTDataOriginTPC);
160 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo = AliHLTComponentDataTypeInitializer("CLMCINFO", kAliHLTDataOriginTPC);
163 const AliHLTTPCDefinitions::AliClusterParameter AliHLTTPCDefinitions::fgkClusterParameterDefinitions[]= {
164 {AliHLTTPCDefinitions::kPadRow, "padrow", 6, 1, 1}, // difference of rows, mostly 0 or 1
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
167 {AliHLTTPCDefinitions::kSigmaY2, "sigmaY2", 8, 5, 25},
168 {AliHLTTPCDefinitions::kSigmaZ2, "sigmaZ2", 8, 5, 10},
169 {AliHLTTPCDefinitions::kCharge, "charge", 16, 9, 1},
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
173 {AliHLTTPCDefinitions::kClusterCount,"clustercount", 6, 3, 1} // number of clusters on that row
176 unsigned AliHLTTPCDefinitions::GetNumberOfClusterParameterDefinitions()
178 return sizeof(fgkClusterParameterDefinitions)/sizeof(AliClusterParameter);
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;
186 AliHLTTPCDefinitions::AliHLTTPCDefinitions()
188 // see header file for class documentation
190 // refer to README to build package
192 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
195 AliHLTTPCDefinitions::~AliHLTTPCDefinitions()
197 // see header file for class documentation
200 bool AliHLTTPCDefinitions::DDLIdToSlicePatch(AliHLTInt32_t ddlid, AliHLTUInt8_t& slice, AliHLTUInt8_t& patch)
202 // Convert DDL ID to patch and slice numbers.
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;
221 Int_t AliHLTTPCDefinitions::GetSingleSliceNr( ULong_t spec )
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;
233 Int_t AliHLTTPCDefinitions::GetSinglePatchNr( ULong_t spec )
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;