1 #ifndef FastSimulation_Tracking_SeedingTree_h
2 #define FastSimulation_Tracking_SeedingTree_h
7 #include <unordered_set>
23 allNodes.push_back(
this);
43 allNodes.push_back(
this);
44 for (
unsigned int ichild = 0; ichild <
_children.size(); ++ichild) {
50 if (
_depth + 1 >= dataList.size()) {
53 for (
unsigned int ichild = 0; ichild <
_children.size(); ++ichild) {
55 return allNodes[
_children[ichild]]->insert(dataList, allNodes);
59 if (node->
getDepth() + 1 >= dataList.size()) {
62 return node->
insert(dataList, allNodes);
100 for (
unsigned int i = 0;
i <
_depth; ++
i) {
103 printf(
"[%s, %s] \r\n",
_data.toString().c_str(),
_data.toIdString().c_str());
107 for (
unsigned int ichild = 0; ichild <
_children.size(); ++ichild) {
113 template <
class DATA>
116 typedef std::unordered_set<DATA, typename DATA::hashfct, typename DATA::eqfct>
SingleSet;
126 bool insert(
const std::vector<DATA>& dataList) {
127 for (
unsigned int i = 0;
i < dataList.size(); ++
i) {
131 if (dataList.empty()) {
134 for (
unsigned int iroot = 0; iroot <
_roots.size(); ++iroot) {
148 std::vector<SeedingNode<DATA>*> allNodes;
149 for (
unsigned int iroot = 0; iroot <
_roots.size(); ++iroot) {
150 _roots[iroot]->sort(allNodes, -1);
168 for (
unsigned int iroot = 0; iroot <
_roots.size(); ++iroot) {
169 _roots[iroot]->printRecursive();
174 for (
unsigned int inode = 0; inode <
_allNodes.size(); ++inode) {
181 for (
unsigned int inode = 0; inode <
_allNodes.size(); ++inode) {
187 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
printf("params %d %f %f %f\n", minT, eps, errmax, chi2max)
void sort(std::vector< SeedingNode< DATA > * > &allNodes, unsigned int parentIndex)
void printRecursive() const
std::unordered_set< DATA, typename DATA::hashfct, typename DATA::eqfct > SingleSet
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