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

Allow to filter by collection name of the object #76

Merged
merged 10 commits into from
Aug 19, 2024

Conversation

brauliorivas
Copy link
Member

BEGINRELEASENOTES

ENDRELEASENOTES

Copy link

github-actions bot commented Aug 10, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-08-19 14:06 UTC

@kjvbrt
Copy link
Collaborator

kjvbrt commented Aug 12, 2024

Hi @brauliorivas, Nice work, in some cases there is too many collections :)

Initially, do you draw all the collections?
Would it be possible to have active check-marks from the beginning?
Also, sometimes it is a bit clumsy to select all many checkmarks, would it be possible to have "select all", and "clear" buttons?

@brauliorivas
Copy link
Member Author

brauliorivas commented Aug 12, 2024

Initially, do you draw all the collections?

Yes

Would it be possible to have active check-marks from the beginning?

So, whenever the user selects a view, the filters for collections will show like this?
image

Also, sometimes it is a bit clumsy to select all many checkmarks, would it be possible to have "select all", and "clear" buttons?

Yeah! I'll add that.

@kjvbrt
Copy link
Collaborator

kjvbrt commented Aug 13, 2024

Hi @brauliorivas,

So, whenever the user selects a view, the filters for collections will show like this?
image

Yes, because otherwise it is not clear which collections are already shown. After looking more into this, I think having checkmarks checked also applies to all the other checkmark filters (generator status, simulation status). For simulation status you will also have to show only the ones which are applicable.

I'm getting way more connections when applying the filter.
This is before clicking apply:
image

and this is after:
image

I just loaded a file, selcted the view and clicked on apply filter. There was no messing with any filter options.

@kjvbrt
Copy link
Collaborator

kjvbrt commented Aug 14, 2024

Hi @brauliorivas, the filtering issue runs deeper. I would expect, that if I deselect "Particle" collection I should not get any particles.
This is what I get when I deselect "Particle" collection:
image

And also, If I again select the "Particle" collection I should get exact same particle tree.
ATM I get the same tree as in the printscreen. This tree however contains new connections.

It is probably good to have a test that would do a round trip and see if the particle tree stays the same.

@brauliorivas
Copy link
Member Author

I would expect, that if I deselect "Particle" collection I should not get any particles.

I made it that way because I think it can be easier to understand. If there is only one type of collection, and you chose none, then no particle will match the filter (and if choosing none, I would get an empty mcparticle tree which is not very useful ). The same happens with the simulator status. If we think the same way, then from the beginning the view should be empty because no mcparticle matches the available simulator statuses. So only if any of the checkboxes are marked, then it will work normally, but if choosing none of the checkboxes, it will ignore that section of checkboxes and filter using other property (if set).

And also, If I again select the "Particle" collection I should get exact same particle tree.
ATM I get the same tree as in the printscreen. This tree however contains new connections.

Going to fix it!

@brauliorivas
Copy link
Member Author

I would expect, that if I deselect "Particle" collection I should not get any particles.

I made it that way because I think it can be easier to understand. If there is only one type of collection, and you chose none, then no particle will match the filter (and if choosing none, I would get an empty mcparticle tree which is not very useful ). The same happens with the simulator status. If we think the same way, then from the beginning the view should be empty because no mcparticle matches the available simulator statuses. So only if any of the checkboxes are marked, then it will work normally, but if choosing none of the checkboxes, it will ignore that section of checkboxes and filter using other property (if set).

Anyway, right now I've done it the way you say @kjvbrt.

@kjvbrt
Copy link
Collaborator

kjvbrt commented Aug 15, 2024

So only if any of the checkboxes are marked, then it will work normally, but if choosing none of the checkboxes, it will ignore that section of checkboxes and filter using other property (if set).

This is also a possibility, but than I would suggest to use grey font for that section or any other way to signify that it is not active.

Doing round trip (filtering particles based on generator status and than clearing the status) I 'm also getting new connections...

@brauliorivas
Copy link
Member Author

Right now I've done a new reconnecting logic. So a MCParticle will keep a relation if that parent or daughter particle satisfies the filtering criteria. However, if the immediate particle doesn't satisfy filtered, it will search for (the parents of the parent, or children of the child) and connect with that particle. If any of the "grandparents" or "granddaughters" doesn't apply either, it will go one level further until finding a level where it at least may connect with one new particle (or don't connect, if arrived to the end of the tree).

image

@kjvbrt
Copy link
Collaborator

kjvbrt commented Aug 16, 2024

Hi @brauliorivas, It think we are moving :) There are no more particle connections generated, but I can't get back the particles I filtered out in previous filtering.
Is this expected behaviour?

When I unselect generator status 4 I get:
image
The photons do not gain new connections :) And particles with ID:0 and 1 are filtered out.

However, when I select generator status again I get the result of previous filtering:
image
Particles with ID 0 and 1 are not present.

@kjvbrt kjvbrt merged commit c4e1e28 into key4hep:main Aug 19, 2024
2 checks passed
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.

Make it possible to select / view only certain collections for a given view
2 participants