From 4e8cba0164ddccb69f758a84b330db7a70797fd6 Mon Sep 17 00:00:00 2001 From: Xin Qian Date: Tue, 1 Sep 2020 22:13:41 -0400 Subject: [PATCH] improve --- 2dtoy | 2 +- data | 2 +- .../apps/wire-cell-imaging-eval-celltree.cxx | 30 ++++++++-------- .../apps/wire-cell-imaging-eval.cxx | 31 ++++++++-------- .../apps/wire-cell-truth-imaging.cxx | 28 ++++++++------- .../apps/wire-cell-imaging-lmem-celltree.cxx | 29 ++++++++------- .../apps/wire-cell-imaging-lmem.cxx | 36 +++++++++---------- 7 files changed, 84 insertions(+), 74 deletions(-) diff --git a/2dtoy b/2dtoy index e3b0f90b..9b0831a1 160000 --- a/2dtoy +++ b/2dtoy @@ -1 +1 @@ -Subproject commit e3b0f90b9d0f12c96e9efaba326188fc884a8a92 +Subproject commit 9b0831a1f1ca0c4f88fae91269e4654e5a49e8e4 diff --git a/data b/data index 4429a844..c7685c45 160000 --- a/data +++ b/data @@ -1 +1 @@ -Subproject commit 4429a844d20f37c279dcf30fae817d19f7c39f8c +Subproject commit c7685c45307a15258d44f480d28a295491fb24c5 diff --git a/uboone_eval_app/apps/wire-cell-imaging-eval-celltree.cxx b/uboone_eval_app/apps/wire-cell-imaging-eval-celltree.cxx index c5bebf2a..9c954ab1 100644 --- a/uboone_eval_app/apps/wire-cell-imaging-eval-celltree.cxx +++ b/uboone_eval_app/apps/wire-cell-imaging-eval-celltree.cxx @@ -230,6 +230,8 @@ int main(int argc, char* argv[]) int eve_num = atoi(argv[3]); int nrebin = 4; + int slim3dcluster_id = 0; + TPCParams& mp = Singleton::Instance(); double pitch_u = gds.pitch(WirePlaneType_t(0)); @@ -1072,7 +1074,7 @@ if(beamspill || beam==-1){ if (cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; cluster_set.insert(cluster); } }else{ @@ -1103,7 +1105,7 @@ if(beamspill || beam==-1){ } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; cluster_set.insert(cluster); } } @@ -2030,7 +2032,7 @@ if(beamspill || beam==-1){ if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -2061,7 +2063,7 @@ if(beamspill || beam==-1){ } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -2110,7 +2112,7 @@ if(beamspill || beam==-1){ if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -2141,7 +2143,7 @@ if(beamspill || beam==-1){ } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -2191,7 +2193,7 @@ if(beamspill || beam==-1){ if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j]));slim3dcluster_id ++; temp_cluster_set.insert(cluster); } }else{ @@ -2222,7 +2224,7 @@ if(beamspill || beam==-1){ } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -2273,7 +2275,7 @@ if(beamspill || beam==-1){ if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -2304,7 +2306,7 @@ if(beamspill || beam==-1){ } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -3084,7 +3086,7 @@ std::cout << "# of good mcell: " << good_mcells.size() << std::endl; if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -3114,7 +3116,7 @@ std::cout << "# of good mcell: " << good_mcells.size() << std::endl; } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -3317,7 +3319,7 @@ if (no_dead_channel==1){ GeomCellSelection& allmcell = lowmemtiling[i]->get_two_bad_wire_cells(); if (lowmemtiling[i]->get_regen_two_bad_wire_cells() || dead_cluster_set.empty()){ if (dead_cluster_set.empty()){ - Slim3DDeadCluster *cluster = new Slim3DDeadCluster(*((SlimMergeGeomCell*)allmcell[0]),i); + Slim3DDeadCluster *cluster = new Slim3DDeadCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[0]),i); slim3dcluster_id++; dead_cluster_set.insert(cluster); } for (int j=0;j::Instance(); double pitch_u = gds.pitch(WirePlaneType_t(0)); @@ -890,7 +891,7 @@ int main(int argc, char* argv[]) if (cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id,*((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; cluster_set.insert(cluster); } }else{ @@ -919,7 +920,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id,*((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; cluster_set.insert(cluster); } } @@ -1623,7 +1624,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1654,7 +1655,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -1703,7 +1704,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1734,7 +1735,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -1784,7 +1785,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1815,7 +1816,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -1866,7 +1867,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1897,7 +1898,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id ++; temp_cluster_set.insert(cluster); } } @@ -2581,7 +2582,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -2611,7 +2612,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id ++; temp_cluster_set.insert(cluster); } } @@ -2693,7 +2694,7 @@ int main(int argc, char* argv[]) GeomCellSelection& allmcell = lowmemtiling[i]->get_two_bad_wire_cells(); if (lowmemtiling[i]->get_regen_two_bad_wire_cells() || dead_cluster_set.empty()){ if (dead_region && dead_cluster_set.empty()){ - Slim3DDeadCluster *cluster = new Slim3DDeadCluster(*((SlimMergeGeomCell*)allmcell[0]),i); + Slim3DDeadCluster *cluster = new Slim3DDeadCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[0]),i); slim3dcluster_id ++; dead_cluster_set.insert(cluster); } for (int j=0;j::Instance(); double pitch_u = gds.pitch(WirePlaneType_t(0)); @@ -881,7 +883,7 @@ int main(int argc, char* argv[]) if (cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; cluster_set.insert(cluster); } }else{ @@ -910,7 +912,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; cluster_set.insert(cluster); } } @@ -1614,7 +1616,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1645,7 +1647,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -1694,7 +1696,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1725,7 +1727,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -1775,7 +1777,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1806,7 +1808,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -1857,7 +1859,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1888,7 +1890,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -2571,7 +2573,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -2601,7 +2603,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -2712,7 +2714,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DDeadCluster *cluster = new Slim3DDeadCluster(*((SlimMergeGeomCell*)allmcell[j]),i); + Slim3DDeadCluster *cluster = new Slim3DDeadCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j]),i); slim3dcluster_id++; dead_cluster_set.insert(cluster); } } diff --git a/uboone_nusel_app/apps/wire-cell-imaging-lmem-celltree.cxx b/uboone_nusel_app/apps/wire-cell-imaging-lmem-celltree.cxx index 42682ca4..e647189a 100644 --- a/uboone_nusel_app/apps/wire-cell-imaging-lmem-celltree.cxx +++ b/uboone_nusel_app/apps/wire-cell-imaging-lmem-celltree.cxx @@ -238,6 +238,8 @@ int main(int argc, char* argv[]) int eve_num = atoi(argv[3]); int nrebin = 4; + int slim3dcluster_id = 0; + TPCParams& mp = Singleton::Instance(); double pitch_u = gds.pitch(WirePlaneType_t(0)); @@ -1139,7 +1141,7 @@ if(beamspill || beam==-1){ std::vector::size_type i; for (i=0;i!=component.size(); ++i){ if (cluster_vec.at(component.at(i))==0){ - Slim3DCluster *cluster = new Slim3DCluster(*all_mcells.at(i)); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id,*all_mcells.at(i)); slim3dcluster_id++; cluster_vec.at(component.at(i)) = cluster; }else{ cluster_vec.at(component.at(i))->DirectAddCell(*all_mcells.at(i)); @@ -1267,9 +1269,9 @@ if(beamspill || beam==-1){ int nmcell_deleted = 0; int nmcell_before = 0, nmcell_after = 0; - std::map> u_2D_3D_clus_map; - std::map> v_2D_3D_clus_map; - std::map> w_2D_3D_clus_map; + std::map, Projected2DClusterComparep> u_2D_3D_clus_map; + std::map, Projected2DClusterComparep> v_2D_3D_clus_map; + std::map, Projected2DClusterComparep> w_2D_3D_clus_map; if (no_dead_channel!=1){ @@ -1974,7 +1976,7 @@ if(beamspill || beam==-1){ std::vector::size_type i; for (i=0;i!=component.size(); ++i){ if (cluster_vec.at(component.at(i))==0){ - Slim3DCluster *cluster = new Slim3DCluster(*all_mcells.at(i)); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *all_mcells.at(i)); slim3dcluster_id++; cluster_vec.at(component.at(i)) = cluster; }else{ cluster_vec.at(component.at(i))->DirectAddCell(*all_mcells.at(i)); @@ -1986,6 +1988,7 @@ if(beamspill || beam==-1){ num_mcells += (*it)->get_allcell().size(); } + // std::cout << num_mcells << " " << all_mcells.size() << " " << num1 << " " << cluster_vec.size() << std::endl; // std::cout << num_mcells << " " << all_mcells.size() << std::endl; std::copy(cluster_vec.begin(), cluster_vec.end(), std::inserter(cluster_set, cluster_set.end())); @@ -2055,7 +2058,7 @@ if(beamspill || beam==-1){ std::vector::size_type i; for (i=0;i!=component.size(); ++i){ if (cluster_vec.at(component.at(i))==0){ - Slim3DCluster *cluster = new Slim3DCluster(*all_mcells.at(i)); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *all_mcells.at(i)); slim3dcluster_id++; cluster_vec.at(component.at(i)) = cluster; }else{ cluster_vec.at(component.at(i))->DirectAddCell(*all_mcells.at(i)); @@ -2067,6 +2070,7 @@ if(beamspill || beam==-1){ num_mcells += (*it)->get_allcell().size(); } + // std::cout << num_mcells << " " << all_mcells.size() << " " << num1 << " " << cluster_vec.size() << std::endl; // std::cout << num_mcells << " " << all_mcells.size() << std::endl; std::copy(cluster_vec.begin(), cluster_vec.end(), std::inserter(cluster_set, cluster_set.end())); @@ -2135,7 +2139,7 @@ if(beamspill || beam==-1){ std::vector::size_type i; for (i=0;i!=component.size(); ++i){ if (cluster_vec.at(component.at(i))==0){ - Slim3DCluster *cluster = new Slim3DCluster(*all_mcells.at(i)); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *all_mcells.at(i)); slim3dcluster_id++; cluster_vec.at(component.at(i)) = cluster; }else{ cluster_vec.at(component.at(i))->DirectAddCell(*all_mcells.at(i)); @@ -2147,6 +2151,7 @@ if(beamspill || beam==-1){ num_mcells += (*it)->get_allcell().size(); } + // std::cout << num_mcells << " " << all_mcells.size() << " " << num1 << " " << cluster_vec.size() << std::endl; // std::cout << num_mcells << " " << all_mcells.size() << std::endl; std::copy(cluster_vec.begin(), cluster_vec.end(), std::inserter(cluster_set, cluster_set.end())); @@ -2215,7 +2220,7 @@ if(beamspill || beam==-1){ std::vector::size_type i; for (i=0;i!=component.size(); ++i){ if (cluster_vec.at(component.at(i))==0){ - Slim3DCluster *cluster = new Slim3DCluster(*all_mcells.at(i)); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *all_mcells.at(i)); slim3dcluster_id++; cluster_vec.at(component.at(i)) = cluster; }else{ cluster_vec.at(component.at(i))->DirectAddCell(*all_mcells.at(i)); @@ -2227,7 +2232,7 @@ if(beamspill || beam==-1){ num_mcells += (*it)->get_allcell().size(); } - // std::cout << num_mcells << " " << all_mcells.size() << std::endl; + // std::cout << num_mcells << " " << all_mcells.size() << " " << num1 << " " << cluster_vec.size() << std::endl; std::copy(cluster_vec.begin(), cluster_vec.end(), std::inserter(cluster_set, cluster_set.end())); } @@ -3366,7 +3371,7 @@ std::cout << "# of good mcell: " << good_mcells.size() << std::endl; std::vector::size_type i; for (i=0;i!=component.size(); ++i){ if (cluster_vec.at(component.at(i))==0){ - Slim3DCluster *cluster = new Slim3DCluster(*all_mcells.at(i)); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id,*all_mcells.at(i)); slim3dcluster_id++; cluster_vec.at(component.at(i)) = cluster; }else{ cluster_vec.at(component.at(i))->DirectAddCell(*all_mcells.at(i)); @@ -3553,7 +3558,7 @@ std::cout << "# of good mcell: " << good_mcells.size() << std::endl; GeomCellSelection& allmcell = lowmemtiling[i]->get_two_bad_wire_cells(); if (lowmemtiling[i]->get_regen_two_bad_wire_cells() || dead_cluster_set.empty()){ if (dead_cluster_set.empty()){ - Slim3DDeadCluster *cluster = new Slim3DDeadCluster(*((SlimMergeGeomCell*)allmcell[0]),i); + Slim3DDeadCluster *cluster = new Slim3DDeadCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[0]),i); slim3dcluster_id++; dead_cluster_set.insert(cluster); } for (int j=0;jClose(); delete file1; - + int slim3dcluster_id=0; for (int i=start_num;i!=end_num+1;i++){ @@ -724,7 +724,7 @@ int main(int argc, char* argv[]) if (cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; cluster_set.insert(cluster); } }else{ @@ -753,7 +753,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id,*((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; cluster_set.insert(cluster); } } @@ -790,9 +790,9 @@ int main(int argc, char* argv[]) // first round only deal with the absolute match ... - std::map> u_2D_3D_clus_map; - std::map> v_2D_3D_clus_map; - std::map> w_2D_3D_clus_map; + std::map, Projected2DClusterComparep> u_2D_3D_clus_map; + std::map, Projected2DClusterComparep> v_2D_3D_clus_map; + std::map, Projected2DClusterComparep> w_2D_3D_clus_map; for (auto it = cluster_set.begin();it!=cluster_set.end();it++){ (*it)->Calc_Projection(); @@ -1457,7 +1457,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id,*((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1488,7 +1488,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j]));slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -1537,7 +1537,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id,*((SlimMergeGeomCell*)allmcell[j]));slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1568,7 +1568,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id,*((SlimMergeGeomCell*)allmcell[j]));slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -1618,7 +1618,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id,*((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1649,7 +1649,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -1700,7 +1700,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -1731,7 +1731,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -2414,7 +2414,7 @@ int main(int argc, char* argv[]) if (temp_cluster_set.empty()){ // if cluster is empty, just insert all the mcell, each as a cluster for (int j=0;j!=allmcell.size();j++){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } }else{ @@ -2444,7 +2444,7 @@ int main(int argc, char* argv[]) } if (flag==0){ - Slim3DCluster *cluster = new Slim3DCluster(*((SlimMergeGeomCell*)allmcell[j])); + Slim3DCluster *cluster = new Slim3DCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[j])); slim3dcluster_id++; temp_cluster_set.insert(cluster); } } @@ -2526,7 +2526,7 @@ int main(int argc, char* argv[]) GeomCellSelection& allmcell = lowmemtiling[i]->get_two_bad_wire_cells(); if (lowmemtiling[i]->get_regen_two_bad_wire_cells() || dead_cluster_set.empty()){ if (dead_cluster_set.empty()){ - Slim3DDeadCluster *cluster = new Slim3DDeadCluster(*((SlimMergeGeomCell*)allmcell[0]),i); + Slim3DDeadCluster *cluster = new Slim3DDeadCluster(slim3dcluster_id, *((SlimMergeGeomCell*)allmcell[0]),i); slim3dcluster_id++; dead_cluster_set.insert(cluster); } for (int j=0;j