Hello, I would like to use the functionality to convert AmpGen options files to GooFit code.
However, I'm running into issues. For example, trying to do
python3 -m decaylanguage -G goofit models/DtoKpipipi_v2.txt
/* Autogenerated file by AmpGen2GooFit
Generated on 2023-01-31 17:28:16.726714
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/home/freiss/.local/lib/python3.10/site-packages/decaylanguage/__main__.py", line 29, in <module>
main()
File "/home/freiss/.local/lib/python3.10/site-packages/decaylanguage/__main__.py", line 25, in main
DecayLanguageDecay.run()
File "/home/freiss/.local/lib/python3.10/site-packages/plumbum/cli/application.py", line 634, in run
retcode = inst.main(*tailargs)
File "/home/freiss/.local/lib/python3.10/site-packages/decaylanguage/__main__.py", line 21, in main
ampgen2goofit(filename)
File "/home/freiss/.local/lib/python3.10/site-packages/decaylanguage/modeling/ampgen2goofit.py", line 40, in ampgen2goofit
printer(colors.bold | seen_factor, ":", *my_lines[0].spinfactors)
File "/home/freiss/.local/lib/python3.10/site-packages/decaylanguage/modeling/goofit.py", line 167, in spinfactors
raise LineFailure(
decaylanguage.utils.errors.LineFailure: D0{K(1)(1270)-[GSpline.EFF]{KPi20[FOCUS.Kpi]{K-,pi+},pi-},pi+}: Spinfactors not currently included!: DtoA1P1_A1toN2P2_N2toP3P4
Trying to understand this, I believe this is caused by some particles in the decay chain having NonDefined
or Unknown
SpinType. From the particle
package:
@property
def spin_type(self) -> SpinType:
"""
Access the SpinType enum.
Note that this is relevant for bosons only. SpinType.NonDefined is returned otherwise.
"""
# Non-valid or non-standard PDG IDs
if self.pdgid.j_spin is None:
return SpinType.NonDefined
# Fermions - 2J+1 is always an even number
if self.pdgid.j_spin % 2 == 0:
return SpinType.NonDefined
J = int(self.J)
if J in {0, 1, 2}:
if self.P == Parity.p:
return (SpinType.Scalar, SpinType.Axial, SpinType.Tensor)[J]
if self.P == Parity.m:
spin_types = (
SpinType.PseudoScalar,
SpinType.Vector,
SpinType.PseudoTensor,
)
return spin_types[J]
return SpinType.Unknown
One place where I noticed this, are the pipi and Kpi S-waves, which are described as quasi-particles in MintDalitzSpecialParticles.csv
. In this case, the KPi20
quasi-particle is given the PDGID 998112
. In my understanding, the last digit corresponds to 2*j+1, so its spin is 1/2, which I don't think is intended and results in an undefined SpinType.NonDefined
. I believe this could be fixed by changing the last digits of the quasi-particles to 1 to represent spin 0. This requires changing another digit to have unique PDGIDs for all of them and I'm not sure which can be safely changed.