Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Example bump #32

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open

Example bump #32

wants to merge 27 commits into from

Conversation

gerbaudo
Copy link
Owner

@gerbaudo gerbaudo commented Oct 7, 2013

This is still a work in progress, but I need some input, so I am using a pull request to discuss the code.
I do not understand how to use the new setup: I thought that the 'model' and template were not needed anymore, but it complains with an AssertionError: A template is required.
Do you have a working example?

Also, I have two comments/suggestions for pyFBU:

  • we should specify the input data, not the json file (the input can be either from json or from another source, we don't care)
  • one of the input parameters is the bkg. This is not always well defined (the bump case is one example where we don't need to differentiate between bkg spectrum and signal spectrum, b/c we're unfolding one spectrum). I think we should have by default a null background, i.e. nreco*[0.] and ntruth*[0.]
    Please let me know what you think.

Thanks

Davide

Details:
- factorize the code in well-defined functions
- add docstrings explaining what I am doing
- rewrite most of this script. Now plotting and using the resulting
histograms as bins/counts that can be used for the unfolding.
- compute normalized response matrix
- add plotting functions
Details:
two separate logic steps: generate the pseudo-data, and then unfold.
The pseudo-data can come either from the json file, or be generated.
Details:
complaining about template. I thought it wasn't needed anymore.
Need to ask clement and Francesco about it.
@francescorubbo
Copy link
Collaborator

I think the problem is that your branch is not in sync with the master. Could you try to fast-forward it to get that latest developments?

A working example is tests/priors/runPriors.py

Details:
- factorize the code in well-defined functions
- add docstrings explaining what I am doing
- rewrite most of this script. Now plotting and using the resulting
histograms as bins/counts that can be used for the unfolding.
- compute normalized response matrix
- add plotting functions
Details:
two separate logic steps: generate the pseudo-data, and then unfold.
The pseudo-data can come either from the json file, or be generated.
Details:
complaining about template. I thought it wasn't needed anymore.
Need to ask clement and Francesco about it.
Details:
- factorize the code in well-defined functions
- add docstrings explaining what I am doing
- rewrite most of this script. Now plotting and using the resulting
histograms as bins/counts that can be used for the unfolding.
- compute normalized response matrix
- add plotting functions
Details:
two separate logic steps: generate the pseudo-data, and then unfold.
The pseudo-data can come either from the json file, or be generated.
Details:
complaining about template. I thought it wasn't needed anymore.
Need to ask clement and Francesco about it.
Details:
the vertical axis of the histo provided by histogram2d is reversed
(see
http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram2d.html)
Conflicts:
	python/generate_bump.py
	python/utils.py
@gerbaudo
Copy link
Owner Author

Hi,
Thanks for the suggestion. After pulling in the changes from the master, and some fixes see #34 , now it works, almost. I see the warning below

$ python/generate_bump.py
Warning: Stochastic truth's value is neither numerical nor array with floating-point dtype. Recommend fitting method fmin (default).

Have you seen it before? it also seems to be quite slow...can you please try to run my example and tell me whether you see anything obviously wrong?

Thanks!

@francescorubbo
Copy link
Collaborator

Ciao,

I'm not surprised it takes so long, you are doing a 50-dimensional sampling! You might want to try a coarser binning.
About the Warning, I understand from Clement that this is coming from using MAP.

Unrelated, would it be possible grouping all the test and example files in the test directory (or in a "example" directory). I would prefer to have only FBU code in the main directory (whatever we will call it).

@clementhelsens
Copy link
Collaborator

Hi Davide,

I see you want to merge this branch with the master, but now your "cleanup" branch has been merged to master, I'm afraid you will have some conflicts to solve first

@gerbaudo
Copy link
Owner Author

Hi,

I made some progress (now it runs), but I am getting nonsense.
Can you please try to run this example and tell me if you see anything obviously wrong?
It's probably some stupid but on my side...for the response matrix are we using [t][r] or [r][t]?
Thanks.

@clementhelsens
Copy link
Collaborator

Hi Davide,

sorry for the late answer.
For the response matrix we use [r][t]
I'll try your example now and let you know.

Details:
when computing p(r|t), there can be bins without any reconstructed
events. Protect against divide by zero.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants