GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » Question about using pointers to fill TClonesArray
Re: Question about using pointers to fill TClonesArray [message #17679 is a reply to message #17672] Thu, 18 December 2014 20:58 Go to previous messageGo to previous message
Tobias Stockmanns is currently offline  Tobias Stockmanns
Messages: 489
Registered: May 2007
first-grade participant
From: *netcologne.de
Dear Martin (and Klaus),

the new with placement creates a pointer at a position inside a TClonesArray. The owner of this object is the TClonesArray fTrackCandArray, myCand is a pointer pointing at the same memory position of the newly created PndTrackCand and is used to add some more information.

fTrackCandArray has to be deleted otherwise you will have in the next event still the PndTrackCands from the prvious event. This is done in the FinishEvent() method where the Delete() of the TClonesArrays is called.

I hope it gets a bit more clear but the TClonesArrays are a bit tricky to handle.

Cheers and a Merry Christmas,

Tobias
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [FIXED] fts/FtsTracking/PndFtsHoughSpace.h::ExportTH2S() declared but not implemented
Next Topic: [FIXED] Memory leak in PndSttHitProducerRealFull / PndFtsHitProducerRealFull?
Goto Forum:
  


Current Time: Mon Oct 07 19:18:06 CEST 2024

Total time taken to generate the page: 0.00760 seconds