Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
NeuralCalibrator.hpp
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file NeuralCalibrator.hpp
1
// This file is part of the Acts project.
2
//
3
// Copyright (C) 2023 CERN for the benefit of the Acts project
4
//
5
// This Source Code Form is subject to the terms of the Mozilla Public
6
// License, v. 2.0. If a copy of the MPL was not distributed with this
7
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
9
#pragma once
10
11
#include "
Acts/EventData/SourceLink.hpp
"
12
#include "
Acts/Utilities/CalibrationContext.hpp
"
13
#include <
Acts/Plugins/Onnx/OnnxRuntimeBase.hpp
>
14
#include <
ActsExamples/EventData/MeasurementCalibration.hpp
>
15
16
#include <filesystem>
17
18
namespace
ActsExamples {
19
20
class
NeuralCalibrator
:
public
MeasurementCalibrator
{
21
public
:
48
NeuralCalibrator
(
const
std::filesystem::path
& modelPath,
49
size_t
nComponents = 1,
50
std::vector<size_t> volumeIds = {7, 8, 9});
51
53
void
calibrate
(
54
const
MeasurementContainer
& measurements,
55
const
ClusterContainer
*
clusters
,
const
Acts::GeometryContext
&
gctx
,
56
const
Acts::CalibrationContext
& cctx,
const
Acts::SourceLink
& sourceLink,
57
Acts::MultiTrajectory<Acts::VectorMultiTrajectory>::TrackStateProxy
&
58
trackState)
const override
;
59
60
bool
needsClusters
()
const override
{
return
true
; }
61
62
private
:
63
Ort::Env
m_env
;
64
Acts::OnnxRuntimeBase
m_model
;
65
size_t
m_nComponents
;
66
size_t
m_nInputs
=
67
57;
// TODO make this configurable? e.g. for changing matrix size?
68
69
// TODO: this should probably be handled outside of the calibrator,
70
// by setting up a GeometryHierarchyMap<MeasurementCalibrator>
71
std::vector<size_t>
m_volumeIds
;
72
PassThroughCalibrator
m_fallback
;
73
};
74
75
}
// namespace ActsExamples
acts
blob
sPHENIX
Examples
Framework
ML
include
ActsExamples
EventData
NeuralCalibrator.hpp
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:38
using
1.8.2 with
sPHENIX GitHub integration