Modules
load_geometry(file_path, tree_name)
¶
Load geometry from a ROOT file into a pandas DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
The path to the ROOT file. |
required |
tree_name
|
str
|
The name of the tree to load. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A pandas DataFrame containing the loaded geometry. |
Raises:
| Type | Description |
|---|---|
Exception
|
If coordinate branches have not been set before loading geometry. |
Source code in pygeosimplify/io/geo_handler.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
plot_geometry(df, ax=None, layer_list=None, eta_range=None, phi_range=None, axis_labels=None, color=None, unit_scale=1, cell_energy_col=None, unit_scale_energy=1, energy_label='Cell Energy', color_map='gist_heat_r')
¶
Plot the geometry based on the provided DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The DataFrame containing the geometry data. |
required |
ax
|
Axes3D
|
The 3D axes to plot on. If not provided, a new figure and axes will be created. |
None
|
layer_list
|
list[int]
|
The list of layers to consider. If not provided, all layers will be considered. |
None
|
eta_range
|
list
|
The range of eta values to filter the data. If not provided, the default range is [-5, 5]. |
None
|
phi_range
|
list
|
The range of phi values to filter the data. If not provided, the default range is [0, np.pi]. |
None
|
axis_labels
|
list
|
The labels for the x, y, and z axes. If not provided, the default labels are ["x", "y", "z"]. |
None
|
color
|
str
|
The color to use for the cells. If not provided, colors will be automatically assigned based on the layers. |
None
|
unit_scale
|
float
|
The scale factor for the unit of measurement. Default is 1. |
1
|
cell_energy_col
|
str
|
The name of the column containing the cell energy values. If provided, the cells will be colored based on the energy values. |
None
|
unit_scale_energy
|
float
|
The scale factor for the unit of measurement of the cell energy. Default is 1. |
1
|
energy_label
|
str
|
The label for the colorbar when cell energy is used. Default is "Cell Energy". |
'Cell Energy'
|
color_map
|
str
|
The colormap to use when coloring the cells based on energy values. Default is "gist_heat_r". |
'gist_heat_r'
|
Returns:
| Name | Type | Description |
|---|---|---|
Axes3D |
Axes3D
|
The 3D axes object containing the plot. |
Source code in pygeosimplify/vis/geo.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |