Skip to content
This repository was archived by the owner on May 3, 2024. It is now read-only.
This repository was archived by the owner on May 3, 2024. It is now read-only.

Isolate Framework into a Dependency #48

@tomeichlersmith

Description

@tomeichlersmith

Edit: I'm updating the description since the target of this issue has evolved. I've left the original issue description below.

Now that #73 alleviates the dictionary generation annoyances, the main motivation for moving Framework out of ldmx-sw is to make it easier to do two things:

  1. Strictly test its various behaviors
  2. Use it in ldmx-sw-like repos (for example ldmx-analysis)

The https://github.com/LDMX-Software/fire repo achieves these goals while also doing a pretty major refactor of various components of Framework that help clean up the code and make various points of usage less error prone. I think it would be natural to adopt a lot of these refactors while avoiding the HDF5 transition since many of these refactors are helpful on their own. Below, I've listed the more major refactors I'm thinking of along with a description and motivation.

  • Remove separation between Producers and Analyzers: we already have the input data very well protected since fire will never edit a file in place. This makes Analyzers irrelevant for their const reference to the event bus and so they are only helpful in name. Removing the separation would help make the code easier to maintain and easier to explain.
  • Remove the configure function in favor of passing parameters to the constructor: Currently, we call configure immediately after construction. We can swap configure for an attach(Process&) method that cannot be overloaded (via final). This removes user access from the Process handle and emphasizes that configuration can (and should) happen before any processing occurs.
  • Add in templated factory: This would be used for the processors and conditions themselves but then also would be available for downstream users like SimCore.
  • Generally more use of libraries and namespaces: Keeps the code organized and helps improve the organization of the documentation. config for python configuration, exception for exceptions, logging for logging, factory for the factory, io for reading and writing data, version for holding the version information, etc...
  • Modernize python module: test it alone and make sure it is helpfully documented and organized. This is also related to Auto Python Bindings #44
  • Generate own documentation: using doxygen as well as other tools
  • Refactor python imbedding: no real reason to have an object, run the script and produce the parameters tree within a function and return the parameters tree to be passed to the constructor of Process. This is also related to Auto Python Bindings #44 since I could forsee a solution that binds python in such a way that we don't need to imbed it anymore. We simply run python config.py and config.py constructors the Process and processors as well as calls p.run() at some point.

Currently, the Framework module requires that it is linked to the event object dictionary libraries at compile time. This behavior allows for Framework to use ROOT I/O on the objects in the dictionary libraries.

Why bad?

This is annoying for several reasons.

  • Any changes to event bus objects trigger a re-build of Framework because Framework is a dependency.
  • Re-generation of the ROOT dictionaries during the cmake step trigger a re-build of Framework
  • This limits the applicability of Framework to other experiments

Solution

We "just" need to load ROOT dictionaries before attempting to use ROOT I/O. We already have a library loading mechanism that occurs during the configure step (before any I/O), so that is the first place I will look. After that, I can start de-coupling Framework compilation from ldmx-sw. In the long-ish term, this would allow us to compile Framework into the development container as "just" another dependency. This would slightly speed up the compiling of ldmx-sw and open the door to using Framework more freely in other experiment softwares.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions