4 /**************************************************************************
5 * TPCCompModelAnalysisright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * Authors: Anders Vestbo <mailto:vestbo@fi.uib.no> *
8 * for The ALICE Off-line Project. *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
19 /** @file AliHLTTPCCompDataCompressorHelper.h
22 @brief The Data Compressor helper for the Vestbo-compression for the TPC
25 #ifndef AliHLTTPCComp_DataCompressorHelper
26 #define AliHLTTPCComp_DataCompressorHelper
28 #include "AliHLTTPCRootTypes.h"
30 /** @class AliHLTTPCCompDataCompressorHelper
33 @brief Class to implement compression functions that will be used in Vestbo-compression
35 class AliHLTTPCCompDataCompressorHelper {
39 /** function to set numbers of bits for compression model
40 * @param pad integer to define pad
41 * @param time integer to define time bin
42 * @param charge integer to define total charge of the cluster
43 * @param shape integer to define shape of the cluster
45 static void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape);
47 /** function to define transverse resolutions
48 * @param res1 float to define first resolution
49 * @param res2 float to define second resolution
50 * @param res3 float to define third resolution
51 * @param width float to define width (set to 0.005 if nothing is specified)
53 static void SetTransverseResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005);
55 /** function to define longitudinal resolutions
56 * @param res1 float to define first resolution
57 * @param res2 float to define second resolution
58 * @param res3 float to define third resolution
59 * @param width float to define width (set to 0.005 if nothing is specified)
61 static void SetLongitudinalResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005);
63 /** function to set number of bits for remaining clusters
64 * @param pad integer to define pad
65 * @param time integer to define time bin
66 * @param shape integer to define shape of the cluster
68 static void SetRemainingBitNumbers(Int_t pad,Int_t time,Int_t shape);
70 /** function to get number of pad bits
71 * @return fgNumPadBits integer for number of pad bits
73 static Int_t GetNPadBits() {return fgNumPadBits;}
75 /** function to get number of time bits
76 * @return fgNumTimeBits integer for number of time bin bits
78 static Int_t GetNTimeBits() {return fgNumTimeBits;}
80 /** function to get number of charge bits (total charge)
81 * @return fgNumChargeBits integer for number of charge bits
83 static Int_t GetNChargeBits() {return fgNumChargeBits;}
85 /** function to get number of shape bits
86 * @return fgNumShapeBits integer for number of shape bits
88 static Int_t GetNShapeBits() {return fgNumShapeBits;}
90 /** function to get detector xy width step
91 * @return fgXYWidthStep float for the x-y-width-step
93 static Float_t GetXYWidthStep() {return fgXYWidthStep;}
95 /** function to get detector z width step
96 * @return fgZWidthStep float for the z-width-step
98 static Float_t GetZWidthStep() {return fgZWidthStep;}
100 /** function to get the total charge of the cluster
101 * @return fgClusterCharge integer for the total charge of the cluster
103 static Int_t GetClusterCharge() {return fgClusterCharge;}
105 /** function to get detector xy residual step
106 * @param row integer to define the pad row
107 * @return fgXYResidualStepX float for the x-y-residual-step (X stands for 1 to 3, depending on the step)
109 static Float_t GetXYResidualStep(Int_t row);
111 /** function to get detector z residual step
112 * @param row integer to define the pad row
113 * @return fgZResidualStepX float for the z-residual-step (X stands for 1 to 3, depending on the step)
115 static Float_t GetZResidualStep(Int_t row);
117 /** function to get the number of bits for pads from remaining clusters
118 * @return fgNumPadBitsRemaining integer for the number of bits for pads from remaining clusters
120 static Int_t GetNPadBitsRemaining() {return fgNumPadBitsRemaining;}
122 /** function to get the number of bits for time bins from remaining clusters
123 * @return fgNumTimeBitsRemaining integer for the number of bits for time bins from remaining clusters
125 static Int_t GetNTimeBitsRemaining() {return fgNumTimeBitsRemaining;}
127 /** function to get the number of bits for shapes of remaining clusters
128 * @return fgNumShapeBitsRemaining integer for the number of bits for shapes of remaining clusters
130 static Int_t GetNShapeBitsRemaining() {return fgNumShapeBitsRemaining;}
132 /** function to get pad precision factor
133 * @return float that defines the number of bits (-> precision)
135 static Float_t GetPadPrecisionFactor();
137 /** function to get time precision factor
138 * @return float that defines the number of bits (-> precision)
140 static Float_t GetTimePrecisionFactor();
144 /** function to convert double to int
145 * @param x double value to be converted
146 * @return integer created from double value
148 static Int_t Nint(Double_t x);
150 /** function to calculate the absolute of an integer
151 * @param d integer to be taken absolute value from
152 * @return positive integer
154 static Int_t Abs(Int_t d) { return (d > 0) ? d : -d; }
156 /** function to calculate the absolute of a double
157 * @param d double to be taken absolute value from
158 * @return positive double
160 static Double_t Abs(Double_t d) { return (d > 0) ? d : -d; }
164 /** standard constructor */
165 AliHLTTPCCompDataCompressorHelper();
167 /** standard destructor */
168 virtual ~AliHLTTPCCompDataCompressorHelper() {};
170 /** number of pad bits */
171 static Int_t fgNumPadBits; // Number of pad bits
172 /** number of time bits */
173 static Int_t fgNumTimeBits; // Number of time bits
174 /** number of charge bits */
175 static Int_t fgNumChargeBits; // Number of charge bits
176 /** number of shape bits */
177 static Int_t fgNumShapeBits; // Number of shape bits
178 /** number of remaining pad bits */
179 static Int_t fgNumPadBitsRemaining; // Number of remaining pad bits
180 /** number of remaining time bits */
181 static Int_t fgNumTimeBitsRemaining; // Number of remaining time bits
182 /** number of remaining shape bits */
183 static Int_t fgNumShapeBitsRemaining; // Number of remaining shape bits
185 /** xy residual at step 1 */
186 static Float_t fgXYResidualStep1; // XY residual at step 1
187 /** xy residual at step 2 */
188 static Float_t fgXYResidualStep2; // XY residual at step 2
189 /** xy residual at step 3 */
190 static Float_t fgXYResidualStep3; // XY residual at step 3
191 /** z residual at step 1 */
192 static Float_t fgZResidualStep1; // Z residual at step 1
193 /** z residual at step 2 */
194 static Float_t fgZResidualStep2; // Z residual at step 2
195 /** z residual at step 3 */
196 static Float_t fgZResidualStep3; // Z residual at step 3
197 /** width of xy step */
198 static Float_t fgXYWidthStep; // Width of XY step
199 /** width of z step */
200 static Float_t fgZWidthStep; // Width of Z step
201 /** cluster charge */
202 static Int_t fgClusterCharge; // Cluster charge
205 ClassDef(AliHLTTPCCompDataCompressorHelper,1)