1 #ifndef RECOTOOL_CMERGEMANAGER_CXX 2 #define RECOTOOL_CMERGEMANAGER_CXX 95 << Form(
" Merging iteration %zu: processing %zu clusters...",
_iter_ctr,nclusters)
122 std::cout <<
" Did not find any newly merged clusters..." <<std::endl;
126 std::cout <<
" Output cluster length is 1 (= no more merging needed)" << std::endl;
130 std::cout <<
" Non-iterative option: terminating..." << std::endl;
150 _book_keeper_v.clear();
173 merge_switch.at(i) =
false;
197 if(indexes_v.size()==1) {
202 size_t tmp_hit_counts=0;
203 for(
auto const& index : indexes_v)
206 std::vector<util::PxHit> tmp_hits;
207 tmp_hits.reserve(tmp_hit_counts);
209 for(
auto const& index : indexes_v) {
211 tmp_hits.push_back(
hit);
217 if((*
_out_clusters.rbegin()).SetHits(tmp_hits) < 1)
continue;
218 (*
_out_clusters.rbegin()).FillParams(
true,
true,
true,
true,
true,
false);
240 std::vector<bool>(in_clusters.size(),
true),
245 const std::vector<bool> &merge_flag,
248 if(merge_flag.size() != in_clusters.size())
249 throw CMTException(Form(
"in_clusters (%zu) and merge_flag (%zu) vectors must be of same length!",
257 << Form(
" Calling %s with %zu clusters...",__FUNCTION__,in_clusters.size())
271 auto citer2 = citer1;
273 UChar_t plane1 = in_clusters.at((*citer1).second).Plane();
280 UChar_t plane2 = in_clusters.at((*citer2).second).Plane();
281 if(plane1 != plane2)
continue;
284 if(!(merge_flag.at((*citer2).second)) && !(merge_flag.at((*citer1).second)) )
continue;
287 if(!(book_keeper.
MergeAllowed((*citer1).second,(*citer2).second)))
continue;
292 << Form(
" \033[93mInspecting a pair (%zu, %zu) for merging... \033[00m",(*citer1).second, (*citer2).second)
296 bool merge =
_merge_algo->
Bool(in_clusters.at((*citer1).second),in_clusters.at((*citer2).second));
301 std::cout <<
" \033[93mfound to be merged!\033[00m " 306 std::cout <<
" \033[93mfound NOT to be merged...\033[00m" 314 book_keeper.
Merge((*citer1).second,(*citer2).second);
322 std::cout <<
" Found following clusters to be merged..." << std::endl;
323 for(
auto const &indexes_v : book_keeper.
GetResult()) {
325 if(indexes_v.size()==1)
continue;
327 for(
auto index : indexes_v)
329 std::cout<<index<<
" ";
330 std::cout<<
" ... indexes to be merged!"<<std::endl;
351 << Form(
" Calling %s with %zu clusters...",__FUNCTION__,in_clusters.size())
361 for(
size_t cindex1 = 0; cindex1 < in_clusters.size(); ++cindex1) {
363 UChar_t plane1 = in_clusters.at(cindex1).Plane();
365 for(
size_t cindex2 = cindex1+1; cindex2 < in_clusters.size(); ++cindex2) {
368 UChar_t plane2 = in_clusters.at(cindex2).Plane();
369 if(plane1 != plane2)
continue;
377 << Form(
" \033[93mInspecting a pair (%zu, %zu) for separation... \033[00m",cindex1,cindex2)
381 bool separate =
_separate_algo->
Bool(in_clusters.at(cindex1),in_clusters.at(cindex2));
386 std::cout <<
" \033[93mfound to be separated!\033[00m " 391 std::cout <<
" \033[93mfound NOT to be separated...\033[00m"
Detector simulation of raw signals on wires.
Class def header for a class CMergeManager.