Read a String from TTree (Root File)

_ROOT Version: 6.08
_Platform:Linux Ubuntu
Compiler: Not Provided

Goog Morning to all of you,

I need to read a string type from a TTree but I’m not able to do it.

I creted a root file saving the string “DateTime” as follows:

I tried to read this information in another file, reading a root file as:
Char_t Mystring;
CR->SetBranchAddress(“DateTime”, &Mystring);

I dodn’t have any compilation error, but in the code I’m not able to read the string.
If I try to print the Mystring value this is an empty value.

Can someone help me?

Kind regards,

Hi @dgiordan,
here is a review of different methods you can use to read values from a ROOT file.
Another method is what @Wile_E_Coyote suggested: creating an analysis skeleton, fill in your logic and run the resulting program.

Hope this helps!

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