[ROOT] char * in TTree

From: Nicolas Produit (Nicolas.Produit@obs.unige.ch)
Date: Thu Jun 05 2003 - 16:25:41 MEST


Hi,

I have a TTree with some char * member.
I want to filter on the value of this char*
according documentation page 263 case 25 and 26
I can use == and strstr and I have to escape the " as \"
This work well most of the case.
But I have sometimes character '+' '-' and ' ' inside the variable.
The parser does not seem to like that.
(  *   Version   3.05/05       21 May 2003   *
on solaris)

Example
root [7] t->Scan("name","strstr(name,\"4U2358\")")
************************
*    Row   *      name *
************************
*        0 * 4U2358+21 *
************************
==> 1 selected entry
(Int_t)1
root [8] t->Scan("name","strstr(name,\"4U2358+\")")

*ERROR 26 :
  Unknown name : ""4U2358"
(Int_t)(-1)
root [9] t->Scan("name","strstr(name,\"4U2358\+\")")

*ERROR 26 :
  Unknown name : ""4U2358"
(Int_t)(-1)
root [10] t->Scan("name","strstr(name,\"XMMU\")")
************************
*    Row   *      name *
************************
*       25 * XMMU J004 *
*       26 * XMMU J004 *
*       28 * XMMU J004 *
*       29 * XMMU J004 *
*       30 * XMMU J004 *
************************
==> 5 selected entries
(Int_t)5
root [11] t->Scan("name","strstr(name,\"XMMU J\")")
************************
*    Row   *      name *
************************
************************
==> 0 selected entries
(Int_t)0

Any way to achieve that?





-- 
Nicolas Produit
INTEGRAL Science Data Center    Phone:  +41 22 950 91 40
16, Chemin d'Ecogia             Fax:    +41 22 950 91 33
CH-1290 Versoix                 www:    http://isdc.unige.ch/



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