AlbertoPdRF / root-file-viewer

View ROOT files directly in VS Code!
https://marketplace.visualstudio.com/items?itemName=albertopdrf.root-file-viewer
MIT License
47 stars 5 forks source link

When Nans are stored in TBranch, VS code does not display the branch at all #25

Closed abhijitm08 closed 1 year ago

abhijitm08 commented 1 year ago

When a TBranch has a value of Nan stored (due to failing fits, etc), VS code does not display the branch at all.

Screenshot 2023-07-24 at 13 27 36

To get around this one has to apply a cut TRUEPT != TMath::QuiteNan().

Screenshot 2023-07-24 at 13 37 19

I believe this is not an issue when plotting with plain ROOT TBrowser but when displaying within VS code.

Would appreciate it if this could be fixed.

AlbertoPdRF commented 1 year ago

Hi @abhijitm08 and thanks for opening the issue! Could you provide a sample ROOT File so I can reproduce this? Thanks!

abhijitm08 commented 1 year ago

@AlbertoPdRF Thank you for the quick response. The ROOT file is at the CERN box. I just noticed that the CERN box ROOT viewer has the same behaviour as VS code browser.

When I do: tree->Draw("Branch1"), I get:

Screenshot 2023-07-24 at 15 09 34

When I open TBrowser t, I get:

Screenshot 2023-07-24 at 15 16 57

In VS code and the CERN box ROOT viewer I get:

Screenshot 2023-07-24 at 15 09 40

AlbertoPdRF commented 1 year ago

I can also replicate the issue online in https://jsroot.gsi.de/latest/api.htm#url_syntax_open_file, so I'm CC'ing @linev.

linev commented 1 year ago

Yes, NaN values where not handled correctly with TTree::Draw. Now fixed in dev and 7.4 branch.

abhijitm08 commented 1 year ago

Yes, NaN values where not handled correctly with TTree::Draw. Now fixed in dev and 7.4 branch.

Thank you for the reply. Would be awesome if this gets fixed in the new release of root-file-viewer.

linev commented 1 year ago

Now available with https://github.com/root-project/jsroot/releases/tag/7.4.2 release

AlbertoPdRF commented 1 year ago

Awesome @linev! I'll publish a release with JSROOT v7.4.2 soon 🚀