3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthOnnxComps.OnnxRuntimeInferenceConfig
import OnnxRuntimeInferenceToolCfg
6 from PathResolver
import PathResolver
12 name="CaloClusterMLCalibToolLite",
13 config_file="CaloClusterCorrection/config_hgm_mc20.yaml",
16 config = yaml.safe_load(f)
18 onnx_model_path = config[
"model"][
"onnx_path"]
19 features = config[
"data"][
"features"]
20 sorted_features =
sorted(features.items(), key=
lambda item: item[1][
"position"])
22 item[1][
"preprocessing"][
"processors"][0]
for item
in sorted_features
25 [
float(x)
for x
in item[1][
"preprocessing"][
"parameters"]]
26 for item
in sorted_features
31 CaloClusterMLCalibToolLite = CompFactory.CaloClusterMLCalibToolLite(name)
32 CaloClusterMLCalibToolLite.ORTInferenceTool = onnx_tool
33 CaloClusterMLCalibToolLite.PreprocessingTransformNames = transform_names
34 CaloClusterMLCalibToolLite.PreprocessingTransformParams = transform_params
35 ca.setPrivateTools(CaloClusterMLCalibToolLite)