FairShip
Loading...
Searching...
No Matches
heavyFlavourScaling Namespace Reference

Functions

 file_is_beauty (first_hadron_mass)
 check_input_flavour (is_beauty, file_beauty)
 derive_cross_sections (target_composition=None, A=None, chicc=None, chibb=None, sigma_QQ=None, is_beauty=False)
 check_run_type_override (is_beauty, chicc, chibb)
 format_summary (cs, target_composition=None)

Variables

int heavyflavour_Ascale = 1
float mbias_Ascale = 0.71
float A_REF = 98.0
float CHICC_REF = 1.7e-3
float CHIBB_REF = 1.6e-7
float SIGMA_CC_REF = 18.1e-3
float SIGMA_BB_REF = SIGMA_CC_REF * CHIBB_REF / CHICC_REF
dict TARGET_A = {"W": 184.0, "Mo": 98.0}
 CrossSections = namedtuple("CrossSections", ["chicc", "chibb", "A", "scale"])
float BEAUTY_MASS_MIN = 5.0

Detailed Description

Target-composition scaling of charm/beauty over min-bias cross-section ratios.

Shared by ``macro/makeDecay.py`` and ``macro/run_fixedTarget.py`` so the physics
constants and the ``chicc``/``chibb`` derivation live in a single place.

Function Documentation

◆ check_input_flavour()

heavyFlavourScaling.check_input_flavour ( is_beauty,
file_beauty )
Reject a run type (``--charm``/``--beauty``) that disagrees with the flavour of the cascade input file.

The generator takes the flavour from the file, so a mismatch would scale the wrong cross section.

Definition at line 36 of file heavyFlavourScaling.py.

36def check_input_flavour(is_beauty, file_beauty):
37 """Reject a run type (``--charm``/``--beauty``) that disagrees with the flavour of the cascade input file.
38
39 The generator takes the flavour from the file, so a mismatch would scale the wrong cross section.
40 """
41 if is_beauty != file_beauty:
42 requested = "beauty" if is_beauty else "charm"
43 found = "beauty" if file_beauty else "charm"
44 raise ValueError(f"--{requested} was requested, but the cascade input file holds {found}")
45
46

◆ check_run_type_override()

heavyFlavourScaling.check_run_type_override ( is_beauty,
chicc,
chibb )
Reject a cross-section override that does not match the run type.

A run is either charm or beauty, so at most one of ``chicc``/``chibb`` is
meaningful. Passing the wrong one (or both) is a mistake and raises
``ValueError`` with a clear message rather than being silently ignored.

Definition at line 73 of file heavyFlavourScaling.py.

73def check_run_type_override(is_beauty, chicc, chibb):
74 """Reject a cross-section override that does not match the run type.
75
76 A run is either charm or beauty, so at most one of ``chicc``/``chibb`` is
77 meaningful. Passing the wrong one (or both) is a mistake and raises
78 ``ValueError`` with a clear message rather than being silently ignored.
79 """
80 if chicc is not None and chibb is not None:
81 raise ValueError("Set only one of --chicc / --chibb; a run is either charm or beauty.")
82 if is_beauty and chicc is not None:
83 raise ValueError("This is a beauty run: pass --chibb, not --chicc.")
84 if not is_beauty and chibb is not None:
85 raise ValueError("This is a charm run: pass --chicc, not --chibb.")
86
87

◆ derive_cross_sections()

heavyFlavourScaling.derive_cross_sections ( target_composition = None,
A = None,
chicc = None,
chibb = None,
sigma_QQ = None,
is_beauty = False )
Return default-scaled chicc/chibb, honouring explicit overrides.

``A`` overrides the ``target_composition`` preset; ``chicc``/``chibb``
override the target-derived value when not ``None``. Supply either
``target_composition`` (a known preset) or an explicit ``A``.
``sigma_QQ`` is the cross section per nucleon [mb] of the cascade input
file, and rescales the reference probability of the flavour that file
holds: beauty for ``is_beauty``, charm otherwise.

Definition at line 47 of file heavyFlavourScaling.py.

47def derive_cross_sections(target_composition=None, A=None, chicc=None, chibb=None, sigma_QQ=None, is_beauty=False):
48 """Return default-scaled chicc/chibb, honouring explicit overrides.
49
50 ``A`` overrides the ``target_composition`` preset; ``chicc``/``chibb``
51 override the target-derived value when not ``None``. Supply either
52 ``target_composition`` (a known preset) or an explicit ``A``.
53 ``sigma_QQ`` is the cross section per nucleon [mb] of the cascade input
54 file, and rescales the reference probability of the flavour that file
55 holds: beauty for ``is_beauty``, charm otherwise.
56 """
57 if A is None:
58 if target_composition is None:
59 raise ValueError(f"Provide either target_composition (one of {sorted(TARGET_A)}) or an explicit A.")
60 A = TARGET_A[target_composition]
61 if A <= 0:
62 raise ValueError(f"Invalid target mass number A={A}. Must be > 0.")
63 if sigma_QQ is not None and sigma_QQ <= 0:
64 raise ValueError(f"Invalid cross section sigma_QQ={sigma_QQ}. Must be > 0.")
65 scale = (A / A_REF) ** (heavyflavour_Ascale - mbias_Ascale)
66 cc_ref = CHICC_REF if sigma_QQ is None or is_beauty else CHICC_REF * sigma_QQ / SIGMA_CC_REF
67 bb_ref = CHIBB_REF * sigma_QQ / SIGMA_BB_REF if sigma_QQ is not None and is_beauty else CHIBB_REF
68 chicc = chicc if chicc is not None else cc_ref * scale
69 chibb = chibb if chibb is not None else bb_ref * scale
70 return CrossSections(chicc, chibb, A, scale)
71
72

◆ file_is_beauty()

heavyFlavourScaling.file_is_beauty ( first_hadron_mass)
Flavour of a cascade input file as FixedTargetGenerator sees it, from the mass [GeV] of its first hadron.

Definition at line 31 of file heavyFlavourScaling.py.

31def file_is_beauty(first_hadron_mass):
32 """Flavour of a cascade input file as FixedTargetGenerator sees it, from the mass [GeV] of its first hadron."""
33 return first_hadron_mass > BEAUTY_MASS_MIN
34
35

◆ format_summary()

heavyFlavourScaling.format_summary ( cs,
target_composition = None )
One human-readable summary of the derived cross-section ratios.

Definition at line 88 of file heavyFlavourScaling.py.

88def format_summary(cs, target_composition=None):
89 """One human-readable summary of the derived cross-section ratios."""
90 label = target_composition or "custom (A given)"
91 return (
92 f"Target composition: {label}, A={cs.A}, "
93 f"scale=(A/{A_REF})^({heavyflavour_Ascale}-{mbias_Ascale})={cs.scale:.4f}\n"
94 f"Derived cross-section ratios: chicc={cs.chicc:.3e}, chibb={cs.chibb:.3e}"
95 )

Variable Documentation

◆ A_REF

float heavyFlavourScaling.A_REF = 98.0

Definition at line 17 of file heavyFlavourScaling.py.

◆ BEAUTY_MASS_MIN

float heavyFlavourScaling.BEAUTY_MASS_MIN = 5.0

Definition at line 28 of file heavyFlavourScaling.py.

◆ CHIBB_REF

float heavyFlavourScaling.CHIBB_REF = 1.6e-7

Definition at line 19 of file heavyFlavourScaling.py.

◆ CHICC_REF

float heavyFlavourScaling.CHICC_REF = 1.7e-3

Definition at line 18 of file heavyFlavourScaling.py.

◆ CrossSections

heavyFlavourScaling.CrossSections = namedtuple("CrossSections", ["chicc", "chibb", "A", "scale"])

Definition at line 26 of file heavyFlavourScaling.py.

◆ heavyflavour_Ascale

int heavyFlavourScaling.heavyflavour_Ascale = 1

Definition at line 14 of file heavyFlavourScaling.py.

◆ mbias_Ascale

float heavyFlavourScaling.mbias_Ascale = 0.71

Definition at line 15 of file heavyFlavourScaling.py.

◆ SIGMA_BB_REF

float heavyFlavourScaling.SIGMA_BB_REF = SIGMA_CC_REF * CHIBB_REF / CHICC_REF

Definition at line 23 of file heavyFlavourScaling.py.

◆ SIGMA_CC_REF

float heavyFlavourScaling.SIGMA_CC_REF = 18.1e-3

Definition at line 22 of file heavyFlavourScaling.py.

◆ TARGET_A

dict heavyFlavourScaling.TARGET_A = {"W": 184.0, "Mo": 98.0}

Definition at line 24 of file heavyFlavourScaling.py.