-
Notifications
You must be signed in to change notification settings - Fork 499
Expand file tree
/
Copy pathGPUTPCGrid.h
More file actions
69 lines (60 loc) · 2.31 KB
/
GPUTPCGrid.h
File metadata and controls
69 lines (60 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file GPUTPCGrid.h
/// \author Sergey Gorbunov, Ivan Kisel, David Rohr
#ifndef GPUTPCGRID_H
#define GPUTPCGRID_H
#include "GPUTPCDef.h"
namespace o2::gpu
{
/**
* @class GPUTPCGrid
*
* 2-dimensional grid of pointers.
* pointers to (y,z)-like objects are assigned to the corresponding grid bin
* used by GPUTPCTracker to speed-up the hit operations
* grid axis are named Z,Y to be similar to TPC row coordinates.
*/
class GPUTPCGrid
{
public:
GPUd() void CreateEmpty();
GPUd() void Create(float yMin, float yMax, float zMin, float zMax, int32_t ny, int32_t nz);
GPUd() int32_t GetBin(float Y, float Z) const;
/**
* returns -1 if the row is empty == no hits
*/
GPUd() int32_t GetBinBounded(float Y, float Z) const;
GPUd() void GetBin(float Y, float Z, int32_t* const bY, int32_t* const bZ) const;
GPUd() void GetBinArea(float Y, float Z, float dy, float dz, int32_t& bin, int32_t& ny, int32_t& nz) const;
GPUd() uint32_t N() const { return mN; }
GPUd() uint32_t Ny() const { return mNy; }
GPUd() uint32_t Nz() const { return mNz; }
GPUd() float YMin() const { return mYMin; }
GPUd() float YMax() const { return mYMax; }
GPUd() float ZMin() const { return mZMin; }
GPUd() float ZMax() const { return mZMax; }
GPUd() float StepYInv() const { return mStepYInv; }
GPUd() float StepZInv() const { return mStepZInv; }
private:
friend class GPUTPCNeighboursFinder;
uint32_t mNy; //* N bins in Y
uint32_t mNz; //* N bins in Z
uint32_t mN; //* total N bins
float mYMin; //* minimal Y value
float mYMax; //* maximal Y value
float mZMin; //* minimal Z value
float mZMax; //* maximal Z value
float mStepYInv; //* inverse bin size in Y
float mStepZInv; //* inverse bin size in Z
};
} // namespace o2::gpu
#endif // GPUTPCGRID_H