|
[Rivet] Compatibility questionFrank Siegert frank.siegert at cern.chWed Dec 7 13:02:34 GMT 2011
Hi Riveters, I had recently added the option of specifying an input final state in the W/ZFinder constructor e.g. like this: WFinder(..., FinalState inputfs=FinalState()); ( http://projects.hepforge.org/rivet/trac/browser/trunk/include/Rivet/Projections/WFinder.hh#L37 ) Only now I realised, that this won't work in all cases, as code like VetoedFinalState vfs; WFinder wfinder(..., vfs); will upcast the VetoedFinalState to a FinalState and loose any VetoedFinalState functionality (in particular its project method). The proper solution to avoid the upcast is to pass by reference, WFinder(..., const FinalState& inputfs); but then I can't specify a default argument to keep backwards compatibility. So here my questions about which solution you would prefer: 1. Break backwards compatibility and move the inputfs argument to the front without default argument. (This would bring the W/ZFinder more in line with other projections like FastJets) 2. Introduce such alternative constructors for each of the two already existing constructors, but also keep the old ones around as deprecated? 3. Or is there any other trick that avoids upcasting but allows a default argument? Anything with smart pointers that we would want to use at this place? Cheers, Frank PS: Fortunately this does not affect any of our current usage of W/ZFinder, but I would like to have this working eventually, since there was a user request for this kind of functionality.
More information about the Rivet mailing list |