Dear Rene, I applied the proposed corrections but they seems have no effect at all. > Numbering in ROOT and C++ starts at 0, not 1. If you replace the 2 > lines: It is correct of cause but nor 1 nor 0 newer happend in this example in fact the lowest tracks number was around 500 in MainEvent. I made available the code of the example at: http://chorusdq.na.infn.it/r/MainEvent.cxx all my lines are marked as //VT http://chorusdq.na.infn.it/r/branch1.root - the result with 1 branch http://chorusdq.na.infn.it/r/branch2.root - the result with 2 branches Thank you for your help Valeri > > Tioukov Valeri wrote: > > > > Dear rooters, > > > > I have 2 TObjArrays and after some selections I need to store objects > > from them into the different branches of the tree. > > > > When I have just one branch it works fine. If I add the second all tree > > leaves are filled by zeros. > > > > To illustrate a problem I added the following lines into > > test/MainEvent.cxx: > > > > // Create one event > > .... > > Track *track1 = new Track(); > > Track *track2 = new Track(); > > .... > > TTree *tree2 = new TTree("T2","My example of a ROOT tree"); > > tree2->Branch("track1", "Track", &track1, bufsize,split); //1-st branch > > tree2->Branch("track2", "Track", &track2, bufsize,split); //2-d branch > > .... > > > > // inside the event cycle: > > > > if( event->GetNtrack()>1) { > > track1 = (Track*)event->GetTracks()->UncheckedAt(1); > > track2 = (Track*)event->GetTracks()->UncheckedAt(2); > > if (write) tree2->Fill(); > > } > > > > .... > > > > If I just comment the line belongs to one branch the tree filling > > correctly. > > > > What is wrong here? > > > > Best regards > > Valeri Tioukov >
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:29 MET