key4hep / eede

EDM4hep Event Data Explorer
https://key4hep.github.io/eede/
BSD 2-Clause "Simplified" License
3 stars 4 forks source link

Allow to filter by collection name of the object #76

Closed brauliorivas closed 3 weeks ago

brauliorivas commented 1 month ago

BEGINRELEASENOTES

ENDRELEASENOTES

github-actions[bot] commented 1 month ago

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

kjvbrt commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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.