Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading slice with TTree Draw #10

Open
ebusato opened this issue Oct 11, 2016 · 2 comments
Open

Reading slice with TTree Draw #10

ebusato opened this issue Oct 11, 2016 · 2 comments
Assignees

Comments

@ebusato
Copy link

ebusato commented Oct 11, 2016

Hi Seb,

Writing slices of int or float64 to a TTree using croot seems to work fine, however, accessing those variables with TTree::Draw doesn't work. Is there a way to fix this ?

Emmanuel

@sbinet sbinet self-assigned this Oct 12, 2016
@sbinet
Copy link
Member

sbinet commented Oct 12, 2016

hum...

the following interactive ROOT session worked for me:

root [0] auto f = TFile::Open("event.root");
Warning in <TClass::Init>: no dictionary for class Event is available
Warning in <TClass::Init>: no dictionary for class Det is available
Warning in <TClass::Init>: no dictionary for class golang::goslice<double> is available

root [1] auto t = (TTree*)f->Get("tree");
root [2] t->Draw("evt.I:evt.S.Data");
Info in <TCanvas::MakeDefCanvas>:  created default TCanvas with name c1
![data](https://cloud.githubusercontent.com/assets/1070920/19312978/13f224a4-9095-11e6-9409-d2e268186dd5.png)

where event.root was generated with:
https://github.com/go-hep/examples/blob/master/croot/go-croot-ex-tree-02/main.go

my ROOT version: ROOT 6.06/08
(not sure if that's important.)
what's yours?

PS: I have attached the plot for t->Draw("evt.S.Data");

@sbinet
Copy link
Member

sbinet commented Oct 12, 2016

data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants