-
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
Protect against wrong primary particle mass #1233
Comments
Doesn't this rather mean to check against insufficient total energy, and not check against the mass of the particle? For my education, what happens if one simulates the alpha with 1 MeV total energy? I am also not sure if you refer to the particle.tbl file, which allows one to define additional particles, but it doesn't allow one to overwrite particles Geant4 already knows. DD4hep/DDG4/plugins/Geant4ExtraParticles.cpp Lines 110 to 112 in 4db360e
There is no way for us to know what the correct mass of a particle is. If there are MC records used as input, which define include the mass of particles, we could check that that mass is consistent with the mass of the defined, but this doesn't sound like the issue you are raising here. Cheers, |
Hi,
ddsim still assigns a positive kinetic energy to the alpha, but well below 1 MeV. Simulation runs but the output is wrong. It can be very misleading.
Yes, that would be my point. Sorry I was not clear enough. Best, |
But my proposal would do nothing for the 1 MeV Alpha case? The mass of the Alpha isn't changed, is it? |
The alpha at 1 MeV should still trigger an exception because the tabulated mass is bigger than the input value of |
What is the |
Geant4 maintains a table with all possible particles and their properties. Accessing the static properties of particles can be done as follows:
The mass of the alpha particle is retrieved using the above snippet. The DD4hep native particle gun requires the energy parameter to include the mass of the particle, so specifying 1 MeV for an alpha particle is incorrect. If the mass is not accounted for, it could lead to erroneous simulations. Similar issues may arise when setting up the primaries from a hepmc3 file. In my opinion, it would be safer to throw an exception when encountering such inconsistencies before starting the actual simulation. There is a dedicated way to declare new particles for Geant4; it is not possible to run a simulation with an incorrect mass for a known particle. |
Hi Alvaro, I verified again in the code:
I cannot see anything wrong with that - except that the property name is perhaps not entirely detailed. It is true, if an input file contains 3-momentum and energy and at the same time the particle mass |
Yes, that it is. Additionally, even with positive mass, there might be a mismatch between the derived mass from input 3momentum+energy and the mass value used by Geant4. For example, if the input is In case the derived mass value is smaller than 10 eV, the dynamical mass is set to zero. In case is larger by more than 10 eV than the PDG value, the input mass is taken. This behavior is implemented here. Thank you for taking a look to this :) |
I had a quick chat with some Geant4 people, and I will open a review of the G4PrimaryParticle class to add a sanity check there. A piece of code may be added in the hepMC3 reader in order to check the mass consistency of the derived value from the input and the value from Geant4/PDG. What do you think? |
Ideally the check is done in a central piece of code where the data of all readers, generators and guns are processed. |
Maybe here DD4hep/DDG4/src/Geant4InputHandling.cpp Line 346 in 58fa8c0
|
@andresailer This is a very good place. all is present and also the particle definitions are queried from Geant4. |
after reading a bit more Geant4 code, I noticed that G4PrimaryParticle actually implements a check for negative masses here. I have asked some colleagues from the FCC physics performance studies group, if implementing a check for the input particle mass would be an obstacle for their work or not (just to be sure). |
Please see MR #1259 |
Hi,
ddsim allows to load primary particles from an external file, but it seems there is no sanity check for the mass of the particles.
Question: would be worth to check the mass of the primary particles before starting the simulation? This issue would affect the builtin particle gun, which allows to define a total energy of primary particle smaller than the mass (e.g., an alpha particle with 1 MeV).
Best,
Alvaro
The text was updated successfully, but these errors were encountered: