RE: using TString in the selection

Valery Fine (fine@bnl.gov)
Tue, 25 May 1999 14:12:47 -0400


>
> 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
>