-
Notifications
You must be signed in to change notification settings - Fork 31
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
Incorrectly set G4 Process and Subprocess types? #25
Comments
Sorry I forgot to quote: I used edep-sim built in this container if anyone would like to know/see. |
The process and sub-process type are copied directly from the underlying G4VProcess* for the step or track. I suspect that you are looking at a particles with an undefined process. Can you please attach the simplest input kinematics file and the associated geant4 macro file that will reproduce the issue. |
I have no doubt they are supposed to be copied from G4 and there appears to be no room of a mistake. Unfortunately I don't have a g4 macro that works handy because this came out from running a custom event generator. But if somehow you could take a look, that would be great. Sorry for not being able to attend this problem right now... I will for now comment as a potential bug in my software that depend on edep-sim and mark as unreliable information when ParentId == -1. |
The trajectory point values should be a faithful representation of the internal G4 values (and if G4 doesn't initialize the value, it should be a faithful copy of that too). Have you seen evidence that the value is not a good copy of the step that created the trajectory point? What needs to be checked, and which I haven't reproduced, is an example where the process/subprocess values copied into the TG4TrajectoryPoint object do not match the values present in the G4VProcess (actually the derived class) associated with the step that is creating the trajectory point, or that the value in the TG4TrajectoryPoint object is being incorrectly modified after it is assigned. |
@ClarkMcGrew to me, above stored values are enough evidences. But let me understand this point clearly: so you are suggesting the issue may be in Geant4 rather than edep-sim? I expect Geant4 to give an identical tag for creation process for injected particles if Geant4 is correctly reset for each event simulation. In the past, I have dealt with G4String rather than a combination of process and subprocess enums (not in edep-sim, different experiments different G4 wrapper softwares / running bare G4). But I don't have a reason to doubt it should be different (i.e. like G4String I assume process and subprocess enums to be reset). Yes, I am glad to hear you have not done the check = this remains as a possibility. That was my question (whether this was actually checked before) and I appreciate the answer that this is never validated. is because whenever I dealt with Geant4 in the past, the G4String associated with a creation process of injected particles have been consistent |
My understanding is that you have found a case where the saved process and subprocess values do not match your expectation, and you have isolated the problem to be that the saved edep-sim values to do not match internal geant4 values. The validation includes inputs similar to what I think you describe, and does not reproduce your report. It "works for me". I do not have example inputs where the process and subprocess values are incorrectly saved. To debug, I need example inputs which produce incorrect results and that can be used to write a test. The output is not sufficient. Alternatively, I would be very happy to have a PR with a test (and, ideally, a fix), which can be validated and merged. |
Bug not verified. |
There seem to be an issue with values filling
TG4TrajectoryPoint::Process
andTG4TrajectoryPoint::Subprocess
attributes. If I generate an event with particles (defined by me), these attribute values are set to0
. In TG4Trajectory.h,G4ProcessType
enum is defined with the value0
associated withkProcessNotDefined
. ForG4ProcessSubtype
,0
is not defined but I assume this is the right values to be filled for user-injected particles.Here's the issue:
If I look at the 2nd and 3rd events where identical set of particles are injected into Geant4 world for tracking, these attributes (
Process
andSubprocess
) are filled with non-zero values. This seems like a bug but please correct me if I am missing something.Here's a sample data file produced using edep-sim.
Here is a print-out of
TrackId
,ParentId
,Process
, andSubprocess
attribute values for the first three events.Below, you find a simple python script I am running to printout this information.
The text was updated successfully, but these errors were encountered: