MultiParticlePtCorrelations
- class MultiParticlePtCorrelations.MultiParticlePtCorrelations(max_order: int)[source]
Compute multi-particle transverse momentum correlations and cumulants up to the 8th order. This class is based on the following paper:
For the computation of transverse momentum correlations and cumulants, the implementation closely follows the equations and methods described in Ref. [1].
- Parameters:
- max_orderint
Maximum order of correlations and cumulants to compute (must be between 1 and 8).
Examples
A demonstration of how to use the MultiParticlePtCorrelations class to calculate transverse momentum correlations and cumulants.
1>>> from sparkx import * 2>>> 3>>> # Maximum order for correlations and cumulants 4>>> max_order = 8 5>>> # Create a MultiParticlePtCorrelations object 6>>> corr_obj = MultiParticlePtCorrelations(max_order=max_order) 7>>> 8>>> # List of events, where each event is a list of particle objects 9>>> particle_list = Jetscape("./particles.dat").particle_object_list() 10>>> 11>>> # Compute mean transverse momentum correlations 12>>> mean_pt_correlations = corr_obj.mean_pt_correlations(particle_list_all_events) 13>>> print(mean_pt_correlations) 14>>> 15>>> # Compute mean transverse momentum cumulants 16>>> mean_pt_cumulants = corr_obj.mean_pt_cumulants(particle_list_all_events) 17>>> print(mean_pt_cumulants)
- Attributes:
- mean_pt_correlationnp.ndarray, optional
Mean transverse momentum correlations for each order up to max_order.
- mean_pt_correlation_errornp.ndarray, optional
Error estimates (if computed) for mean transverse momentum correlations.
- kappanp.ndarray, optional
Mean transverse momentum cumulants for each order up to max_order.
- kappa_errornp.ndarray, optional
Error estimates (if computed) for mean transverse momentum cumulants.
- N_eventslist
List to store numerators (N) of correlations for each event.
- D_eventslist
List to store denominators (D) of correlations for each event.
Methods
mean_pt_correlations:
Computes the mean transverse momentum correlations for each order k across all events.
mean_pt_cumulants:
Computes the mean transverse momentum cumulants for each order k from the correlations.
- MultiParticlePtCorrelations.mean_pt_correlations(particle_list_all_events: List[List[Particle]], compute_error: bool = True, delete_fraction: float = 0.4, number_samples: int = 100, seed: int = 42) ndarray | Tuple[ndarray, ndarray] [source]
Computes mean transverse momentum correlations for each order up to max_order using Eq. [14] in Ref. [1]. The weight is chosen to be \(W^{\prime}_{m} = D\langle m\rangle_{p_{\mathrm{T}}}\).
- Parameters:
- particle_list_all_eventslist
List of events, where each event is a list of particle objects.
- compute_errorbool, optional
Whether to compute error estimates (default is True).
- delete_fractionfloat, optional
Fraction of data to delete for jackknife method (default is 0.4).
- number_samplesint, optional
Number of jackknife samples (default is 100).
- seedint, optional
Random seed for reproducibility (default is 42).
- Returns:
- np.ndarray or tuple
Mean transverse momentum correlations for each order. If compute_error is True, returns a tuple (mean_pt_correlation, mean_pt_correlation_error).
- Raises:
- TypeError
If delete_fraction is not a float. If number_samples is not an integer. If seed is not an integer. If compute_error is not a boolean.
- ValueError
If delete_fraction is not between 0 and 1. If number_samples is not greater than 0.
- MultiParticlePtCorrelations.mean_pt_cumulants(particle_list_all_events: List[List[Particle]], compute_error: bool = True, delete_fraction: float = 0.4, number_samples: int = 100, seed: int = 42) ndarray | Tuple[ndarray, ndarray] [source]
Computes the mean transverse momentum cumulants for each order k from Eqs. B9-B16 in Ref. [1].
- Parameters:
- particle_list_all_eventslist
List of events, where each event is a list of particle objects.
- compute_errorbool, optional
Whether to compute error estimates (default is True).
- delete_fractionfloat, optional
Fraction of data to delete for jackknife method (default is 0.4).
- number_samplesint, optional
Number of jackknife samples (default is 100).
- seedint, optional
Random seed for reproducibility (default is 42).
- Returns:
- np.ndarray or tuple
Mean transverse momentum cumulants for each order. If compute_error is True, returns a tuple (kappa, kappa_error).
- Raises:
- TypeError
If delete_fraction is not a float. If number_samples is not an integer. If seed is not an integer. If compute_error is not a boolean.
- ValueError
If delete_fraction is not between 0 and 1. If number_samples is not greater than 0.