54 std::set<unsigned int> track_keep_list;
55 std::set<unsigned int> track_delete_list;
57 unsigned int good_track = 0;
58 unsigned int ok_track = 0;
60 std::multimap<unsigned int, unsigned int> tpcid_track_mmap;
61 std::set<unsigned int> tpc_id_set;
65 auto track_id = (*it).first;
66 auto track = (*it).second;
69 auto tpc_seed = track->get_tpc_seed();
72 auto tpc_track_pair = std::make_pair(tpc_index, track_id);
74 tpc_id_set.insert(tpc_index);
75 tpcid_track_mmap.insert(tpc_track_pair);
79 std::cout <<
" tpcid_track_mmap size " << tpcid_track_mmap.size() << std::endl;
83 for(
auto seed_iter = tpc_id_set.begin(); seed_iter != tpc_id_set.end(); ++seed_iter)
85 unsigned int tpc_id = *seed_iter;
88 std::cout <<
" TPC ID " << tpc_id << std::endl;
90 auto tpc_range = tpcid_track_mmap.equal_range(tpc_id);
92 unsigned int best_id = 99999;
93 double min_chisq_df = 99999.0;
94 unsigned int best_ndf = 1;
95 for (
auto it = tpc_range.first;
it !=tpc_range.second; ++
it)
97 unsigned int track_id =
it->second;
135 double qual = min_chisq_df;
138 std::cout <<
" best track for tpc_id " << tpc_id <<
" has track_id " << best_id <<
" best_ndf " << best_ndf <<
" chisq/ndf " << qual << std::endl;
142 track_keep_list.insert(best_id);
151 std::cout <<
" no track exists for tpc_id " << tpc_id << std::endl;
156 std::cout <<
" Number of good tracks with qual < 10 is " << good_track <<
" OK tracks " << ok_track << std::endl;
161 auto id = track_it->first;
163 auto set_it = track_keep_list.find(
id);
164 if(set_it == track_keep_list.end())
167 std::cout <<
" add id " <<
id <<
" to track_delete_list " << std::endl;
168 track_delete_list.insert(
id);
173 std::cout <<
" track_delete_list size " << track_delete_list.size() << std::endl;
176 for(
auto it = track_delete_list.begin();
it != track_delete_list.end(); ++
it)
179 std::cout <<
" erasing track ID " << *
it << std::endl;
184 std::cout <<
"Track map size after choosing best silicon match: " <<
_track_map->
size() << std::endl;
196 _tpc_seed_map = findNode::getClass<TrackSeedContainer>(topNode,
"TpcTrackSeedContainer");
199 std::cout <<
PHWHERE <<
" ERROR: Can't find TpcTrackSeedContainer: " << std::endl;
203 _track_map = findNode::getClass<SvtxTrackMap>(topNode,
"SvtxTrackMap");
206 std::cout <<
PHWHERE <<
" ERROR: Can't find SvtxTrackMap: " << std::endl;