-
Notifications
You must be signed in to change notification settings - Fork 490
Expand file tree
/
Copy pathGPUO2InterfaceUtils.h
More file actions
81 lines (72 loc) · 3.33 KB
/
GPUO2InterfaceUtils.h
File metadata and controls
81 lines (72 loc) · 3.33 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
70
71
72
73
74
75
76
77
78
79
80
81
// 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 GPUO2Interface.h
/// \author David Rohr
#ifndef GPUO2INTERFACEUTILS_H
#define GPUO2INTERFACEUTILS_H
#include <functional>
#include <memory>
namespace o2
{
struct InteractionRecord;
namespace raw
{
class RawFileWriter;
} // namespace raw
namespace tpc
{
class CalibdEdxContainer;
class Digit;
template <class T>
class CalDet;
} // namespace tpc
} // namespace o2
namespace o2::gpu
{
struct GPUParam;
struct GPUO2InterfaceConfiguration;
struct GPUSettingsO2;
struct TPCPadGainCalib;
class GPUO2InterfaceUtils
{
public:
static std::unique_ptr<TPCPadGainCalib> getPadGainCalibDefault();
static std::unique_ptr<TPCPadGainCalib> getPadGainCalib(const o2::tpc::CalDet<float>& in);
static std::unique_ptr<o2::tpc::CalibdEdxContainer> getCalibdEdxContainerDefault();
template <class S>
static void RunZSEncoder(const S& in, std::unique_ptr<uint64_t[]>* outBuffer, uint32_t* outSizes, o2::raw::RawFileWriter* raw, const o2::InteractionRecord* ir, int32_t version, bool verify, float threshold = 0.f, bool padding = false, std::function<void(std::vector<o2::tpc::Digit>&)> digitsFilter = nullptr);
template <class S>
static void RunZSEncoder(const S& in, std::unique_ptr<uint64_t[]>* outBuffer, uint32_t* outSizes, o2::raw::RawFileWriter* raw, const o2::InteractionRecord* ir, GPUO2InterfaceConfiguration& config, int32_t version, bool verify, bool padding = false, std::function<void(std::vector<o2::tpc::Digit>&)> digitsFilter = nullptr);
template <class T>
static float getNominalGPUBzOld(T& src)
{
return (5.00668f / 30000.f) * src.getL3Current();
}
template <class T>
static float getNominalGPUBz(T& src)
{
return getNominalGPUBzFromCurrent(src.getL3Current());
}
static float getNominalGPUBzFromCurrent(float l3curr);
static std::unique_ptr<GPUParam> getFullParam(float solenoidBz, uint32_t nHbfPerTf = 0, std::unique_ptr<GPUO2InterfaceConfiguration>* pConfiguration = nullptr, std::unique_ptr<GPUSettingsO2>* pO2Settings = nullptr, bool* autoMaxTimeBin = nullptr);
static std::shared_ptr<GPUParam> getFullParamShared(float solenoidBz, uint32_t nHbfPerTf = 0, std::unique_ptr<GPUO2InterfaceConfiguration>* pConfiguration = nullptr, std::unique_ptr<GPUSettingsO2>* pO2Settings = nullptr, bool* autoMaxTimeBin = nullptr); // Return owning pointer
static void paramUseExternalOccupancyMap(GPUParam* param, uint32_t nHbfPerTf, const uint32_t* occupancymap, int32_t occupancyMapSize);
static uint32_t getTpcMaxTimeBinFromNHbf(uint32_t nHbf);
class GPUReconstructionZSDecoder
{
public:
void DecodePage(std::vector<o2::tpc::Digit>& outputBuffer, const void* page, uint32_t tfFirstOrbit, const GPUParam* param, uint32_t triggerBC = 0);
private:
std::vector<std::function<void(std::vector<o2::tpc::Digit>&, const void*, uint32_t, uint32_t)>> mDecoders;
};
};
} // namespace o2::gpu
#endif