id summary reporter owner description type status priority milestone component resolution keywords cc workpackage 1086 verify and document up_frac_i and up_frac_f calculations for magnetic models pkienzle "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." defect reopened major SasView 4.3.0 SasView SasView Bug Fixing