TCut and TString

In root 5, it was easy to declare a TCut and assign the value from a TString. In root 6 this is not working.
Error: error: no viable conversion from ‘TString’ to ‘TCut’
Other thing is, in root 5, if we write TString::Format("Something > %g", doubleVar); works but TString::Format("%s > %g", string, doubleVar); doesn’t work. Can you please tell me, how to do these things?

Try:

TString::Format("%s > %g", string.Data(), doubleVar);

BTW. Rename your “string” into something else (you may also get another problems when your “string” gets confused with the “std::string” class).

Thanks for help. It is working well in root5. Do you have any idea about what should I write to convert a TString variable in TCut variable?

Like I show, use: someTString->Data()

Oh! That works. I forget to see that. Thanks a lot.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.