15 #include <unordered_map> 26 const unsigned int nlvl = 6;
27 if(depth < nlvl)
return 0;
30 static std::unordered_map<const TGeoNode*, int> nodemap;
33 for(
unsigned int i = depth-nlvl;
i <= depth; ++
i){
34 auto it = nodemap.find(n[
i]);
35 if(
it == nodemap.end()){
37 int mapsize = nodemap.size()+1;
38 nodemap[n[
i]] = mapsize;
42 if(nodemap.size() == 512){
43 std::cout <<
"NodesToUniqueId: Number of unique TGeoNodes exceeds 511." 44 <<
" Need to fix the logic here. Abort." <<
std::endl;
52 if(
id > ULLONG_MAX/512){
CellUniqueId NodesToUniqueId(const std::vector< const TGeoNode * > &n, unsigned int depth)
Give every cell in the geometry a unique ID number based on the TGeo path to the node.
unsigned long long int CellUniqueId