Skip to content

Commit

Permalink
Merge branch 'master' into print_descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
admorris authored Jun 28, 2023
2 parents 4b9c113 + 8f52f3e commit cf47af0
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 9 deletions.
12 changes: 11 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,22 @@
"code",
"doc"
]
},
{
"login": "admorris",
"name": "Adam Morris",
"avatar_url": "https://avatars.githubusercontent.com/u/15155249?v=4",
"profile": "https://gitlab.cern.ch/users/admorris",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"skipCi": true,
"repoType": "github",
"repoHost": "https://github.com",
"projectName": "decaylanguage",
"projectOwner": "scikit-hep"
"projectOwner": "scikit-hep",
"commitType": "docs"
}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
- id: end-of-file-fixer

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.270"
rev: "v0.0.272"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand All @@ -37,7 +37,7 @@ repos:
additional_dependencies: [attrs, particle, importlib_resources, numpy, types-deprecated]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.5
hooks:
- id: codespell
args: ["-L", "vertexes,unkown,te"]
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ We hereby acknowledge the contributors that made this project possible ([emoji k
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sognetic"><img src="https://avatars.githubusercontent.com/u/10749132?v=4?s=100" width="100px;" alt="Moritz Bauer"/><br /><sub><b>Moritz Bauer</b></sub></a><br /><a href="https://github.com/scikit-hep/decaylanguage/commits?author=sognetic" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/FlorianReiss"><img src="https://avatars.githubusercontent.com/u/44642966?v=4?s=100" width="100px;" alt="FlorianReiss"/><br /><sub><b>FlorianReiss</b></sub></a><br /><a href="https://github.com/scikit-hep/decaylanguage/commits?author=FlorianReiss" title="Code">💻</a> <a href="https://github.com/scikit-hep/decaylanguage/commits?author=FlorianReiss" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://gitlab.cern.ch/users/admorris"><img src="https://avatars.githubusercontent.com/u/15155249?v=4?s=100" width="100px;" alt="Adam Morris"/><br /><sub><b>Adam Morris</b></sub></a><br /><a href="https://github.com/scikit-hep/decaylanguage/commits?author=admorris" title="Code">💻</a></td>
</tr>
</tbody>
</table>

Expand Down
21 changes: 16 additions & 5 deletions src/decaylanguage/data/decfile.lark
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,34 @@
// or https://github.com/scikit-hep/decaylanguage for details.

start : _NEWLINE* (line _NEWLINE+)+ ("End" _NEWLINE+)?
?line : define | pythia_def | jetset_def | model_alias | alias | chargeconj | commands | decay | cdecay | copydecay | setlspw
?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" LABEL ":" LABEL "=" (LABEL | SIGNED_NUMBER)
pythia_def : ("PythiaBothParam" | "PythiaAliasParam") LABEL ":" LABEL "=" (LABEL | SIGNED_NUMBER)

jetset_def : "JetSetPar" LABEL "=" SIGNED_NUMBER

ls_def : ("LSFLAT" | "LSNONRELBW") label // Choose a lineshape for a particle

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

setlspw : "SetLineshapePW" label label label value

cdecay : "CDecay" label

define : "Define" label value

particle_def: "Particle" label value value // Set the mass and width of a paricle (in GeV)

model_alias : "ModelAlias" model_label model

alias : "Alias" label label

chargeconj : "ChargeConj" label label

changemasslimit : ("ChangeMassMin" | "ChangeMassMax") label value // Set upper/lower mass cuts on a lineshape

?commands : global_photos

global_photos : boolean_photos
Expand All @@ -41,7 +51,7 @@ particle : LABEL // Add full particle parsing here
model_label : LABEL

model : (model_label _SEMICOLON+ | MODEL_NAME_AND_SC | MODEL_NAME_AND_WS model_options _SEMICOLON+)
model_options : (value | LABEL | _NEWLINE)+
model_options : (value | LABEL | _NEWLINE | _COMMA)+

// model : model_generic
// model_helamp : "HELAMP" (SIGNED_NUMBER SIGNED_NUMBER)+
Expand All @@ -55,6 +65,7 @@ model_options : (value | LABEL | _NEWLINE)+
// Disregard comments, (multiple) newlines and whitespace in parser tree
_NEWLINE: ( /\r?\n[\t ]*/ | COMMENT )
_SEMICOLON: /;/
_COMMA: /,/
_WS: WS_INLINE

// Model names must either be followed by at least one whitespace (when they have model parameters) or a semicolon (without model parameters)
Expand All @@ -63,9 +74,9 @@ _WS: WS_INLINE
MODEL_NAME_AND_WS.2: MODEL_NAME _WS+
MODEL_NAME_AND_SC.2: MODEL_NAME _WS* _SEMICOLON+

MODEL_NAME : "BaryonPCR"|"BCL"|"BGL"|"BT02PI_CP_ISO"|"BTO3PI_CP"|"BTOSLLALI"|"BTOSLLBALL"|"BTOXSGAMMA"|"BTOXSLL"|"CB3PI-MPP"|"CB3PI-P00"|"D_DALITZ"|"ETAPRIME_DALITZ"|"ETA_DALITZ"|"ETA_FULLDALITZ"|"ETA_PI0DALITZ"|"FLATQ2"|"FLATSQDALITZ"|"GENERIC_DALITZ"|"GOITY_ROBERTS"|"HELAMP"|"HQET3"|"HQET2"|"HQET"|"ISGW2"|"ISGW"|"LbAmpGen"|"LLSW"|"MELIKHOV"|"OMEGA_DALITZ"|"PARTWAVE"|"PHSP"|"PI0_DALITZ"|"PROPSLPOLE"|"PVV_CPLH"|"PYCONT"|"PYTHIA"|"SLBKPOLE"|"SLN"|"SLPOLE"|"SSD_CP"|"SSD_DirectCP"|"SSS_CP"|"SSS_CP_PNG"|"SSS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MA"|"LQCD"|"MELIKHOV"|"OMEGA_DALITZ"|"PARTWAVE"|"PHI_DALITZ"|"PHSPDECAYTIMECUT"|"PHSPFLATLIFETIME"|"PHSP"|"PI0_DALITZ"|"PROPSLPOLE"|"PTO3P"|"PVV_CPLH"|"PYCONT"|"PYTHIA"|"SLBKPOLE"|"SLL"|"SLN"|"SLPOLE"|"SSD_CP"|"SSD_DirectCP"|"SSS_CP_PNG"|"SSS_CP"|"SSS_CPT"|"STS_CP"|"STS"|"SVP_CP"|"SVP_HELAMP"|"SVP"|"SVS_CP_ISO"|"SVS_CPLH"|"SVS_CP"|"SVS_NONCPEIGEN"|"SVS"|"SVV_CPLH"|"SVV_CP"|"SVV_HELAMP"|"SVV_NONCPEIGEN"|"SVVHELCPMIX"|"TAUHADNU"|"TAULNUNU"|"TAUOLA"|"TAUSCALARNU"|"TAUVECTORNU"|"THREEBODYPHSP"|"TSS"|"TVP"|"TVS_PWAVE"|"VLL"|"VSP_PWAVE"|"VSS_BMIX"|"VSS_MIX"|"VSS"|"VTOSLL"|"VUB"|"VVPIPI"|"VVP"|"VVS_PWAVE"|"XLL"|"YMSTOYNSPIPICLEO"|"YMSTOYNSPIPICLEOBOOST"

LABEL : /[a-zA-Z0-9\/\-+*_()']+/
LABEL : /[a-zA-Z0-9\/\-+*_()'~]+/
COMMENT : /[#][^\n]*/

// We should ignore comments
Expand Down
43 changes: 42 additions & 1 deletion src/decaylanguage/dec/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,86 @@ class PhotosEnum(IntEnum):
# 'decaylanguage/data/decfile.lark'!
known_decay_models = (
"BaryonPCR",
"BC_SMN",
"BC_TMN",
"BC_VHAD",
"BC_VMN",
"BCL",
"BGL",
"BLLNUL",
"BNOCB0TO4PICP",
"BNOCBPTO3HPI0",
"BNOCBPTOKSHHH",
"BS_MUMUKK",
"BSTOGLLISRFSR",
"BSTOGLLMNT",
"BT02PI_CP_ISO",
"BTO3PI_CP",
"BTODDALITZCPK",
"BToDiBaryonlnupQCD",
"BTOSLLALI",
"BTOSLLBALL",
"BTOSLLMS",
"BTOSLLMSEXT",
"BTOVLNUBALL",
"BTOXSGAMMA",
"BTOXELNU",
"BTOXSLL",
"BQTOLLLLHYPERCP",
"BQTOLLLL",
"CB3PI-MPP",
"CB3PI-P00",
"D_DALITZ",
"D_hhhh",
"D0GAMMADALITZ",
"doKm",
"DToKpienu",
"ETAPRIME_DALITZ",
"ETA_DALITZ",
"ETA_FULLDALITZ",
"ETA_LLPIPI",
"ETA_PI0DALITZ",
"FLATQ2",
"FLATSQDALITZ",
"FOURBODYPHSP",
"GENERIC_DALITZ",
"GOITY_ROBERTS",
"HELAMP",
"HQET3",
"HQET2",
"HQET",
"imqp",
"ISGW2",
"ISGW",
"KS_PI0MUMU",
"Lb2Baryonlnu",
"Lb2plnuLCSR",
"Lb2plnuLQCD",
"LbAmpGen",
"LLSW",
"LNUGAMMA",
"LQCD",
"MELIKHOV",
"OMEGA_DALITZ",
"PARTWAVE",
"PHI_DALITZ",
"PHSPDECAYTIMECUT",
"PHSPFLATLIFETIME",
"PHSP",
"PI0_DALITZ",
"PROPSLPOLE",
"PTO3P",
"PVV_CPLH",
"PYCONT",
"PYTHIA",
"SLBKPOLE",
"SLL",
"SLN",
"SLPOLE",
"SSD_CP",
"SSD_DirectCP",
"SSS_CP",
"SSS_CP_PNG",
"SSS_CP",
"SSS_CPT",
"STS_CP",
"STS",
Expand All @@ -82,8 +119,10 @@ class PhotosEnum(IntEnum):
"SVVHELCPMIX",
"TAUHADNU",
"TAULNUNU",
"TAUOLA",
"TAUSCALARNU",
"TAUVECTORNU",
"THREEBODYPHSP",
"TSS",
"TVP",
"TVS_PWAVE",
Expand All @@ -92,10 +131,12 @@ class PhotosEnum(IntEnum):
"VSS_BMIX",
"VSS_MIX",
"VSS",
"VTOSLL",
"VUB",
"VVPIPI",
"VVP",
"VVS_PWAVE",
"XLL",
"YMSTOYNSPIPICLEO",
"YMSTOYNSPIPICLEOBOOST",
)

0 comments on commit cf47af0

Please sign in to comment.