Hi Ryosuke, The CDF experiments has been using a similar mechanism that I coded a while back. We will add this mechanism to the CVS repository sometime next week. Please note that there is a few limitations and that the coding is not trivial. If you need this feature sooner let me know and I will send a patch (and explanations). Cheers, Philippe. -----Original Message----- From: owner-roottalk@pcroot.cern.ch [mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Ryosuke Itoh Sent: Tuesday, April 22, 2003 8:57 PM To: roottalk@pcroot.cern.ch Cc: itoh@balpha03.kek.jp Subject: [ROOT] porting of one entry to other process Dear ROOTers, I'm now working on the migration of ROOT I/O into our analysis framework BASF for Belle experiment. This framework has a special feature of parallel processing on an SMP server based on event data distribution to multiple UNIX processes via shared mem. To utilize this mechanism with ROOT, we need a scheme to cut out a serialized stream of single "entry" (=event) on a TBranch, put it on the shared mem, and migrate it into a TBranch on a separate UNIX process. Does anyone know how to "cut out" a seriarized stream of single entry? I tried following code (by mimicing the code in TBranch), however, it did not work at all. Any idea on this? Actually, I'm quite new to ROOT and the following code is my first attempt to understand the internal structure of ROOT. So the code might be completely stupid one. If so, I'm sorry for my too superficial understanding. Thanks in advance, - R.Itoh, KEK ...... TBranch::Fill() should be called before this code TBranch* branch = ..... branch containing event data int entry = (int)branch->GetEntries(); entry--; // minus 1 to point last entry int* entrylist = branch->GetBasketEntry(); int basketid = branch->GetWriteBasket(); TBasket* basket = branch->GetBasket ( basketid ); int first = entrylist[basketid]; printf ( "entry = %d, basketid = %d, first = %d basketadrs = %x\n", entry, basketid, first, basket ); TBuffer *buf = basket->GetBufferRef(); int bufbegin = basket->GetEntryPointer ( entry-first ); int* displacement = basket->GetDisplacement(); if ( displacement ) buf->SetBufferDisplacement(displacement[entry-first]); else buf->SetBufferDisplacement(); printf ( "bufbegin = %d, length = %d\n", bufbegin, buf->Length() ); m_nbytes = buf->Length() - bufbegin; // this buffer should contain serialized whole "one event" m_buf = (char*) malloc ( m_nbytes ); buf->WriteBuf ( m_buf, m_nbytes ); ----------------------------------------------------------------------- Ryosuke Itoh / 伊藤 領介 Insutitute of Particle and Nuclear Studies High Energy Accelerator Research Organization e-mail : ryosuke.itoh@kek.jp ----------------------------------------------------------------------- ################################################################# ################################################################# ################################################################# ##### ##### ##### ################################################################# ################################################################# #################################################################
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET