PCAFlow

class PCAFlow.PCAFlow(n=2, alpha=2, number_subcalc=4)[source]

This class implements the flow analysis with Principal Component Analysis (PCA).

PCAFlow is designed for analyzing anisotropic flow in high-energy nuclear collisions using two-particle correlations. It uses Principal Component Analysis (PCA) to extract flow information from particle data.

This class implements the method proposed in:

The implementation is done in a similar way as in:

Parameters:
nint, optional

The flow harmonic to compute. Must be a positive integer. Default is 2.

alphaint, optional

The order in sub-leading flow up to which the flow is computed. Must be an integer greater than or equal to 1. Default is 2.

number_subcalcint, optional

The number of sub-calculations to estimate the error of the flow. Must be an integer greater than or equal to 2. Default is 4.

Raises:
TypeError

If n, alpha, or number_subcalc is not an integer.

ValueError

If n is not a positive integer, alpha is less than 1, or number_subcalc is less than 2.

Attributes:
n_int

The flow harmonic to compute.

alpha_int

The order in sub-leading flow up to which the flow is computed.

number_subcalc_int

The number of sub-calculations to estimate the error of the flow.

number_events_int or None

The total number of events.

subcalc_counter_int

A counter to keep track of the current sub-calculation.

normalization_None or numpy.ndarray

Normalization factors for each bin.

bin_multiplicity_total_None or numpy.ndarray

Total multiplicity in each bin across all events.

sigma_multiplicity_total_list of numpy.ndarray

List of arrays containing the multiplicity in each bin for each sub-calculation.

number_events_subcalc_None or numpy.ndarray

Number of events used in each sub-calculation.

QnRe_total_None or numpy.ndarray

Real part of the flow vector for each bin across all events.

QnIm_total_None or numpy.ndarray

Imaginary part of the flow vector for each bin across all events.

SigmaQnReSub_total_None or numpy.ndarray

Real part of the flow vector for each bin and sub-calculation.

SigmaQnImSub_total_None or numpy.ndarray

Imaginary part of the flow vector for each bin and sub-calculation.

VnDelta_total_None or numpy.ndarray

Covariance matrix for flow vectors across all events.

SigmaVnDelta_total_None or numpy.ndarray

Covariance matrix for flow vectors for each sub-calculation.

FlowSubCalc_None or numpy.ndarray

An array containing the flow magnitude for sub-calculations.

Flow_None or numpy.ndarray

An array containing the flow magnitude.

FlowUncertainty_None or numpy.ndarray

An array containing the uncertainty of the flow.

Pearson_r_None or numpy.ndarray

An array containing the Pearson correlation between two bins.

Pearson_r_uncertainty_None or numpy.ndarray

An array containing the Pearson correlation uncertainty between two bins.

Methods

differential_flow:

Computes the differential flow.

Pearson_correlation:

Returns the Pearson coefficient and its uncertainty if the flow is already computed.

PCAFlow.differential_flow(particle_data, bins, flow_as_function_of)[source]

Compute the differential flow.

Parameters:
particle_datalist

List of particle data for multiple events.

binslist or np.ndarray

Bins used for the differential flow calculation.

flow_as_function_ofstr

Variable on which the flow is calculated (“pt”, “rapidity” or “pseudorapidity”).

Returns:
list of numpy.ndarrays

A list containing the differential flow and its uncertainty. Each array in the list corresponds:

  • anisotropic flow of order alpha (float): Differential flow magnitude for the bin.

  • anisotropic flow error (float): Error on the differential flow magnitude for the bin.

Notes

  • The flow or the uncertainty can be accessed by: function_return[bin][alpha]

  • If a bin has no events or the uncertainty could not be computed, the corresponding element in the result list is set to np.nan.

PCAFlow.Pearson_correlation()[source]

Retrieve the Pearson correlation coefficient and its uncertainty (Eq. (12), Ref. [1]).

Returns:
list

A list containing the Pearson correlation coefficient and its uncertainty.

  • Pearson_r (numpy.ndarray): The Pearson correlation coefficient for factorization breaking between each pair of bins.

  • Pearson_r_uncertainty (numpy.ndarray): The uncertainty of the Pearson correlation coefficient for factorization breaking between each pair of bins.

Notes

The values in the list can be accessed by name[bin1][bin2].