Skip to content

Commit

Permalink
Merge d8c9bb9 into 26d7ead
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardo-rodrigues committed Apr 5, 2019
2 parents 26d7ead + d8c9bb9 commit ac7c468
Show file tree
Hide file tree
Showing 7 changed files with 332 additions and 8 deletions.
22 changes: 22 additions & 0 deletions tests/data/test_Bc2BsPi_Bs2KK.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Example decay chain for testing purposes:
# [B_c+ -> (B_s0 -> K+ K-) pi+]cc

Alias B_c+sig B_c+
Alias B_c-sig B_c-
ChargeConj B_c+sig B_c-sig

Alias MyB_s0 B_s0
Alias Myanti-B_s0 anti-B_s0
ChargeConj MyB_s0 Myanti-B_s0

Decay B_c+sig
1.000 MyB_s0 pi+ PHOTOS PHSP;
Enddecay
CDecay B_c-sig

Decay MyB_s0
1.000 K+ K- SSD_CP 20.e12 0.1 1.0 0.04 9.6 -0.8 8.4 -0.6;
Enddecay
CDecay Myanti-B_s0

End
48 changes: 48 additions & 0 deletions tests/data/test_Bd2DDst_Ds2DmPi0.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Example decay chain for testing purposes:
# B0 -> D*- D+, D*- -> D- (pi0, gamma), D- -> K+ pi- pi- or D- -> K+K-pi- & cc

# --------------------------------------
# DEFINE THE ALIASES & CHARGE CONJUGATES
# --------------------------------------
Alias B0sig B0
Alias anti-B0sig anti-B0
ChargeConj B0sig anti-B0sig

Alias MyD*- D*-
Alias MyD*+ D*+
ChargeConj MyD*+ MyD*-

# --------------------
# DEFINE THE D+ AND D-
# --------------------
Alias MyD- D-
Alias MyD+ D+
ChargeConj MyD+ MyD-

# ---------------
# DECAY OF THE B0
# ---------------
Decay B0sig
1.000 MyD*- MyD+ SVS;
Enddecay
CDecay anti-B0sig

# ----------------
# DECAY OF THE D*-
# ----------------
Decay MyD*-
0.9505 MyD- pi0 VSS;
0.0495 MyD- gamma VSP_PWAVE;
Enddecay
CDecay MyD*+

# ---------------
# DECAY OF THE D-
# ---------------
Decay MyD-
0.905 K+ pi- pi- D_DALITZ;
0.095 K+ K- pi- D_DALITZ;
Enddecay
CDecay MyD+

End
42 changes: 42 additions & 0 deletions tests/data/test_Bd2DmTauNu_Dm23PiPi0_Tau2MuNu.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Example decay chain for testing purposes:
# Descriptor: [B0 -> (D- -> pi- pi+ pi- pi0) (tau+ -> mu+ nu_mu anti-nu_tau) nu_tau]cc

Alias B0sig B0
Alias anti-B0sig anti-B0
ChargeConj B0sig anti-B0sig

Alias MyD+ D+
Alias MyD- D-
ChargeConj MyD+ MyD-

Alias Mya_1- a_1-
Alias Mya_1+ a_1+
ChargeConj Mya_1+ Mya_1-

Alias MyTau- tau-
Alias MyTau+ tau+
ChargeConj MyTau- MyTau+

Decay B0sig
1.00 MyD- MyTau+ nu_tau ISGW2;
Enddecay
CDecay anti-B0sig

Decay MyD-
0.15 pi- pi+ pi- pi0 PHSP;
0.60 Mya_1- pi0 SVS;
0.25 rho- rho0 SVV_HELAMP 1.0 0.0 1.0 0.0 1.0 0.0;
Enddecay
CDecay MyD+

Decay MyTau-
1.00 mu- nu_tau anti-nu_mu PHOTOS TAULNUNU;
Enddecay
CDecay MyTau+

Decay Mya_1+
1.000 rho0 pi+ VVS_PWAVE 1.0 0.0 0.0 0.0 0.0 0.0;
Enddecay
CDecay Mya_1-

End
127 changes: 127 additions & 0 deletions tests/data/test_Bd2Dst0X_D02KPi.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Example decay chain for testing purposes:
# B0 -> D*0 X, i.e. inclusive production of D*0 mesons
# (sum of exclusive modes), with D0 forced to the K- pi+ final state.

Alias B0sig B0
Alias anti-B0sig anti-B0
ChargeConj B0sig anti-B0sig

Alias myD*0 D*0
Alias myanti-D*0 anti-D*0
ChargeConj myD*0 myanti-D*0

Alias myD0 D0
Alias myanti-D0 anti-D0
ChargeConj myD0 myanti-D0

Alias myD_1+ D_1+
Alias myD_1- D_1-
ChargeConj myD_1+ myD_1-

Alias myD'_1+ D'_1+
Alias myD'_1- D'_1-
ChargeConj myD'_1- myD'_1+

Alias myD_2*+ D_2*+
Alias myD_2*- D_2*-
ChargeConj myD_2*+ myD_2*-

Decay anti-B0sig
0.00346684 myD_1+ e- anti-nu_e PHOTOS ISGW2;
0.00553361 myD'_1+ e- anti-nu_e PHOTOS ISGW2;
0.0004807 myD_2*+ e- anti-nu_e PHOTOS ISGW2;
0.0007 myD*0 pi+ e- anti-nu_e PHOTOS GOITY_ROBERTS;

0.00346684 myD_1+ mu- anti-nu_mu PHOTOS ISGW2;
0.00553361 myD'_1+ mu- anti-nu_mu PHOTOS ISGW2;
0.0004807 myD_2*+ mu- anti-nu_mu PHOTOS ISGW2;
0.0007 myD*0 pi+ mu- anti-nu_mu PHOTOS GOITY_ROBERTS;

0.00086671 myD_1+ tau- anti-nu_tau ISGW2;
0.0013334 myD'_1+ tau- anti-nu_tau ISGW2;
0.000418 myD_2*+ tau- anti-nu_tau ISGW2;

0.0004 myD'_1+ D_s- SVS;
0.0008 myD'_1+ D_s*- SVV_HELAMP 0.48 0.0 0.734 0.0 0.48 0.0;
0.0008 myD_1+ D_s- SVS;
0.0016 myD_1+ D_s*- SVV_HELAMP 0.48 0.0 0.734 0.0 0.48 0.0;
0.0008778 myD_2*+ D_s- STS;
0.000836 myD_2*+ D_s*- PHSP;

0.0049 D+ myanti-D*0 K- PHSP;
0.0100 D*+ myanti-D*0 K- PHSP;

0.0005 myD*0 anti-D0 anti-K0 PHSP;
0.0015 D0 myanti-D*0 anti-K0 PHSP;
0.0015 myD*0 anti-D*0 anti-K0 PHSP;
0.0015 D*0 myanti-D*0 anti-K0 PHSP;

0.0025 D+ myanti-D*0 K*- PHSP;
0.0050 D*+ myanti-D*0 K*- PHSP;

0.0005 anti-D0 myD*0 anti-K*0 PHSP;
0.0005 myanti-D*0 D0 anti-K*0 PHSP;
0.0010 myanti-D*0 D*0 anti-K*0 PHSP;
0.0010 anti-D*0 myD*0 anti-K*0 PHSP;

0.0003 myD*0 pi+ pi- PHSP;
0.0005 myD*0 pi0 pi0 PHSP;

0.0010 myD*0 pi+ pi- pi0 PHSP;
0.0001 myD*0 pi0 pi0 pi0 PHSP;

0.0004 myD_1+ pi- SVS;
0.00006667 myD'_1+ pi- SVS;
0.0001881 myD_2*+ pi- STS;
0.00026668 myD_1+ rho- PHSP;
0.00086671 myD'_1+ rho- PHSP;
0.0004598 myD_2*+ rho- PHSP;

0.00004 myD*0 K0 SVS;
0.00004 myD*0 anti-K*0 SVV_HELAMP 1. 0. 1. 0. 1. 0.;
0.00001 myanti-D*0 anti-K*0 SVV_HELAMP 1. 0. 1. 0. 1. 0.;

0.00027 myD*0 pi0 SVS;
0.00029 myD*0 rho0 SVV_HELAMP 0.228 0.0 0.932 0.0 0.283 0.0;
0.00026 myD*0 eta SVS;
0.00017 myD*0 eta' SVS;
0.00042 myD*0 omega SVV_HELAMP 0.228 0.0 0.932 0.0 0.283 0.0;
Enddecay
CDecay B0sig

Decay myD*0
0.6190 myD0 pi0 VSS;
0.3810 myD0 gamma VSP_PWAVE;
Enddecay
CDecay myanti-D*0

Decay myD0
1.0 K- pi+ PHSP;
Enddecay
CDecay myanti-D0

Decay myD_1+
1.0 myD*0 pi+ VVS_PWAVE 0.0 0.0 0.0 0.0 1.0 0.0;
Enddecay

Decay myD_1-
1.0 myanti-D*0 pi- VVS_PWAVE 0.0 0.0 0.0 0.0 1.0 0.0;
Enddecay

Decay myD'_1+
1.0 myD*0 pi+ VVS_PWAVE 1.0 0.0 0.0 0.0 0.0 0.0;
Enddecay

Decay myD'_1-
1.0 myanti-D*0 pi- VVS_PWAVE 1.0 0.0 0.0 0.0 0.0 0.0;
Enddecay

Decay myD_2*+
1.0 myD*0 pi+ TVS_PWAVE 0.0 0.0 1.0 0.0 0.0 0.0;
Enddecay

Decay myD_2*-
1.0 myanti-D*0 pi- TVS_PWAVE 0.0 0.0 1.0 0.0 0.0 0.0;
Enddecay

End
85 changes: 85 additions & 0 deletions tests/data/test_Bd2DstDst.dec
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Example decay chain for testing purposes:
# [B0 -> D*- D*+]cc
# with
# D*- -> D- (pi0, gamma), D*+ -> D0 pi+
# and
# D- -> K+ pi- pi- or D- -> K+ K- pi- and D0 -> K- pi- pi+ pi+

# -----------------------------------------------
# DEFINE THE ALIASES & CHARGE CONJUGATES of the B
# -----------------------------------------------
Alias B0sig B0
Alias anti-B0sig anti-B0
ChargeConj B0sig anti-B0sig

# --------------------------------------------------
# DEFINE THE D* decaying to charged D and neutral pi
# --------------------------------------------------
Alias MyFirstD*- D*-
Alias MyFirstD*+ D*+
ChargeConj MyFirstD*+ MyFirstD*-

# --------------------------------------------------
# DEFINE THE D* decaying to neutral D and charged pi
# --------------------------------------------------
Alias MySecondD*- D*-
Alias MySecondD*+ D*+
ChargeConj MySecondD*+ MySecondD*-

# --------------------
# DEFINE THE D+ AND D-
# --------------------
Alias MyD- D-
Alias MyD+ D+
ChargeConj MyD+ MyD-

# ---------------------
# DEFINE THE D0 AND D~0
# ---------------------
Alias MyD0 D0
Alias Myanti-D0 anti-D0
ChargeConj MyD0 Myanti-D0

# ---------------
# DECAY OF THE B0
# ---------------
Decay B0sig
1.000 MyFirstD*- MySecondD*+ SVV_HELAMP 0.0 0.0 0.0 0.0 1.0 0.0;
Enddecay
CDecay anti-B0sig

# -------------------------------------------
# DECAY OF THE D* to charged D and neutral pi
# -------------------------------------------
Decay MyFirstD*-
0.9505 MyD- pi0 VSS;
0.0495 MyD- gamma VSP_PWAVE;
Enddecay
CDecay MyFirstD*+

# -------------------------------------------
# DECAY OF THE D* to neutral D and charged pi
# -------------------------------------------
Decay MySecondD*+
1.000 MyD0 pi+ VSS;
Enddecay
CDecay MySecondD*-

# ---------------
# DECAY OF THE D-
# ---------------
Decay MyD-
0.700 K+ pi- pi- D_DALITZ;
0.300 K+ K- pi- D_DALITZ;
Enddecay
CDecay MyD+

# ---------------
# DECAY OF THE D0
# ---------------
Decay MyD0
1.00 K- pi- pi+ pi+ LbAmpGen DtoKpipipi_v1 ;
Enddecay
CDecay Myanti-D0

End
File renamed without changes.
16 changes: 8 additions & 8 deletions tests/test_dec.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,32 @@ def test_unknown_decfile():

def test_non_parsed_decfile():
with pytest.raises(DecFileNotParsed):
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.list_decay_mother_names()


def test_non_existent_decay():
with pytest.raises(DecayNotFound):
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.parse()
p.list_decay_modes('XYZ')


def test_default_grammar_loading():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')

assert p.grammar is not None


def test_explicit_grammar_loading():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.load_grammar(DIR / '../decaylanguage/data/decfile.lark')

assert p.grammar_loaded is True


def test_string_representation():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')

assert "n_decays" not in p.__str__()

Expand All @@ -60,7 +60,7 @@ def test_string_representation():


def test_simple_dec():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.parse()

assert p.list_decay_mother_names() == ['D*+', 'D*-', 'D0', 'D+', 'pi0']
Expand All @@ -69,7 +69,7 @@ def test_simple_dec():


def test_decay_mode_details():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.parse()

tree_Dp = p._find_decay_modes('D+')[0]
Expand All @@ -78,7 +78,7 @@ def test_decay_mode_details():


def test_build_decay_chain():
p = DecFileParser(DIR / '../decaylanguage/data/test_example_Dst.dec')
p = DecFileParser(DIR / 'data/test_example_Dst.dec')
p.parse()

output = {'D+': [{'bf': 1.0, 'fs': ['K-', 'pi+', 'pi+', 'pi0'], 'm': 'PHSP', 'mp': ''}]}
Expand Down

0 comments on commit ac7c468

Please sign in to comment.