-
Notifications
You must be signed in to change notification settings - Fork 100
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
Vertex time not imported correctly from hepmc #1082
Comments
Why don't you make a PR with the patch to fix this problem? |
It's hacky. Because it adds a data member |
Keep in mind, this won't fix secondaries / pre-assigned decays |
Can you elaborate on the problem of secondaries and pre assigned decays there is? |
The code as it is only generates GEANT vertices for parentless particles, which e.g. a decayed J/psi and its daughters cannot be. |
Do you have a hepmc file that shows that there actually is a problem? Because pre-assigned decays are working right now, for example in this file https://github.com/AIDASoft/DD4hep/blob/master/DDTest/inputFiles/Pythia_output.hepmc |
run
|
Interesting, let me give that a try. I made assumptions I probably shouldn't have. |
Pre-assigned decays do not need new G4Vertices, they need the decay products to be assigned to particles: Which is done here: DD4hep/DDG4/src/Geant4InputHandling.cpp Line 430 in 8c5fd05
|
You are correct, I withdraw my comment :) I'm currently getting
when running over this pythia event, but I suspect that's because it's going through the full detector and it exceeds the RAM allotted to my docker image somewhere in the writing stage. I'll follow up if it persists after choosing a simpler geometry. Your PR works, and after it's merged I consider this issue fully resolved. Thanks a lot for the fast and smart help!! |
Yes, that is a very heavy event. I usually disable almost everything in a detector when debugging MC record issues, and it still takes minutes to simulate something from this file. Cheers! |
To confirm, if I use just the inner tracker it works just fine. Thanks again! |
!!!IMPORTANT!!!: To facilitate faster and easier response to your issue please provide in addition to the description of the issue also the following information
OS version: e.g. centos7
container based on debian,
https://github.com/eic/eic-shell
https://github.com/eic/containers
Compiler version: e.g GCC 8.0
gcc 12
Package version: tag or commit ID, or GitHub branch
dd4hep@1.24 +ddg4 +ddcad -frames +hepmc3 +lcio
(None of the above matters. We are stuck for technical reasons with 1.24 now, but the current branch has the same code.)
Reproduced by: exact steps to reproduce the problem: checkout, setup environment (Geant4/ROOT version, LCG/iLCSoft/Key4hep release), cmake, build, run...
Run the attached file through any detector
It has three final photons emerging from different vertices and crucially at different times, 0, 1000, and 2000 ns
simple.hepmc.zip
You don't want that... Let me zoom in on the problem, close to the end
The problem is here
DD4hep/DDG4/hepmc/HepMC3EventReader.cpp
Lines 104 to 105 in 504cc12
and here:
DD4hep/DDG4/hepmc/HepMC3EventReader.cpp
Lines 136 to 149 in 504cc12
Particles correctly know their start vertex and, from there, creation time. However, GEANT vertices are only constructed from the end vertices of particles without a parent. I have a simple patch for that at https://github.com/eic/eic-spack/blob/develop/packages/dd4hep/vertex-time.patch
The reason I'm not making a pull request from that is that it may be better to rethink the logic of using parent-less particles for geant vertices. I have some idea about why it's done but I don't think it's right. And I believe it should also not work for preassigned decays. I have some experience with reading HepMC into GEANT, https://github.com/eic/east/blob/main/PrimGenInterface/src/eASTHepMC3Interface.cc and I'd be happy to help. Otherwise please let me know and I'll open a PR for the kludge.
The text was updated successfully, but these errors were encountered: