]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/comp/AliHLTTPCCompDataCompressorHelper.h
documentation and keyword substitution fixed
[u/mrichter/AliRoot.git] / HLT / TPCLib / comp / AliHLTTPCCompDataCompressorHelper.h
1 // XEmacs -*-C++-*-
2 // $Id$
3
4 /**************************************************************************
5  * TPCCompModelAnalysisright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
6  *                                                                        *
7  * Authors: Anders Vestbo <mailto:vestbo@fi.uib.no>                       *
8  *          for The ALICE Off-line Project.                               *
9  *                                                                        *
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  **************************************************************************/
18
19 /** @file   AliHLTTPCCompDataCompressorHelper.h
20     @author Anders Vestbo
21     @date   30-11-2006
22     @brief  The Data Compressor helper for the Vestbo-compression for the TPC
23 */
24
25 #ifndef AliHLTTPCComp_DataCompressorHelper
26 #define AliHLTTPCComp_DataCompressorHelper
27
28 #include "AliHLTTPCRootTypes.h"
29
30 /** @class   AliHLTTPCCompDataCompressorHelper
31     @author Anders Vestbo
32     @date   30-11-2006
33     @brief  Class to implement compression functions that will be used in Vestbo-compression  
34 */
35 class AliHLTTPCCompDataCompressorHelper {
36   
37  public:
38
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
44    */
45   static void SetBitNumbers(Int_t pad,Int_t time,Int_t charge,Int_t shape);
46
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)
52    */
53   static void SetTransverseResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005);
54
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)
60    */
61   static void SetLongitudinalResolutions(Float_t res1,Float_t res2,Float_t res3,Float_t width=0.005);
62
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
67    */ 
68   static void SetRemainingBitNumbers(Int_t pad,Int_t time,Int_t shape);
69
70   /** function to get number of pad bits
71    * @return fgNumPadBits integer for number of pad bits
72    */
73   static Int_t GetNPadBits() {return fgNumPadBits;}
74
75   /** function to get number of time bits
76    * @return fgNumTimeBits integer for number of time bin bits
77    */
78   static Int_t GetNTimeBits() {return fgNumTimeBits;}
79
80   /** function to get number of charge bits (total charge)
81    * @return fgNumChargeBits integer for number of charge bits
82    */
83   static Int_t GetNChargeBits() {return fgNumChargeBits;}
84
85   /** function to get number of shape bits
86    * @return fgNumShapeBits integer for number of shape bits
87    */
88   static Int_t GetNShapeBits() {return fgNumShapeBits;}
89
90   /** function to get detector xy width step
91    * @return fgXYWidthStep float for the x-y-width-step
92    */
93   static Float_t GetXYWidthStep() {return fgXYWidthStep;}
94
95   /** function to get detector z width step
96    * @return fgZWidthStep float for the z-width-step
97    */
98   static Float_t GetZWidthStep() {return fgZWidthStep;}
99
100   /** function to get the total charge of the cluster
101    * @return fgClusterCharge integer for the total charge of the cluster
102    */
103   static Int_t GetClusterCharge() {return fgClusterCharge;}
104
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)
108    */
109   static Float_t GetXYResidualStep(Int_t row);
110
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)
114    */
115   static Float_t GetZResidualStep(Int_t row);
116
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
119    */
120   static Int_t GetNPadBitsRemaining() {return fgNumPadBitsRemaining;}
121
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
124    */
125   static Int_t GetNTimeBitsRemaining() {return fgNumTimeBitsRemaining;}
126
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
129    */
130   static Int_t GetNShapeBitsRemaining() {return fgNumShapeBitsRemaining;}
131
132   /** function to get pad precision factor
133    * @return float that defines the number of bits (-> precision)
134    */
135   static Float_t GetPadPrecisionFactor();
136
137   /** function to get time precision factor
138    * @return float that defines the number of bits (-> precision)
139    */
140   static Float_t GetTimePrecisionFactor();
141
142   //taken from TMath:
143
144   /** function to convert double to int
145    * @param x double value to be converted
146    * @return integer created from double value
147    */
148   static Int_t Nint(Double_t x); 
149
150   /** function to calculate the absolute of an integer
151    * @param d integer to be taken absolute value from
152    * @return positive integer
153    */
154   static Int_t Abs(Int_t d) { return (d > 0) ? d : -d; }
155
156   /** function to calculate the absolute of a double
157    * @param d double to be taken absolute value from
158    * @return positive double
159    */
160   static Double_t Abs(Double_t d) { return (d > 0) ? d : -d; }
161
162  private:
163
164   /** standard constructor */
165   AliHLTTPCCompDataCompressorHelper();
166
167   /** standard destructor */
168   virtual ~AliHLTTPCCompDataCompressorHelper() {};
169
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
184
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
203
204
205   ClassDef(AliHLTTPCCompDataCompressorHelper,1) 
206
207 };
208
209 #endif