forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VertexerTraitsHIP.h
95 lines (80 loc) · 2.79 KB
/
VertexerTraitsHIP.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
88
89
90
91
92
93
94
95
// 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 VertexerTraitsHIP.h
/// \brief
/// \author matteo.concas@cern.ch
#ifndef O2_ITS_TRACKING_VERTEXERTRAITS_HIP_H_
#define O2_ITS_TRACKING_VERTEXERTRAITS_HIP_H_
#include <vector>
#include <array>
#include "ITStracking/VertexerTraits.h"
#include "ITStracking/Cluster.h"
#include "ITStracking/Constants.h"
#include "ITStracking/Tracklet.h"
#include "ITStrackingHIP/DeviceStoreVertexerHIP.h"
#include "ITStrackingHIP/UniquePointerHIP.h"
#ifdef _ALLOW_DEBUG_TREES_ITS_
#include "ITStracking/StandaloneDebugger.h"
#endif
namespace o2
{
namespace its
{
class ROframe;
using constants::its2::InversePhiBinSize;
class VertexerTraitsHIP : public VertexerTraits
{
public:
#ifdef _ALLOW_DEBUG_TREES_ITS_
VertexerTraitsHIP();
~VertexerTraitsHIP();
#else
VertexerTraitsHIP();
~VertexerTraitsHIP() = default;
#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::DeviceStoreVertexerHIP& getDeviceContext();
GPUhd() gpu::DeviceStoreVertexerHIP* getDeviceContextPtr();
protected:
// #ifdef _ALLOW_DEBUG_TREES_ITS_
// StandaloneDebugger* mDebugger;
// #endif
gpu::DeviceStoreVertexerHIP mStoreVertexerGPU;
gpu::UniquePointer<gpu::DeviceStoreVertexerHIP> mStoreVertexerGPUPtr;
};
GPUdi() const int2 VertexerTraitsHIP::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};
}
GPUhdi() gpu::DeviceStoreVertexerHIP& VertexerTraitsHIP::getDeviceContext()
{
return *mStoreVertexerGPUPtr;
}
GPUhdi() gpu::DeviceStoreVertexerHIP* VertexerTraitsHIP::getDeviceContextPtr()
{
return mStoreVertexerGPUPtr.get();
}
extern "C" VertexerTraits* createVertexerTraitsHIP();
} // namespace its
} // namespace o2
#endif /* O2_ITS_TRACKING_VERTEXERTRAITS_HIP_H_ */