functions module

Based functions shared by all fit implementations.

The fit functions (ie all functions defined here except those to determine_...(...) functions) are called repeatedly for each value in an array by iminuit.

reaction_plane_fit.functions.background_wrapper(phi: float, c: float, resolution_parameters: Dict[str, float], background_function: Callable[[...], float]) → Callable[[...], float][source]

Wrapper around the RPF background function to allow the specification of relevant parameters.

This allows the more standard background function to be used without having to pass these fixed parameters to the function every time.

Parameters:
  • phi (float) – Center of the reaction plane bin. Matches up to phi_s in the RPF paper.
  • c (float) – Width of the reaction plane bin. Matches up to c in the RPF paper.
  • resolution_parameters (dict) – Maps resolution parameters of the form “R22” (for the R_{2,2} parameter) to the value. Expects “R22” - “R82”.
  • background_function (Callable) – Background function to be wrapped.
Returns:

Wrapper around the actual background function with the specified parameters.

Return type:

function

reaction_plane_fit.functions.determine_background_fit_function(rp_orientation: str, resolution_parameters: Dict[str, float], reaction_plane_parameter: base.ReactionPlaneParameter, rp_background_function: Callable[[...], float], inclusive_background_function: Callable[[...], float]) → Callable[[...], float][source]

Determine the background fit function.

For inclusive RP orientations, this is a Fourier series (but may include additional constraints). For other RP orientations, it is an RPF function.

Note

If the RP orientation is inclusive, it is assumed to be labeled as “inclusive”.

Parameters:
  • rp_orientation (str) – The reaction plane orientation.
  • resolution_parameters (dict) – Maps resolution parameters of the form “R22” (for the R_{2,2} parameter) to the value. Expects “R22” - “R82”. Only used for RPF.
  • reaction_plane_parameter (base.ReactionPlaneParameter) – Reaction plane parameters for the selected reaction plane.
  • rp_background_function (function) – RP orientation dependent background fit function.
  • inclusive_background_function (function) – Inclusive RP orientation background fit function.
Returns:

The background function.

Return type:

function

reaction_plane_fit.functions.determine_signal_dominated_fit_function(rp_orientation: str, resolution_parameters: Dict[str, float], reaction_plane_parameter: base.ReactionPlaneParameter, rp_background_function: Callable[[...], float], inclusive_background_function: Callable[[...], float]) → Callable[[...], float][source]

Determine the signal fit function.

This function consists of near-side and away side gaussians representing the signal added to a function to describe the background. For inclusive RP orientations, this is a Fourier series, while for other RP orientations, this is a RPF function.

Parameters:
  • rp_orientation (str) – The reaction plane orientation.
  • resolution_parameters (dict) – Maps resolution parameters of the form “R22” (for the R_{2,2} parameter) to the value. Expects “R22” - “R82”. Only used for RPF.
  • reaction_plane_parameter (base.ReactionPlaneParameter) – Reaction plane parameters for the selected reaction plane.
  • rp_background_function (function) – RP orientation dependent background fit function.
  • inclusive_background_function (function) – Inclusive RP orientation background fit function.
Returns:

The signal fit function.

Return type:

Callable

reaction_plane_fit.functions.fourier(x: float, BG: float, v2_t: float, v2_a: float, v4_t: float, v4_a: float, v1: float, v3: float, **kwargs) → float[source]

Fourier decomposition for use in describing the background.

Note

B was renamed to BG in the args so the argument would be decoupled (ie separate) from the background of the RPF! This is needed because iminuit routes the arguments based on these names.

Parameters:
  • BG (float) – Overall multiplicative background level.
  • v2_t (float) – Trigger v_{2}.
  • v2_a (float) – Associated v_{2}.
  • v4_t (float) – Trigger v_{4}.
  • v4_a (float) – Associated v_{4}
  • v1 (float) – v1 parameter.
  • v3 (float) – v3 parameter.
  • kwargs (dict) – Used to absorbs extra possible parameters from Minuit (especially when used in conjunction with other functions).
Returns:

Values calculated by the function.

Return type:

float

reaction_plane_fit.functions.signal(x: float, A1: float, A2: float, s1: float, s2: float, pedestal: float) → float[source]

Function for fitting the signal region of the reaction plane fit.

The signal function consists of two gaussian peaks (one at the NS (0.0) and one at the AS (np.pi)), along with a pedestal. Gaussians are normalized and are of the form:

\[1/(\sigma*\sqrt(2*\pi) * e^{-(x-0.0)^{2}/(2*\sigma^{2})}\]
Parameters:
  • x (float) – Delta phi value for which the signal will be calculated.
  • A1 (float) – Near-side gaussian amplitude.
  • A2 (float) – Away-side gaussian amplitude.
  • s1 (float) – Near-side gaussian sigma.
  • s2 (float) – Away-side gaussian sigma.
  • pedestal (float) – Pedestal on which the signal sits.
Returns:

Value calculated by the function.

Return type:

float

reaction_plane_fit.functions.signal_wrapper(x: float, ns_amplitude: float, as_amplitude: float, ns_sigma: float, as_sigma: float, signal_pedestal: float, **kwargs) → float[source]

Wrapper for use with iminuit that basically reassigns descriptive parameter names to shorter names.

These shorter names make the function definition less verbose to look and therefore easier to understand.

Parameters:
  • x (float) – Delta phi value for which the signal will be calculated.
  • ns_amplitude (float) – Near-side gaussian amplitude.
  • as_amplitude (float) – Away-side gaussian amplitude.
  • ns_sigma (float) – Near-side gaussian sigma.
  • as_sigma (float) – Away-side gaussian sigma.
  • signal_pedestal (float) – Pedestal on which the signal sits.
  • kwargs (dict) – Used to absorbs extra possible parameters from Minuit (especially when used in conjunction with other functions).
Returns:

Value calculated by the function.

Return type:

float