RE: [ROOT] aliases for tree variables

From: Philippe Canal (pcanal@fnal.gov)
Date: Mon Jun 30 2003 - 17:55:08 MEST


Hi Valeri,

This is a good idea.   The CVS repository has been updated to add support for such alias.  They can be used as follow:

	tree->SetAlias("x1","(tdc1[1]-tdc1[0])/49");
	tree->SetAlias("y1","(tdc1[3]-tdc1[2])/47");
	tree->SetAlias("x2","(tdc2[1]-tdc2[0])/49");
	tree->SetAlias("y2","(tdc2[3]-tdc2[2])/47");
	tree->Draw("y2-y1:x2-x1");

Note that the aliases have been added to the TTree object so that they can be persistent (with the tree) if you choose.

Also note that the alias are not checked for validity until they are used in a Draw or Scan command.

Cheers,
Philippe.

-----Original Message-----
From: Valeri Tioukov [mailto:Valeri.Tioukov@na.infn.it]
Sent: Tuesday, June 24, 2003 4:22 AM
To: Philippe Canal
Cc: roottalk
Subject: RE: [ROOT] aliases for tree variables


On Mon, 23 Jun 2003, Philippe Canal wrote:

> Hi Valeri,
>
> One of the many ways:
> 	TString x = "tdc1[1]-tdc1[0]/49";
> 	TString y = "tdc1[3]-tdc1[2]/47";
> 	tree->Draw(y+"%"+x);

I would prefere smth like:

TTreeViewer v(tree);
v.AddAlias("x1","(tdc1[1]-tdc1[0])/49");
v.AddAlias("y1","(tdc1[3]-tdc1[2])/47");
v.AddAlias("x2","(tdc2[1]-tdc2[0])/49");
v.AddAlias("y2","(tdc2[3]-tdc2[2])/47");
v.Draw("y2-y1:x2-x1");

In viewer there is gui for moreless similar functionality, but it is not alwais
convenient (as in the above case for example) to drag many variables by the
scring.

May be there is already API to this funtions? It is not obvious from the
documentation.

Regards,
Valeri

>
> Cheers,
> Philippe.
>
> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
> [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Valeri Tioukov
> Sent: Monday, June 23, 2003 8:32 AM
> To: roottalk
> Subject: [ROOT] aliases for tree variables
>
>
> Hi Rooters,
>
> What is the simpliest way to get in root the same effect
> as I can do in paw with lines:
>
> alias/cre x tdc1[1]-tdc1[0]/49
> alias/cre y tdc1[3]-tdc1[2]/47
> nt/pl 1.y%x
>
> Regards
> Valeri
>
>
> #################################################################
> #################################################################
> #################################################################
> #####
> #####
> #####
> #################################################################
> #################################################################
> #################################################################
>
>



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET