Created attachment 491 [details] summary reporting of the problems and 2 folders with applications with different results. Dear Sir or Madam, I have been used Geant4 for more than 8 years but this is the first time I am using electric field. I am starting with a very simple geometry: one point source monodirectional and monoenergetic of electrons irradiation a solid anode of cupper. These electrons have initial energy (in order of few eV) and are accelerated by a homogeneous electric field. I added a beryllium window and I printout the photons that reaches the internal and external surfaces of this window (position of the photon, momentum, momentum direction, kinetic energy...). I got some strange results like alteration of the shape of the expected photons spectra and different number of electrons reaching the window (I start to check it too after observe the change on the expected photons spectra shape and efficiency conversion). The only difference on the files is the DetectorConstructor class (considering the position of the anode). When the anode is totally immersed or totally outside of the electric field container (correct description of the geometry, I believe) than the shape of the generated photons spectra is completely wrong and it doen't not agree with the expected one (but the conversion efficiency is close too the expected). When the anode is partially immersed on the electric field container and partially in the "world" (not a corect descrition of the geometry, I believe) then we get photons spectra close to de expected shape, but we get a half of the conversion efficiency we expect. We get several G4 Wawnings because of the problem in the description of the geometry on this second case. I can understand the reduction on conversion efficiency for the wrong description of the geometry: because the worning informs that those particles were killed (it they are killed in the anode volume) and we get some errors for the homogeneous electric field calculation (some parameters seems to be not correct and must be recalculated). I tested it on Mac and Linux (Ubuntu) operational systems and I got the same problems. I tested the energy of the reaches the anode (they are ok to all cases) and I tested the emitted photons from the anode (they are consistent to the collection in the solid angle of interest). I am attaching a file with 2 page summary of the problem (including images of the tested geometries and spectra generated) and the examples of the 2 applications (with different just on the detector constructor) that results in the different spectra. I do not know, but it seem a bug on Geant4, because I cannot see the error I am doing on the geometry description and I cannot understand how this possible mistake on geometry description can influence on the chape of the generated spectra...(but I can be mistaken)
I think I add in a wrong title in the error (sorry it is the first time I use this system). My question is about the shape of the curve...I get the theoretical expected one (considering that I didn't change the set cuts of 1mm to all materiais) and I was able to generate photons under this energy in the Cu anode....it can be caused by the inconsistency in the geometry? I hope now I made my point understandable... This is the bug I think can be in G4.
Thanks for submitting a report about your problem and including your source code as reference. From the inspection that I have been able to make of the part of the geometry which involves the electric field, and of the code that creates the classes for propagating in it, I cannot find a problem in your “normal” geometry. I will not comment on your second geometry, in which you create an overlap the volume with the electric field with another volume in the ‘mass’ geometry. This is a recipe for problems, so I am not clear why you have tried to use this modified geometry. If you wanted the electric field to penetrate part of a volume (why?), there would be other ways to achieve it. ( E.g. by creating a subvolume inside that volume and attaching the same field manager to that subvolume.) Please note that combining material and electric field in a volume is fragile in Geant4 - the competition between energy loss due to ionisation and the acceleration due to the electric field is not handled by Geant4, but must be tuned by the user - at least to make sure the energy does not change substantially during a step (using a maximum step). Since it seems that the electric field is accelerating particles correctly, I do not understand how it could otherwise be affecting your results so that they would be incorrect. I suggest to check whether the E-field has any effect in the following way: to start the particle at the end of its expected trajectory in the (volume with the) electric field with the correct energy and check whether you see the same (problematic) results. Also I am not clear exactly how your spectra are affected - some figures would make it easier to understand.
As we have received no feedback to our initial response we are closing this issue. In case you have new information, and the problem persists, please let us know and we will reopen it.