forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VertexerTraitsGPU.h
87 lines (73 loc) · 2.58 KB
/
VertexerTraitsGPU.h
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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 VertexerTraitsGPU.h
/// \brief
/// \author matteo.concas@cern.ch
#ifndef O2_ITS_TRACKING_VERTEXER_TRAITS_GPU_H_
#define O2_ITS_TRACKING_VERTEXER_TRAITS_GPU_H_
#include <vector>
#include <array>
#include "ITStracking/VertexerTraits.h"
#include "ITStracking/Cluster.h"
#include "ITStracking/Constants.h"
#include "ITStracking/Definitions.h"
#include "ITStracking/Tracklet.h"
#include "ITStrackingCUDA/DeviceStoreVertexerGPU.h"
#include "ITStrackingCUDA/UniquePointer.h"
#ifdef _ALLOW_DEBUG_TREES_ITS_
#include "ITStracking/StandaloneDebugger.h"
#endif
namespace o2
{
namespace its
{
class ROframe;
using constants::its2::InversePhiBinSize;
class VertexerTraitsGPU : public VertexerTraits
{
public:
#ifdef _ALLOW_DEBUG_TREES_ITS_
VertexerTraitsGPU();
~VertexerTraitsGPU() override;
#else
VertexerTraitsGPU();
~VertexerTraitsGPU() override;
#endif
void initialise(ROframe*) override;
void computeTracklets() override;
void computeTrackletMatching() override;
void computeVertices() override;
#ifdef _ALLOW_DEBUG_TREES_ITS_
void computeMCFiltering() override;
#endif
// GPU-specific getters
GPUd() static const int2 getBinsPhiRectWindow(const Cluster&, float maxdeltaphi);
GPUhd() gpu::DeviceStoreVertexerGPU& getDeviceContext();
protected:
gpu::DeviceStoreVertexerGPU mStoreVertexerGPU;
gpu::UniquePointer<gpu::DeviceStoreVertexerGPU> mStoreVertexerGPUPtr;
};
inline GPUd() const int2 VertexerTraitsGPU::getBinsPhiRectWindow(const Cluster& currentCluster, float phiCut)
{
// This function returns the lowest PhiBin and the number of phi bins to be spanned, In the form int2{phiBinLow, PhiBinSpan}
const int phiBinMin{constants::its2::getPhiBinIndex(
math_utils::getNormalizedPhiCoordinate(currentCluster.phiCoordinate - phiCut))};
const int phiBinSpan{static_cast<int>(MATH_CEIL(phiCut * InversePhiBinSize))};
return int2{phiBinMin, phiBinSpan};
}
inline gpu::DeviceStoreVertexerGPU& VertexerTraitsGPU::getDeviceContext()
{
return *mStoreVertexerGPUPtr;
}
extern "C" VertexerTraits* createVertexerTraitsGPU();
} // namespace its
} // namespace o2
#endif /* O2_ITS_TRACKING_VERTEXER_TRAITS_GPU_H_ */