Dear Rene & Fons, I want to write a routine which fills TClonesArrays of different types by copying data from different BOS banks (i.e. tables ). The best would be to have it done by just one routine. How can I ask an TClonesArray of what type the object are that it stores ? Is there a way to replace the TDverRow, TDtraRow, ... statements in all this routines by a thing determned at runtime? ahoi Jobst void Event::SetDver() { Bank bank("DVER"); if(!bank.is_open()) { fNDver=0; return; } TClonesArray& a = *fDver; for(UInt_t irow=1 ; irow <=bank.nrows() ;irow++) { new (a[irow-1]) TDverRow(bank.rowStart(irow)); } fNDver = bank.nrows(); } void Event::SetDtra() { Bank bank("DTRA"); if(!bank.is_open()) { fNDtra=0; return; } TClonesArray& a = *fDtra; for(UInt_t irow=1 ; irow <=bank.nrows() ;irow++) { new (a[irow-1]) TDtraRow(bank.rowStart(irow)); } fNDtra = bank.nrows(); } :wq
This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:26:22 MET