Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend for drift chamber and TPC #179

Merged
merged 16 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,28 @@ A generic event data model for future HEP collider experiments.
|-|-|-|
| [Vector3f ](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L9) | [Vector3d ](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L24) | [Vector2i](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L40) |
| [Vector2f](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L54) | [TrackState ](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L68) | [ObjectID](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L91) |
| [Quantity](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L103) | [Hypothesis ](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L111) | [HitLevelData](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L118) |


**Datatypes**

| | | |
|-|-|-|
| [EventHeader](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L113) | [MCParticle](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L123) | [SimTrackerHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L191) |
| [CaloHitContribution](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L225) | [SimCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L237) | [RawCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L249) |
| [CalorimeterHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L258) | [ParticleID](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L270) | [Cluster](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L283) |
| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L304) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L321) | [TPCHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L342) |
| [Track](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L354) | [Vertex](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L373) | [ReconstructedParticle](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L390) |
| [EventHeader](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L129) | [MCParticle](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L139) | [SimTrackerHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L207) |
| [CaloHitContribution](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L241) | [SimCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L254) | [RawCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L266) |
| [CalorimeterHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L274) | [ParticleID](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L286) | [Cluster](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L299) |
| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L320) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L337) | [RawTimeSeries](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L358) |
| [Track](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L371) | [Vertex](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L390) | [ReconstructedParticle](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L407) |
| [SimPrimaryIonizationCluster](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L511) | [TrackerPulse](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L529) | [RecIonizationCluster](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L542) |
| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L553) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L565) | |

**Associations**

| | | |
|-|-|-|
| [MCRecoParticleAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L421) | [MCRecoCaloAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L430) | [MCRecoTrackerAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L439) |
| [MCRecoTrackerHitPlaneAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L448) | [MCRecoCaloParticleAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L457) | [MCRecoClusterParticleAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L466) |
| [MCRecoTrackParticleAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L475) | [RecoParticleVertexAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L484) | |
| [MCRecoParticleAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L438) | [MCRecoCaloAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L447) | [MCRecoTrackerAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L456) |
| [MCRecoTrackerHitPlaneAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L465) | [MCRecoCaloParticleAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L474) | [MCRecoClusterParticleAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L483) |
| [MCRecoTrackParticleAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L492) | [RecoParticleVertexAssociation](https://github.com/key4hep/EDM4hep/blob/master/edm4hep.yaml#L501) | |

The tests and examples in the `tests` directory show how to read, write, and use these types in your code.

Expand Down
98 changes: 92 additions & 6 deletions edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,22 @@ 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 // reconstructed energy deposit [GeV].
- float pathLength // track path length [mm].

datatypes :


Expand Down Expand Up @@ -307,7 +323,7 @@ datatypes :
Author : "F.Gaede, DESY"
Members :
- uint64_t cellID //ID of the sensor that created this hit
- int32_t type //type of raw data hit, either one of edm4hep::TPCHIT, edm4hep::SIMTRACKERHIT - see collection parameters "TrackerHitTypeNames" and "TrackerHitTypeValues".
- int32_t type //type of raw data hit, either one of edm4hep::RawTimeSeries, edm4hep::SIMTRACKERHIT - see collection parameters "TrackerHitTypeNames" and "TrackerHitTypeValues".
- int32_t quality //quality bit flag of the hit.
- float time //time of the hit.
- float eDep //energy deposited on the hit [GeV].
Expand All @@ -324,7 +340,7 @@ datatypes :
Author : "Placido Fernandez Declara, CERN"
Members :
- uint64_t cellID //ID of the sensor that created this hit
- int32_t type //type of raw data hit, either one of edm4hep::TPCHIT, edm4hep::SIMTRACKERHIT - see collection parameters "TrackerHitTypeNames" and "TrackerHitTypeValues".
- int32_t type //type of raw data hit, either one of edm4hep::RawTimeSeries, edm4hep::SIMTRACKERHIT - see collection parameters "TrackerHitTypeNames" and "TrackerHitTypeValues".
- int32_t quality //quality bit flag of the hit.
- float time //time of the hit.
- float eDep //energy deposited on the hit [GeV].
Expand All @@ -339,17 +355,18 @@ datatypes :
- edm4hep::ObjectID rawHits //raw data hits. Check getType to get actual data type.


#---------- TPCHit
edm4hep::TPCHit:
Description: "Time Projection Chamber Hit"
#---------- RawTimeSeries
edm4hep::RawTimeSeries:
Description: "Raw data of a detector readout"
Author : "F.Gaede, DESY"
Members:
- uint64_t cellID //detector specific cell id.
- int32_t quality //quality flag for the hit.
- float time //time of the hit.
- float charge //integrated charge of the hit.
- float interval //interval of each sampling [ns].
VectorMembers:
- int32_t rawDataWords //raw data (32-bit) word at i.
- int32_t adcCounts //raw data (32-bit) word at i.

#-------- Track
edm4hep::Track:
Expand Down Expand Up @@ -489,3 +506,72 @@ datatypes :
OneToOneRelations:
- edm4hep::ReconstructedParticle rec // reference to the reconstructed particle
- edm4hep::Vertex vertex // reference to the vertex


#----------- SimPrimaryIonizationCluster
edm4hep::SimPrimaryIonizationCluster:
Description: "Simulated Primary Ionization"
Author : "Wenxing Fang, IHEP"
Members:
- uint64_t cellID //cell id.
- float time //the primary ionization's time in the lab frame [ns].
- edm4hep::Vector3d position //the primary ionization's position [mm].
- int16_t type //type.
VectorMembers:
- uint64_t electronCellID //cell id.
- float electronTime //the time in the lab frame [ns].
- edm4hep::Vector3d electronPosition //the position in the lab frame [mm].
- float pulseTime //the pulse's time in the lab frame [ns].
- float pulseAmplitude //the pulse's amplitude [fC].
OneToOneRelations:
- edm4hep::MCParticle MCParticle //the particle that caused the ionizing collisions.

#---------- TrackerPulse
edm4hep::TrackerPulse:
Description: "Reconstructed Tracker Pulse"
Author : "Wenxing Fang, IHEP"
Members:
- uint64_t cellID //cell id.
- float time //time [ns].
- float charge //charge [fC].
- int16_t quality //quality.
- std::array<float,3> covMatrix //lower triangle covariance matrix of the charge(c) and time(t) measurements.
OneToOneRelations:
- edm4hep::TimeSeries timeSeries //Optionally, the timeSeries that has been used to create the pulse can be stored with the pulse.

#---------- RecIonizationCluster
edm4hep::RecIonizationCluster:
Description: "Reconstructed Ionization Cluster"
Author : "Wenxing Fang, IHEP"
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"
Author : "Wenxing Fang, IHEP"
Members:
- uint64_t cellID //cell id.
- float time //begin time [ns].
- float interval //interval of each sampling [ns].
VectorMembers:
- float amplitude //calibrated detector data.


#------------- RecDqdx
edm4hep::RecDqdx:
Description : "dN/dx or dE/dx info of Track."
Author : "Wenxing Fang, IHEP"
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<edm4hep::Hypothesis, 5> hypotheses //5 particle hypothesis
VectorMembers:
- edm4hep::HitLevelData hitData //hit level data
OneToOneRelations:
- edm4hep::Track track //the corresponding track.
4 changes: 2 additions & 2 deletions test/read_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// test data model
#include "edm4hep/CaloHitContributionCollection.h"
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/RawTimeSeriesCollection.h"
#include "edm4hep/SimCalorimeterHitCollection.h"
#include "edm4hep/SimTrackerHitCollection.h"
#include "edm4hep/TPCHitCollection.h"
#include "edm4hep/TrackerHitPlaneCollection.h"

// podio specific includes
Expand All @@ -23,7 +23,7 @@ void processEvent(const podio::Frame& event, bool verboser, unsigned eventNum) {
auto& sths = event.get<edm4hep::SimTrackerHitCollection>("SimTrackerHits");
auto& schs = event.get<edm4hep::SimCalorimeterHitCollection>("SimCalorimeterHits");
auto& sccons = event.get<edm4hep::CaloHitContributionCollection>("SimCalorimeterHitContributions");
auto& tpchs = event.get<edm4hep::TPCHitCollection>("TPCHits");
auto& tpchs = event.get<edm4hep::RawTimeSeriesCollection>("TPCHits");
auto& thps = event.get<edm4hep::TrackerHitPlaneCollection>("TrackerHitPlanes");

if (mcps.isValid()) {
Expand Down
6 changes: 3 additions & 3 deletions test/write_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
// Data model
#include "edm4hep/CaloHitContributionCollection.h"
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/RawTimeSeriesCollection.h"
#include "edm4hep/SimCalorimeterHitCollection.h"
#include "edm4hep/SimTrackerHitCollection.h"
#include "edm4hep/TPCHitCollection.h"
#include "edm4hep/TrackerHitPlaneCollection.h"

// STL
Expand Down Expand Up @@ -186,8 +186,8 @@ void write(std::string outfilename) {
event.put(std::move(sccons), "SimCalorimeterHitContributions");

//===============================================================================
// write some TPCHits:
auto tpchs = edm4hep::TPCHitCollection();
// write some RawTimeSeries:
auto tpchs = edm4hep::RawTimeSeriesCollection();
int ntpch = 5;
for (int j = 0; j < ntpch; ++j) {
auto tpch1 = tpchs.create();
Expand Down