miranov25 / RootInteractive

5 stars 12 forks source link

Problem with the alias primitive atan2 an unit #283

Closed miranov25 closed 1 year ago

miranov25 commented 1 year ago

There is an problem defining using alias and the atan2 alias - the translation looks to be not working

aliasArray=[
#    ("","dNprimdx*padLength"),     # ionization over pad
    ("Unit","1+0*(QMax_Clusters_Mean>0)"),
    ("phi","arctan2(gy,gx)"),

-> Atan2

(function anonymous(gy,gx
) {
"use strict";
return Math.atan2(gygx)
})

Unit - was failing - I had to write vectorized version

miranov25 commented 1 year ago

Unit test OK

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
------------------------------------------------------------------------------------------------ JSON report ------------------------------------------------------------------------------------------------
report saved to: test6.json
================================================================================= 37 passed, 7 warnings in 74.16s (0:01:14) =================================================================================

real    1m15.655s
user    14m9.104s
sys     0m55.316s
miranov25 commented 1 year ago
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
------------------------------------------------------------------------------------------------ JSON report ------------------------------------------------------------------------------------------------
report saved to: test6.json
====================================================================================== 37 passed, 7 warnings in 58.35s ======================================================================================

real    0m59.750s
user    13m4.512s
sys     0m44.424s
miranov25 commented 1 year ago

The realistic use case is also working. Merging

http://127.0.0.1:8889/notebooks/ATO-611/tpcCalibrationQA.ipynb
variables+=["Unit","IDC0_OK","1"]