Particle Identification and Tracking
track_list.h
Go to the documentation of this file.
1 //Copyright 2008,2009 Thomas A Caswell
2 //tcaswell@uchicago.edu
3 //http://jfi.uchicago.edu/~tcaswell
4 //
5 //This program is free software; you can redistribute it and/or modify
6 //it under the terms of the GNU General Public License as published by
7 //the Free Software Foundation; either version 3 of the License, or (at
8 //your option) any later version.
9 //
10 //This program is distributed in the hope that it will be useful, but
11 //WITHOUT ANY WARRANTY; without even the implied warranty of
12 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 //General Public License for more details.
14 //
15 //You should have received a copy of the GNU General Public License
16 //along with this program; if not, see <http://www.gnu.org/licenses>.
17 //
18 //Additional permission under GNU GPL version 3 section 7
19 //
20 //If you modify this Program, or any covered work, by linking or
21 //combining it with MATLAB (or a modified version of that library),
22 //containing parts covered by the terms of MATLAB User License, the
23 //licensors of this Program grant you additional permission to convey
24 //the resulting work.
25 #include <list>
26 #include <set>
27 #include <vector>
28 #include "particle_track.h"
29 //#include "track_shelf.h"
30 
31 #ifndef TRACK_LIST
32 #define TRACK_LIST
33 namespace tracking{
34 
35 class Track_shelf;
46 class track_list{
47 
48 public:
49 
53  void link_next(std::list<particle_track*>* new_next);
54 
57  track_list(std::list<particle_track*>* first_list,
58  float i_max_disp,Track_shelf* in_tracks);
59 
60  ~track_list();
61 
62 protected:
64  std::list<particle_track*> * p_list;
66  std::list<particle_track*> * n_list;
67 
69  std::list<particle_track*>* store_list;
70 
72  //std::set<particle_track*,bool(*)(particle_track*,particle_track*)> p_sub_net;
73  std::set<particle_track*> p_sub_net;
75  //std::set<particle_track*,bool(*)(particle_track*,particle_track*)> n_sub_net;
76  std::set<particle_track*> n_sub_net;
81 
83  float max_disp;
85  float max_disp_sq;
86 
87 
92  void link_sub_ntwrk();
93 
94 
96  void trivial_bonds();
97 
100  void set_up_sub_ntwrk();
101 
102  void clean_lists();
103 
105  std::list<particle_track*>::iterator erase(std::list<particle_track*>* in,
106  std::list<particle_track*>::iterator it);
107 
109  static bool part_lt(particle_track* a, particle_track* b);
110 
114  void recur_fnc_np(std::vector<std::pair<particle_track*, particle_track*> >* min,
115  std::vector<std::pair<particle_track*, particle_track*> >* cur,
116  float disp,float& min_disp,
117  std::set<particle_track*>::iterator it,
118  const std::set<particle_track*>::iterator& itend);
122  void recur_fnc_pn(std::vector<std::pair<particle_track*, particle_track*> >* min,
123  std::vector<std::pair<particle_track*, particle_track*> >* cur,
124  float disp,float & min_disp,
125  std::set<particle_track*>::iterator it,
126  const std::set<particle_track*>::iterator& itend);
130  void link_pairs(std::vector<std::pair<particle_track*, particle_track*> >& in);
131 
132 };
133 
134 // tac 2009-10-19
135 // took this out in September because I got rid of the unq_id
136 // inline bool track_list::part_lt(particle_track* a, particle_track* b){
137 // return (a->unq_id_)<(b->unq_id_);
138 //}
139 }
140 
141 #endif