Project
Loading...
Searching...
No Matches
GPUO2InterfaceUtils.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef GPUO2INTERFACEUTILS_H
16#define GPUO2INTERFACEUTILS_H
17
18#include <functional>
19#include <memory>
20
21namespace o2
22{
23struct InteractionRecord;
24namespace raw
25{
26class RawFileWriter;
27} // namespace raw
28namespace tpc
29{
30class CalibdEdxContainer;
31class Digit;
32template <class T>
33class CalDet;
34} // namespace tpc
35} // namespace o2
36
37namespace o2::gpu
38{
39struct GPUParam;
40struct GPUO2InterfaceConfiguration;
41struct GPUSettingsO2;
42struct TPCPadGainCalib;
44{
45 public:
46 static std::unique_ptr<TPCPadGainCalib> getPadGainCalibDefault();
47 static std::unique_ptr<TPCPadGainCalib> getPadGainCalib(const o2::tpc::CalDet<float>& in);
48 static std::unique_ptr<o2::tpc::CalibdEdxContainer> getCalibdEdxContainerDefault();
49 template <class S>
50 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);
51 template <class S>
52 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);
53 template <class T>
54 static float getNominalGPUBz(T& src)
55 {
56 return (5.00668f / 30000.f) * src.getL3Current();
57 }
58 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);
59 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
60 static void paramUseExternalOccupancyMap(GPUParam* param, uint32_t nHbfPerTf, const uint32_t* occupancymap, int32_t occupancyMapSize);
61 static uint32_t getTpcMaxTimeBinFromNHbf(uint32_t nHbf);
62
64 {
65 public:
66 void DecodePage(std::vector<o2::tpc::Digit>& outputBuffer, const void* page, uint32_t tfFirstOrbit, const GPUParam* param, uint32_t triggerBC = 0);
67
68 private:
69 std::vector<std::function<void(std::vector<o2::tpc::Digit>&, const void*, uint32_t, uint32_t)>> mDecoders;
70 };
71};
72
73} // namespace o2::gpu
74
75#endif
uint16_t padding
uint32_t version
Definition RawData.h:8
void DecodePage(std::vector< o2::tpc::Digit > &outputBuffer, const void *page, uint32_t tfFirstOrbit, const GPUParam *param, uint32_t triggerBC=0)
static std::unique_ptr< TPCPadGainCalib > getPadGainCalibDefault()
static void paramUseExternalOccupancyMap(GPUParam *param, uint32_t nHbfPerTf, const uint32_t *occupancymap, int32_t occupancyMapSize)
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)
static std::unique_ptr< TPCPadGainCalib > getPadGainCalib(const o2::tpc::CalDet< float > &in)
static uint32_t getTpcMaxTimeBinFromNHbf(uint32_t nHbf)
static float getNominalGPUBz(T &src)
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::unique_ptr< o2::tpc::CalibdEdxContainer > getCalibdEdxContainerDefault()
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)
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)
GLenum src
Definition glcorearb.h:1767
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLenum GLfloat param
Definition glcorearb.h:271
o2::cpv::Digit Digit
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
o2::InteractionRecord ir(0, 0)