-
Notifications
You must be signed in to change notification settings - Fork 9
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
More cosmetic and usability changes #25
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Pere for this nice PR. It's great you find how to implement a generic get function to retrieve objects from the TFile
. I've added some comments about improvements.
brMuon_pt = Branch(tree, "Muon_pt[nMuon]", Muon_pt, 32000, 99) | ||
brMuon_eta = Branch(tree, "Muon_eta[nMuon]", Muon_eta, 32000, 99) | ||
brMuon_phi = Branch(tree, "Muon_phi[nMuon]", Muon_phi, 32000, 99) | ||
nMuon = Ref{Int32}(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get the purpose of the change. We don't necessarily know in advance the maximum size of a collection.
The example was showing how to do in case of variable length collection.
I think the original example should be kept.
src/demo.jl
Outdated
@@ -13,6 +13,6 @@ function demo() | |||
FillRandom(h, "gaus") | |||
c = ROOT.TCanvas() | |||
Fit(h, "gaus") | |||
c | |||
Draw(c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to return 'c' to keep a reference to the TCanvas, which otherwise can be garbage collected at any time.
Why the call to 'Draw()'? Call to 'Fit' already triggers a draw, at least on Linux. Does the behaviour differ on mac (I don't have the possibility to test it)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored original code. Confirmation that the canvas is plotted on MacOS is needed.
@peremato can you review the changes I made and tell me if they are ok for you? |
fc474b8
to
eb75743
Compare
9ecc35f
to
7d0a95b
Compare
…File. The methods returns now an instance of the object, of proper type, instead of a Ptr{TObjet}. getproperty is also implemented with the same effect as the Get method, to provide object access with the dot notation, `file.objet`. Code from commit c10c8e028cc29837f765aeeb4cb717c8c45392e4 of ROOT.jl-generator Co-authored-by: Philippe Gras <[email protected]>
Added extra usability functions:
This allows to get all sort of objects from a
TFile