diff --git a/src/decaylanguage/data/decfile.lark b/src/decaylanguage/data/decfile.lark index a752ef96..3e4d384e 100644 --- a/src/decaylanguage/data/decfile.lark +++ b/src/decaylanguage/data/decfile.lark @@ -6,31 +6,37 @@ start : _NEWLINE* (line _NEWLINE+)* ("End" _NEWLINE+)? ?line : define | particle_def | pythia_def | jetset_def | ls_def | model_alias | alias | chargeconj | commands | decay | cdecay | copydecay | setlspw | setlsbw | changemasslimit | inc_factor -pythia_def : ("PythiaBothParam" | "PythiaAliasParam") LABEL ":" LABEL "=" (LABEL | SIGNED_NUMBER) +pythia_def : LABEL_PYTHIA_PARAMETERS LABEL ":" LABEL "=" (LABEL | SIGNED_NUMBER) + +LABEL_PYTHIA_PARAMETERS : "PythiaBothParam" | "PythiaAliasParam" jetset_def : "JetSetPar" LABEL "=" SIGNED_NUMBER -ls_def : ("LSFLAT" | "LSNONRELBW") label // Choose a lineshape for a particle +ls_def : LABEL_LINESHAPE LABEL // Choose a lineshape for a particle + +LABEL_LINESHAPE : "LSFLAT" | "LSNONRELBW" | "LSMANYDELTAFUNC" inc_factor: ("IncludeBirthFactor" | "IncludeDecayFactor") label ("yes" | "no") // Presence of the birth/decay factor and form-factor -setlsbw : "BlattWeisskopf" label value // Set Blatt-Weisskopf barrier factor for a lineshape +setlsbw : "BlattWeisskopf" LABEL SIGNED_NUMBER // Set Blatt-Weisskopf barrier factor for a lineshape setlspw : "SetLineshapePW" LABEL LABEL LABEL INT // Redefine Partial Wave for label -> label label -cdecay : "CDecay" label +cdecay : "CDecay" LABEL -define : "Define" label value +define : "Define" LABEL SIGNED_NUMBER particle_def: "Particle" label value value // Set the mass and width of a particle (in GeV) model_alias : "ModelAlias" model_label model -alias : "Alias" label label +alias : "Alias" LABEL LABEL + +chargeconj : "ChargeConj" LABEL LABEL -chargeconj : "ChargeConj" label label +changemasslimit : LABEL_CHANGE_MASS LABEL SIGNED_NUMBER // Set upper/lower mass cuts on a lineshape -changemasslimit : ("ChangeMassMin" | "ChangeMassMax") label value // Set upper/lower mass cuts on a lineshape +LABEL_CHANGE_MASS : "ChangeMassMin" | "ChangeMassMax" ?commands : global_photos diff --git a/src/decaylanguage/dec/dec.py b/src/decaylanguage/dec/dec.py index 78bfe381..c1997d5b 100644 --- a/src/decaylanguage/dec/dec.py +++ b/src/decaylanguage/dec/dec.py @@ -382,15 +382,16 @@ def get_particle_property_definitions(self) -> dict[str, dict[str, float]]: self._check_parsing() return get_particle_property_definitions(self._parsed_dec_file) - def dict_pythia_definitions(self) -> dict[str, str | float]: + def dict_pythia_definitions(self) -> dict[str, dict[str, str | float]]: """ - Return a dictionary of all Pythia definitions, of type - = "PythiaBothParam" or "PythiaAliasParam", - in the input parsed file, of the form + Return a dictionary of all Pythia definitions, with keys corresponding to the types + = "PythiaBothParam" and/or "PythiaAliasParam", + set in the input parsed file with statements of the form " =