RE: using TString in the selection

From: Valery Fine (Faine) (fine@bnl.gov)
Date: Tue May 25 1999 - 20:12:47 MEST


> 
>                                                          Protvino, 25-MAY-1999
> 
>     Dear Rooters,
> 
> is it possible to use TString in the selection?
> For example, I have 
>     class Person
>         {
>             TString name;
>             Double_t age;
>             ...
> 
>         }
> 
> and when I make selection 
>         tree.Draw("age","name==Boris") I get error message:

  You can try:
    char buffer selection[1000];
    sprintf(selection,"\"%s\"==\"Boris\",name.Data());
    tree.Draw("age",selection)

    I doubt you can compare to "char *" this way, may be you will need

    sprintf(selection,"strcmp(\"%s\",\"Boris\")",name.Data());
    tree.Draw("age",selection);

    instead.

      Just an idea,
                             Valery   

> *ERROR 26 : 
>  Unknown name : "name"
>         
>             When I was wrong?
>             
>             
>                             Best regards,
>                             Boris
> 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:33 MET