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::fgkHWClustersDataType = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC);
40 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAlterClustersDataType = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC);
41 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkVertexDataType = AliHLTComponentDataTypeInitializer("VERTEX ", kAliHLTDataOriginTPC);
42 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTrackSegmentsDataType = AliHLTComponentDataTypeInitializer("TRAKSEGS", kAliHLTDataOriginTPC);
43 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkTracksDataType = AliHLTComponentDataTypeInitializer("TRACKS ", kAliHLTDataOriginTPC);
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);
50 const AliHLTComponentDataType& AliHLTTPCDefinitions::DDLEncodedEntropyRawDataType() {
51 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("DDLENCEN", kAliHLTDataOriginTPC);
54 const AliHLTComponentDataType& AliHLTTPCDefinitions::PackedRawDataType() {
55 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("RAWPAKED", kAliHLTDataOriginTPC);
58 const AliHLTComponentDataType& AliHLTTPCDefinitions::UnpackedRawDataType() {
59 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("RAWUNPAK", kAliHLTDataOriginTPC);
62 const AliHLTComponentDataType& AliHLTTPCDefinitions::ClustersDataType() {
63 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLUSTERS", kAliHLTDataOriginTPC);
66 const AliHLTComponentDataType& AliHLTTPCDefinitions::RawClustersDataType() {
67 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLUSTRAW", kAliHLTDataOriginTPC);
70 const AliHLTComponentDataType& AliHLTTPCDefinitions::HWClustersDataType() {
71 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("HWCLUST1", kAliHLTDataOriginTPC);
74 const AliHLTComponentDataType& AliHLTTPCDefinitions::AlterClustersDataType() {
75 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("HWCL_ALT", kAliHLTDataOriginTPC);
78 const AliHLTComponentDataType& AliHLTTPCDefinitions::VertexDataType() {
79 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("VERTEX ", kAliHLTDataOriginTPC);
82 const AliHLTComponentDataType& AliHLTTPCDefinitions::TrackSegmentsDataType() {
83 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("TRAKSEGS", kAliHLTDataOriginTPC);
86 const AliHLTComponentDataType& AliHLTTPCDefinitions::TracksDataType() {
87 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("TRACKS ", kAliHLTDataOriginTPC);
91 const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterTracksModelDataType() {
92 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLSTRKMD", kAliHLTDataOriginTPC);
95 const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClustersModelDataType() {
96 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLSMD", kAliHLTDataOriginTPC);
99 const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterTracksCompressedDataType() {
100 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLSTRKCM", kAliHLTDataOriginTPC);
103 const AliHLTComponentDataType& AliHLTTPCDefinitions::ClusterIdTracksDataType() {
104 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLIDSTRK", kAliHLTDataOriginTPC);
107 const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClustersCompressedDataType() {
108 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLSCM", kAliHLTDataOriginTPC);
111 const AliHLTComponentDataType& AliHLTTPCDefinitions::RemainingClusterIdsDataType() {
112 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("REMCLIDS", kAliHLTDataOriginTPC);
116 const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibPedestalDataType() {
117 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_PED ", kAliHLTDataOriginTPC);
120 const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibPulserDataType() {
121 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_PULS", kAliHLTDataOriginTPC);
124 const AliHLTComponentDataType& AliHLTTPCDefinitions::CalibCEDataType() {
125 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CAL_CE ", kAliHLTDataOriginTPC);
129 const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibAlignDataType() {
130 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALALIGN", kAliHLTDataOriginTPC);
133 const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibTracksDataType() {
134 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALTRACK", kAliHLTDataOriginTPC);
138 const AliHLTComponentDataType& AliHLTTPCDefinitions::OfflineCalibTracksGainDataType() {
139 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CALGAIN ", kAliHLTDataOriginTPC);
143 const AliHLTComponentDataType& AliHLTTPCDefinitions::AliHLTDataTypeClusterMCInfo() {
144 static AliHLTComponentDataType dt = AliHLTComponentDataTypeInitializer("CLMCINFO", kAliHLTDataOriginTPC);
147 const AliHLTComponentDataType AliHLTTPCDefinitions::fgkAliHLTDataTypeClusterMCInfo = AliHLTComponentDataTypeInitializer("CLMCINFO", kAliHLTDataOriginTPC);
150 const AliHLTTPCDefinitions::AliClusterParameter AliHLTTPCDefinitions::fgkClusterParameterDefinitions[]= {
151 {AliHLTTPCDefinitions::kPadRow, "padrow", 6, 1, 1}, // difference of rows, mostly 0 or 1
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
154 {AliHLTTPCDefinitions::kSigmaY2, "sigmaY2", 8, 5, 25},
155 {AliHLTTPCDefinitions::kSigmaZ2, "sigmaZ2", 8, 5, 10},
156 {AliHLTTPCDefinitions::kCharge, "charge", 16, 9, 1},
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
160 {AliHLTTPCDefinitions::kClusterCount,"clustercount", 6, 3, 1} // number of clusters on that row
163 unsigned AliHLTTPCDefinitions::GetNumberOfClusterParameterDefinitions()
165 return sizeof(fgkClusterParameterDefinitions)/sizeof(AliClusterParameter);
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;
173 AliHLTTPCDefinitions::AliHLTTPCDefinitions()
175 // see header file for class documentation
177 // refer to README to build package
179 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
182 AliHLTTPCDefinitions::~AliHLTTPCDefinitions()
184 // see header file for class documentation
187 bool AliHLTTPCDefinitions::DDLIdToSlicePatch(AliHLTInt32_t ddlid, AliHLTUInt8_t& slice, AliHLTUInt8_t& patch)
189 // Convert DDL ID to patch and slice numbers.
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;
208 Int_t AliHLTTPCDefinitions::GetSingleSliceNr( ULong_t spec )
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;
220 Int_t AliHLTTPCDefinitions::GetSinglePatchNr( ULong_t spec )
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;