[Rivet] flip3() in FourVector and FourMomentum

Andy Buckley andy.buckley at cern.ch
Wed Sep 30 23:27:13 BST 2015


Hi all,

In testing today I noticed that I'd recently introduced a 
MissingMomentum problem in the Rivet trunk, by returning the "missing 
momentum" FourMomentum object as -visibleMomentum(mass=0). I hadn't been 
switched-on enough to realise that I was multiplying the energy by -1 as 
well, which of course led to -ve mass2's.

Since it's not trivial to just invert the spatial components, I've added 
a "flip3()" method to FourVector and FourMomentum, which does just that. 
I'd appreciate a bit of feedback on the API:

NAME: I don't love "flip3". But "invert" feels equally ambiguous. So 
does "reflect". "parity" feels too abstract and would maybe be expected 
to return a double eigenvalue for something. "negate" sounds to me like 
"set to zero" rather than "multiply by -1". Any better ideas?

RETURN: at the moment I'm making this return a new vector object rather 
than do the flip in-place and return a reference to *this. This is 
consistent with the behaviour of operator-. Any thoughts on this? Less 
important than the name, I think.

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