Code for the interactive sttistical aggregation and visualisation of multidimensional data in ROOT or native Python formats (Panda, numpy).
Support for ROOT data structures:
Root and PyRoot (AliRoot/O2) data structures could be used as input data sources. However, the code also works with pandas only, without the need to have the ROOT package installed. Internally, these data structures are converted into the Bokeh CDS (ColumnDataSource) or in our RootInteractive CDS for the NDimensional histograms, projections and aggregated information.
The figure array declaration is used as an argument in bokehDrawSA to create an array of figures/graphs/scatter plots/ Unbined or binned (Ndimension histogram and derived statistics/projection) bokeh data sources and derived variables and aggregated statistics can be used for drawing.
The declarative programming used in bokehDrawSA is a type of coding where developers express the computational logic without having to programme the control flow of each process. This can help simplify coding, as developers only need to describe what they want the programme to achieve, rather than explicitly prescribing the steps or commands required to achieve the desired result.
The interactive visualization is declared in the 6 arrays as ine the example bellow
bokehDrawSA.fromArray(df, None, figureArray, widgetParams, layout=figureLayoutDesc, tooltips=tooltips, parameterArray=parameterArray,
widgetLayout=widgetLayoutDesc, sizing_mode="scale_width", nPointRender=300,
aliasArray=aliasArray, histogramArray=histoArray,arrayCompression=arrayCompression)
figureArray = [
[['A'], ['A*A-C*C'], {"size": 2, "colorZvar": "A", "errY": "errY", "errX":"0.01"}],
[['A'], ['C+A', 'C-A', 'A/A']],
[['B'], ['C+B', 'C-B'], { "colorZvar": "colorZ", "errY": "errY", "rescaleColorMapper": True}],
[['D'], ['(A+B+C)*D'], {"colorZvar": "colorZ", "size": 10, "errY": "errY"} ],
[['D'], ['D*10'], {"errY": "errY"}],
{"size":"size", "legend_options": {"label_text_font_size": "legendFontSize"}}
]
histoArray = [
{"name": "histoABC", "variables": ["(A+C)/2", "B", "C"], "nbins": [8, 10, 12], "weights": "D", "axis": [0], "sum_range": [[.25, .75]]},
]
figureArray = [
[['bin_center_1'], ['mean']],
[['bin_center_1'], ['sum_0']],
[['bin_center_1'], ['std']],
{"source": "histoABC_0", "colorZvar": "bin_center_2", "size": 7}
]
aliasArray = [
# They can also be used as selection (boolen) used e.g. for histogram weights
{
"name": "C_accepted",
"variables": ["C"],
"parameters": ["C_cut"],
"func": "return C < C_cut"
},
# User-defined JS columns can also be created in histograms by specifying the context (CDS) parameter
{
"name": "efficiency_A",
"variables": ["entries", "entries_C_cut"],
"func": "return entries_C_cut / entries",
"context": "histoA"
},
# Shorthand notation - only for scalar functions
("effC", "entries_C_cut / bin_count", "histoAC"),
]
layout = {
"A": [
[0, 1, 2, {'commonX': 1, 'y_visible': 1, 'x_visible':1, 'plot_height': 300}],
{'plot_height': 100, 'sizing_mode': 'scale_width', 'y_visible' : 2}
],
"B": [
[3, 4, {'commonX': 1, 'y_visible': 3, 'x_visible':1, 'plot_height': 100}],
{'plot_height': 100, 'sizing_mode': 'scale_width', 'y_visible' : 2}
]
}
widgetLayoutKine=[
["dca0","tgl","qPt","ncl"],
["dEdxtot","dEdxmax","mTime0"],
["hasA","Run","IR","isMC"],
{'sizing_mode': 'scale_width'}
]
widgetLayoutDesc={
"Select":widgetLayoutKine,
"Histograms":[["nbinsX","nbinsY", "varX","yAxisTransform"], {'sizing_mode': 'scale_width'}],
"Legend": figureParameters['legend']['widgetLayout'],
"Markers":["markerSize"]
}
arrayCompressionParam=[(".*conv.*Sigma.*",[("relative",7), ("code",0), ("zip",0), ("base64",0)]),
(".*delta.*",[("relative",10), ("code",0), ("zip",0), ("base64",0)]),
(".*i2.*",[("relative",7), ("code",0), ("zip",0), ("base64",0)]),
(".*",[("relative",8), ("code",0), ("zip",0), ("base64",0)])]
Sevearal ALICE use case (detector calibration, QA/QC)
Support material for RCU note [N2]
Support material for V0 reconstruction studies [P1]
QA and production preparation :
PID
Fast MCkalman and event display
Space charge distortion calibration