Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply pointcloud #294

Merged
merged 167 commits into from
May 17, 2024
Merged

Apply pointcloud #294

merged 167 commits into from
May 17, 2024

Conversation

brettviren
Copy link
Member

@HaiwangYu

I think we should merge apply-pointcloud in to master. The two branches are starting to diverge.

HaiwangYu and others added 30 commits November 20, 2023 00:26
…g the way, cleanup long standing logging build issue
Some in-dev code and speed up of conversion code
This commit adds a new interface called IClusterFaninTensorSet to the WireCellIface namespace. The interface is a fan-in node that takes IClusters as input and outputs an ITensorSet. The commit also includes the necessary header and source file changes to implement the interface.
HaiwangYu and others added 24 commits April 18, 2024 12:52
…d comment out one that is apparently not used (now called nprojection()
…ts option offset=0 to go back to ray-centric
…and other things.

In general, a scoped view will not have the same ordering as children().  The scoped view may not even span the children of one node.  In the case of the blob and cluster facade and the "3d" scoped view on a cluster node there was a chance the two orders would be the same but its still not guaranteed.  So, in order to properly resolve a k-d point index back to a blob one must go through the scoped view's nodes and convert extract their blob facades.  This now implemented.

Detailed changes:

- Lots of API improvements in Nary, Points, Facade, clustering funcs, MultiAlgBlobClustering

- Various replacement of copy-pasted code for const variants with const_casting.

- Fix regression in NaryTree where the wrong node was being notified for an insert/remove action.

- Fix NFKDVec::point() which was only setting dimension 0.  It seems no code yet used this.

- Improve NFKDVec to have symmetric behavior for dynamic or static and have lazy behavior w.r.t. constructing and filling the underlying nanoflann object.  Nothing is done to nanoflann until a query.  When nanoflann is created, any points that were appended prior will be added en masse.  If append happens after a static nanoflan is created, static nanoflan is deleted and remade on the new, larger point set.

- Make ScopedView more lazy for everything but its collection of nodes.

- Points now uses STATIC NFKDVec/nanoflan k-d tree.

- Many changes in PointCloudFacade.  Facades can now return their parent facade.  Cluster and blob facades have new methods: hash() and sanity() to help with debugging.  Cluster has several new methods to simply and hide access to scoped view and k-d tree queries and to help resolve k-d results to blobs and points.  A pair of `{cluster,blob}_less()` and `sort_{clusters,blobs}()` methods are defined to sort facades by their "size".  NOTE, this makes 3 possible ordering of blobs in the wild: tree children(), scoped view and sorted.  Also, ostream operators added.

- The "TPCParams" is no longer externally passed everywhere but set on a Grouping.  A cluster may ask its parent grouping for the TP.  This makes Cluster::get_length() argless.

- In MultiAlgBlobClustering, consolidate the various debug prints and ExecMon into a Perf object that is controlled by the "perf" config option.

- In `clustering_live_dead()`, remove prints/ExecMon and there and other clusering funcs, adjust to change in where the "tp" lives.

- In PointTreeBuilding, move the check for "3d" from graph exec time to the configuration.

- Various tests and docs improvements and additions.
@brettviren
Copy link
Member Author

Here's a bee showing the latest results:

clusters

@brettviren
Copy link
Member Author

This should also negate the need for special spdlog/fmt formatter to print Point
and removes a very nasty bug where the compiler apparently is perfectly happy to
convert a Point to bool and then to double.
- The result of unnecessary resolution from point to major index was passed as a
point index.

- For some mysterious reason, I had the NaryTreeFacade::children() sorting on
child pointer value.

A few changes along the way:

- Make log pointer optional to the sanity() methods.

- Add sanity checking of the facade blob and scoped node ordering, now that they
are correctly, if accidentally/constructed to be the same.

- Rewrite get_closest_blob() to do slightly less work to get its job done.

- Add cluster length as most significant value to the mix of values when
comparing the "size" of two clusters.

- Rename test cases in clustering prototype test to better follow convention to
make the tests more user friendly for "-tc='clustering*'" type doctest executing.
@HaiwangYu
Copy link
Member

Test results before merging:

$SPDLOG_LEVEL=debug ./build/img/wcdoctest-img -tc="clustering facade"
[doctest] doctest version is "2.4.11"
[doctest] run with "--help" for options
[2024-05-17 16:06:16.326] [wct] [debug] pc1: 10
[2024-05-17 16:06:16.327] [wct] [debug] pc2: 10
[2024-05-17 16:06:16.327] [wct] [debug] blob 0: q=1, r=0.5
[2024-05-17 16:06:16.327] [wct] [debug] blob 1: q=2, r=1.5
[2024-05-17 16:06:16.327] [wct] [debug] expect average pos 1.1666666666666667
[2024-05-17 16:06:16.327] [wct] [debug] ave_pos: (1.16667 0 0) | expecting (1.1666666666666665 0 0)
[2024-05-17 16:06:16.327] [wct] [debug] vdir_alg0: (0.999946 0.0087264 0.00555556) | expecting around {1, 0, 0}
[2024-05-17 16:06:16.328] [wct] [debug] vdir_alg1: (0.999924 0.0087262 -0.00872654) | expecting around {1, 0, 0}
[2024-05-17 16:06:16.328] [wct] [debug] length: 8.503120030318284 | expecting 8.50312003032
[2024-05-17 16:06:16.328] [wct] [debug] earliest_latest_points: (0 0 0) (1.9 0 0) | expecting (0 0 0) (1.9 0 0)
[2024-05-17 16:06:16.328] [wct] [debug] num_points: 15 5 | expecting 15, 5
===============================================================================
[doctest] test cases:  1 |  1 passed | 0 failed | 2 skipped
[doctest] assertions: 14 | 14 passed | 0 failed |
[doctest] Status: SUCCESS!

uboone test:
log:
may-17.log
BEE
https://www.phy.bnl.gov/twister/bee/set/b2ebf761-7724-4b7a-928a-26532c5cc6fc/event/6501/

@HaiwangYu HaiwangYu merged commit 0cc89ab into master May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants