Skip to content

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
lastgeorge committed Sep 2, 2020
1 parent 878fb77 commit 4e8cba0
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 74 deletions.
2 changes: 1 addition & 1 deletion 2dtoy
Submodule 2dtoy updated 1 files
+2 −2 test/test_cluster.cxx
30 changes: 16 additions & 14 deletions uboone_eval_app/apps/wire-cell-imaging-eval-celltree.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<TPCParams>::Instance();

double pitch_u = gds.pitch(WirePlaneType_t(0));
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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<allmcell.size();j++){
Expand Down Expand Up @@ -3346,7 +3348,7 @@ if (no_dead_channel==1){
}

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);
}
}
Expand Down
31 changes: 16 additions & 15 deletions uboone_eval_app/apps/wire-cell-imaging-eval.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ int main(int argc, char* argv[])
int max_events = 100;
int eve_num = 0;
int nrebin = 4;

int slim3dcluster_id = 0;

TPCParams& mp = Singleton<TPCParams>::Instance();

double pitch_u = gds.pitch(WirePlaneType_t(0));
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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<allmcell.size();j++){
Expand Down Expand Up @@ -2722,7 +2723,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);
}
}
Expand Down
Loading

0 comments on commit 4e8cba0

Please sign in to comment.