|
[Rivet] flip3() in FourVector and FourMomentumAndy Buckley andy.buckley at cern.chThu Oct 1 11:15:57 BST 2015
I like it! Thank you, Synonym Man! Any more thoughts before I switch the code to use reverse()? Andy On 01/10/15 08:39, Ben Waugh wrote: > Would "reverse" be better? > > Cheers > Ben > > On 30/09/15 23:27, Andy Buckley wrote: >> 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 |