Re: Seg Fault when adding collections [message #2212 is a reply to message #2206] |
Wed, 15 February 2012 09:15   |
gaede Messages: 233 Registered: January 2004 Location: DESY, Hamburg |
|
|
|
hi tony,
as far as I can see there are a few issues with your code:
- you should not use setsubset with collections of elements that you created -> this will result in corrupt LCIO files
(l.278)
- a memory leak in ee_Durham_Jet_Finder_Exclusive (l. 158):
you create a new particle on the heap every time you combine two particles but in the end you only add n jet particles to the collection
-> you need to delete the intermediate ReconstrucetParticles (possibly in CombineParticles)
- the follwoing will result in an undefined pointer in the LCIO file (if the vector is empty the first element is undefined):
if(p1_particles.size()==0)
{
jet->addParticle( p1_particles[0] );
}
hope this helps to find your problem.
Cheers, Frank.
|
|
|