2 #ifndef ALIHLTTPCRAWCLUSTER_H
3 #define ALIHLTTPCRAWCLUSTER_H
5 #include "AliHLTTPCRootTypes.h"
8 * @struct AliHLTTPCRawCluster
9 * Primitive data of a TPC cluster in raw coordinates. The plan is to store the
10 * data in a compressed format by limiting the resolution of the float values.
11 * @ingroup alihlt_tpc_datastructs
13 struct AliHLTTPCRawCluster {
14 /* UInt_t fP0; // First 4 bytes of the packed data */
15 /* UInt_t fP1; // Second 4 bytes of the packed data */
16 /* UInt_t fP2; // Third 4 bytes of the packed data */
17 /* UInt_t fP3; // Last 4 bytes of the packed data */
23 unsigned short fCharge;
26 Int_t GetPadRow() const {return fPadRow;}
27 Float_t GetPad() const {return fPad;}
28 Float_t GetTime() const {return fTime;}
29 Float_t GetSigmaY2() const {return fSigmaY2;}
30 Float_t GetSigmaZ2() const {return fSigmaZ2;}
31 Int_t GetCharge() const {return fCharge;}
32 Int_t GetQMax() const {return fQMax;}
34 void SetPadRow(Short_t padrow) {fPadRow=padrow;}
35 void SetPad(Float_t pad) {fPad=pad;}
36 void SetTime(Float_t time) {fTime=time;}
37 void SetSigmaY2(Float_t sigmaY2) {fSigmaY2=sigmaY2;}
38 void SetSigmaZ2(Float_t sigmaZ2) {fSigmaZ2=sigmaZ2;}
39 void SetCharge(UShort_t charge) {fCharge=charge;}
40 void SetQMax(UShort_t qmax) {fQMax=qmax;}
42 /* Int_t GetPadRow() const {return (fP0>>24) & 0xff;} */
43 /* Float_t GetPad() const {return (float( fP0 & 0xffffff)-8388608.)*1.e-4;} */
44 /* Float_t GetTime() const {return (float( fP1 & 0xffffff)-8388608.)*1.e-4;} */
45 /* Float_t GetSigmaY2() const {return (float( fP2 & 0xffff)-32768.)*1.e-4;} */
46 /* Float_t GetSigmaZ2() const {return (float((fP2>>16) & 0xffff)-32768.)*1.e-4;} */
47 /* Int_t GetCharge() const {return fP3 & 0xfffff;} */
48 /* Int_t GetQMax() const {return (fP3>>20) & 0x3ff;} */
50 /* void SetPadRow(Int_t padrow) { fP0&=0x00ffffff; fP0|=(padrow & 0xff)<<24;} */
51 /* void SetPad(Float_t pad) { fP0&=0xff000000; float v=pad*1.e4+8388608.; */
52 /* if( v<0 ) v=0; else if( v>0x00FFFFFF ) v=0x00FFFFFF; */
53 /* UInt_t iv=(UInt_t) v; fP0|=iv; */
55 /* void SetTime(Float_t time) { fP1&=0xff000000; float v=time*1.e4+8388608.; */
56 /* if( v<0 ) v=0; else if( v>0x00FFFFFF ) v=0x00FFFFFF; */
57 /* UInt_t iv=(UInt_t) v; fP1|=iv; */
59 /* void SetSigmaY2(Float_t sigmaY2) { fP2&=0xffff0000; float v=sigmaY2*1.e4+32768.; */
60 /* if( v<0 ) v=0; else if( v>0x0000FFFF ) v=0x0000FFFF; */
61 /* UInt_t iv=(UInt_t) v; fP2|=iv; */
63 /* void SetSigmaZ2(Float_t sigmaZ2) { fP2&=0x0000ffff; float v=sigmaZ2*1.e4+32768.; */
64 /* if( v<0 ) v=0; else if( v>0x0000FFFF ) v=0x0000FFFF; */
65 /* UInt_t iv=(UInt_t) v; fP2|=iv<<16; */
67 /* void SetCharge(Int_t charge) { fP3&=0xfff00000; fP3|=charge&0xfffff;} */
68 /* void SetQMax(Int_t qmax) { fP3&=0x000fffff; fP3|=(qmax&0x3ff)<<20;} */
70 typedef struct AliHLTTPCRawCluster AliHLTTPCRawCluster;
72 struct AliHLTTPCRawClusterData
74 UInt_t fVersion; // version number
75 UInt_t fCount; // number of clusters
76 #if defined(__HP_aCC) || defined(__DECCXX) || defined(__SUNPRO_CC)
77 AliHLTTPCRawCluster fClusters[1]; // array of clusters
79 AliHLTTPCRawCluster fClusters[0]; // array of clusters
82 typedef struct AliHLTTPCRawClusterData AliHLTTPCRawClusterData;