From 2948a80d9f6dec8db0c56fab541222b250c130fc Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 3 Dec 2024 20:10:59 -0500 Subject: [PATCH 1/4] Add edm4hep::Tensor type for use in ML training/inference --- edm4hep.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/edm4hep.yaml b/edm4hep.yaml index 5fff0bc6..057ddd07 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -821,6 +821,16 @@ datatypes: - float amplitude // calibrated detector data + edm4hep::Tensor: + Description: "Tensor type for use in training/inference for ML models" + Author: "EDM4hep authors" + Members: + - int32_t elementType // Data type in the same encoding as "ONNXTensorElementDataType", 1 - float, 7 - int64 + VectorMembers: + - int64_t shape // Vector of tensor lengths along its axes + - float floatData // Iff elementType==1, values are stored here + - int64_t int64Data // Iff elementType==7, values are stored here + edm4hep::RecDqdx: Description: "dN/dx or dE/dx info of a Track" From b592d24b208016674f1bae77723b38d5712a7fa4 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 3 Dec 2024 20:29:25 -0500 Subject: [PATCH 2/4] README.md: run ./scripts/updateReadmeLinks.py --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 812b1ef2..d542087f 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ A generic event data model for future HEP collider experiments. | [CalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L394) | [ParticleID](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L405) | [Cluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L419) | | [TrackerHit3D](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L451) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L477) | [RawTimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L507) | | [Track](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L521) | [Vertex](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L538) | [ReconstructedParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L584) | -| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L813) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L825) | | +| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L813) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L835) | | **Links** @@ -41,14 +41,14 @@ A generic event data model for future HEP collider experiments. | | | | |-|-|-| -| [GeneratorEventParameters](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L837) | | | -| [GeneratorPdfInfo](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L853) | | | +| [GeneratorEventParameters](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L847) | | | +| [GeneratorPdfInfo](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L863) | | | **Interfaces** | | | | |-|-|-| -| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L864) | | | +| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L874) | | | The tests and examples in the `tests` directory show how to read, write, and use these types in your code. From cd2101ac44eb8873c4a9ca164b7988db0ad27de1 Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 3 Dec 2024 20:48:11 -0500 Subject: [PATCH 3/4] update edm4hep2json.hxx --- tools/include/edm4hep2json.hxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/include/edm4hep2json.hxx b/tools/include/edm4hep2json.hxx index 799e839f..f49f385e 100644 --- a/tools/include/edm4hep2json.hxx +++ b/tools/include/edm4hep2json.hxx @@ -12,6 +12,7 @@ #include "edm4hep/ParticleIDCollection.h" #include "edm4hep/RawCalorimeterHitCollection.h" #include "edm4hep/RawTimeSeriesCollection.h" +#include "edm4hep/TensorCollection.h" #include "edm4hep/RecDqdxCollection.h" #include "edm4hep/ReconstructedParticleCollection.h" #include "edm4hep/SimCalorimeterHitCollection.h" @@ -102,6 +103,8 @@ nlohmann::json processEvent(const podio::Frame& frame, std::vector& insertIntoJson(jsonDict, coll, collList[i]); } else if (coll->getTypeName() == "edm4hep::TimeSeriesCollection") { insertIntoJson(jsonDict, coll, collList[i]); + } else if (coll->getTypeName() == "edm4hep::Tensor") { + insertIntoJson(jsonDict, coll, collList[i]); } else if (coll->getTypeName() == "edm4hep::RecDqdxCollection") { insertIntoJson(jsonDict, coll, collList[i]); } From ddc91df322776928fdc6db1f7bfb3430b970f31d Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Tue, 3 Dec 2024 20:56:43 -0500 Subject: [PATCH 4/4] edm4hep2json.hxx: reorder headers --- tools/include/edm4hep2json.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/include/edm4hep2json.hxx b/tools/include/edm4hep2json.hxx index f49f385e..33be0dca 100644 --- a/tools/include/edm4hep2json.hxx +++ b/tools/include/edm4hep2json.hxx @@ -12,11 +12,11 @@ #include "edm4hep/ParticleIDCollection.h" #include "edm4hep/RawCalorimeterHitCollection.h" #include "edm4hep/RawTimeSeriesCollection.h" -#include "edm4hep/TensorCollection.h" #include "edm4hep/RecDqdxCollection.h" #include "edm4hep/ReconstructedParticleCollection.h" #include "edm4hep/SimCalorimeterHitCollection.h" #include "edm4hep/SimTrackerHitCollection.h" +#include "edm4hep/TensorCollection.h" #include "edm4hep/TimeSeriesCollection.h" #include "edm4hep/TrackCollection.h" #include "edm4hep/TrackerHit3DCollection.h"