Re: request of function to get Nval in TFormula
Rene Brun (Rene.Brun@cern.ch)
Fri, 28 Aug 1998 16:30:45 +0200
Ye Shuwei wrote:
>
> Dear ROOT teams,
>
> Would you please provided a new function in class of TFormula to get
> the number of different variables occurs ?
>
> We use ntuple format itself instead of ntuple-converted(via h2root) root
> file as input for display. TTree allows user to impose cuts via TTreeFormula,
> and I want to emulate the similar feature for ntuple while keeping the
> advantage of reading only variables appeared in the cut expression. So I need
> have a function to get the list of different variables appeared in the cut
> expression. If I know fNval, I can write such function.
>
> for (int i=0; i<fcut->GetNval(); i++) {
> fcut->GetLeaf(i)->GetBranch()->GetName();
> ...
> }
> where fcut is an object of TTreeFormula which derives from TFormula.
>
This is a good point. I will add this function in the next release.
The existing data member being named fNcodes, I will call this
function TTreeFormula::GetNcodes() for consistency.
> In addition, I found that TApplication::StartIdleing() and StopIdleing()
> do not work under interactive ROOT, I have not checked for batch mode. So I
> have to use RemoveIdleTimer each time when I want to stop the IdleTimer, and
> use SetIdleTimer to restart IdleTimer. I checked the corresponding source
> code, it should work.
>
Fons will reply to this last point
Rene Brun