diff --git a/README.md b/README.md index 812b1ef2b..d542087fc 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. diff --git a/edm4hep.yaml b/edm4hep.yaml index 5fff0bc63..057ddd071 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" diff --git a/tools/include/edm4hep2json.hxx b/tools/include/edm4hep2json.hxx index 799e839fc..33be0dca8 100644 --- a/tools/include/edm4hep2json.hxx +++ b/tools/include/edm4hep2json.hxx @@ -16,6 +16,7 @@ #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" @@ -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]); }