Skip to content

Add "derived plots" that use other plots' histograms (e.g. sum)

Pieter David requested to merge piedavid/bamboo:derivedhistos into master

Fixes #7 (closed)

Thanks to @swertz for the initial implementation. I thought a bit more about integrating these, and ended up with this solution. It is a bit less flexible than calling code from the postprocess method, but in the majority of common cases that is not needed, and then this is rather clean - I may have missed some subtleties, though.

Since the bookkeeping (caching of the results, mainly) is done in the backend, this should make combined plots easy to use, and it is also quite straightforward to implement e.g. an envelope systematic based on the individual contributions by inheriting from DerivedPlot.

In practice this would go with a helper method on the analysis side to share code for defining the same or similar quantities for different categories (I think this may slightly differ depending on the case, but if we find a general and easy to use version we could put it in bamboo.analysisutils). I did not put an example in the documentation yet since it would conflict with !60 (merged) , but I can add it there after rebasing.

Merge request reports