Tags: ehellbar/RootInteractive
Tags
PWGPP-485,PWGPP-519 - automatic parsing and check variable using Tool…
…_aliTreePlayer
* Function internally used
# def getAndTestVariableList(expressions, toRemove=None, toReplace=None, tree=None):
getAndTest variable list - decompose expression and extract the list of variables/branches/aliases which should be extracted from trees
:type toReplace: list
:type toRemove: list
:param expressions: - list of expressions
:param toRemove: - list of regular expression to be ignored
:param toReplace: - list of regular expression to be replaced
:param tree: - tree
:return: - list of the trivial expression to export
* Test:
* code:
````
varDraw="meanMIP:meanMIPele:resolutionMIP:xxx"
tooltips=[("MIP","(@meanMIP)"), ("Electron","@meanMIPele"), ("Global status","(@global_Outlier,@global_Warning)"),
("MIP status(Warning,Outlier,Acc.)","@MIPquality_Warning,@MIPquality_Outlier,@MIPquality_PhysAcc")]
widgets="tab.sliders(slider.meanMIP(45,55,0.1,45,55),slider.meanMIPele(50,80,0.2,50,80), slider.resolutionMIP(0,0.15,0.01,0,0.15)),"
widgets+="tab.checkboxGlobal(slider.global_Warning(0,1,1,0,1),checkbox.global_Outlier(0)),"
widgets+="tab.checkboxMIP(slider.MIPquality_Warning(0,1,1,0,1),checkbox.MIPquality_Outlier(0), checkbox.MIPquality_PhysAcc(1))"
toRemove=["^tab\..*"]
toReplace=["^slider.","^checkbox."]
print(getAndTestVariableList([selection,varDraw,widgets,"xxx"],toRemove,toReplace,tree))
````
* output
````
('Not existing tree variable', 'xxx')
{'meanMIP': 1, 'global_Warning': 1, 'MIPquality_Outlier': 1, 'resolutionMIP': 1, 'MIPquality_Warning': 1, 'global_Outlier': 1, 'time': 1, 'meanMIPele': 1, 'MIPquality_PhysAcc': 1}
````
Merge pull request miranov25#4 from miranov25/widgets Widgets - forgotten commits before merging