From 95a8df152545b4aebd059881dea1be082322d3e8 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 27 Jun 2024 10:51:57 +0200 Subject: [PATCH 1/4] Remove datatypes related to drift chamber studies --- edm4hep.yaml | 93 +--------------------------------------------------- 1 file changed, 1 insertion(+), 92 deletions(-) diff --git a/edm4hep.yaml b/edm4hep.yaml index 78099dd6c..add62ff0d 100644 --- a/edm4hep.yaml +++ b/edm4hep.yaml @@ -227,22 +227,6 @@ components: - float value // value of the quantity - float error // error on the value of the quantity - - # Hypothesis for 5 particle types - edm4hep::Hypothesis: - Members: - - float chi2 // chi2 - - float expected // expected value - - float sigma // sigma value - - # Reconstructed hit information - edm4hep::HitLevelData: - Members: - - uint64_t cellID // cell id - - uint32_t N // number of reconstructed ionization cluster - - float eDep [GeV] // reconstructed energy deposit - - float pathLength [mm] // track path length - datatypes: @@ -528,6 +512,7 @@ datatypes: VectorMembers: - int32_t adcCounts // raw data (32-bit) word at i + #-------- Track edm4hep::Track: Description: "Reconstructed track" @@ -686,77 +671,6 @@ datatypes: - edm4hep::ReconstructedParticle rec // reference to the reconstructed particle - edm4hep::Vertex vertex // reference to the vertex - - #----------- SimPrimaryIonizationCluster - edm4hep::SimPrimaryIonizationCluster: - Description: "Simulated Primary Ionization" - Author: "EDM4hep authors" - Members: - - uint64_t cellID // cell id - - float time [ns] // the primary ionization's time in the lab frame - - edm4hep::Vector3d position [mm] // the primary ionization's position - - int16_t type // type - VectorMembers: - - uint64_t electronCellID // cell id - - float electronTime [ns] // the time in the lab frame - - edm4hep::Vector3d electronPosition [mm] // the position in the lab frame - - float pulseTime [ns] // the pulse's time in the lab frame - - float pulseAmplitude [fC] // the pulse's amplitude - OneToOneRelations: - - edm4hep::MCParticle particle // the particle that caused the ionizing collisions - MutableExtraCode: - includes: " - #include \n - #include \n - " - declaration: " - [[deprecated(\"use setParticle instead\")]]\n - void setMCParticle(edm4hep::MCParticle particle) { setParticle(std::move(particle)); }\n - " - - ExtraCode: - includes: "#include \n" - declaration: " - [[deprecated(\"use getParticle instead\")]] - edm4hep::MCParticle getMCParticle() const { return getParticle(); }\n - " - - #---------- TrackerPulse - edm4hep::TrackerPulse: - Description: "Reconstructed Tracker Pulse" - Author: "EDM4hep authors" - Members: - - uint64_t cellID // cell id - - float time [ns] // time - - float charge [fC] // charge - - int16_t quality // quality - - edm4hep::CovMatrix2f covMatrix // covariance matrix of the charge and time measurements - OneToOneRelations: - - edm4hep::TimeSeries timeSeries // Optionally, the timeSeries that has been used to create the pulse can be stored with the pulse - ExtraCode: - includes: "#include " - declaration: " - /// Get the position covariance matrix value for the two passed dimensions\n - float getCovMatrix(edm4hep::TrackerPulseDims dimI, edm4hep::TrackerPulseDims dimJ) const { return getCovMatrix().getValue(dimI, dimJ); }\n - " - MutableExtraCode: - includes: "#include " - declaration: " - /// Set the position covariance matrix value for the two passed dimensions\n - void setCovMatrix(float value, edm4hep::TrackerPulseDims dimI, edm4hep::TrackerPulseDims dimJ) { getCovMatrix().setValue(value, dimI, dimJ); }\n - " - - #---------- RecIonizationCluster - edm4hep::RecIonizationCluster: - Description: "Reconstructed Ionization Cluster" - Author: "EDM4hep authors" - Members: - - uint64_t cellID // cell id - - float significance // significance - - int16_t type // type - OneToManyRelations: - - edm4hep::TrackerPulse trackerPulse // the TrackerPulse used to create the ionization cluster - #---------- TimeSeries edm4hep::TimeSeries: Description: "Calibrated Detector Data" @@ -775,11 +689,6 @@ datatypes: Author: "EDM4hep authors" Members: - edm4hep::Quantity dQdx // the reconstructed dEdx or dNdx and its error - - int16_t particleType // particle type, e(0),mu(1),pi(2),K(3),p(4) - - int16_t type // type - - std::array hypotheses // 5 particle hypothesis - VectorMembers: - - edm4hep::HitLevelData hitData // hit level data OneToOneRelations: - edm4hep::Track track // the corresponding track From dddb0dd25c013a5ba643ff5d879e010ee132e806 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 27 Jun 2024 11:22:36 +0200 Subject: [PATCH 2/4] Remove dumping of removed datatypes --- tools/include/edm4hep2json.hxx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tools/include/edm4hep2json.hxx b/tools/include/edm4hep2json.hxx index 2ff0faba0..0878ca180 100644 --- a/tools/include/edm4hep2json.hxx +++ b/tools/include/edm4hep2json.hxx @@ -13,16 +13,13 @@ #include "edm4hep/RawCalorimeterHitCollection.h" #include "edm4hep/RawTimeSeriesCollection.h" #include "edm4hep/RecDqdxCollection.h" -#include "edm4hep/RecIonizationClusterCollection.h" #include "edm4hep/ReconstructedParticleCollection.h" #include "edm4hep/SimCalorimeterHitCollection.h" -#include "edm4hep/SimPrimaryIonizationClusterCollection.h" #include "edm4hep/SimTrackerHitCollection.h" #include "edm4hep/TimeSeriesCollection.h" #include "edm4hep/TrackCollection.h" #include "edm4hep/TrackerHit3DCollection.h" #include "edm4hep/TrackerHitPlaneCollection.h" -#include "edm4hep/TrackerPulseCollection.h" #include "edm4hep/VertexCollection.h" #include "edm4hep/MCRecoCaloAssociationCollection.h" @@ -106,12 +103,6 @@ nlohmann::json processEvent(const podio::Frame& frame, std::vector& insertIntoJson(jsonDict, coll, collList[i]); } else if (coll->getTypeName() == "edm4hep::ReconstructedParticleCollection") { insertIntoJson(jsonDict, coll, collList[i]); - } else if (coll->getTypeName() == "edm4hep::SimPrimaryIonizationClusterCollection") { - insertIntoJson(jsonDict, coll, collList[i]); - } else if (coll->getTypeName() == "edm4hep::TrackerPulseCollection") { - insertIntoJson(jsonDict, coll, collList[i]); - } else if (coll->getTypeName() == "edm4hep::RecIonizationClusterCollection") { - insertIntoJson(jsonDict, coll, collList[i]); } else if (coll->getTypeName() == "edm4hep::TimeSeriesCollection") { insertIntoJson(jsonDict, coll, collList[i]); } else if (coll->getTypeName() == "edm4hep::RecDqdxCollection") { From 24598a5557233ad0cc86309f033fd74caf88f4ac Mon Sep 17 00:00:00 2001 From: tmadlener Date: Thu, 27 Jun 2024 11:31:58 +0200 Subject: [PATCH 3/4] Update README links --- README.md | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4cbcb84ce..c9070cc66 100644 --- a/README.md +++ b/README.md @@ -14,43 +14,41 @@ A generic event data model for future HEP collider experiments. |-|-|-| | [Vector4f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L9) | [Vector3f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L34) | [Vector3d](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L56) | | [Vector2i](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L84) | [Vector2f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L104) | [TrackState](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L195) | -| [Quantity](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L224) | [Hypothesis](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L232) | [HitLevelData](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L239) | -| [CovMatrix2f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L123) |[CovMatrix3f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L141) |[CovMatrix4f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L158) | -| [CovMatrix6f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L176) | | | +| [Quantity](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L224) | [CovMatrix2f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L123) | [CovMatrix3f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L141) | +| [CovMatrix4f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L158) | [CovMatrix6f](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L176) | | **Datatypes** | | | | |-|-|-| -| [EventHeader](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L249) | [MCParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L261) | [SimTrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L329) | -| [CaloHitContribution](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L371) | [SimCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L383) | [RawCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L395) | -| [CalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L404) | [ParticleID](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L416) | [Cluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L431) | -| [TrackerHit3D](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L463) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L489) | [RawTimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L519) | -| [Track](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L532) | [Vertex](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L551) | [ReconstructedParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L579) | -| [SimPrimaryIonizationCluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L691) | [TrackerPulse](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L725) | [RecIonizationCluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L750) | -| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L761) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L773) | | +| [EventHeader](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L233) | [MCParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L245) | [SimTrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L313) | +| [CaloHitContribution](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L355) | [SimCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L367) | [RawCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L379) | +| [CalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L388) | [ParticleID](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L400) | [Cluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L415) | +| [TrackerHit3D](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L447) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L473) | [RawTimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L503) | +| [Track](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L517) | [Vertex](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L536) | [ReconstructedParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L564) | +| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L675) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L687) | | **Associations** | | | | |-|-|-| -| [MCRecoParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L617) | [MCRecoCaloAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L626) | [MCRecoTrackerAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L635) | -| [MCRecoTrackerHitPlaneAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L644) | [MCRecoCaloParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L653) | [MCRecoClusterParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L662) | -| [MCRecoTrackParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L671) | [RecoParticleVertexAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L680) | | +| [MCRecoParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L602) | [MCRecoCaloAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L611) | [MCRecoTrackerAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L620) | +| [MCRecoTrackerHitPlaneAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L629) | [MCRecoCaloParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L638) | [MCRecoClusterParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L647) | +| [MCRecoTrackParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L656) | [RecoParticleVertexAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L665) | | **Generator related (meta-)data** | | | | |-|-|-| -| [GeneratorEventParameters](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L790) | | | -| [GeneratorPdfInfo](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L807) | | | +| [GeneratorEventParameters](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L699) | | | +| [GeneratorPdfInfo](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L716) | | | **Interfaces** | | | | |-|-|-| -| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L818) | | | +| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L727) | | | The tests and examples in the `tests` directory show how to read, write, and use these types in your code. From c666a49f36982c537391e8ceb025728e5bc6ce36 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Fri, 28 Jun 2024 11:26:53 +0200 Subject: [PATCH 4/4] Fix minor issue in json conversion checker --- test/tools/test_all_collections.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/tools/test_all_collections.py b/test/tools/test_all_collections.py index 58ff2fc0e..1fbdd3e6d 100644 --- a/test/tools/test_all_collections.py +++ b/test/tools/test_all_collections.py @@ -21,8 +21,7 @@ def test(yamlfile_path, cxxfile_path): datatypes_found = [] with open(cxxfile_path, mode='r', encoding="utf-8") as cxxfile: - for cxxline in cxxfile: - cxxline = cxxfile.readline() + for cxxline in cxxfile.readlines(): result = re.search('insertIntoJson', cxxline) if result: