[ROOT] Can I check the variable expression in TTree?

From: Miroslav Helbich (helbich@mail.desy.de)
Date: Mon Jun 24 2002 - 19:41:40 MEST


Hi all and developers,

  is there any way to figure out if the variable expression and data
selection string are O.K. in 

TTree::Draw(const char* varexp, char* selection, Option_t* option, Int_t
nentries= 1000000000, Int_t firstentry = 0)         

and what dimensional histogram is going to be drawn?

 I am sometimes writing the classes which pass this arguments
from user (or are created inside the code). Is there any way to figure out
if this will perform O.K. before passing this to the TTree::Draw()?

 There must be some parsing already coded in.


If not than maybe some functions like the following would be useful.

 bool CheckSelection(char* selection)
 int CheckVarexp(char* varexp)
 // return 0 if wrong
 // return 1 if 1 dim histogram is drawn
 // return 2 if 2 dim histogram is drawn
 // return 3 if 3 dim histogram is drawn 
+ some other variables depnding on wheter it is going to be draw to
predefined histogram Draw("Energy>>histo") or to event list etc.

                                Miro Helbich



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:58 MET