Giter Club home page Giter Club logo

Comments (4)

jacanchaplais avatar jacanchaplais commented on June 3, 2024

The solution I've settled on is to create a function which takes the descendant masks of all of the non-incoming hard partons, and nests them into mask groups describing the decay channels. For example if the hard process is p p > t t~, with t > b W+ > b u d~ and equivalent for the t~ case, then a MaskGroup of MaskGroups will be created with

>>> masks = gcl.select.hard_hierarchy(graph)
>>> masks
MaskGroup(mask_arrays=['t', 't~'])

will be created at the top level. Subscripting to get the t mask will yield another MaskGroup, eg.

>>> masks["t"]
MaskGroup(mask_arrays=['b', 'W+', 'latent'])

where t is considered a composite of the descendants of b and W+, and latent refers to the particles descending from t which are not descended from these (usually just the duplicates of t, and the b and W+ partons themselves - since they are not included as part of their descendants).

Similarly

>>> masks["t"]["W+"]
MaskGroup(mask_arrays=['u', 'd~', 'latent'])

and the u, d~, and b are MaskArrays rather than MaskGroups, because they are the leaves of the hard process tree.

The function has an option use_pmu: bool = True, which then takes any descendants with overlapping heritage, and assigns them into exclusive groups, such that they are marked as the descendants of whichever partons they are closest to in the pseudorapidity-azimuth plane. This implementation is a bit lazy, it would be better to start from the final state particles, assign those based on their proximity to the hard partons, and work recursively up to the hadronisation vertex propagating that classification. However, if the emissions after hadronisation don't create emissions at wide angles, this shouldn't be a problem, and for my purposes I only care about the final state after hadronisation. Still, it's worth checking that this is a sensible approach by visualising a few events.

Additionally, some changes to the behaviour of MaskGroups have been made. They can now be indexed using a list of strings, which enables MaskGroups to be created with a subset of the constituents in the original, or to reorder the constituents. The order of constituents is also now strictly preserved.

Three additional changes to MaskGroups are required before the next minor release:

  • MaskGroup.__str__() should return an ASCII tree, showing the full composite structure
  • applying a boolean mask currently converts nested MaskGroups into MaskArrays; this should be changed so the structure is preserved
  • MaskGroup.flatten() should be added to remove the nested structure, bringing all of the masks to the top level

from graphicle.

jacanchaplais avatar jacanchaplais commented on June 3, 2024

Want to split the leaf-level filtering into functions which act on the lowest level MaskGroup objects. One of them can be partition_hard(), and another could be filter_background(). This could then either be applied after the hierarchy() tree is generated, or during when each leaf-level MaskGroup is complete.

Would also be nice to create an iterator over the leaves of nested MaskGroup trees.

from graphicle.

jacanchaplais avatar jacanchaplais commented on June 3, 2024

Want to split the leaf-level filtering into functions which act on the lowest level MaskGroup objects. One of them can be partition_hard(), and another could be filter_background(). This could then either be applied after the hierarchy() tree is generated, or during when each leaf-level MaskGroup is complete.

Would also be nice to create an iterator over the leaves of nested MaskGroup trees.

Could levy the strategy pattern to pass the hierarchy() function post-processing functions on the leaves, so both partition_hard() and filter_background() could be passed, but also it would allow user extensibility.

from graphicle.

jacanchaplais avatar jacanchaplais commented on June 3, 2024

Almost complete, just need to modify the masks so that the hard partons in the latent masks go into their respective children masks, instead. Once that is complete, the PR can be merged, and the new version can be shipped.

from graphicle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.