How to deal with Monte Carlo PDFs?
Created by: scarlehoff
I'm trying to finish up #1501 and there is a problem: the difference between Monte Carlo and Hessian PDFs.
For the Monte Carlo PDFs we discard replica 0 which means we have two distinct scenarios: when we ask for the central value we get replica 0, when we want the envelope we get all other replicas.
Now, this is a problem for theory prediction since it means one has to compute the convolution twice, one with a 100xN_x object and then once again with a 1xN_x object. It is obviously much more efficient to compute the convolution once with a 101xN_x object and then split in some way the result.
There are several possible options for doing this:
1 - The PDF always returns the full 101 members. This was my preferred way of doing it until I realised it meant changing not only the whole of validphys but also the convention up to now. This is almost guaranteed to break things because there are still things we don't test so mistakes could be hidden for ever.
2 - The convolution specifically calls a PDF version that has all 101 members active. This is very tricky to do since validphys hides the actual PDF object under a few layers so the only clean way I can think of is using a context manager as I did in #1433. People was not very happy with it there, but now I will be using the stats class instead so there won't be any inplace changes to dataframes. This means nothing changes for most cases but one can still use all 101 members if needed.
3 - We do the convolution twice. I think this is a terrible idea because makes everything go slower.
While doing #1501 I wanted to do (1) but after having a look I'm more inclined to go for (2). Do you guys have an opinion on this? Is there any other options I might be missing?