mlreco.iotools.parsers.particles module

mlreco.iotools.parsers.particles.parse_particles(particle_event, cluster_event, voxel_coordinates=True)[source]

A function to copy construct & return an array of larcv::Particle.

If voxel_coordinates is set to True, the parser rescales the truth positions (start, end, etc.) to voxel coordinates.

schema:
  particles:
    parser: parse_particles
    args:
      particle_event: particle_pcluster
      cluster_event: cluster3d_pcluster
      voxel_coordinates: True
Configuration
  • particle_event (larcv::EventParticle)

  • cluster_event (larcv::EventClusterVoxel3D) – to translate coordinates

  • voxel_coordinates (bool)

Returns

a python list of larcv::Particle objects

Return type

list

mlreco.iotools.parsers.particles.parse_neutrinos(neutrino_event, cluster_event, voxel_coordinates=True)[source]

A function to copy construct & return an array of larcv::Neutrino.

If voxel_coordinates is set to True, the parser rescales the truth position information to voxel coordinates.

schema:
  neutrinos:
    parser: parse_neutrinos
    args:
      neutrino_event: neutrino_mpv
      cluster_event: cluster3d_pcluster
      voxel_coordinates: True
Configuration
  • neutrino_pcluster (larcv::EventNeutrino)

  • cluster3d_pcluster (larcv::EventClusterVoxel3D) – to translate coordinates

  • voxel_coordinates (bool)

Returns

a python list of larcv::Neutrino objects

Return type

list

mlreco.iotools.parsers.particles.parse_particle_points(sparse_event, particle_event, include_point_tagging=True)[source]

A function to retrieve particles ground truth points tensor, returns points coordinates, types and particle index. If include_point_tagging is true, it includes start vs end point tagging.

schema:
  points:
    parser: parse_particle_points
    args:
      sprase_event: sparse3d_pcluster
      particle_event: particle_pcluster
      include_point_tagging: True
Configuration
  • sparse3d_pcluster (larcv::EventSparseTensor3D)

  • particle_pcluster (larcv::EventParticle)

  • include_point_tagging (bool)

Returns

  • np_voxels (np.ndarray) – a numpy array with the shape (N,3) where 3 represents (x,y,z) coordinate

  • np_values (np.ndarray) – a numpy array with the shape (N, 2) where 2 represents the class of the ground truth point and the particle data index in this order. (optionally: end/start tagging)

mlreco.iotools.parsers.particles.parse_particle_coords(particle_event, cluster_event)[source]

Function that returns particle coordinates (start and end) and start time.

This is used for particle clustering into interactions

schema:
  coords:
    parser: parse_particle_coords
    args:
      particle_event: particle_pcluster
      cluster_event: cluster3d_pcluster
Configuration
  • particle_pcluster (larcv::EventParticle)

  • cluster3d_pcluster (larcv::EventClusterVoxel3D) – to translate coordinates

Returns

Shape (N,8) containing: [first_step_x, first_step_y, first_step_z, last_step_x, last_step_y, last_step_z, first_step_t, shape_id]

Return type

numpy.ndarray

mlreco.iotools.parsers.particles.parse_particle_graph(particle_event, cluster_event=None)[source]

A function to parse larcv::EventParticle to construct edges between particles (i.e. clusters)

If cluster_event is provided, it also removes edges to clusters that have a zero pixel count and patches subsequently broken parentage.

schema:
  graph:
    parser: parse_particle_graph
    args:
      particle_event: particle_pcluster
      cluster_event: cluster3d_pcluster
Configuration

particle_pcluster (larcv::EventParticle)

Returns

a numpy array of directed edges where each edge is (parent,child) batch index ID.

Return type

np.ndarray

See also

parse_particle_graph_corrected

in addition, remove empty clusters.

mlreco.iotools.parsers.particles.parse_particle_singlep_pdg(particle_event)[source]

Get each true particle’s PDG code.

schema:
  pdg_list:
    parser: parse_particle_singlep_pdg
    args:
      particle_event: particle_pcluster
Configuration

particle_event (larcv::EventParticle)

Returns

List of PDG codes for each particle in TTree.

Return type

np.ndarray

mlreco.iotools.parsers.particles.parse_particle_singlep_einit(particle_event)[source]

Get each true particle’s true initial energy.

schema:
  einit_list:
    parser: parse_particle_singlep_pdg
    args:
      particle_event: particle_pcluster
Configuration

particle_event (larcv::EventParticle)

Returns

List of true initial energy for each particle in TTree.

Return type

np.ndarray