ReadFileBase

class nndm_library.ReadFileBase(path, recursive=False, ext='.txt', relabel_events=True)[source]

Class to read the labeled data coming in a format like the following:

data1 data2 data3

v11 v12 v13

. . .

. . .

. . .

vn1 vn2 vn3

where data1, data2, … respresent names and vij, a value in the given i row and column dataj.

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

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

  • ext (str) – extension of the files to read

  • relabel_events (bool) – there is an id for each possible event. For instance a collision have an id for it and two sub ids for the particle that interact in it. When relabel_events is True, the values of id are associated unequivocally with each event.

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()[source]

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