3 #ifndef AliHLTVERTEXARRAY_H
4 #define AliHLTVERTEXARRAY_H
7 #include "AliHLTRootTypes.h"
9 class AliHLTVertexArray {
12 Char_t fArray[8320][8][8]; //array
13 Double_t fZSector; //sector
14 Double_t fZSectorErr; //sector error
15 Int_t fMaxSeed; //max seed
16 Int_t fNSeed; //number of seeds
17 Float_t fZSeed[400]; //seed in Z
18 Float_t fRSeed[400]; //seed in XY
19 Int_t fSecSeed[400]; //seed for sectors
21 void FindMean(Float_t *vertex,Int_t *array, Int_t len);
22 void AnalyzeSector(Float_t *vertex, Int_t *array, Int_t len);
25 AliHLTVertexArray(){fNSeed=0;fMaxSeed=400;}
26 AliHLTVertexArray(AliHLTVertexArray&){fNSeed=0;fMaxSeed=400;}
27 AliHLTVertexArray(Int_t maxseed){fNSeed=0;fMaxSeed=maxseed;}
28 virtual ~AliHLTVertexArray(){;}
30 Int_t GetContent(Float_t z,Float_t r,Int_t sec);
31 Int_t Trace(Float_t z,Float_t r,Int_t sec,Float_t vertex);
33 Double_t GetZSectorErr(){return fZSectorErr;}
34 Double_t GetZSector(){return fZSector;}
35 Int_t GetMaxSeed(){return fMaxSeed;}
36 Int_t GetNSeed(){return fNSeed;}
37 Float_t GetRSeed(Int_t i){if(i<400) return fRSeed[i]; else return -999;}
38 Float_t GetZSeed(Int_t i){if(i<400) return fZSeed[i]; else return -999;}
39 Float_t GetSecSeed(Int_t i){if(i<400) return fSecSeed[i]; else return -999;}
41 void FillSector2D(Float_t z,Float_t r,Int_t sec);
42 void FillSectorSeed2D(Float_t z,Float_t r,Int_t sec);
43 void FillSector3D(Float_t x,Float_t y, Float_t z);
44 void FillSectorSeed3D(Float_t x,Float_t y, Float_t z);
45 void FindSectorVertex(Double_t pos = 0,Double_t range = 60,Int_t nbin = 60);
48 ClassDef(AliHLTVertexArray,1) //The L3 Fast Vertex Finder Base Class
52 typedef AliHLTVertexArray AliL3VertexArray; // for backward compatibility
54 inline void AliHLTVertexArray::FillSector3D(Float_t x, Float_t y, Float_t z)
56 // Filling routine in coordinates
57 Int_t sec = Int_t( (y+.168*x)/(.336*x)*8); // 8 subsec!!
58 Float_t r = sqrt(pow(y,2)+pow(x,2));
59 FillSector2D(z,r,sec);
62 inline void AliHLTVertexArray:: FillSectorSeed3D(Float_t x,Float_t y, Float_t z)
64 // Filling routine for seeds in coordinates
65 Int_t sec = Int_t( (y+.168*x)/(.336*x)*8); // 8 subsec!!
66 Float_t r = sqrt(pow(y,2)+pow(x,2));
67 FillSectorSeed2D(z,r,sec);
70 inline void AliHLTVertexArray::FillSectorSeed2D(Float_t z,Float_t r,Int_t sec)
72 // Filling routine in r,z coordinates
73 if(fNSeed>=400) return;
74 fZSeed[fNSeed] = z; fRSeed[fNSeed] = r; fSecSeed[fNSeed] = sec;
78 inline void AliHLTVertexArray::FillSector2D(Float_t z,Float_t r,Int_t sec)
80 // Filling routine for seeds in r,z coordinates
81 if(z>r||z<=0||r<220||r>=252) return;
82 fArray[Int_t(z/r*32*260)][(Int_t(r-220))/4][sec] += 1;
85 inline Int_t AliHLTVertexArray::GetContent(Float_t z,Float_t r,Int_t sec)
87 // Return content of array in r,z coordinates
88 if(z>r||z<=0||r<220||r>=252) return 0;
89 return fArray[Int_t(z/r*32*260)][(Int_t(r-220))/4][sec];
92 inline void AliHLTVertexArray::ResetSector()
98 for(Int_t i =0;i<400;i++)
99 fZSeed[i] = fRSeed[i] = fSecSeed[i] = 0;
100 for(Int_t z=0;z<8320;z++)
101 for(Int_t r=0;r<8;r++)
102 for(Int_t sec =0;sec<8;sec++)
103 fArray[z][r][sec] = 0;
106 inline Int_t AliHLTVertexArray::Trace(Float_t z,Float_t r,Int_t sec,Float_t vertex)
108 // count the number of entries along starting from z,r to vertex,0
110 for(Int_t i = 0;i<8;i++){
111 Float_t ry = 222 +(i*4);
112 Float_t zx = (ry/r)*(z-vertex)+vertex;
113 cont += GetContent(zx,ry,sec);
115 if(cont < 5) return 0;