RE: [ROOT] TTree::Draw selection with Char_t

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri Nov 30 2001 - 21:04:04 MET


Hi Ingo,

In ROOT 3.02/04 and below, you also can use an UChar_t (usigned char) 
instead of the Char_t you use.  

The main issue is that there is some confusion on how TTree::Draw detect
whether a data member is a C-style string or not.  The current algorithm
is to say that anything that is a Char_t, a Char_t* or a Char_t[] is a 
string.  We will be changing this behavior (in ROOT 3.02/05) to consider
ONLY the Char_t* without any size indication in their comment to be 
a C-style string.  All other combination of Char_t will be consider a
number or an array of number.

Cheers,
Philippe

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Ingo Strauch
Sent: Friday, November 23, 2001 11:18 AM
To: Roottalk
Subject: [ROOT] TTree::Draw selection with Char_t


Hi ROOTers!

I have the following problem with ROOT version 3.00/06 on linux:

I have a TTree with a branch "Ivtyp" that contains a Char_t to store
small numbers (0 to 2).

If I do

  mytree->Draw("Ivtyp")

for a given file I get a histogram that contains about 50% zeros and 50%
rest.

I now want to select e.g. only entries where the variable equals one. So
I do

  mytree->Draw("Ivtyp","Ivtyp==1")

but this gives the same result as the above command.

To me it seems that Char_t variables cannot be used to select if they
are treated as numbers. Is there a workaround? Can it be fixed? Or is
the only way to use Short_t instead?

Many thanks,
Ingo

-- 
"What're quantum mechanics?"
"I don't know. People who repair quantums I suppose."
                                     --Rincewind, Terry Pratchett "Eric"



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:10 MET