Objects are either created on the stack or on the heap. The later is done
via "new". Normally stack space is fairly limited so one would never store
n*10**4 hit objects on the stack. The best way to deal with these large
number of recurring objects is by using a TClonesArray to store them in.
See pages 44 and 45 of the just published ROOT tutorial (in part2).
STL classes can store objects (like: vector<hit> vhit) but this is
generally very expensive since each hit in that case is actually passed
by value into the vector (and passing by value causes the hit copy ctor
to be called). Even with STl one would use vector<hit*> or vector<hit&>.
Cheers, Fons.
-- Org: CERN, European Laboratory for Particle Physics. Mail: 1211 Geneve 23, Switzerland Phone: +41 22 7679248 E-Mail: Fons.Rademakers@cern.ch Fax: +41 22 7677910