I’ve a problem in reading a TTree: I’ve written the following code
TFile f = TFile::Open(“data.root”);
friend_ch = (TTree*)f->Get(“T”);
Double_t SS = -1;
TBranch *branch_entropyQP = 0;
int ret = friend_ch->SetBranchAddress(“entropyQP”, &SS, &branch_entropyQP);
cout<<"S entry 1 “<<SS<<” “<<branch_entropyQP->GetEntries()<<” "<<friend_ch->GetEntries()<<endl;
and it works ONLY if I add the line
otherwise it crashes :
0x8ca48f0 //friend_ch value
3 /ret value
Error: Symbol U��WVS��
�c����� is not defined in current scope (tmpfile):1:
signal(11) Error: Segmentation violation (tmpfile):1:
Press return or process will be terminated in 10 sec by timeout.
FILE:(tmpfile) LINE:1 cint>
entropyQP is a variable in my TTree. I’ve checked in the Tree and the value is correct.
However, when I add Show(1) and I try to exit ROOT, it crashes as well…
Can you help me to understand why, please?
PS I’m not able to read the right value of my variable even using t->MakeSelector()…