From 7380fe3c2d330693e3098b0bc05560d8611748bb Mon Sep 17 00:00:00 2001 From: Eduardo Rodrigues Date: Thu, 10 Aug 2023 11:27:28 +0200 Subject: [PATCH] Add model testing for BTOXSGAMMA and BTOXSLL --- tests/data/models/model-BTOXSGAMMA.dec | 7 +++++++ tests/data/models/model-BTOXSLL.dec | 7 +++++++ tests/dec/test_known_decay_models.py | 28 +++++++++++++++++--------- 3 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 tests/data/models/model-BTOXSGAMMA.dec create mode 100644 tests/data/models/model-BTOXSLL.dec diff --git a/tests/data/models/model-BTOXSGAMMA.dec b/tests/data/models/model-BTOXSGAMMA.dec new file mode 100644 index 00000000..10677cd8 --- /dev/null +++ b/tests/data/models/model-BTOXSGAMMA.dec @@ -0,0 +1,7 @@ +# File for testing purposes. Contains a single decay mode with a specific model. + +Decay B+ +0.0003118 Xsu gamma BTOXSGAMMA 2; +Enddecay + +End diff --git a/tests/data/models/model-BTOXSLL.dec b/tests/data/models/model-BTOXSLL.dec new file mode 100644 index 00000000..be94f1f6 --- /dev/null +++ b/tests/data/models/model-BTOXSLL.dec @@ -0,0 +1,7 @@ +# File for testing purposes. Contains a single decay mode with a specific model. + +Decay B+ + 0.0000025 Xsu mu+ mu- PHOTOS BTOXSLL 4.8 0.2 0.0 0.41; +Enddecay + +End diff --git a/tests/dec/test_known_decay_models.py b/tests/dec/test_known_decay_models.py index 8786e9fa..ff3f0aa9 100644 --- a/tests/dec/test_known_decay_models.py +++ b/tests/dec/test_known_decay_models.py @@ -37,13 +37,13 @@ def test_lark_file_model_list_consistency(): # TODO: actually test all models - takes time parsed_models = ( ("BaryonPCR", [1.0, 1.0, 1.0, 1.0]), - ("BC_SMN", ""), - ("BC_TMN", ""), - ("BC_VHAD", ""), - ("BC_VMN", ""), - ("BCL", ""), - ("BGL", ""), - ("BLLNUL", ""), + ("BC_SMN", ""), # No dec file found in EvtGen repository + ("BC_TMN", ""), # No dec file found in EvtGen repository + ("BC_VHAD", ""), # No dec file found in EvtGen repository + ("BC_VMN", ""), # No dec file found in EvtGen repository + ("BCL", ""), # No dec file found in EvtGen repository + ("BGL", ""), # No dec file found in EvtGen repository + ("BLLNUL", ""), # No dec file found in EvtGen repository ("BNOCB0TO4PICP", ""), ("BNOCBPTO3HPI0", ""), ("BNOCBPTOKSHHH", ""), @@ -59,9 +59,9 @@ def test_lark_file_model_list_consistency(): ("BTOSLLMS", ""), ("BTOSLLMSEXT", ""), ("BTOVLNUBALL", ""), - ("BTOXSGAMMA", ""), + ("BTOXSGAMMA", [2.0]), ("BTOXELNU", ""), - ("BTOXSLL", ""), + ("BTOXSLL", [4.8, 0.2, 0.0, 0.41]), ("BQTOLLLLHYPERCP", ""), ("BQTOLLLL", ""), ("CB3PI-MPP", ""), @@ -169,7 +169,15 @@ def test_model_parsing(decay_model: str, expected_model_parameters: str): are parsed with no errors but, most importantly, correctly. """ # TODO: actually test all models - takes time - if decay_model not in {"BaryonPCR", "GOITY_ROBERTS", "LNUGAMMA", "PHSP", "SSD_CP"}: + if decay_model not in { + "BaryonPCR", + "BTOXSGAMMA", + "BTOXSLL", + "GOITY_ROBERTS", + "LNUGAMMA", + "PHSP", + "SSD_CP", + }: pass else: dfp = DecFileParser(DIR / f"../data/models/model-{decay_model}.dec")