4 //* This file is property of and copyright by the ALICE HLT Project *
5 //* ALICE Experiment at CERN, All rights reserved. *
6 //* See cxx source for full Copyright notice *
8 /** @file AliHLTTPCCompDataCompressorHelper.h
11 @brief The Data Compressor helper for the Vestbo-compression for the TPC
14 #ifndef AliHLTTPCComp_DataCompressorHelper
15 #define AliHLTTPCComp_DataCompressorHelper
17 #include "AliHLTTPCRootTypes.h"
19 /** @class AliHLTTPCCompDataCompressorHelper
20 @brief Class to implement compression functions that will be used in
23 class AliHLTTPCCompDataCompressorHelper {
27 /** function to set numbers of bits for compression model
28 * @param pad integer to define pad
29 * @param time integer to define time bin
30 * @param charge integer to define total charge of the cluster
31 * @param shape integer to define shape of the cluster
33 static void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape);
35 /** function to define transverse resolutions
36 * @param res1 float to define first resolution
37 * @param res2 float to define second resolution
38 * @param res3 float to define third resolution
39 * @param width float to define width (set to 0.005 if nothing is specified)
41 static void SetTransverseResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005);
43 /** function to define longitudinal resolutions
44 * @param res1 float to define first resolution
45 * @param res2 float to define second resolution
46 * @param res3 float to define third resolution
47 * @param width float to define width (set to 0.005 if nothing is specified)
49 static void SetLongitudinalResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005);
51 /** function to set number of bits for remaining clusters
52 * @param pad integer to define pad
53 * @param time integer to define time bin
54 * @param shape integer to define shape of the cluster
56 static void SetRemainingBitNumbers(Int_t pad,Int_t time,Int_t shape);
58 /** function to get number of pad bits
59 * @return fgNumPadBits integer for number of pad bits
61 static Int_t GetNPadBits() {return fgNumPadBits;}
63 /** function to get number of time bits
64 * @return fgNumTimeBits integer for number of time bin bits
66 static Int_t GetNTimeBits() {return fgNumTimeBits;}
68 /** function to get number of charge bits (total charge)
69 * @return fgNumChargeBits integer for number of charge bits
71 static Int_t GetNChargeBits() {return fgNumChargeBits;}
73 /** function to get number of shape bits
74 * @return fgNumShapeBits integer for number of shape bits
76 static Int_t GetNShapeBits() {return fgNumShapeBits;}
78 /** function to get detector xy width step
79 * @return fgXYWidthStep float for the x-y-width-step
81 static Float_t GetXYWidthStep() {return fgXYWidthStep;}
83 /** function to get detector z width step
84 * @return fgZWidthStep float for the z-width-step
86 static Float_t GetZWidthStep() {return fgZWidthStep;}
88 /** function to get the total charge of the cluster
89 * @return fgClusterCharge integer for the total charge of the cluster
91 static Int_t GetClusterCharge() {return fgClusterCharge;}
93 /** function to get detector xy residual step
94 * @param row integer to define the pad row
95 * @return fgXYResidualStepX float for the x-y-residual-step (X stands for 1 to 3, depending on the step)
97 static Float_t GetXYResidualStep(Int_t row);
99 /** function to get detector z residual step
100 * @param row integer to define the pad row
101 * @return fgZResidualStepX float for the z-residual-step (X stands for 1 to 3, depending on the step)
103 static Float_t GetZResidualStep(Int_t row);
105 /** function to get the number of bits for pads from remaining clusters
106 * @return fgNumPadBitsRemaining integer for the number of bits for pads from remaining clusters
108 static Int_t GetNPadBitsRemaining() {return fgNumPadBitsRemaining;}
110 /** function to get the number of bits for time bins from remaining clusters
111 * @return fgNumTimeBitsRemaining integer for the number of bits for time bins from remaining clusters
113 static Int_t GetNTimeBitsRemaining() {return fgNumTimeBitsRemaining;}
115 /** function to get the number of bits for shapes of remaining clusters
116 * @return fgNumShapeBitsRemaining integer for the number of bits for shapes of remaining clusters
118 static Int_t GetNShapeBitsRemaining() {return fgNumShapeBitsRemaining;}
120 /** function to get pad precision factor
121 * @return float that defines the number of bits (-> precision)
123 static Float_t GetPadPrecisionFactor();
125 /** function to get time precision factor
126 * @return float that defines the number of bits (-> precision)
128 static Float_t GetTimePrecisionFactor();
132 /** function to convert double to int
133 * @param x double value to be converted
134 * @return integer created from double value
136 static Int_t Nint(Double_t x);
138 /** function to calculate the absolute of an integer
139 * @param d integer to be taken absolute value from
140 * @return positive integer
142 static Int_t Abs(Int_t d) { return (d > 0) ? d : -d; }
144 /** function to calculate the absolute of a double
145 * @param d double to be taken absolute value from
146 * @return positive double
148 static Double_t Abs(Double_t d) { return (d > 0) ? d : -d; }
152 /** standard constructor */
153 AliHLTTPCCompDataCompressorHelper();
155 /** standard destructor */
156 virtual ~AliHLTTPCCompDataCompressorHelper() {};
158 /** number of pad bits */
159 static Int_t fgNumPadBits; // Number of pad bits
160 /** number of time bits */
161 static Int_t fgNumTimeBits; // Number of time bits
162 /** number of charge bits */
163 static Int_t fgNumChargeBits; // Number of charge bits
164 /** number of shape bits */
165 static Int_t fgNumShapeBits; // Number of shape bits
166 /** number of remaining pad bits */
167 static Int_t fgNumPadBitsRemaining; // Number of remaining pad bits
168 /** number of remaining time bits */
169 static Int_t fgNumTimeBitsRemaining; // Number of remaining time bits
170 /** number of remaining shape bits */
171 static Int_t fgNumShapeBitsRemaining; // Number of remaining shape bits
173 /** xy residual at step 1 */
174 static Float_t fgXYResidualStep1; // XY residual at step 1
175 /** xy residual at step 2 */
176 static Float_t fgXYResidualStep2; // XY residual at step 2
177 /** xy residual at step 3 */
178 static Float_t fgXYResidualStep3; // XY residual at step 3
179 /** z residual at step 1 */
180 static Float_t fgZResidualStep1; // Z residual at step 1
181 /** z residual at step 2 */
182 static Float_t fgZResidualStep2; // Z residual at step 2
183 /** z residual at step 3 */
184 static Float_t fgZResidualStep3; // Z residual at step 3
185 /** width of xy step */
186 static Float_t fgXYWidthStep; // Width of XY step
187 /** width of z step */
188 static Float_t fgZWidthStep; // Width of Z step
189 /** cluster charge */
190 static Int_t fgClusterCharge; // Cluster charge
193 ClassDef(AliHLTTPCCompDataCompressorHelper,1)