-
Notifications
You must be signed in to change notification settings - Fork 48
Description
The weights for each cross section computed from up_frac_i and up_frac_f need to be checked. The code uses:
wuu = sqrt(up_i * up_f)
wud = sqrt(up_i * (1-up_f))
wdu = sqrt((1-up_i) * up_f)
wdd = sqrt((1-up_i) * (1-up_f))
I = wuu*Iuu + wud*Iud + wdu*Idu + wdd*Idd
If either up_i or up_f is not 0 or 1, then the sum of the weights does not equal one which does not sound correct. That is, if up_i/up_f represents leakage between channels, the total number of neutrons should be preserved.
Consider up_i = 0.9, which lets through 90% up and 10% down from the guides (so up/(up+down)=0.9, and similarly up_f=0.9, which lets through 90% up and 10% down after the sample. Tracing the individual channels:
initial => sample => final selection
up=0.9 => 0.9*Iuu => 0.9*0.9*Iuu = 0.81*Iuu [true pos]
0.1*0.9*Iuu [false neg]
0.9*Iud => 0.1*0.9*Iud = 0.09*Iud [false pos]
0.9*0.9*Iud [true neg]
dn=0.1 => 0.1*Idu => 0.9*0.1*Idu = 0.09*Idu [true pos]
0.1*0.1*Idu [false neg]
0.1*Idd => 0.1*0.1*Idd = 0.01*Idd [false pos]
0.9*0.1*Idd [true neg]
So weights should not use sqrt. Note that the false positive and false negative rates may be independent, and further, with He3 polarizers, may be time dependent, but we keep things simple by having only one number per polarizer rather than two.
Doing the same analysis with a partially polarized or unpolarized beam requires an additional factor of two intensity correction. In this case, with 90% efficiency on the front end and 50% on the back end:
initial => sample => final selection
up=0.9 => 0.9*Iuu => 0.5*0.9*Iuu = 0.45*Iuu
0.5*0.9*Iuu
0.9*Iud => 0.5*0.9*Iud = 0.45*Iud
0.5*0.9*Iud
dn=0.1 => 0.1*Idu => 0.5*0.1*Idu = 0.05*Idu
0.5*0.1*Idu
0.1*Idd => 0.5*0.1*Idd = 0.05*Idd
0.5*0.1*Idd
For non-magnetic systems Iuu=Idd and Iud=Idu=0. In the first example, a correction of 1/(up_i*up*f + (1-up_i)*(1-up_f)) is needed so that I=Iuu=Iud. In the second example the correction is 2.
Update the user guide to contain complete details of the final implementation and how it is to be interpreted.
Migrated from http://trac.sasview.org/ticket/1086
{
"status": "reopened",
"changetime": "2019-03-29T10:14:54",
"_ts": "2019-03-29 10:14:54.453013+00:00",
"description": "The weights for each cross section computed from up_frac_i and up_frac_f need to be checked. The code uses:\n{{{\n wuu = sqrt(up_i * up_f)\n wud = sqrt(up_i * (1-up_f))\n wdu = sqrt((1-up_i) * up_f)\n wdd = sqrt((1-up_i) * (1-up_f))\n I = wuu*Iuu + wud*Iud + wdu*Idu + wdd*Idd \n}}}\n\nIf either up_i or up_f is not 0 or 1, then the sum of the weights does not equal one which does not sound correct. That is, if up_i/up_f represents leakage between channels, the total number of neutrons should be preserved.\n\nConsider up_i = 0.9, which lets through 90% up and 10% down from the guides (so {{{up/(up+down)=0.9}}}, and similarly up_f=0.9, which lets through 90% up and 10% down after the sample. Tracing the individual channels:\n{{{\ninitial => sample => final selection\n\n up=0.9 => 0.9*Iuu => 0.9*0.9*Iuu = 0.81*Iuu [true pos]\n 0.1*0.9*Iuu [false neg]\n 0.9*Iud => 0.1*0.9*Iud = 0.09*Iud [false pos]\n 0.9*0.9*Iud [true neg] \n dn=0.1 => 0.1*Idu => 0.9*0.1*Idu = 0.09*Idu [true pos]\n 0.1*0.1*Idu [false neg]\n 0.1*Idd => 0.1*0.1*Idd = 0.01*Idd [false pos]\n 0.9*0.1*Idd [true neg]\n}}}\n**So weights should not use sqrt**. Note that the false positive and false negative rates may be independent, and further, with He3 polarizers, may be time dependent, but we keep things simple by having only one number per polarizer rather than two.\n\nDoing the same analysis with a partially polarized or unpolarized beam requires an additional factor of two intensity correction. In this case, with 90% efficiency on the front end and 50% on the back end:\n{{{\ninitial => sample => final selection\n up=0.9 => 0.9*Iuu => 0.5*0.9*Iuu = 0.45*Iuu\n 0.5*0.9*Iuu\n 0.9*Iud => 0.5*0.9*Iud = 0.45*Iud\n 0.5*0.9*Iud\n dn=0.1 => 0.1*Idu => 0.5*0.1*Idu = 0.05*Idu\n 0.5*0.1*Idu\n 0.1*Idd => 0.5*0.1*Idd = 0.05*Idd\n 0.5*0.1*Idd\n}}}\n\nFor non-magnetic systems {{{Iuu=Idd}}} and {{{Iud=Idu=0}}}. In the first example, a correction of {{{1/(up_i*up*f + (1-up_i)*(1-up_f))}}} is needed so that {{{I=Iuu=Iud}}}. In the second example the correction is {{{2}}}.\n\nUpdate the user guide to contain complete details of the final implementation and how it is to be interpreted.",
"reporter": "pkienzle",
"cc": "",
"resolution": "",
"workpackage": "SasView Bug Fixing",
"time": "2018-04-06T22:18:01",
"component": "SasView",
"summary": "verify and document up_frac_i and up_frac_f calculations for magnetic models",
"priority": "major",
"keywords": "",
"milestone": "SasView 4.3.0",
"owner": "",
"type": "defect"
}