Linear Collider Forum

Home » Software Tools » LCIO » Strange behaviour of LCEvent::takeCollection()
Strange behaviour of LCEvent::takeCollection() [message #1660] Sun, 07 December 2008 12:18 Go to previous message
Messages: 125
Registered: July 2005
Location: CERN

the behaviour of LCEvent::takeCollection() is not as I expected.
The ownership is transferred correctly, but
  • the collection stays in the event I took it from.
  • the collection is set to transient.

If I take the collection away from the event I would expect that the collection is removed from the event. And I can't call removeCollection() since this deletes the collection from memory. This definitely is a bug since an event which gave away the ownership must not delete the collection.

That fact that it is set transient is also not very helpful, since I want to add it to another event (compose an event from several subevents) and write it to disc. So I remove the transient flag which means it will also be non-transient in the subevent I took it from. Currently this is not a problem since I delete the subevent, which correctly does not delete the collections that don't belong to it.

Here are my proposals for improvement:
  • If it is desired that the taken collection stays in the source object, the removeCollection() should be modified so the collection which does no longer belong to the event is not deleted.
  • In any case the transientness of the collection should not be modified. One could modify the streamer so only collections belonging to the event are written to disc.



Martin Killenberg

Read Message
Read Message
Previous Topic:stdehepjob fails on 64 bit
Next Topic:confusion about memory issues.
Goto Forum:

Current Time: Sat Feb 22 10:43:23 Pacific Standard Time 2020
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software