Currently the second definition is implemented. This has the advantage that mean longitudinal momentum is well defined and thereby the reference particle has the same velocity as the centroid. The disadvantage is that the kinematic energy of the bunch is to high.
The definition for PC should be chosen and the two attributes should be described in the manual for 1.6 and 1.9.
Edited
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
So everywhere in Beam / PartData it is assumed that PC is the full particle momentum, not the longitudinal one. From this it seems to me that the Distribution class should use the first definition.
On the other hand of course we can change it, or introduce a new attribute if this is convenient.
Note that the Beam attributes ENERGY and GAMMA also assume the full energy / gamma in the same way as PC, and not just the longitudinal part. This is in contrast to what the Distribution class does with it and seems counter-intuitive.
snuverink_jchanged title from Attributes PC and ENERGY of BEAM command not described to Attributes PC, ENERGY and GAMMA of BEAM command not described
changed title from Attributes PC and ENERGY of BEAM command not described to Attributes PC, ENERGY and GAMMA of BEAM command not described
I have implemented a correction but not pushed yet. Have to think how to include OFFSETPX, OFFSETPY and OFFSETPZ. Do they increase/decrease the energy? If not, does OFFSETPZ make sense? Or should we have OFFSETEKIN or similar? How does a user specify a bunch that has the nominal energy but a momentum that isn't tangential to the reference trajectory?
I've added the attribute OFFSETP to add a momentum shift relative to the nominal momentum. OFFSETPZ is imho redundant since the longintudinal component of the momentum is fixed with PC, OFFSETPX and OFFSETPY.
I think we need to make sure this is 100% documented. What about compatibility to other codes: astra, elegant etc ? Would it maybe wise to discuss this on the mailing list ?
My 5 cents: the distribution should not change the total energy of the beam. Because of symmetry in generating the distribution, as far as I remember, this should not happen.
I totally agree, the number of attributes in the distribution command are way too many.
How to progress on this? This is mostly relevant for low energy.
In Elegant it seems one can only define P0 : Central momentum of the bunch. Not sure about the actual implementation.
Elegant also has an ENERGY element, which can define central energy and P0.
I've implemented and pushed (sometime end of November) a correction that ensures that the mean momentum (not mean Pz) is equal to P0. For me this is fixed and the issue can be closed.