22#include <onnxruntime/core/session/onnxruntime_cxx_api.h>
36class CbmRichMCbmDenoiseCnn :
public TObject {
39 CbmRichMCbmDenoiseCnn() =
default;
42 ~CbmRichMCbmDenoiseCnn() =
default;
45 CbmRichMCbmDenoiseCnn(
const CbmRichMCbmDenoiseCnn&) =
delete;
48 CbmRichMCbmDenoiseCnn operator=(
const CbmRichMCbmDenoiseCnn&) =
delete;
58 void Process(
CbmEvent* event,
const TClonesArray* richHits);
67 void ProcessTimeWindow(
const std::vector<int>& timeWindowHitIndices,
const double& seedHitTime,
68 const TClonesArray* richHits);
75 int AddressToGridIndex(
const int address);
82 std::vector<float> Inference(
const std::vector<int>& gridIndices);
88 void SetClassificationThreshold(
float threshold) { fClassificationThreshold = threshold; }
91 const double fTimeWindowLength{25.};
92 const int fMinHitsInTimeWindow{7};
94 float fClassificationThreshold{0.5};
96 const std::string fOnnxFilePath =
97 std::string(gSystem->Getenv(
"VMCWORKDIR")) +
"/parameters/rich/mRich/rich_v21c_mcbm_UNet.onnx";
100 const std::vector<const char*> fInputNames{
"input"};
101 const std::vector<const char*> fOutputNames{
"output"};
103 const std::array<int64_t, 4> fInputShape{1, 1, 72, 32};
104 const std::array<int64_t, 4> fOutputShape{1, 1, 72, 32};
106 std::array<float, 2304> fInput{};
108 std::unique_ptr<Ort::Env> fOrtEnv{
nullptr};
109 std::unique_ptr<Ort::SessionOptions> fOrtSessionOptions{
nullptr};
110 std::unique_ptr<Ort::Session> fOrtSession{
nullptr};
111 std::unique_ptr<Ort::MemoryInfo> fOrtAllocatorInfo{
nullptr};
112 std::unique_ptr<Ort::RunOptions> fOrtRunOptions{
nullptr};
114 std::unique_ptr<Ort::Value> fOrtInput{
nullptr};
118 ClassDef(CbmRichMCbmDenoiseCnn, 1);
Class characterising one event by a collection of links (indices) to data objects,...