Set a TTreeFormula via SetTitle

Hello,

I would like to initialize a TTreeFormula after it’s declared. I tried (v. 6.12/06):

TTreeFormula f;
//stuff
f.SetName("f");
f.SetTitle("2*x");
f.SetTree(tree);

But I think my change is being ignored: only the parameters passed at declaration TTreeFormula f("f", "...", tree) matter. TTreeFormula::Init is protected, I suppose I need a similar command to make this work. Which one?

Thank you!

As currently implemented TTreeFormula are (essentially) immutable. To get a different formula, you will need to create a new TTreeFormula object.

Cheers,
Philippe.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.