-
Notifications
You must be signed in to change notification settings - Fork 12
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
Geant4 extension: Primary Generator Action class. #18
Comments
Dear Diego, Regards |
Hi Diego I have implemented a special "post-generation operation" that is able to rotate the full generated event in such a way one of the generated particles in this event (namely the target particle) is emitted in a cone with a preferential direction (defined by a (x,y,z) triplet of coordinates or by (theta,phi) doublet of longitude and colatitude angles) and an angle of aperture. This is a typical geometry biasing operation that is useful for radiation protection studies with G4 when you want to track only gammas that go in an interesting direction. The target particle can be selected by type (electron, gamma...) and its ranking in the event, so that you can choose for example: the first particle of any type, the first gamma, the second electron... The preliminary algorithm seems to work and I have tried it for forcing Cs137 gamma rays to run in a cone along the X axis. The resulting histogram is shown below: I now have to provide an extended interface in the G4 extension. Let me know if that would solve your problem. By the way: this algorithm is named MDL for Momentum Direction Lock ;-) Regards |
Dear François, I really thank you for your help. This solution seems to be ideal for my interest, as I am only interested in changing the direction of the electrons in the Cs-137 decay. However, I wonder about the internal conversion electrons that are sometimes produced: the Cs137 decay produces an electron and then the Ba137 that is excited and emits a gamma in most of the cases but also sometimes an internal conversion electron instead of the gamma. I am also interested in emitting these second electrons in the same solid angle that the first ones but if I don't understand wrongly, the method you propose can achieve this too. I comment this just to be sure :) The histogram you send confirms the validity of the method for my problem! Thank you so much! I look forward to hearing about the implementation of this new tool. Best, Diego |
In principle, What you are asking is not correct in terms of the solid angle distributions associated to the particles in a same event. I mean that if you choose a target particle to go in a given direction, then forcing this momentum without corrupting the solid angle distributions of all other particles will result in rotating the full event and this will not imply that other particles goes in the same cone like the target one. In the case of Cs137, this does not hurt because emission directions of all electrons and gammas in each event are non correlated in principle. So the effect would be just like biased sampling with preference for events with particles emitted in the same cone. This would be another story for other kinds of decays (like double beta decay or similar process) where emitted particles are strongly correlated in solid angle and corrupting the angular distribution like this implies wrong geometrical acceptance. Anyway I propose you to add another option to achieve what you want so that you could make a try ASAP with the development branch I will create for that. If it is ok, I will push the mods in a new tag.
Regards |
Dear François, I totally agree with your reasoning. Theoretically, there would be a correlation between the direction of emission and forcing one particle to be produced in one direction will have an impact on the other particles that are produced. However, under the assumptions of the real experiment that I am trying to simulate and compare, I have reached to the conclusion that I can neglect this correlation as the real radioactive source is fixed at an position and it is large enough to assume the Ba137 nuclei to be fixed after the decay, so the direction emission of gammas or internal conversion electrons wouldn't be affected. The fact that in the Cs137 decay the emissions of the particles are not correlated in the simulation is perfect under the previous assumption and helps to achieve the aim I want. Of course, I am not interested for the moment in other types of decay, so I also agree that it would be a different story for them. I thank you for your suggestion, I would be very pleased to check the results after implementing your code! Best regards, Diego |
Hi Diego, I've pushed a new feature branch that implements the MDL post-generation event operation : The documentation about MDL is here: https://github.com/BxCppDev/bxdecay0/blob/feature-lock-particule-dir/documentation/PostGenEventOps/MDL/README.rst . There are several snapshots to figure out the behavior of the MDL driver. It is now possible to force all particles of a given type in the original BxDecay0 generated event to be emitted in the requested emission cone. The cone is specified by its longitude (first param) then colatitude (2nd params) and finally its (demi-)angle of aperture. All angles are given in degrees in the G4 interface (the conversion is automatically done in the MDFL driver internally). The supported particle types are: "all", "*", "e+", "positron", "e-", "electron", "g", "gamma", "a", "alpha", "n", "neutron", "p" and "proton". The rank of the particle is an integer:
Please make a try and report and let me know if it works for you. Regards |
Dear François, I apologize for the lack of feedback these days, I hadn't been able to try the new tool until now. I can confirm that it works very accurately, I haven't found any bug! The example is also very helpful to understand how it works and the option to include all particles in the decay or only some of them just what I needed. I really thank you for your time and the solution! However, I have just realized about little problems to apply this tool in my case: first, because of the detector geometry that I am trying to simulate, the solid angle emission in which I am interested is not a cone. It is defined by two angles and it normally has a rectangle form (or when they are equal, square form). I attach a picture of an example I did. I think it wouldn't be a big problem but I have to think how to solve this. Secondly, the particles are always produced at the origin (0,0,0). This can be a disadvantage in order to implement the Primary Generator in an already existing geometry, as my case is. I am trying to solve it changing somethings in the tool that you just provided, but I just wanted to comment this to see your opinion. Again, many thanks for your time and the help. It is being very important to improve my simulation! Diego |
The MDL Post Generation Op has been updated to optionaly support a rectangular cut with two angles of aperture of your choice (see the doc in Concerning the position of the vertex, the Geant4 extension already proposes an interface to install your own vertex generator Let me know if this is still free of bugs (which I hope) and enjoy ! Best regards. |
This new features discussed in this issue are now integrated in BxDecay0 1.0.10. |
Dear François, Sorry for my luck of feedback these days. I really thank you for making the effort to implement new tool in the BxDecay0. I finished some weeks ago my project and the results have been very satisfactory making use of your Primary Generator, which is also very easy to use with the instructions! I wish you all the best! I will continue learning and using Geant4 :) Kind regards, Diego |
Dear developers,
First of all, I really thank you for this super useful tool. The results of a simulation of Cs137 beta decay have improved and helped my work at the moment.
I write you because I am interested in generating the decay particles in a certain way (direction), so I was thinking of implementing a class derived from the Primary Generator Action. However, I have tried to modify the Generate Primaries function of your Primary Generator Action class so I can give another argument and have access to the direction of emission from my own Primary Generator Action class. However, I am having a big trouble to solve this. I would really appreciate if you could recommend me the best way to achieve this aim or your suggestions.
I look forward to hearing from you.
Kind regards,
Diego Mendoza
The text was updated successfully, but these errors were encountered: