example module

Example of how to use the Reaction Plane Fit package.

Provides example for fitting only the background, or fitting the inclusive signal.

reaction_plane_fit.example.run_background_fit(input_filename: str, user_arguments: Dict[str, Union[bool, float, Tuple[float, float], Tuple[int, int]]]) → Tuple[reaction_plane_fit.fit.ReactionPlaneFit, Dict[str, reaction_plane_fit.fit.FitComponent], Dict[FitType, pachyderm.histogram.Histogram1D], iminuit.Minuit][source]

Run the background example fit.

Parameters:
  • input_filename – Path to the input data to use.
  • user_arguments – User arguments to override the arguments to the fit.
Returns:

(rp_fit, full_components, data, minuit), where rp_fit (fit.ReactionPlaneFit) is the reaction plane

fit object from the fit, full_components is the full set of fit components (one for each RP orientation), data (dict) is the formated data dict used for the fit, and minuit is the minuit fit object.

Return type:

tuple

reaction_plane_fit.example.run_differential_signal_fit(input_filename: str, user_arguments: Dict[str, Union[bool, float, Tuple[float, float], Tuple[int, int]]]) → Tuple[reaction_plane_fit.fit.ReactionPlaneFit, Dict[str, reaction_plane_fit.fit.FitComponent], Dict[FitType, pachyderm.histogram.Histogram1D], iminuit.Minuit][source]

Run the differential signal example fit.

Parameters:
  • input_filename – Path to the input data to use.
  • user_arguments – User arguments to override the arguments to the fit.
Returns:

(rp_fit, full_components, data, minuit), where rp_fit (fit.ReactionPlaneFit) is the reaction plane

fit object from the fit, full_components is the full set of fit components (one for each RP orientation), data (dict) is the formated data dict used for the fit, and minuit is the minuit fit object.

Return type:

tuple

reaction_plane_fit.example.run_fit(fit_object: Type[reaction_plane_fit.fit.ReactionPlaneFit], input_data: Dict[str, Dict[str, Union[Any, pachyderm.histogram.Histogram1D]]], user_arguments: Dict[str, Union[bool, float, Tuple[float, float], Tuple[int, int]]]) → Tuple[reaction_plane_fit.fit.ReactionPlaneFit, Dict[str, reaction_plane_fit.fit.FitComponent], Dict[FitType, pachyderm.histogram.Histogram1D], iminuit.Minuit][source]

Driver function for performing the fit.

Note

Here we just set the resolution parameters to 1 for convenience of the example, but they are an extremely important part of the fit!

Parameters:
  • fit_object – Fit object to be used.
  • data – Input data for the fit, labeled as defined in setup_data().
  • user_arguments – User arguments to override the arguments to the fit.
Returns:

(rp_fit, full_components, data, minuit), where rp_fit (fit.ReactionPlaneFit) is the reaction plane

fit object from the fit, full_components is the full set of fit components (one for each RP orientation), data (dict) is the formated data dict used for the fit, and minuit is the minuit fit object.

Return type:

tuple

reaction_plane_fit.example.run_inclusive_signal_fit(input_filename: str, user_arguments: Dict[str, Union[bool, float, Tuple[float, float], Tuple[int, int]]]) → Tuple[reaction_plane_fit.fit.ReactionPlaneFit, Dict[str, reaction_plane_fit.fit.FitComponent], Dict[FitType, pachyderm.histogram.Histogram1D], iminuit.Minuit][source]

Run the inclusive signal example fit.

Parameters:
  • input_filename – Path to the input data to use.
  • user_arguments – User arguments to override the arguments to the fit.
Returns:

(rp_fit, full_components, data, minuit), where rp_fit (fit.ReactionPlaneFit) is the reaction plane

fit object from the fit, full_components is the full set of fit components (one for each RP orientation), data (dict) is the formated data dict used for the fit, and minuit is the minuit fit object.

Return type:

tuple

reaction_plane_fit.example.setup_data(input_filename: str) → Dict[str, Dict[str, Union[Any, pachyderm.histogram.Histogram1D]]][source]

Setup the example input data.

Read the data using uproot so we can avoid an explicit dependency on ROOT. Histograms are assumed to be named {region}_{orientation} (for example, “signalDominated_inclusive”).

Parameters:input_filename – Path to the input data to use.
Returns:Containing the input data.
Return type:dict