ReadLhe

class nndm_library.ReadLhe(path, particle_ids=None, var_of_interest=None, outgoing=False, recursive=False, relabel_events=True, verbose=1)[source]

Class to read the data coming in lhe format. By default it will read all the particles. Filters used apply to the such default data.

Parameters
  • path (string) – the direction to the file containing all the events information.

  • partcile_ids (list of integers) – ids of the particles to extract from the file according to the pdg, By default: None, which means exctract all the particles.

  • var_of_interest (list of strings) – names of the variables to extract from the lhe. eg. [“e”,”angle”], [“e”,”px”,”py”] …. By default: None, which means exctract all the variables.

  • outgoing (bool) – filtrate to obtain all the outgoing particles

  • files_dir (string) – directory where the files are to be found

  • recursive (bool) – read all the .lhe files found in all paths inside a given files_dir

  • verbose (bool) – show progress reading all the .lhe files

Variables
  • data – dataframe with the read events

  • files_dir – directory with the name of the files read and its id

add_angle(axes=['px', 'py', 'pz'], angle_axis='pz')

Calculate the angle of the particles starting from a list of the form [px, py, pz]. This with respect to the “axis” element.

extract_params_from_path()

Format is as follows: {particle_name}_{param1}_{value1}_{param2}_{value2}_{param3}_{value3}*.lhe An example would be eta_decay_events_mk_0.38_eps2_5.404557191441203e-07.lhe.

Returns

dictionary with all extracted data