[Rivet] Updated Cuts system prototype/demo

Andy Buckley andy.buckley at cern.ch
Fri May 3 12:32:48 BST 2013


Hi everyone,

Some code for your enjoyment (ha!):
http://pastebin.com/DbG36iCv

I recommend looking at the bottom first, to see how it's *used* and then
the implementation if you're interested. I hope this will be the basis
of a major improvement in how we specify kinematic cuts in Rivet... and
I'd like to re-use the idea elsewhere, too.

I can't remember if I sent around the earlier version of this that I
wrote at Christmas, but I definitely sent round an earlier one, based on
some rather scary magic with a "dynamic_any" type, and David gave some
good feedback which led to me making this neater approach. I've now
updated it with a negation operator which I think now covers all
use-cases... at least for the simple demo case of cuts on integer values
that I've implemented here! More feedback? I think this is much nicer
than the previous version: there aren't any nasty surprise behaviours as
far as I can tell.

If this looks good, we can use this method to pass combinations of
kinematic cuts as single objects to e.g. the FinalState and FastJets
constructors and particles()/jets() methods. It'll really clean things
up and allow much more natural and powerful defining of complicated
selection cuts.

We do realistically require C++11 to implement this, though, otherwise
the end user will end up having to deal with some truly horrific nested
templated types. That requires timing in with ATLAS' migration to a gcc
version in which C++11 is allowed (I think CMS are already using a new
enough compiler), which probably defines the shortest timescale for
putting this into practice... one for discussion at the collab meeting.

Andy

-- 
Dr Andy Buckley, Royal Society University Research Fellow
Particle Physics Expt Group, University of Edinburgh


More information about the Rivet mailing list