icehgcal

HGCAL functions.

icehgcal.common

load_root_file(root_path, ids=None, entry_start=0, entry_stop=None, maxevents=None, args=None)[source]

(HGCAL-CND)

Loads the root files

Parameters:

root_path – paths to root files (list)

Returns:

columnar data Y: class labels W: event weights ids: columnar variable string (list) info: trigger and pre-selection acceptance x efficiency information (dict)

Return type:

X

process_root(rootfile, tree, load_ids, isMC, entry_start, entry_stop, maxevents, args)[source]

(HGCAL-CND)

process_tracklet_data(args, X)[source]

(HGCAL-TRK)

read_data_tracklet(args, runmode)[source]

(HGCAL-TRK)

splitfactor(x, y, w, ids, args)[source]

(HGCAL-CND)

Transform data into different datatypes.

Parameters:
  • data – jagged arrays

  • args – arguments dictionary

Returns:

dictionary with different data representations

icehgcal.graphio

compute_edge_attr(data)[source]
get_node_features(p4vec, num_nodes, num_node_features, coord)[source]
parse_graph_data_candidate(X, ids, features, graph_param, Y=None, weights=None, entry_start=None, entry_stop=None, EPS=1e-12, null_value=-999.0)[source]

EVENT LEVEL (PROCESSING CANDIDATES)

Jagged array data into pytorch-geometric style Data format array.

Parameters:
  • X – Jagged array of variables

  • ids – Variable names as an array of strings

  • features – List of active global feature strings

  • graph_param – Graph construction parameters dict

  • Y – Target class array (if any, typically MC only)

  • weights – (Re-)weighting array (if any, typically MC only)

Returns:

List of pytorch-geometric Data objects

parse_graph_data_trackster(data, graph_param, weights=None, maxevents=1000000000, null_value=-999.0)[source]

TRACKSTER LEVEL

Parse graph data to torch geometric format

Parameters:

data – awkward array

icehgcal.preprocess

compute_edges(trk_data, ass_data, gra_data, edge_index, edge_labels, edge_qualities, graph_param)[source]

Logic based on (but refined): https://github.com/Abhirikshma/HackathonLinking/blob/master/firstModelAndTraining.ipynb

Returns:

node, edge, edge_labels

create_trackster_data(files)[source]
event_loop(files, graph_param, maxevents=1000000000)[source]