Skip to content

Commit

Permalink
Merge branch 'master' of github.com:scikit-hep/decaylanguage into mod…
Browse files Browse the repository at this point in the history
…el_alias_transformer_replacement
  • Loading branch information
sognetic committed Nov 8, 2023
2 parents d38a472 + d1fdf16 commit e8e5797
Show file tree
Hide file tree
Showing 20 changed files with 362 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: "3.11"
- uses: pre-commit/action@v3.0.0
with:
extra_args: --all-files --hook-stage manual
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.0
rev: 23.10.1
hooks:
- id: black-jupyter

Expand All @@ -24,7 +24,7 @@ repos:
- id: end-of-file-fixer

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.1"
rev: "v0.1.4"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
2 changes: 1 addition & 1 deletion src/decaylanguage/data/decfile.lark
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ model_options : (value | LABEL | _NEWLINE | _COMMA)+
// Model names must either be followed by at least one whitespace (when they have model parameters) or a semicolon (without model parameters)
// We must set priorities here to use lalr - match model name above label, and label above something else

MODEL_NAME.2 : ("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"|"BTOSLLMSE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EIGEN"|"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")/\b/

// model : model_generic
// model_helamp : "HELAMP" (SIGNED_NUMBER SIGNED_NUMBER)+
Expand Down
1 change: 0 additions & 1 deletion src/decaylanguage/dec/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class PhotosEnum(IntEnum):
"HQET3",
"HQET2",
"HQET",
"imqp",
"ISGW2",
"ISGW",
"KS_PI0MUMU",
Expand Down
2 changes: 1 addition & 1 deletion src/decaylanguage/decay/decay.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

Self_DaughtersDict = TypeVar("Self_DaughtersDict", bound="DaughtersDict")

if TYPE_CHECKING: # noqa: SIM108
if TYPE_CHECKING:
CounterStr = Counter[str] # pragma: no cover
else:
CounterStr = Counter
Expand Down
34 changes: 34 additions & 0 deletions tests/data/models/model-BQTOLLLL.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# File for testing purposes. Contains a single decay mode with a specific model.

# Documentation: the B_d0 -> mu^+ mu^- mu^+ mu^- decay based on MNT-model for
# B_d0 -> mu^+ mu^- gamma decay
# mu - the scale parameter (in GeV's);
# Nf - number of "effective" flavors (for b-quark Nf=5);
# res_swch - resonant switching parameter:
# = 0 the resonant contribution switched OFF,
# = 1 the resonant contribution switched ON;
# ias - switching parameter for \alpha_s(M_Z) value:
# = 0 PDG 1sigma minimal alpha_s(M_Z),
# = 1 PDG average value alpha_s(M_Z),
# = 2 PDG 1sigma maximal alpha_s(M_Z).
# Wolfenstein parameterization for CKM matrix:
# A
# lambda
# barrho
# bareta
# EndDocumentation

Define mu 5.0
Define Nf 5
Define res_swch 0
Define ias 1
Define A 0.88
Define lambda 0.227
Define barrho 0.22
Define bareta 0.34

Decay B0sig
1.0 mu+ mu- mu+ mu- BQTOLLLL mu Nf res_swch ias A lambda barrho bareta;
Enddecay

End
22 changes: 22 additions & 0 deletions tests/data/models/model-BQTOLLLLHYPERCP.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# File for testing purposes. Contains a single decay mode with a specific model.

Define mS 2.5
Define mP 0.214
Define gammaS 0.0001
Define gammaP 0.0001
Define mLiiLR 1.0
Define Fc 1.0
Define mD23LL 450.0
Define mD23RR 0.0
Define mD32LL 450.0
Define mD32RR 0.0
Define mD13LL 380.0
Define mD13RR 0.0
Define mD31LL 380.0
Define mD31RR 0.0

Decay B0sig
1.000 mu+ mu- mu+ mu- BQTOLLLLHYPERCP mS mP gammaS gammaP mLiiLR Fc mD23LL mD23RR mD32LL mD32RR mD13LL mD13RR mD31LL mD31RR;
Enddecay

End
7 changes: 7 additions & 0 deletions tests/data/models/model-BTOSLLALI.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File for testing purposes. Contains a single decay mode with a specific model.

Decay B_s0sig
1.0 phi mu+ mu- BTOSLLALI;
Enddecay

End
7 changes: 7 additions & 0 deletions tests/data/models/model-BTOSLLBALL.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File for testing purposes. Contains a single decay mode with a specific model.

Decay B+sig
1.0 pi+ e+ e- PHOTOS BTOSLLBALL 6;
Enddecay

End
8 changes: 8 additions & 0 deletions tests/data/models/model-BTOSLLMS.dec
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# File for testing purposes. Contains a single decay mode with a specific model.

# Documentation: the B -> phi mu^+ mu^- decay with the transition form factors
# from the paper D.Melikhov, B.Stech, PRD62, 014006 (2000).
# Input parameters - mu - the scale parameter (in GeV's);
# res_swch - resonant switching parameter:
# ias - switching parameter for \alpha_s(M_Z) value:
# Wolfenstein parameterization for CKM matrix:
# EndDocumentation

Define mu 5.0
Define Nf 5
Define res_swch 0
Expand Down
41 changes: 41 additions & 0 deletions tests/data/models/model-BTOSLLMSEXT.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# File for testing purposes. Contains a single decay mode with a specific model.

# Documentation: the B_d^0 -> rho^0 ell^+ ell^- decay with the transition form factors
# from the paper D.Melikhov, B.Stech, PRD62, 014006 (2000).
# mu - the scale parameter (in GeV's);
# Nf - number of "effective" flavors (for b-quark Nf=5);
# res_swch - resonant switching parameter:
# = 0 the resonant contribution switched OFF,
# = 1 the resonant contribution switched ON;
# ias - switching parameter for \alpha_s(M_Z) value:
# = 0 PDG 1sigma minimal alpha_s(M_Z),
# = 1 PDG average value alpha_s(M_Z),
# = 2 PDG 1sigma maximal alpha_s(M_Z).
# Wolfenstein parameterization for CKM matrix:
# A
# lambda
# barrho
# bareta
# Multiplication coefficients
# A7 = ReA7 + i*ImA7
# A10 = ReA10 + i*ImA10
# EndDocumentation

Define mu 5.0
Define Nf 5
Define res_swch 0
Define ias 1
Define A 0.88
Define lambda 0.227
Define barrho 0.22
Define bareta 0.34
Define ReA7 1.0
Define ImA7 0.0
Define ReA10 -1.0
Define ImA10 0.0

Decay B0sig
1.0 MyRho0 mu+ mu- BTOSLLMSEXT mu Nf res_swch ias A lambda barrho bareta ReA7 ImA7 ReA10 ImA10;
Enddecay

End
12 changes: 12 additions & 0 deletions tests/data/models/model-BTOVLNUBALL.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# File for testing purposes. Contains a single decay mode with a specific model.

# Documentation: Decay file for [B+ -> (phi(1020) -> K+ K-) mu+ nu_mu]cc,
# using the BToVlnuBall model (for Bs -> phi, lacking an alternative), see https://arxiv.org/pdf/hep-ph/0412079.pdf
# order is r2_A1 mfit2_A1 r1_A2 r2_A2 mfit2_A2 r1_V r2_V mfit2_V
# EndDocumentation

Decay B+sig
1.0 MyPhi mu+ nu_mu PHOTOS BTOVLNUBALL 0.308 36.54 -0.054 0.288 48.94 1.484 -1.049 39.52;
Enddecay

End
9 changes: 9 additions & 0 deletions tests/data/models/model-CB3PI-MPP.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# File for testing purposes. Contains a single decay mode with a specific model.

Define alpha 1.365

Decay B+
1.0 pi+ pi+ pi- CB3PI-MPP alpha;
Enddecay

End
9 changes: 9 additions & 0 deletions tests/data/models/model-CB3PI-P00.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# File for testing purposes. Contains a single decay mode with a specific model.

Define alpha 1.365

Decay B-
0.000026 pi- pi0 pi0 CB3PI-P00 alpha;
Enddecay

End
7 changes: 7 additions & 0 deletions tests/data/models/model-ETA_LLPIPI.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File for testing purposes. Contains a single decay mode with a specific model.

Decay eta
1.0 mu+ mu- pi+ pi- ETA_LLPIPI;
Enddecay

End
7 changes: 7 additions & 0 deletions tests/data/models/model-FLATQ2.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File for testing purposes. Contains a single decay mode with a specific model.

Decay B+sig
1.0 MyKst+ mu+ mu- FLATQ2 1;
Enddecay

End
13 changes: 13 additions & 0 deletions tests/data/models/model-FOURBODYPHSP.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# File for testing purposes. Contains a single decay mode with a specific model.

# Flat phase space in the analysis region of B0 -> D0 D0b.
Define m12_min 1.3 # The model will take at least m1+m2
Define m12_max 2.5 # Must be in GeV/c^2
Define m34_min 1.3 # The model will take at least m1+m2
Define m34_max 2.5 # Must be in GeV/c^2

Decay B0
1.0 K+ K- K- pi+ FOURBODYPHSP m12_min m12_max m34_min m34_max;
Enddecay

End
7 changes: 7 additions & 0 deletions tests/data/models/model-HELAMP.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# File for testing purposes. Contains a single decay mode with a specific model.

Decay h_b(2P)
0.22 gamma eta_b HELAMP 1.0 0.0 1.0 0.0;
Enddecay

End
40 changes: 40 additions & 0 deletions tests/data/models/model-PTO3P.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# File for testing purposes. Contains a single decay mode with a specific model.

# B+ decay to pi+, K- and K+ with Dalitz model so as to agree roughly with the Dalitz plot distribution
Decay B+
1.000 K+ K- pi+ PTO3P
MAXPDF 0.09
#SCANPDF 10000
AMPLITUDE RESONANCE BC K*0
ANGULAR AC
TYPE RBW_ZEMACH
DVFF BLATTWEISSKOPF 4.0
COEFFICIENT POLAR_RAD 1.0 0.0
AMPLITUDE LASS BC 1.412 0.294 2.07
3.32 1.8
COEFFICIENT POLAR_RAD 32.9 -0.38
AMPLITUDE RESONANCE AB phi
ANGULAR CA
TYPE RBW_ZEMACH
DVFF BLATTWEISSKOPF 4.0
COEFFICIENT POLAR_RAD 6.04 2.99
AMPLITUDE RESONANCE AB f_0 0.965 0.695
ANGULAR CA
TYPE FLATTE 0.165 0.13957 0.13957
COEFFICIENT POLAR_RAD 5.28 0.48
AMPLITUDE RESONANCE AB f_0(1500) 1.539
0.257
ANGULAR CA
TYPE RBW_ZEMACH
COEFFICIENT POLAR_RAD 24.0 1.29
AMPLITUDE RESONANCE AB chi_c0
ANGULAR CA
TYPE RBW_ZEMACH
DVFF BLATTWEISSKOPF 4.0
COEFFICIENT POLAR_RAD 0.437 -1.02
AMPLITUDE PHASESPACE
COEFFICIENT POLAR_RAD 6.9 -2.29
;
Enddecay

End
Loading

0 comments on commit e8e5797

Please sign in to comment.