|
15 | 15 | /// \author Luca Barioglio, University and INFN of Torino |
16 | 16 |
|
17 | 17 | #include "ITSMFTReconstruction/LookUp.h" |
| 18 | +#include "DataFormatsITSMFT/CompCluster.h" |
18 | 19 |
|
19 | 20 | ClassImp(o2::itsmft::LookUp); |
20 | 21 |
|
@@ -68,27 +69,24 @@ int LookUp::groupFinder(int nRow, int nCol) |
68 | 69 | int LookUp::findGroupID(int nRow, int nCol, const unsigned char patt[ClusterPattern::MaxPatternBytes]) const |
69 | 70 | { |
70 | 71 | int nBits = nRow * nCol; |
71 | | - // Small topology |
72 | | - if (nBits < 9) { |
| 72 | + if (nBits < 9) { // Small unique topology |
73 | 73 | int ID = mDictionary.mSmallTopologiesLUT[(nCol - 1) * 255 + (int)patt[0]]; |
74 | 74 | if (ID >= 0) { |
75 | 75 | return ID; |
76 | | - } else { //small rare topology (inside groups) |
77 | | - int index = groupFinder(nRow, nCol); |
78 | | - auto res = mDictionary.mGroupMap.find(index); |
79 | | - return res == mDictionary.mGroupMap.end() ? -1 : res->second; |
| 76 | + } |
| 77 | + } else { // Big unique topology |
| 78 | + unsigned long hash = ClusterTopology::getCompleteHash(nRow, nCol, patt); |
| 79 | + auto ret = mDictionary.mCommonMap.find(hash); |
| 80 | + if (ret != mDictionary.mCommonMap.end()) { |
| 81 | + return ret->second; |
80 | 82 | } |
81 | 83 | } |
82 | | - // Big topology |
83 | | - unsigned long hash = ClusterTopology::getCompleteHash(nRow, nCol, patt); |
84 | | - auto ret = mDictionary.mCommonMap.find(hash); |
85 | | - if (ret != mDictionary.mCommonMap.end()) { |
86 | | - return ret->second; |
87 | | - } else { // Big rare topology (inside groups) |
| 84 | + if (!mDictionary.mGroupMap.empty()) { // rare valid topology group |
88 | 85 | int index = groupFinder(nRow, nCol); |
89 | 86 | auto res = mDictionary.mGroupMap.find(index); |
90 | | - return res == mDictionary.mGroupMap.end() ? -1 : res->second; |
| 87 | + return res == mDictionary.mGroupMap.end() ? CompCluster::InvalidPatternID : res->second; |
91 | 88 | } |
| 89 | + return CompCluster::InvalidPatternID; |
92 | 90 | } |
93 | 91 |
|
94 | 92 | } // namespace itsmft |
|
0 commit comments