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

Use interface types for TrackerHit #252

Merged
merged 5 commits into from
Feb 23, 2024
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
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ A generic event data model for future HEP collider experiments.

**Datatypes**

| | | |
|-|-|-|
| [EventHeader](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L136) | [MCParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L148) | [SimTrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L216) |
| [CaloHitContribution](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L258) | [SimCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L270) | [RawCalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L282) |
| [CalorimeterHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L291) | [ParticleID](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L303) | [Cluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L316) |
| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L337) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L352) | [RawTimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L371) |
| [TrackerHit3D](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L337) | [TrackerHitPlane](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L352) | [RawTimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L371) |
| [Track](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L384) | [Vertex](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L403) | [ReconstructedParticle](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L420) |
| [SimPrimaryIonizationCluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L528) | [TrackerPulse](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L562) | [RecIonizationCluster](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L575) |
| [TimeSeries](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L586) | [RecDqdx](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L598) | |
Expand All @@ -37,6 +35,13 @@ A generic event data model for future HEP collider experiments.
| [MCRecoTrackerHitPlaneAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L481) | [MCRecoCaloParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L490) | [MCRecoClusterParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L499) |
| [MCRecoTrackParticleAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L508) | [RecoParticleVertexAssociation](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L517) | |

**Interfaces**

| | | |
|-|-|-|
| [TrackerHit](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#625) | | |


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


Expand Down
18 changes: 17 additions & 1 deletion edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ datatypes:
- edm4hep::ParticleID particleIDs // particle IDs (sorted by their likelihood)

#------------- TrackerHit
edm4hep::TrackerHit:
edm4hep::TrackerHit3D:
Description: "Tracker hit"
Author: "EDM4hep authors"
Members:
Expand Down Expand Up @@ -607,3 +607,19 @@ datatypes:
- edm4hep::HitLevelData hitData // hit level data
OneToOneRelations:
- edm4hep::Track track // the corresponding track

interfaces:
edm4hep::TrackerHit:
Description: "Tracker hit interface class"
Author: "Thomas Madlener, DESY"
Members:
- uint64_t cellID // ID of the sensor that created this hit
- int32_t type // type of the raw data hit
- int32_t quality // quality bit flag of the hit
- float time [ns] // time of the hit
- float eDep [GeV] // energy deposited on the hit
- float eDepError [GeV] // error measured on eDep
- edm4hep::Vector3d position [mm] // hit position
Types:
- edm4hep::TrackerHit3D
- edm4hep::TrackerHitPlane
6 changes: 3 additions & 3 deletions tools/include/edm4hep2json.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "edm4hep/SimTrackerHitCollection.h"
#include "edm4hep/TimeSeriesCollection.h"
#include "edm4hep/TrackCollection.h"
#include "edm4hep/TrackerHitCollection.h"
#include "edm4hep/TrackerHit3DCollection.h"
#include "edm4hep/TrackerHitPlaneCollection.h"
#include "edm4hep/TrackerPulseCollection.h"
#include "edm4hep/VertexCollection.h"
Expand Down Expand Up @@ -92,8 +92,8 @@ nlohmann::json processEvent(const podio::Frame& frame, std::vector<std::string>&
insertIntoJson<edm4hep::ParticleIDCollection>(jsonDict, coll, collList[i]);
} else if (coll->getTypeName() == "edm4hep::ClusterCollection") {
insertIntoJson<edm4hep::ClusterCollection>(jsonDict, coll, collList[i]);
} else if (coll->getTypeName() == "edm4hep::TrackerHitCollection") {
insertIntoJson<edm4hep::TrackerHitCollection>(jsonDict, coll, collList[i]);
} else if (coll->getTypeName() == "edm4hep::TrackerHit3DCollection") {
insertIntoJson<edm4hep::TrackerHit3DCollection>(jsonDict, coll, collList[i]);
} else if (coll->getTypeName() == "edm4hep::TrackerHitPlaneCollection") {
insertIntoJson<edm4hep::TrackerHitPlaneCollection>(jsonDict, coll, collList[i]);
} else if (coll->getTypeName() == "edm4hep::RawTimeSeriesCollection") {
Expand Down
4 changes: 2 additions & 2 deletions utils/src/dataframe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "edm4hep/ReconstructedParticleData.h"
#include "edm4hep/SimCalorimeterHitData.h"
#include "edm4hep/SimTrackerHitData.h"
#include "edm4hep/TrackerHitData.h"
#include "edm4hep/TrackerHit3DData.h"
#include "edm4hep/TrackerHitPlaneData.h"
#include "edm4hep/VertexData.h"

Expand Down Expand Up @@ -77,7 +77,7 @@ INST_MOMENTUM_FUNCS(edm4hep::ReconstructedParticleData);
INST_MOMENTUM_FUNCS(edm4hep::SimTrackerHitData);

INST_POSITION_FUNCS(edm4hep::SimTrackerHitData);
INST_POSITION_FUNCS(edm4hep::TrackerHitData);
INST_POSITION_FUNCS(edm4hep::TrackerHit3DData);
INST_POSITION_FUNCS(edm4hep::TrackerHitPlaneData);
INST_POSITION_FUNCS(edm4hep::SimCalorimeterHitData);
INST_POSITION_FUNCS(edm4hep::CalorimeterHitData);
Expand Down
Loading