-
Notifications
You must be signed in to change notification settings - Fork 101
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
Geant4PrimaryHandling: fix issue with multiple vertices in Geant4 GeneralParticleSource #1205
Conversation
…eralParticleSource
@andresailer -- Why is it not possible to add multiple primary vertices per interaction ? Please do not merge. |
Thanks for your comments! But could you be more specific about where in the code you see an issue?
Every source still has its own mask, just that the GPS one has multiple masks now, or did I mess something up with my changes there?
There are still checks in the code that prevent multiple interactions with the same mask from happening.
Just more re-writing of the code, which has possibly other implications elsewhere.
Maybe we need to define what we understand with GPS? The DD4hep incarnation of the GPS, or the Geant4 setup for the GPS? In the example macro from #1205 There is one Geant4 GPS with two different sources.
No worries! |
…ultiple sources from GPS
…hter 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
@andresailer
But he did not....
Now that I have all this explained and wanted to have a cross-check on the code, I see that you have already implemented all this according to the ideas above :-)..... |
But something broke in t_Persist_CLICSiD_Geant4_LONGTEST |
Geant4InputHandling: prevent adding same particle more than once
BEGINRELEASENOTES
ENDRELEASENOTES
This is a little bit hacky, but as long as no-one goes over 10k primary sources we are OK.There are actually two issues: One already pointed out in #1204
which is triggered in
prim->add(m_mask, inter);
Because we cannot add multiple vertices with the same mask
And with the m_mask replaced by an increasing maskCounter, we run into
DD4hep/DDG4/src/Geant4InputHandling.cpp
Lines 120 to 137 in 3a6b9ff
Where
vid
is always 0, because we take the length of a just created vector.Better fixes would probably to switch the loops around in the Geant4GeneratorWrapper to create one interaction, which has multiple vertices, instead of multiple interactions with one vertex each.
But I want to see if these changes cause any other test failures as well, so I already open the PR