From a029add2015401ac0aa60a8b655a010bb7e12b03 Mon Sep 17 00:00:00 2001
From: Andre Sailer <andre.philippe.sailer@cern.ch>
Date: Fri, 15 Dec 2023 13:16:55 +0100
Subject: [PATCH] Geant4InputHandling: collectPrimaries: use the mask to place
 the daughter vertices rather than size of the map

Now every place where interaction->vertices map is being used, the mask is used as the key to the map, instead of something else
---
 DDG4/src/Geant4InputHandling.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/DDG4/src/Geant4InputHandling.cpp b/DDG4/src/Geant4InputHandling.cpp
index a741179a9..279db4b6a 100644
--- a/DDG4/src/Geant4InputHandling.cpp
+++ b/DDG4/src/Geant4InputHandling.cpp
@@ -103,14 +103,13 @@ static void collectPrimaries(Geant4PrimaryMap*         pm,
 
   if ( dau )   {
     Geant4Vertex* dv = new Geant4Vertex(*particle_origine);
-    int vid = int(interaction->vertices.size());
     PropertyMask reason(p->reason);
     reason.set(G4PARTICLE_HAS_SECONDARIES);
 
     dv->mask = mask;
     dv->in.insert(p->id);
 
-    interaction->vertices[vid].emplace_back(dv) ;
+    interaction->vertices[mask].emplace_back(dv) ;
 
     for(; dau; dau = dau->GetNext())
       collectPrimaries(pm, interaction, dv, dau);
-- 
GitLab