ULB-Metronu / georges

Opinionated particle accelerator modeling Python package.
https://ulb-metronu.github.io/georges/
GNU General Public License v3.0
7 stars 8 forks source link

Some question about setting SigmaP. #86

Open cy1034429432 opened 7 months ago

cy1034429432 commented 7 months ago

@rtesse Hi, I am sorry to bother you again. I have a question about setting SigmaP (SigmaE, or SigmaEk, which all work to set energy spread). I can't find some functions for setting SigmaP (Similar to using BDSIM, set initial particles with Gaussian energy distribution), but I only find these parameters about energy spread as shown in the following figure. image Does Georges have a function similar to what I said?

chernals commented 7 months ago

Hello there !

We do not have specific functions to populate the dpp values in beam distributions. All in all these are simple numpy arrays, so it should be straightforward to use any type of generator (for example random Gaussian in numpy) and to set the 5th coordinate in the array using that vector array.

rtesse commented 7 months ago

Hello,

In the screenshot you showed, you have the parameter dpprms, which is equivalent to the SigmaP in BDSIM. If you know or if the distribution of your momentum is not Gaussian, you can set the distribution as Cedric said.