[ROOT] Hashing

From: Alberto Pulvirenti (alberto.pulvirenti@ct.infn.it)
Date: Tue Nov 06 2001 - 15:06:49 MET


Dear all,

given that I didn't succeed in finding the correct solution for my 
problem, I will expose it to all of you, to find the skilled one who 
knows how to solve it.

I must create a collection class to store object of a class I created 
which is, essentially, an experimental point of a detector. This 
detector (ALICE ITS) is made of 6 sensible layers, so, for each point, i 
get not only its coordinates, but also its layer.

Then, I must use these points to create some simple segments, linking 
them in couples, for each couple which satisfies some criterions.
Just to know which is the criterion, I can say that I need that two 
points differ by 1 in the layer value (it's integer), and not more than 
a certain value in the phi and theta polar coordinates.
Because I have to deal with many points, I would like to organize them 
in a mesh, divided in sectors with respect to the azymuthal (phi) angle, 
in order to have a fast retrieving of only the points I need. But the 
only collection class I am able to use well i the TObjArray, so I was 
obliged to construct, in my class, objects like " TObjArray **fUnits[6]" 
  say a pointer for a matrix of TObjArrays. It seems too strange that 
there isn't a method to organize these points in a better way. I am sure 
that it's possible to use a collection class (that I don't know) where I 
can store all points maintaining a criterion to find the ones which are 
contained at least in a certain layer and a certain phi sector, in order 
to avoid to confront all the couples that are certainly not linkable. 
And all this without the terrible memory leaks that I had in my previous 
trials...

I hope to have been clear in my explanation.
I have guessed a solution: tha THashTable, but I'm not sure that It 
could work well for me, because (you can believe it?) I don't know well 
in what consists the "hashing" of a collection. If there is someone who 
uses these particular collections (maps, haslists, etc.), I will be 
grateful for knowing how they work, and for which kind of problems they 
are used.

Thanks

Alberto



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:06 MET