2 // Original: AliHLTVertexArray.h,v 1.4 2004/06/11 16:06:33 loizides
4 #ifndef AliHLTTPCVERTEXARRAY_H
5 #define AliHLTTPCVERTEXARRAY_H
8 #include "AliHLTTPCRootTypes.h"
10 class AliHLTTPCVertexArray {
12 AliHLTTPCVertexArray();
13 AliHLTTPCVertexArray(AliHLTTPCVertexArray&);
14 AliHLTTPCVertexArray(Int_t maxseed);
15 virtual ~AliHLTTPCVertexArray();
17 Int_t GetContent(Float_t z,Float_t r,Int_t sec);
18 Int_t Trace(Float_t z,Float_t r,Int_t sec,Float_t vertex);
20 Double_t GetZSectorErr(){return fZSectorErr;}
21 Double_t GetZSector(){return fZSector;}
22 Int_t GetMaxSeed(){return fMaxSeed;}
23 Int_t GetNSeed(){return fNSeed;}
24 Float_t GetRSeed(Int_t i){if(i<400) return fRSeed[i]; else return -999;}
25 Float_t GetZSeed(Int_t i){if(i<400) return fZSeed[i]; else return -999;}
26 Float_t GetSecSeed(Int_t i){if(i<400) return fSecSeed[i]; else return -999;}
28 void FillSector2D(Float_t z,Float_t r,Int_t sec);
29 void FillSectorSeed2D(Float_t z,Float_t r,Int_t sec);
30 void FillSector3D(Float_t x,Float_t y, Float_t z);
31 void FillSectorSeed3D(Float_t x,Float_t y, Float_t z);
32 void FindSectorVertex(Double_t pos = 0,Double_t range = 60,Int_t nbin = 60);
36 void FindMean(Float_t *vertex,Int_t *array, Int_t len);
37 void AnalyzeSector(Float_t *vertex, Int_t *array, Int_t len);
39 Char_t fArray[8320][8][8]; //array
40 Double_t fZSector; //sector
41 Double_t fZSectorErr; //sector error
42 Int_t fMaxSeed; //max seed
43 Int_t fNSeed; //number of seeds
44 Float_t fZSeed[400]; //seed in Z
45 Float_t fRSeed[400]; //seed in XY
46 Int_t fSecSeed[400]; //seed for sectors
48 ClassDef(AliHLTTPCVertexArray,1) //The HLTTPC Fast Vertex Finder Base Class
51 inline void AliHLTTPCVertexArray::FillSector3D(Float_t x, Float_t y, Float_t z)
53 // Filling routine in coordinates
54 Int_t sec = Int_t( (y+.168*x)/(.336*x)*8); // 8 subsec!!
55 Float_t r = sqrt(pow(y,2)+pow(x,2));
56 FillSector2D(z,r,sec);
59 inline void AliHLTTPCVertexArray:: FillSectorSeed3D(Float_t x,Float_t y, Float_t z)
61 // Filling routine for seeds in coordinates
62 Int_t sec = Int_t( (y+.168*x)/(.336*x)*8); // 8 subsec!!
63 Float_t r = sqrt(pow(y,2)+pow(x,2));
64 FillSectorSeed2D(z,r,sec);
67 inline void AliHLTTPCVertexArray::FillSectorSeed2D(Float_t z,Float_t r,Int_t sec)
69 // Filling routine in r,z coordinates
70 if(fNSeed>=400) return;
71 fZSeed[fNSeed] = z; fRSeed[fNSeed] = r; fSecSeed[fNSeed] = sec;
75 inline void AliHLTTPCVertexArray::FillSector2D(Float_t z,Float_t r,Int_t sec)
77 // Filling routine for seeds in r,z coordinates
78 if(z>r||z<=0||r<220||r>=252) return;
79 fArray[Int_t(z/r*32*260)][(Int_t(r-220))/4][sec] += 1;
82 inline Int_t AliHLTTPCVertexArray::GetContent(Float_t z,Float_t r,Int_t sec)
84 // Return content of array in r,z coordinates
85 if(z>r||z<=0||r<220||r>=252) return 0;
86 return fArray[Int_t(z/r*32*260)][(Int_t(r-220))/4][sec];
89 inline void AliHLTTPCVertexArray::ResetSector()
95 for(Int_t i =0;i<400;i++)
96 fZSeed[i] = fRSeed[i] = fSecSeed[i] = 0;
97 for(Int_t z=0;z<8320;z++)
98 for(Int_t r=0;r<8;r++)
99 for(Int_t sec =0;sec<8;sec++)
100 fArray[z][r][sec] = 0;
103 inline Int_t AliHLTTPCVertexArray::Trace(Float_t z,Float_t r,Int_t sec,Float_t vertex)
105 // count the number of entries along starting from z,r to vertex,0
107 for(Int_t i = 0;i<8;i++){
108 Float_t ry = 222 +(i*4);
109 Float_t zx = (ry/r)*(z-vertex)+vertex;
110 cont += GetContent(zx,ry,sec);
112 if(cont < 5) return 0;