|
[Rivet] Dangerous casting to FinalStateFrank Siegert frank.siegert at cern.chFri Jul 10 12:18:48 BST 2015
Actually, I think Chris has pointed that out before, and I only realise it now: My copying test case also fails on current Rivet tip, even without my patch! Are there no (other) cases, where we really copy projections by value? So we might as well go ahead with my patch, since it will save users from this silly slicing mistake. And we will have to fix the projection registration mechanism anyway if we want to allow copying of projections by value. Though I didn't quite understand David's last comment: do you find the patch ok, or not (assuming we only care about FinalState-derived projections at the moment)? Any other objections? Cheers, Frank On 10 July 2015 at 12:41, Chris Pollard <cpollard at cern.ch> wrote: > Hi David, all, > > Before responding below, can I solicit opinions from David and Frank on > whether we should move forward with the release? This still looks like a > complicated issue to me that needs more time... > >>>> In that case we would need to understand why >>>> VetoedFinalState remainder = zfinder.remainingFinalState(); >>>> addProjection(remainder, "RFS"); >>>> (i.e. making a full copy, not just by reference) >>>> makes Rivet's projection book-keeping fall over: >>>> >>>> Error in MY_RFSTEST2c::init method: No projections registered >>>> for >>>> parent 0x7ffe07be8840 >> >> >> I guess that's because we don't have a dedicated copy constructor that >> re-registers the copy with the handler. This now would be a valid reason to >> ban copies completely, but needs to be done consistently throughout the >> projection machinery. > > > Do we have other options? Isn't it possible to check with the handler > whether the projection-being-copied already has been registered and, if so, > register the new projection as well? > > Chris > > _______________________________________________ > Rivet mailing list > Rivet at projects.hepforge.org > https://www.hepforge.org/lists/listinfo/rivet
More information about the Rivet mailing list |