[Rivet] New Rivet feature: regex group references in .plot blocks

Andy Buckley andy.buckley at cern.ch
Wed Jul 20 11:40:46 BST 2016


Hi all,

I just added a simple but very handy feature to Rivet's .plot file 
handling: you can now use regex groups in your histo path patterns, and 
expand those groups into the make-plots key values.

That's pretty abstract, so here's an example:

PLOT /FOO/bar_(.*)_(\d)
Title=Bar for \1 selection (jet \2)
END PLOT

Hopefully you get the idea: the (...) groups in the path pattern can be 
expanded as numbered \1, \2, ... references in any of the block values. 
It was a lot easier than I expected, modulo some fighting with 
backslashes, otherwise I'd have done it long ago!

This should allow a lot of "private" and "MC_*" .plot files to be 
compressed. Unfortunately it probably won't help much for the 
d01-x01-y01, etc. type of HepData histo names, but maybe someone will 
have a bright idea about how those could be improved.

Cheers,
Andy

-- 
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow
Particle Physics Expt Group, University of Glasgow


More information about the Rivet mailing list