-
Notifications
You must be signed in to change notification settings - Fork 1
Isolate Framework into a Dependency #48
Description
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:
- Strictly test its various behaviors
- 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
firewill never edit a file in place. This makesAnalyzersirrelevant for theirconstreference 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
configurefunction in favor of passing parameters to the constructor: Currently, we callconfigureimmediately after construction. We can swapconfigurefor anattach(Process&)method that cannot be overloaded (viafinal). This removes user access from theProcesshandle 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.
configfor python configuration,exceptionfor exceptions,loggingfor logging,factoryfor the factory,iofor reading and writing data,versionfor 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.pyandconfig.pyconstructors the Process and processors as well as callsp.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.