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