[Rivet] Plugin Projections

Andy Buckley andy.buckley at ed.ac.uk
Mon May 2 16:37:34 BST 2011


On 29/04/11 12:27, Holger Schulz wrote:
> Hi there,
> 
> I wonder if it would be possible at all to have a plugin mechanism
> for Projections as well. Has this been thought about already?

Hi Holger,

It can't work with the current design: the point of a plugin system is
that all the plugins implement the same interface. That is the case for
analyses, but each projection is specific to a certain kind of
information and so they have different interfaces. Loading projections
as plugins would mean that they couldn't have interfaces suited to their
purpose, since that interface can't be made available dynamically. I.e.
if an analysis hasn't seen a projection's header file when the analysis
is being compiled, it can't know what any of its methods are.

There are ways that that info could be provided generically (e.g. via
access to a map of "obsname" -> double defined on the Projection
inferface) but they would make Rivet analysis code less safe and harder
to read, would make projection writing a bit more complex, and would
require porting all the existing ones -- I don't think it would be worth
the effort and those associated problems.

You *might* be able to write a new projection and build it into an
analysis plugin, because then the only code that is using that
projection will have been able to see its interface while being
compiled. I have a vague feeling that I *have* done that before, but if
I did it was a long time ago!

Andy

-- 
Dr Andy Buckley
SUPA Advanced Research Fellow
Particle Physics Experiment Group, University of Edinburgh

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



More information about the Rivet mailing list