Hi All,
I'm working with a geometry and need to assign unique read out channel numbers to the lowest level nodes in my geometry. I thought I could use the "gGeoManager->GetCurrentNodeId()" to map each detector cell uniquely to an integer, but when I do that, I discover that my geometry has duplicate ID numbers (that is, TGeoNodes located along different paths that return the same ID number). Perhaps I am misinterpreting what is meant my the NodeId's?
Looking at the code that assigns NodeId's it seems to me that duplicate ID's are expected:
Int_t TGeoNodeCache::GetNodeId() const
{
// Get unique node id.
Long_t id=0;
for (Int_t level=0;level<fLevel+1; level++)
id += (Long_t)fNodeBranch[level];
return (Int_t)id;
}
This sum which defines id's has an obvious degeneracy when fNodeBranch [0,1] = 1,2 and fNodeBranch[0,1] = 2,1. That's oversimplified, of course, since the fNodeBranch[]'s are pointers, but other such degeneracies must exist.
Any tips on how to efficiently map a geometry path to a single ID number?
Thanks,
Mark
Mark Messier messier_at_indiana.edu Department of Physics http://www.physics.indiana.edu/~messier Indiana University Phone: (812) 855-0236 Bloomington, IN 47405 Fax: (812) 855-0440Received on Mon Jul 23 2007 - 18:10:06 CEST
This archive was generated by hypermail 2.2.0 : Mon Jul 23 2007 - 23:50:02 CEST