]>
Commit | Line | Data |
---|---|---|
d54804bf | 1 | //-*- Mode: C++ -*- |
2 | // $Id$ | |
ce565086 | 3 | // ************************************************************************ |
fbb9b71b | 4 | // This file is property of and copyright by the ALICE HLT Project * |
ce565086 | 5 | // ALICE Experiment at CERN, All rights reserved. * |
6 | // See cxx source for full Copyright notice * | |
7 | // * | |
8 | //************************************************************************* | |
d54804bf | 9 | |
10 | #ifndef ALIHLTTPCCAGRID_H | |
11 | #define ALIHLTTPCCAGRID_H | |
12 | ||
00d07bcd | 13 | #include "AliHLTTPCCADef.h" |
d54804bf | 14 | |
15 | /** | |
16 | * @class AliHLTTPCCAGrid | |
17 | * | |
18 | * 2-dimensional grid of pointers. | |
19 | * pointers to (y,z)-like objects are assigned to the corresponding grig bin | |
20 | * used by AliHLTTPCCATracker to speed-up the hit operations | |
21 | * grid axis are named Z,Y to be similar to TPC row coordinates. | |
22 | */ | |
23 | class AliHLTTPCCAGrid | |
24 | { | |
fbb9b71b | 25 | public: |
d54804bf | 26 | |
fbb9b71b | 27 | GPUd() void Create( float yMin, float yMax, float zMin, float zMax, unsigned int n ); |
28 | GPUd() void Create( float yMin, float yMax, float zMin, float zMax, float sy, float sz ); | |
d54804bf | 29 | |
fbb9b71b | 30 | GPUd() unsigned int GetBin( float Y, float Z ) const; |
31 | GPUd() void GetBin( float Y, float Z, unsigned int &bY, unsigned int &bZ ) const ; | |
00d07bcd | 32 | |
fbb9b71b | 33 | GPUd() unsigned int GetBinNoCheck( float Y, float Z ) const { |
34 | unsigned int bY = ( unsigned int ) ( ( Y - fYMin ) * fStepYInv ); | |
35 | unsigned int bZ = ( unsigned int ) ( ( Z - fZMin ) * fStepZInv ); | |
36 | return bZ*fNy + bY; | |
37 | } | |
d54804bf | 38 | |
fbb9b71b | 39 | GPUd() void GetBinNoCheck( float Y, float Z, unsigned int &bY, unsigned int &bZ ) const { |
40 | bY = ( unsigned int ) ( ( Y - fYMin ) * fStepYInv ); | |
41 | bZ = ( unsigned int ) ( ( Z - fZMin ) * fStepZInv ); | |
42 | } | |
43 | ||
44 | ||
45 | GPUd() unsigned int N() const { return fN; } | |
46 | GPUd() unsigned int Ny() const { return fNy; } | |
47 | GPUd() unsigned int Nz() const { return fNz; } | |
48 | GPUd() float YMin() const { return fYMin; } | |
49 | GPUd() float YMax() const { return fYMax; } | |
50 | GPUd() float ZMin() const { return fZMin; } | |
51 | GPUd() float ZMax() const { return fZMax; } | |
52 | GPUd() float StepYInv() const { return fStepYInv; } | |
53 | GPUd() float StepZInv() const { return fStepZInv; } | |
54 | ||
55 | private: | |
56 | ||
57 | unsigned int fNy; //* N bins in Y | |
58 | unsigned int fNz; //* N bins in Z | |
59 | unsigned int fN; //* total N bins | |
60 | float fYMin; //* minimal Y value | |
61 | float fYMax; //* maximal Y value | |
62 | float fZMin; //* minimal Z value | |
63 | float fZMax; //* maximal Z value | |
64 | float fStepYInv; //* inverse bin size in Y | |
65 | float fStepZInv; //* inverse bin size in Z | |
d54804bf | 66 | |
00d07bcd | 67 | }; |
d54804bf | 68 | |
69 | #endif |