1717#ifndef TOOLS_PIDML_PIDONNXMODEL_H_
1818#define TOOLS_PIDML_PIDONNXMODEL_H_
1919
20+ #include " Tools/PIDML/pidUtils.h"
21+ //
22+ #include < CCDB/CcdbApi.h>
2023#include < Framework/ASoA.h>
21- #include < array>
24+ #include < Framework/Logger.h>
25+
26+ #include < onnxruntime_c_api.h>
27+ #include < onnxruntime_cxx_api.h>
28+ #include < rapidjson/document.h>
29+ #include < rapidjson/filereadstream.h>
30+
2231#include < algorithm>
32+ #include < array>
33+ #include < cassert>
2334#include < cstdint>
24- #include < cstring>
2535#include < cstdio>
36+ #include < cstring>
2637#include < limits>
38+ #include < map>
39+ #include < memory>
2740#include < optional>
41+ #include < sstream>
2842#include < string>
29- #include < map>
30- #include < type_traits>
3143#include < utility>
32- #include < memory>
3344#include < vector>
34- #include < onnxruntime_cxx_api.h>
35-
36- #include " rapidjson/document.h"
37- #include " rapidjson/filereadstream.h"
38- #include " CCDB/CcdbApi.h"
39- #include " Tools/PIDML/pidUtils.h"
4045
4146enum PidMLDetector {
4247 kTPCOnly = 0 ,
@@ -57,7 +62,7 @@ constexpr MomentumLimitsMatrix defaultModelPLimits({0.0, 0.5, 0.8});
5762// TODO: Copied from cefpTask, shall we put it in some common utils code?
5863namespace
5964{
60- bool readJsonFile (const std::string& config, rapidjson::Document& d)
65+ bool readJsonFile (std::string const & config, rapidjson::Document& d)
6166{
6267 FILE* fp = fopen (config.data (), " rb" );
6368 if (!fp) {
@@ -77,7 +82,7 @@ bool readJsonFile(const std::string& config, rapidjson::Document& d)
7782template <typename T>
7883struct PidONNXModel {
7984 public:
80- PidONNXModel (std::string& localPath, std::string& ccdbPath, bool useCCDB, o2::ccdb::CcdbApi& ccdbApi, uint64_t timestamp,
85+ PidONNXModel (std::string const & localPath, std::string const & ccdbPath, bool useCCDB, o2::ccdb::CcdbApi const & ccdbApi, uint64_t timestamp,
8186 int pid, double minCertainty, const double * pLimits = &pidml_pt_cuts::defaultModelPLimits[0 ])
8287 : mPid (pid), mMinCertainty (minCertainty), mPLimits (pLimits, pLimits + kNDetectors )
8388 {
@@ -136,8 +141,8 @@ struct PidONNXModel {
136141 return getModelOutput (track) >= mMinCertainty ;
137142 }
138143
139- int mPid ;
140- double mMinCertainty ;
144+ int mPid { 0 } ;
145+ double mMinCertainty { 0 } ;
141146
142147 private:
143148 void getModelPaths (std::string const & path, std::string& modelDir, std::string& modelFile, std::string& modelPath, int pid, std::string const & ext)
@@ -155,7 +160,7 @@ struct PidONNXModel {
155160 modelPath = modelDir + " /" + modelFile;
156161 }
157162
158- void downloadFromCCDB (o2::ccdb::CcdbApi& ccdbApi, std::string const & ccdbFile, uint64_t timestamp, std::string const & localDir, std::string const & localFile)
163+ void downloadFromCCDB (o2::ccdb::CcdbApi const & ccdbApi, std::string const & ccdbFile, uint64_t timestamp, std::string const & localDir, std::string const & localFile)
159164 {
160165 std::map<std::string, std::string> metadata;
161166 bool retrieveSuccess = ccdbApi.retrieveBlob (ccdbFile, localDir, metadata, timestamp, false , localFile);
@@ -167,7 +172,7 @@ struct PidONNXModel {
167172 }
168173 }
169174
170- void loadInputFiles (std::string const & localPath, std::string const & ccdbPath, bool useCCDB, o2::ccdb::CcdbApi& ccdbApi, uint64_t timestamp, int pid, std::string& modelPath)
175+ void loadInputFiles (std::string const & localPath, std::string const & ccdbPath, bool useCCDB, o2::ccdb::CcdbApi const & ccdbApi, uint64_t timestamp, int pid, std::string& modelPath)
171176 {
172177 rapidjson::Document trainColumnsDoc;
173178 rapidjson::Document scalingParamsDoc;
0 commit comments