From 254234ee1406e0772d25ccf193ae51ff17602eb8 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Thu, 22 Feb 2024 09:28:49 +0100 Subject: [PATCH 1/2] Add weights vector to EventHeader and constant for storing them --- README.md | 20 ++++++++++---------- edm4hep.yaml | 2 ++ include/edm4hep/Constants.h | 1 + 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index aa86f64c6..52ce10b38 100644 --- a/README.md +++ b/README.md @@ -22,21 +22,21 @@ A generic event data model for future HEP collider experiments. | | | | |-|-|-| -| [EventHeader](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L145) | [MCParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L155) | [SimTrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L224) | -| [CaloHitContribution](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L266) | [SimCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L278) | [RawCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L290) | -| [CalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L299) | [ParticleID](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L311) | [Cluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L324) | -| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L345) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L362) | [RawTimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L383) | -| [Track](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L396) | [Vertex](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L415) | [ReconstructedParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L432) | -| [SimPrimaryIonizationCluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L536) | [TrackerPulse](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L570) | [RecIonizationCluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L583) | -| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L594) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L606) | | +| [EventHeader](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L145) | [MCParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L157) | [SimTrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L226) | +| [CaloHitContribution](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L268) | [SimCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L280) | [RawCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L292) | +| [CalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L301) | [ParticleID](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L313) | [Cluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L326) | +| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L347) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L364) | [RawTimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L385) | +| [Track](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L398) | [Vertex](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L417) | [ReconstructedParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L434) | +| [SimPrimaryIonizationCluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L538) | [TrackerPulse](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L572) | [RecIonizationCluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L585) | +| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L596) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L608) | | **Associations** | | | | |-|-|-| -| [MCRecoParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L462) | [MCRecoCaloAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L471) | [MCRecoTrackerAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L480) | -| [MCRecoTrackerHitPlaneAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L489) | [MCRecoCaloParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L498) | [MCRecoClusterParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L507) | -| [MCRecoTrackParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L516) | [RecoParticleVertexAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L525) | | +| [MCRecoParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L464) | [MCRecoCaloAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L473) | [MCRecoTrackerAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L482) | +| [MCRecoTrackerHitPlaneAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L491) | [MCRecoCaloParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L500) | [MCRecoClusterParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L509) | +| [MCRecoTrackParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L518) | [RecoParticleVertexAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L527) | | 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 0c05dc822..8fb2309e7 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -150,6 +150,8 @@ datatypes: - int32_t runNumber //run number - uint64_t timeStamp //time stamp - float weight // event weight + VectorMembers: + - double weights // event weights in case there are multiple. **NOTE that weights[0] might not be the same as weight!** Event weight names should be stored using the edm4hep::EventWeights name in the file level metadata. edm4hep::MCParticle: diff --git a/include/edm4hep/Constants.h b/include/edm4hep/Constants.h index 48b09d6dc..81dde40ea 100644 --- a/include/edm4hep/Constants.h +++ b/include/edm4hep/Constants.h @@ -22,6 +22,7 @@ namespace edm4hep { static constexpr const char* CellIDEncoding = "CellIDEncoding"; static constexpr const char* EventHeaderName = "EventHeader"; +static constexpr const char* EventWeights = "EventWeightNames"; } // namespace edm4hep #endif // EDM4HEP_CONSTANTS_H From 0c44261dc426573de1e11334cd62c222a3435fe7 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Tue, 13 Feb 2024 10:39:33 +0100 Subject: [PATCH 2/2] Make existing weight a double as well --- edm4hep.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edm4hep.yaml b/edm4hep.yaml index 8fb2309e7..ea2042af1 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -149,7 +149,7 @@ datatypes: - int32_t eventNumber //event number - int32_t runNumber //run number - uint64_t timeStamp //time stamp - - float weight // event weight + - double weight // event weight VectorMembers: - double weights // event weights in case there are multiple. **NOTE that weights[0] might not be the same as weight!** Event weight names should be stored using the edm4hep::EventWeights name in the file level metadata.