1 #ifndef FastSimulation_Tracking_SeedingTree_h
2 #define FastSimulation_Tracking_SeedingTree_h
7 #include <unordered_set>
28 allNodes.push_back(
this);
53 allNodes.push_back(
this);
54 for (
unsigned int ichild=0; ichild<
_children.size();++ichild)
62 if (
_depth+1>=dataList.size())
67 for (
unsigned int ichild=0; ichild<
_children.size();++ichild)
72 return allNodes[
_children[ichild]]->insert(dataList,allNodes);
77 if (node->
getDepth()+1>=dataList.size())
81 return node->
insert(dataList,allNodes);
149 printf(
"[%s, %s] \r\n",
_data.toString().c_str(),
_data.toIdString().c_str());
155 for (
unsigned int ichild=0; ichild<
_children.size(); ++ichild)
166 typedef std::unordered_set<DATA,typename DATA:: hashfct, typename DATA:: eqfct>
SingleSet;
179 bool insert(
const std::vector<DATA>& dataList)
181 for (
unsigned int i = 0;
i< dataList.size(); ++
i)
186 if (dataList.size()==0)
190 for (
unsigned int iroot=0; iroot<
_roots.size();++iroot)
212 std::vector<SeedingNode<DATA>*> allNodes;
213 for (
unsigned int iroot=0; iroot<
_roots.size();++iroot)
215 _roots[iroot]->sort(allNodes,-1);
244 for (
unsigned int iroot=0; iroot<
_roots.size();++iroot)
246 _roots[iroot]->printRecursive();
252 for (
unsigned int inode=0; inode<
_allNodes.size();++inode)
261 for (
unsigned int inode=0; inode<
_allNodes.size();++inode)
269 for (
unsigned int iroot=0; iroot<
_roots.size();++iroot)
const SeedingNode< DATA > * next() const
const SingleSet & getSingleSet() const
void printRecursive() const
const SeedingNode< DATA > * firstChild() const
SeedingNode(const DATA &data, std::vector< SeedingNode * > &allNodes, int parentIndex=-1)
const DATA & getData() const
unsigned int getChildrenSize() const
unsigned int getDepth() const
const SeedingNode * getParent() const
std::vector< SeedingNode< DATA > * > _roots
bool insert(const std::vector< DATA > &dataList)
unsigned int numberOfNodes() const
unsigned int numberOfRoots() const
std::unordered_set< DATA, typename DATA::hashfct, typename DATA::eqfct > SingleSet
void sort(std::vector< SeedingNode< DATA > * > &allNodes, unsigned int parentIndex)
void printRecursive() const
bool insert(const std::vector< DATA > &dataList, std::vector< SeedingNode< DATA > * > &allNodes)
std::vector< unsigned int > _children
std::vector< SeedingNode< DATA > * > _allNodes
const SeedingNode< DATA > * getRoot(unsigned int i) const
char data[epos_bytes_allocation]
void printOrdered() const
const std::vector< SeedingNode< DATA > * > & _allNodes
unsigned int getIndex() const
tuple size
Write out results.
unsigned int getChildIndex() const
const SeedingNode< DATA > * getChild(unsigned int ichild) const