Leaf

salam
i tried again with this simple example after reading tree4 i find this code
event->Addname of leafs that i need to added
i tried to use it but there was error message that said

non class,struct,union object values used with . or -> <1>
please what this mean and what should i do

thanks in advanced

TFile f("ht.root","recreate");

TTree* mytree = new TTree("mytree","Test Tree");

TH1D* h = new TH1D("h","h",10,0,1);

Double_t values[5] = {0,0,0,0,0};
Double_t values1[3]={0,0,0};

TBranch *b2 = mytree->Branch("b2",values, "a/D:b:c:d:e");

TBranch *b1 = mytree->Branch("b1",values1, "a/D:b:c");

 
values->Addb1; 


values[0] = 10; values[3] = -3.14;  values[2] = 3;
values1[0] = 10; values1[3] = -3.14;  values1[2] = 3;

mytree->Fill();

f.Write();

comment out “values->Addb1;”
‘values’ is an array of doubles, not a class w/ method “Addb1”

do this and then ‘root -l ht.root’ and you can look at the values in your test tree with the TBrowser. cheers