TreeChain SetAlias and AddFriend branches

17 views
Skip to first unread message

Daniel Böckenhoff

unread,
Aug 21, 2015, 10:51:26 AM8/21/15
to rootpy dev
Hi everyone!

After I opened a tree from a file with a TreeChain (t = TreeChain("t",filePath)) , I want to set an alias.

It returns True

        >>> t.SetAlias("chiliX","distP + distD")
        True

but i get an ROOTError when drawing:

        loc='TTreeFormula::Compile', msg=' Bad numerical expression : "chiliX"

and also Branches added with

        t.AddFriend("tP",filePathPromptFriend)

are not known when drawing.

Could someone comment? I am very excited about finding everything I ever dreamed of in rootpy, so I hope to make this work.

Cheers,

Daniel


Noel Dawe

unread,
Sep 4, 2015, 2:30:33 AM9/4/15
to rootp...@googlegroups.com
Hi Daniel,

Catching up on email after vacation. Sorry for the lack of response earlier.

At this time, TreeChain is really only intended to replace TChain in the context of looping on an entry-by-entry basis. Simple Draw()s are also fine, but SetAlias and AddFriend will not work as intended since __getattr__ is really delegating those method requests to the currently active (first) tree in the chain.

Sorry about that. For now, I'd suggest sticking with TChain for anything involving aliases or friends.

Best,
Noel

--
You received this message because you are subscribed to the Google Groups "rootpy dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rootpy-dev+...@googlegroups.com.
To post to this group, send email to rootp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rootpy-dev/c0851919-1131-41d4-bf64-c3fa78b04fe1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages