diff --git a/doc/VertexRecoParticleRecos.md b/doc/VertexRecoParticleRecos.md
index 3c44c0f7c..cd586b76c 100644
--- a/doc/VertexRecoParticleRecos.md
+++ b/doc/VertexRecoParticleRecos.md
@@ -27,6 +27,9 @@ should follow these main guidelines
- in order to allow navigation from a decay particle to the vertex it originated
from a `RecoParticleVertexAssociation` should be created. If no such
navigation is necessary, creating these associations can also be omitted.
+- in order to allow for an easy navigation from the `Vertex` to the high level
+ `ReconstructedParticle` a `RecoParticleVertexAssociation` should be created if
+ necessary.
## Using `Vertex` and (high level) `ReconstructeParticle` objects
@@ -75,7 +78,7 @@ following outputs
All of the steps will use function stubs whereever necessary and will mainly
focus on setting the relations / associations.
-### 1. Creating vertices
+### Creating vertices
The main point here is to attach the decay particles to the `particles` field of
each `Vertex`. In this example we will assume that that is not already done by
@@ -101,7 +104,7 @@ edm4hep::VertexCollection createVertices(const edm4hep::ReconstructedParticleCol
}
```
-### 2. Creating high level reconstruction particles
+### Creating high level reconstruction particles
This is the most simplest implementation possible. It simply sums up all four
vectors of the decay particles and sets that into the newly created particles.
@@ -127,13 +130,33 @@ edm4hep::ReconstructedParticleCollection createVertexRecos(const edm4hep::Vertex
}
```
-### 3. Creating start vertex associations
+#### Creating associations from `Vertex` to high level `ReconstructedParticle`
+
+This is a potentially optional step that makes it possible to more easily access
+the `ReconstructedParticle` that decayed at a `Vertex`
+
+```cpp
+edm4hep::RecoParticleVertexAssociationCollection
+createVtxParticleAssociations(const edm4hep::ReconstructedParticleCollection& particles) {
+ auto vtxPartAssocs = edm4hep::RecoParticleVertexAssociationCollection{};
+ for (const auto p : particles) {
+ auto assoc = vtxPartAssocs.create();
+ assoc.setRec(p);
+ assoc.setVertex(p.getDecayVertex());
+ }
+
+ return vtxPartAssocs;
+}
+```
+
+### Creating start vertex associations
This is a potentially optional step, depending on whether it is necessary to
allow for easier navigation from the particles back to their start vertices.
```cpp
-edm4hep::RecoParticleVertexAssociationCollection(const edm4hep::VertexCollection& vertices) {
+edm4hep::RecoParticleVertexAssociationCollection
+createStartVtxAssociations(const edm4hep::VertexCollection& vertices) {
auto startVtxAssocs = edm4hep::RecoParticleVertexAssociationCollection{};
for (const auto vtx : vertices) {
for (const auto particle : vtx.getParticles()) {
@@ -146,7 +169,6 @@ edm4hep::RecoParticleVertexAssociationCollection(const edm4hep::VertexCollection
}
```
-
## EDM4hep vs LCIO
### The concept in LCIO
@@ -171,8 +193,83 @@ information in the EDM4hep mutability model without either
reconstruction in one step
- or cloning collections of objects several times in order to be able to fill
all the information consistently
+
+In many cases the `Vertex` and `ReconstructedParticle` collection containing the
+high level particle are created in one step in LCIO to circumvent parts of these
+limitations.
### In LCIO I do this, how do I do it in EDM4hep?
-- [ ] TODO
+#### Get the decay products from a `Vertex`
+
+This case is rather similar between the two datamodels. There is effectively
+just one additional step involved for LCIO.
+
+
+
+LCIO | EDM4hep |
+
+
+
+
+```cpp
+const auto& dps = vtx->getAssociatedParticle()->getParticles();
+```
+
+`dps` will be a `std::vector`.
+
+ |
+
+
+```cpp
+const auto dps = vtx.getParticles();
+```
+
+`dps` will be a `podio::RelationRange`.
+
+ |
+
+
+
+#### Get the particle associated to a `Vertex`
+
+In this case there is a conceptual difference that requires to switch approaches
+a bit. The example below assumes that you are looping over all vertices to
+figure out the associated `ReconstructedParticle`. The main difference in this
+case is that in EDM4hep the loop does not cross the `Vertex` collection, but
+rather a `RecoParticleVertexAssociation` collection.
+
+
+
+LCIO | EDM4hep |
+
+
+
+
+```cpp
+const auto vtxColl = event->getCollection("vertices");
+
+for (size_t i = 0; i < vtxColl->getNumberOfElements(); ++i) {
+ const auto vtx = dynamic_cast(vtxColl->getElementAt(i));
+ const auto reco = vtx->getAssociatedParticle();
+ // .. do something with reco and vtx
+}
+```
+
+ |
+
+
+```cpp
+const auto& assocColl =
+ event.get("vtx_particle_associations");
+
+for (const auto assoc : assocColl) {
+ const auto vtx = assoc.getVertex();
+ const auto reco = assoc.getRec();
+ // .. do something with reco and vtx
+}
+```
+ |
+
+