Thank you ahhill,
Although I am not using ID31 beam line, this template is extremely helpful to me. Thank you very much.
BTW, I think these two lines should be placed out of Str, since we use them to descibe instrument broadening, not sample related broadening, am I right?
lor_fwhm = pr1 Tan(Th) + pr2/Cos(Th) ;
gauss_fwhm = pr3 Tan(Th) + pr4/Cos(Th) ;