Hello Rene! Rene Brun writes: > TTree::GetEntry (or TBranch::GetEntry) read at the place > indicated by the previous TBranch::SetAddress. It cannot read > and store at multiple addresses. You must call > GetEntry for each address. Thanks. I now maintain a list of all addresses and their names myself and use the first address at different places. BTW, why is that interface that complicated? Wouldn't it be better to have something like "MyEvent* e1 = b->GetAddress();"? What is the reason to need a two-liner with a complicated structure (address of a pointer) here? > Also, in read mode, never do > MyEvent* e1 = new MyEvent(); > b->SetAddress(&e1); > but > MyEvent* e1 = 0; > b->SetAddress(&e1); That contradicts the User's Guide (3.2c), page 256, example "Reading the Tree": | // create a pointer to an event object. This will be used | // to read the branch values. | Event *event = new Event(); | | // get two branches and set the branch address | TBranch *bntrack = t4->GetBranch("fNtrack"); | TBranch *branch = t4->GetBranch("event_split"); | branch->SetAddress(&event); Can this be corrected in the manual? Ole
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:11 MET