spine.utils.pid

Module with functions/classes used to identify particle species.

Classes

TemplateParticleIdentifier([use_table, ...])

Class which uses dE/dx templates to do particle identification.

class spine.utils.pid.TemplateParticleIdentifier(use_table=True, use_mpv=False, include_pids=(2, 3, 4, 5), optimize_rr=False, max_rr=100, optimize_orient=True, tracking_mode='step_next', **tracker)[source]

Class which uses dE/dx templates to do particle identification.

The basics of template-based PID are as follows: - Chunk a track into chunks - Identify the dE/dx of the tracks in each chunk - Try to match the dE/dx profile to a known particle template

Methods

__call__(points, depositions, end_point[, ...])

Evaluate the agreement between each PID template and the particle track of interest.

chi2(dedxs, rrs, pid)

Computes a chi2 score given a set of observed/expected dE/dx values.

expected_dedxs(rrs, pid)

Computes the expected dE/dx values given a set of residual ranges.

minimize_rr(dedxs, rrs, pid)

Find the residual range which minimises the chi2 fit between the observed dE/dx values and the spline fit to the template.

minimize_rr(dedxs, rrs, pid)[source]

Find the residual range which minimises the chi2 fit between the observed dE/dx values and the spline fit to the template.

Parameters:
  • dedxs (np.ndarray) –

    1. Measured values of dedxs at a set of unknown residual ranges

  • rrs (np.ndarray) –

    1. Residual ranges assuming the particle came to a complete stop

  • pid (int) – Particle species enumerator

Returns:

  • float – Value of the residual range at the end of the track

  • float – Value of the chi2 for the optimal residual range

chi2(dedxs, rrs, pid)[source]

Computes a chi2 score given a set of observed/expected dE/dx values.

Parameters:
  • dedxs (np.ndarray) –

    1. Measured values of dedxs at a set of known residual ranges

  • rrs (np.ndarray) –

    1. Residual range values (one per track segment)

  • pid (int) – Particle species enumerator

Returns:

Chi2 agreement value

Return type:

float

expected_dedxs(rrs, pid)[source]

Computes the expected dE/dx values given a set of residual ranges.

Parameters:
  • rrs (np.ndarray) –

    1. Residual range values (one per track segment)

  • pid (int) – Particle species enumerator

Returns:

Expected dE/dxs values from a table or the theory

Return type:

np.ndarray