1 #ifndef KDTreeLinkerAlgoTemplated_h 2 #define KDTreeLinkerAlgoTemplated_h 12 template <
typename DATA>
25 void search(
const KDTreeBox &searchBox, std::vector<DATA> &resRecHitList);
52 void recSearch(
int current,
float dimCurrMin,
float dimCurrMax,
float dimOtherMin,
float dimOtherMax);
60 template <
typename DATA>
62 if (!eltList.empty()) {
77 template <
typename DATA>
79 int nbrElts = high - low;
80 int median = (nbrElts & 1) ? nbrElts / 2 : nbrElts / 2 - 1;
121 template <
typename DATA>
130 template <
typename DATA>
132 int current,
float dimCurrMin,
float dimCurrMax,
float dimOtherMin,
float dimOtherMax) {
140 float dimCurr =
nodePool_.median[current];
147 if ((dimCurr >= dimCurrMin) & (dimCurr <= dimCurrMax)) {
148 float dimOther =
nodePool_.dimOther[current];
149 if ((dimOther >= dimOtherMin) & (dimOther <= dimOtherMax)) {
157 bool goLeft = (dimCurrMin <=
median);
158 bool goRight = (dimCurrMax >=
median);
163 if (goLeft & goRight) {
164 int left = current + 1;
165 recSearch(left, dimCurrMin, dimCurrMax, dimOtherMin, dimOtherMax);
170 }
else if (goRight) {
179 template <
typename DATA>
182 template <
typename DATA>
187 template <
typename DATA>
192 template <
typename DATA>
197 template <
typename DATA>
199 int portionSize = high - low;
200 int dimIndex = depth & 1;
202 if (portionSize == 1) {
216 float medianVal = (*initialEltList)[medianId].dim[dimIndex];
226 int left =
recBuild(low, medianId, depth);
227 assert(nodeInd + 1 == left);
int recBuild(int low, int hight, int depth)
std::vector< DATA > * closestNeighbour
std::vector< KDTreeNodeInfo< DATA > > * initialEltList
KDTreeNodes< DATA > nodePool_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
void search(const KDTreeBox &searchBox, std::vector< DATA > &resRecHitList)
void build(std::vector< KDTreeNodeInfo< DATA > > &eltList, const KDTreeBox ®ion)
int medianSearch(int low, int high, int treeDepth)
void recSearch(int current, float dimCurrMin, float dimCurrMax, float dimOtherMin, float dimOtherMax)