EventCharacteristics
- class EventCharacteristics.EventCharacteristics(event_data: List[Particle] | ndarray[Any, dtype[object_]] | Lattice3D)[source]
This class computes event-by-event characteristics, e.g., eccentricities or certain densities.
- Parameters:
- event_data: list, numpy.ndarray or Lattice3D
List or array containing particle objects for one event, or a lattice containing the relevant densities.
Examples
1>>> from sparkx.Oscar import Oscar 2>>> from sparkx.EventCharacteristics import EventCharacteristics 3>>> 4>>> OSCAR_FILE_PATH = [Oscar_directory]/particle_lists.oscar 5>>> 6>>> # Oscar object containing all events 7>>> oscar = Oscar(OSCAR_FILE_PATH).particle_objects_list() 8>>> 9>>> # compute epsilon2 for the first event 10>>> event_characterization = EventCharacteristics(oscar[0]) 11>>> eps2 = event_characterization.eccentricity(2, weight_quantity = "number")
- Attributes:
- event_data_: list, numpy.ndarray or Lattice3D
List or array containing particle objects for one event, or a lattice containing the relevant densities.
- has_lattice_: bool
Contains information if characteristics are derived from a lattice or particles
Methods
set_event_data:
Overwrites the event data.
eccentricity:
Computes the spatial eccentricity.
eccentricity_from_particles:
Computes the spatial eccentricity from particles.
eccentricity_from_lattice:
Computes the spatial eccentricity from a 3D lattice.
generate_eBQS_densities_Milne_from_OSCAR_IC:
Generates energy, baryon, charge, and strangeness densities in Milne coordinates.
generate_eBQS_densities_Minkowski_from_OSCAR_IC:
Generates energy, baryon, charge, and strangeness densities in Minkowski coordinates.
- EventCharacteristics.set_event_data(event_data: List[Particle] | ndarray[Any, dtype[object_]] | Lattice3D) None [source]
Overwrites the event data.
- Parameters:
- event_datalist, numpy.ndarray, or Lattice3D
List or array containing particle objects for one event, or a lattice containing the relevant densities.
- Raises:
- TypeError
If the input is not a list or numpy.ndarray when deriving characteristics from particles. If at least one element in the input is not of type Particle.
- EventCharacteristics.eccentricity(harmonic_n: int, harmonic_m: int | None = None, weight_quantity: str = 'energy') complex [source]
Computes the spatial eccentricity.
\[\varepsilon_{m,n}e^{\mathrm{i}n\Phi_{m,n}} = -\frac{\lbrace{r^{m}e^{\mathrm{i}n\phi}\rbrace}}{\lbrace{r^{m}\rbrace}}\]For harmonic_n=1, \(n=3\) is used. If harmonic_m is provided, then the given value is used as radial exponent.
- Parameters:
- harmonic_nint
The harmonic order for the eccentricity calculation.
- harmonic_mint, optional
The power of the radial weight.
- weight_quantitystr, optional
The quantity used for particle weighting. Valid options are “energy”, “number”, “charge”, “baryon”, “strangeness”. Default is “energy”.
- Returns:
- complex
The complex-valued eccentricity.
- Raises:
- ValueError
If the harmonic order is less than 1.
- EventCharacteristics.generate_eBQS_densities_Milne_from_OSCAR_IC(x_min: float, x_max: float, y_min: float, y_max: float, z_min: float, z_max: float, Nx: int, Ny: int, Nz: int, n_sigma_x: float, n_sigma_y: float, n_sigma_z: float, sigma_smear: float, eta_range: list | tuple, output_filename: str, IC_info: str | None = None) None [source]
Generates energy, baryon, charge, and strangeness densities in Milne coordinates from OSCAR initial conditions.
The total energy in GeV can be obtained by integrating the energy density with \(\tau \mathrm{d}x\mathrm{d}y\mathrm{d}\eta\).
- Parameters:
- x_min, x_max, y_min, y_max, z_min, z_maxfloat
Minimum and maximum coordinates in the x, y, and z directions.
- Nx, Ny, Nzint
Number of grid points in the x, y, and z directions.
- n_sigma_x, n_sigma_y, n_sigma_zfloat
Width of the smearing in the x, y, and z directions in units of sigma_smear.
- sigma_smearfloat
Smearing parameter for particle data.
- eta_rangelist, tuple
A list containing the minimum and maximum values of spacetime rapidity (eta) and the number of grid points.
- output_filenamestr
The name of the output file where the densities will be saved.
- IC_infostr
A string containing info about the initial condition, e.g., collision energy or centrality.
- Returns:
- None
- Raises:
- TypeError
If the given IC_info is not a string and if the class is initialized with a lattice.
- EventCharacteristics.generate_eBQS_densities_Minkowski_from_OSCAR_IC(x_min: float, x_max: float, y_min: float, y_max: float, z_min: float, z_max: float, Nx: int, Ny: int, Nz: int, n_sigma_x: float, n_sigma_y: float, n_sigma_z: float, sigma_smear: float, output_filename: str, IC_info: str | None = None) None [source]
Generates energy, baryon, charge, and strangeness densities in Minkowski coordinates from OSCAR initial conditions.
The total energy in GeV can be obtained by integrating the energy density with \(\mathrm{d}x\mathrm{d}y\mathrm{d}z\).
- Parameters:
- x_min, x_max, y_min, y_max, z_min, z_maxfloat
Minimum and maximum coordinates in the x, y, and z directions.
- Nx, Ny, Nzint
Number of grid points in the x, y, and z directions.
- n_sigma_x, n_sigma_y, n_sigma_zfloat
Width of the smearing in the x, y, and z directions in units of sigma_smear.
- sigma_smearfloat
Smearing parameter for particle data.
- output_filenamestr
The name of the output file where the densities will be saved.
- IC_infostr
A string containing info about the initial condition, e.g., collision energy or centrality.
- Returns:
- None
- Raises:
- TypeError
If the given IC_info is not a string and if the class is initialized with a lattice.