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

[Feature] A branch renaming function? #146

Closed
Moelf opened this issue Feb 10, 2022 · 4 comments
Closed

[Feature] A branch renaming function? #146

Moelf opened this issue Feb 10, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@Moelf
Copy link
Member

Moelf commented Feb 10, 2022

Symbol("STDMTruthTausAuxDyn.classifierParticleOrigin") is crazy branch name and it includes a dot...

@tamasgal tamasgal added the enhancement New feature or request label Feb 10, 2022
@aminnj
Copy link
Member

aminnj commented Feb 10, 2022

Ttrees have a SetAlias function that lets it map a convenient alias to a branch expression and I think these are stored in fAliases. I agree this could be nice. Especially a lazy expression evaluator :) like a pt column lazily constructed from px py columns on the fly.

@Moelf
Copy link
Member Author

Moelf commented Feb 10, 2022

one thing I want is normalizenames like in CSV.jl, which would convert dot to _. As for renaming, DataFrames.jl uses rename!()

@Moelf
Copy link
Member Author

Moelf commented Feb 10, 2022

https://root.cern.ch/doc/master/classTTree.html#a7c505db0d8ed56b5581e683375eb78e1

Alias allows formula,

tree->SetAlias("x1","(tdc1[1]-tdc1[0])/49");

I think the natural translation to Julia would be:

setalias!(tree, :tdc1 => ( x-> (x[2]-x[1])/49) => :x1)

taking inspiration from https://dataframes.juliadata.org/stable/lib/functions/#DataFrames.combine

but too convoluted, don't feel like useful enough LOL

@Moelf
Copy link
Member Author

Moelf commented Apr 8, 2023

implemented in #225 with a slightly different interface (rename at creation time)

@Moelf Moelf closed this as completed Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants