I have a class, Hit, with two members referencing to a
TClonesArray collection of Cluster:
class Hit : public TObject {
[…]
//! p-side cluster reference (Y).
TRef pCluster;
//! n-side cluster reference (X).
TRef nCluster;
[…]
}
(Clearly, when I store this class in a TTree I ask the creation of the
TBranchRef branch)
When I read the structure with an analysis program I see that the
dereference operation Hit.pCluster.GetObject() begins to be slow
when the number of events stored is big (let’s say 1000).
Now I’m using a faster operation that is pCluster.GetPID()->GetObjectWithID(pCluster.GetUniqueID())
but I’m not sure that this operation is safe.
Any suggestion?
Thanks,
Alberto