5from heavyFlavourScaling
import (
11 check_run_type_override,
12 derive_cross_sections,
18 cs = derive_cross_sections(
"Mo")
20 assert cs.scale == pytest.approx(1.0)
21 assert cs.chicc == pytest.approx(CHICC_REF)
22 assert cs.chibb == pytest.approx(CHIBB_REF)
26 cs = derive_cross_sections(
"W")
28 assert cs.scale == pytest.approx((184.0 / 98.0) ** 0.29)
29 assert cs.chicc == pytest.approx(CHICC_REF * cs.scale)
30 assert cs.chibb == pytest.approx(CHIBB_REF * cs.scale)
34 cs = derive_cross_sections(A=181.0)
36 assert cs.scale == pytest.approx((181.0 / 98.0) ** 0.29)
37 assert cs.chicc == pytest.approx(CHICC_REF * cs.scale)
38 assert cs.chibb == pytest.approx(CHIBB_REF * cs.scale)
42 """Passing both is deliberate: an explicit A wins over the "W" preset."""
43 cs = derive_cross_sections(
"W", A=98.0)
45 assert cs.scale == pytest.approx(1.0)
49 cs = derive_cross_sections(A=98.0, chicc=5e-3, chibb=2e-7)
50 assert cs.chicc == 5e-3
51 assert cs.chibb == 2e-7
55 with pytest.raises(ValueError):
56 derive_cross_sections()
60 with pytest.raises(ValueError):
61 derive_cross_sections(A=0)
62 with pytest.raises(ValueError):
63 derive_cross_sections(A=-1.0)
68 check_run_type_override(is_beauty=
False, chicc=1e-3, chibb=
None)
69 check_run_type_override(is_beauty=
True, chicc=
None, chibb=1e-7)
70 check_run_type_override(is_beauty=
False, chicc=
None, chibb=
None)
74 with pytest.raises(ValueError, match=
"beauty run"):
75 check_run_type_override(is_beauty=
True, chicc=1e-3, chibb=
None)
76 with pytest.raises(ValueError, match=
"charm run"):
77 check_run_type_override(is_beauty=
False, chicc=
None, chibb=1e-7)
81 with pytest.raises(ValueError, match=
"only one"):
82 check_run_type_override(is_beauty=
False, chicc=1e-3, chibb=1e-7)
86 cs = derive_cross_sections(
"Mo", sigma_QQ=2 * SIGMA_CC_REF)
87 assert cs.chicc == pytest.approx(2 * CHICC_REF)
88 assert cs.chibb == pytest.approx(CHIBB_REF)
92 cs = derive_cross_sections(
"Mo", sigma_QQ=2 * SIGMA_BB_REF, is_beauty=
True)
93 assert cs.chibb == pytest.approx(2 * CHIBB_REF)
94 assert cs.chicc == pytest.approx(CHICC_REF)
98 assert derive_cross_sections(
"W", sigma_QQ=SIGMA_CC_REF).chicc == pytest.approx(derive_cross_sections(
"W").chicc)
102 assert derive_cross_sections(
"Mo", chicc=1e-3, sigma_QQ=2 * SIGMA_CC_REF).chicc == pytest.approx(1e-3)
106 with pytest.raises(ValueError, match=
"sigma_QQ"):
107 derive_cross_sections(
"W", sigma_QQ=0.0)
111 assert file_is_beauty(5.28)
112 assert not file_is_beauty(1.865)
116 check_input_flavour(
False, file_is_beauty(1.865))
117 check_input_flavour(
True, file_is_beauty(5.28))
121 with pytest.raises(ValueError, match=
"--charm was requested, but the cascade input file holds beauty"):
122 check_input_flavour(
False, file_is_beauty(5.28))
126 with pytest.raises(ValueError, match=
"--beauty was requested, but the cascade input file holds charm"):
127 check_input_flavour(
True, file_is_beauty(1.865))
test_sigma_QQ_scales_the_beauty_reference_for_a_beauty_file()
test_sigma_QQ_reference_value_reproduces_default()
test_w_preset_scales_up()
test_matching_input_flavour_is_accepted()
test_sigma_QQ_scales_the_charm_reference_only()
test_mo_preset_is_reference()
test_file_flavour_from_first_hadron_mass()
test_missing_target_and_A_raises()
test_beauty_run_on_charm_file_raises()
test_override_wrong_run_type_raises()
test_both_overrides_raise()
test_explicit_A_overrides_preset()
test_explicit_ratios_override_derived()
test_sigma_QQ_does_not_override_explicit_chicc()
test_A_without_target_composition()
test_non_positive_A_raises()
test_override_matching_run_type_is_accepted()
test_charm_run_on_beauty_file_raises()