def get_frame(tree_name, file_name): frame = RDataFrame(tree_name, file_name) if verbose: colNames = frame.GetColumnNames() for j in colNames: print(j) return frame
def get_frame(tree_name, file_name): """ Getter of the frame from the file """ frame = RDataFrame(tree_name, file_name) if verbose: colNames = frame.GetColumnNames() for j in colNames: print(j) return frame
def get_frame(file_name, df_index=0, tree_name="O2mcparticle_001"): """ Getter of the frame from the file """ if not path.isfile(file_name): raise ValueError("Did not find AOD file", file_name) sub_names = run_cmd(f"rootls {file_name}").strip().split() df_name = [] for i in sub_names: if not i.startswith("DF_") and not i.startswith("TF_"): continue df_name.append(i) df_name = df_name[df_index] print(df_name) frame = RDataFrame(f"{df_name}/{tree_name}", file_name) if verbose: colNames = frame.GetColumnNames() for j in enumerate(colNames): print(j, frame.GetColumnType(j[1])) return frame