void Example() { TFile *fp = new TFile("parameters_ru98RIV0309_R1.root","RECREATE"); TTree *TREE = new TTree("TREE","data from ru98RIV0309_R1"); TREE->ReadFile("parameters_ru98RIV0309_R1.txt","PeakArea:PeakError"); TREE->Scan(); TREE->Show(0); Double_t P1A1 = TREE->GetLeaf("PeakArea")->GetValue(0); Double_t P1eA1 = TREE->GetLeaf("PeakError")->GetValue(0); printf("P1A1 = %d P1eA1= %d\n", P1A1, P1eA1); TREE->Show(1); TREE->GetEvent(1); Double_t P2A1 = TREE->GetLeaf("PeakArea")->GetValue(1); Double_t P2eA1 = TREE->GetLeaf("PeakError")->GetValue(1); printf("P2A1 = %d P2eA1= %d\n", P2A1, P2eA1); TREE->Show(2); Double_t P3A1 = TREE->GetLeaf("PeakArea")->GetValue(2); Double_t P3eA1 = TREE->GetLeaf("PeakError")->GetValue(2); printf("P3A1 = %d P3eA1= %d\n", P3A1, P3eA1); }