Skip to content

Improve cuts processes files

Tae Hyoun Park requested to merge improve-cuts-processes-files into master

!623 (merged) introduces the ability to specify plotter settings on a per-cut/histogram basis, using an external config files where each line specifies the name(s) of the histograms, followed by the settings. One noteable feature of this file is that multiple lines can exist for the same histogram, e.g.

.name="*/*", .title="my histogram", style.showSub=false, geometry.legend.xMin=0.40 # global settings
.name="Cut/Hist", cutBinLowX=10.0, style.logScale=true # x-axis settings
.name="Cut/Hist", .title="my histogram", style.logMin=0.1, style.max.scale=10. # y-axis settings

Which is convenient for factorizing the configs into "sub-categories".

This MR extends this feature to the cutflowCutFiles and the histogramProcesses files. The primary usage of this that I had in mind was to make it easier to write process-specific settings in the processes file itself. Currently, one has to write these settings in a single-line, which can make them a bit long to handle easily, or separately through generic patches (which is nice, but there isn't a by-construction 1:1 correspondence between the process being plotted and the common sampleFolder to which the style.default setting has to be applied to). With this MR, user can simply write multi-line sets of tags--one line specifying the path and LaTeX legend title, and another for histogram colors, etc.--in the processes file with the same .name identifier and have them be applied.

# the .name tag uniquely identifies the process
.name="someBkgs", .title="$\#it{X}$", .path="/bkg/$(channel)/$(campaign)/[thisProcess+thatProcess]", .isBackground=true
# stylistic settings that I don't necessarily want to have in a long single-line at the end of the above, apply it to processes with matching .name
.name="someBkgs", histFillColor=kRed-2, .legendOptions="f"

This only adds functionality for gathering multiple lines with matching .name into one group of tags to be applied at a time, i.e. all current configs will work exactly as before. Performance impact at loading the configs (done once before cutflow-printing/plotting loop) is expected to be minimal w.r.t. the overall speed of the visualize.py machinery.

MR pointing to !623 (merged) for now to highlight the relevant changes.

Edited by Tae Hyoun Park

Merge request reports