Go to the documentation of this file.00001 #ifndef KDTreeLinkerAlgo_h
00002 #define KDTreeLinkerAlgo_h
00003
00004 #include "RecoParticleFlow/PFProducer/interface/KDTreeLinkerTools.h"
00005
00006 #include <vector>
00007
00008
00009
00010 class KDTreeLinkerAlgo
00011 {
00012 public:
00013 KDTreeLinkerAlgo();
00014
00015
00016 ~KDTreeLinkerAlgo();
00017
00018
00019 void build(std::vector<KDTreeNodeInfo> &eltList,
00020 const KDTreeBox ®ion);
00021
00022
00023
00024 void search(const KDTreeBox &searchBox,
00025 std::vector<KDTreeNodeInfo> &resRecHitList);
00026
00027
00028 void clear();
00029
00030 private:
00031
00032 KDTreeNode* root_;
00033
00034
00035 KDTreeNode* nodePool_;
00036 int nodePoolSize_;
00037 int nodePoolPos_;
00038
00039 private:
00040
00041 void swap(KDTreeNodeInfo &e1, KDTreeNodeInfo &e2);
00042
00043
00044 KDTreeNode* getNextNode();
00045
00046
00047 int medianSearch(std::vector<KDTreeNodeInfo> &eltList,
00048 int low,
00049 int high,
00050 int treeDepth);
00051
00052
00053 KDTreeNode *recBuild(std::vector<KDTreeNodeInfo> &eltList,
00054 int low,
00055 int hight,
00056 int depth,
00057 const KDTreeBox& region);
00058
00059
00060 void recSearch(const KDTreeNode *current,
00061 const KDTreeBox &trackBox,
00062 std::vector<KDTreeNodeInfo> &recHits);
00063
00064
00065 void addSubtree(const KDTreeNode *current,
00066 std::vector<KDTreeNodeInfo> &recHits);
00067
00068
00069 void clearTree();
00070 };
00071
00072 #endif