add N0 estimate to single histogram fit. Some improvements in musredit (see ChangLog)

This commit is contained in:
2013-02-14 09:16:27 +00:00
parent 4e554aaf84
commit 310eedf190
24 changed files with 1089 additions and 163 deletions

View File

@ -0,0 +1,76 @@
FeSe 9p4 TF100 p107apr09_sample*1p02
###############################################################
FITPARAMETER
# Nr. Name Value Step Pos_Error Boundaries
1 Asy 0.2622 -0.0014 0.0014 0 0.33
2 Rate 0.3188 -0.0044 0.0044
3 Field 97.853 -0.056 0.056 0 200
4 Phase_L 178.95 -0.41 0.41
5 Phase_R 1.75 -0.40 0.39
6 N0_L 1097.90 -1.00 1.00
7 N0_R 1159.7 -1.0 1.0
8 Bkg_L 54.47 -0.20 0.20
9 Bkg_R 46.70 -0.19 0.19
###############################################################
THEORY
asymmetry 1
simplExpo 2 (rate)
TFieldCos map1 fun1 (phase frequency)
###############################################################
FUNCTIONS
fun1 = par3 * gamma_mu
###############################################################
RUN data/deltat_pta_gpd_0423 PIE1 PSI PSI-BIN (name beamline institute data-file-format)
fittype 0 (single histogram fit)
norm 6
backgr.fit 8
lifetimecorrection
map 4 0 0 0 0 0 0 0 0 0
forward 1
#background 30 152 # estimated bkg: 49.2393
data 165 7965
t0 162.0
fit 0 8.2
packing 25
RUN data/deltat_pta_gpd_0423 PIE1 PSI PSI-BIN (name beamline institute data-file-format)
fittype 0 (single histogram fit)
norm 7
backgr.fit 9
lifetimecorrection
map 5 0 0 0 0 0 0 0 0 0
forward 2
#background 30 152 # estimated bkg: 43.1545
data 205 7965
t0 202.0
fit 0 8.2
packing 25
###############################################################
COMMANDS
SCALE_N0_BKG TRUE
MINIMIZE
MINOS
SAVE
###############################################################
PLOT 0 (single histo plot)
runs 1 2
range 0 7 -0.3 0.3
###############################################################
FOURIER
units Gauss # units either 'Gauss', 'MHz', or 'Mc/s'
fourier_power 12
apodization NONE # NONE, WEAK, MEDIUM, STRONG
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
phase 8.5
#range_for_phase_correction 50.0 70.0
range 0.0 200.0
###############################################################
STATISTIC --- 2013-02-12 13:15:32
chisq = 663.9, NDF = 515, chisq/NDF = 1.289169

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

View File

@ -0,0 +1,177 @@
% $Id$
\documentclass[twoside]{article}
\usepackage[english]{babel}
\usepackage{a4}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{array}
\usepackage{float}
\usepackage{hyperref}
\usepackage{xspace}
\usepackage{rotating}
\usepackage{dcolumn}
\setlength{\topmargin}{10mm}
\setlength{\topmargin}{-13mm}
% \setlength{\oddsidemargin}{0.5cm}
% \setlength{\evensidemargin}{0cm}
\setlength{\oddsidemargin}{1cm}
\setlength{\evensidemargin}{1cm}
\setlength{\textwidth}{14.5cm}
\setlength{\textheight}{23.8cm}
\def\mathbi#1{\textbf{\em #1}}
\pagestyle{fancyplain}
\addtolength{\headwidth}{0.6cm}
\fancyhead{}%
\fancyhead[RE,LO]{\bf Estimate $\mathbi{N}_0$}%
\fancyhead[LE,RO]{\thepage}
\cfoot{--- Andreas Suter -- \today ---}
\rfoot{\includegraphics[width=6.4cm]{PSI_Logo_wide_blau.pdf}}
\DeclareMathAlphabet{\bi}{OML}{cmm}{b}{it}
\newcommand{\mean}[1]{\langle #1 \rangle}
\newcommand{\lem}{LE-$\mu$SR\xspace}
\newcommand{\musr}{$\mu$SR\xspace}
\newcommand{\etal}{\emph{et al.\xspace}}
\newcommand{\ie}{\emph{i.e.\xspace}}
\newcommand{\eg}{\emph{e.g.\xspace}}
\newcolumntype{d}[1]{D{.}{.}{#1}}
\begin{document}
% Header info --------------------------------------------------
\thispagestyle{empty}
\noindent
\begin{tabular}{@{\hspace{-0.7cm}}l@{\hspace{6cm}}r}
\noindent\includegraphics[width=3.4cm]{PSI_Logo_narrow_blau.jpg} &
{\Huge\sf Memorandum}
\end{tabular}
%
\vskip 1cm
%
\begin{tabular}{@{\hspace{-0.5cm}}ll@{\hspace{4cm}}ll}
Datum: & \today & & \\[3ex]
Von: & Andreas Suter & An: & \\
Telefon: & +41\, (0)56\, 310\, 4238 & & \\
Raum: & WLGA / 119 & cc: & \\
e-mail: & \verb?andreas.suter@psi.ch? & & \\
\end{tabular}
%
\vskip 0.3cm
\noindent\hrulefill
\vskip 1cm
%
\noindent The \musr decay histogram can be described by
\begin{equation}\label{eq:decay}
N(t) = N_0\, e^{-t/\tau_\mu} \left[ 1 + A P(t) \right] + \mathrm{Bkg}
\end{equation}
\noindent For single histogram fits a good initial estimate for $N_0$ is needed
in order that \textsc{Minuit2} has a chance to converge.
Here I summaries how $N_0$ can be reasonably well estimates. For all estimates,
it is assumed that rather to take Eq.(\ref{eq:decay}),
the following ansatz will be used
\begin{equation}\label{eq:N0ansatz}
T(t) = N_0\, e^{-t/\tau_\mu} + \mathrm{Bkg},
\end{equation}
\noindent \ie the asymmetry is ignored all together.
\section*{Estimate $\mathbi{N}_0$ with free Background}
We would like to minimize $\chi^2$, which is
\begin{equation}\label{eq:chisq}
\chi^2 = \sum_i \frac{(D_i - T_i)^2}{\sigma_i^2} = \sum_i \frac{(D_i -
T_i)^2}{D_i},
\end{equation}
\noindent where $D_i$ is a histogram entry of the measured data, $T_i$ the
evaluation of Eq.(\ref{eq:N0ansatz}) at $t_i = \Delta t \cdot i$, with $\Delta
t$ the histogram time resolution. In the last step Poisson statistics is used,
\ie $\sigma_i^2 = D_i$.
In order to minimize Eq.(\ref{eq:N0ansatz}), it is sufficient that $\nabla
\chi^2 = 0 \Longrightarrow$
\begin{eqnarray*}
\frac{\partial \chi^2}{\partial N_0} &=& \sum_i \left[ \frac{2 (D_i -
T_i)}{D_i}\, e^{-t_i/\tau_\mu} \right] = 0 \\
\frac{\partial \chi^2}{\partial \mathrm{Bkg}} &=& \sum_i \left[ \frac{2 (D_i -
T_i)}{D_i} \right] = 0
\end{eqnarray*}
\noindent With the following abbreviations
\begin{eqnarray}\label{eq:abbrv}
x_i &=& e^{-t_i/\tau_\mu} \\
\Delta &=& \sum_i 1/D_i \nonumber \\
S &=& \sum_i 1 \nonumber
\end{eqnarray}
\noindent ($S$ is the number of bins in the histogram) the background can be
written as
\begin{equation}\label{eq:bkgEstimate}
\mathrm{Bkg} = \frac{1}{\Delta}\, \sum_i \left[ 1 - \frac{N_0}{D_i}\, x_i
\right]
\end{equation}
\noindent and using this result, $N_0$ is
\begin{equation}\label{eq:N0estimate}
N_0 = \frac{\displaystyle\sum_i \left[x_i \left(1-\frac{S}{D_i
\Delta}\right)\right]}{\displaystyle\sum_j \left[\frac{x_j}{D_j}\left(x_j -
\frac{1}{\Delta} \sum_k \frac{x_k}{D_k}\right)\right]}.
\end{equation}
\noindent Eqs.(\ref{eq:bkgEstimate}) \& (\ref{eq:N0estimate}) allow to estimate
$N_0$ and Bkg. However, the results are mostly unsatisfactory since typically
$N_0$ is underestimate whereas Bkg is grossly overestimated. The reason is the
missing asymmetry term.
\section*{Estimate $\mathbi{N}_0$ with linked Background}
A much more robust ansatz is to link the background to $N_0$, \ie
\begin{equation}\label{eq:N0ansatz_with_linked_bkg}
T(t) = N_0\, e^{-t/\tau_\mu} + \mathrm{Bkg} = N_0\, e^{-t/\tau_\mu} + \alpha
N_0,
\end{equation}
\noindent where $\alpha$ is typically $0.01$ are smaller. The practical tests
show that it is mostly save to set $\alpha=0$. From
$$ \frac{\partial \chi^2}{\partial N_0} = 0 $$
\noindent it follows
\begin{equation}\label{eq:N0estimate_with_linked_bkg}
N_0 = \frac{\displaystyle\sum_i (\alpha +
x_i)}{\displaystyle\sum_i\frac{(\alpha + x_i)^2}{D_i}}.
\end{equation}
\noindent Eq.(\ref{eq:N0estimate_with_linked_bkg}) with $\alpha < 0.01$ leads typically to
very good results.
A closer look at Eq.(\ref{eq:N0estimate_with_linked_bkg}) reveals that there is
a principle problem. How should one deal with $D_i = 0$? There are two
possibilities:
\begin{enumerate}
\item if $D_i = 0$, set it to $D_i = 1$. This implicitly assumes that an empty bin has an uncertainty of 1.
\item if $D_i = 0$, ignore it!
\end{enumerate}
\noindent Currently \texttt{musrfit} ignores empty bins.
\end{document}