[mcstas-users] A new hand looking for help

Markus Appel masolomaster3000 at googlemail.com
Tue Dec 12 14:20:47 CET 2017

Dear all,

just a remark to getting the Q-resolution out of a McStas-Simulation:
You can do it with the Incoherent ("Vanadium") or any other sample, as
you have access to all variables in contrast to a real instrument:
Calculate the 'real' Q for each neutron ray, and monitor the correlation
with theta on the detector. Have a look at the attached demo instrument
file and the output plot, you can see which Q-range is detected in each
detector angle bin.

There is a specialized sample/detector component which can do this
'behind the scenes' without the code extensions, like the Res_Sample
component, but I don't have an example for that right now.


On 12/12/17 09:56, Andrew Wildes wrote:
> Hi new user,
> I won’t comment on your request for the ‘.instr’ files.  I don't,
> however, understand how you plan to get Q-resolution from a vanadium
> sample?
> Vanadium scatters isotropically.  The scattering cross-section is
> pretty much purely incoherent and elastic.  It’s a good choice to get
> the energy resolution of a spectrometer, but not the Q-resolution for
> a diffractometer.
> Normally, I’d recommend using the Bragg peaks from a powdered
> crystalline sample to get the Q-resolution.  The sample component
> should give resolution-limited peaks.  Once you’ve simulated the
> scattering, you can then plot the widths of the peaks as a function of
> Q to get the resolution.  You can even fit the widths with an
> appropriate analytical function to get the resolution for all Q.
> If you’re planning an instrument for liquids, you don’t need brilliant
> Q-resolution.  You should probably simulate for only one peak at a
> time, or with only a few peaks, to avoid problems with peaks merging
> at high Q.  I think a component like ‘Powder1’ will suffice, although
> it will take a longer time to simulate because you will need to run it
> for a number of peaks over the usable range of Q on your instrument.
>  Alternatively, you can choose something like ‘PowderN’ with, say
> beryllium as a sample, but edit the input file to only have ~10 peaks
> over the usable range of Q for your instrument.
> I’m guessing that your instrument will be a TOF diffractometer.  The
> resolution should probably be pretty flat.  You can get more
> information on TOF resolution functions at:
> <http://wwwisis2.isis.rl.ac.uk/Disordered/Manuals/ATLAS%20manual%20and%20SSG.pdf>http://wwwisis2.isis.rl.ac.uk/Disordered/Manuals/ATLAS%20manual%20and%20SSG.pdf
> I’m also not sure what a "Q detector" is.  Personally, I would use a
> straight-forward monitor that measured the position and energy
>  (possibly as a time-of-flight) of the neutron and then calculate Q
> myself from there.  I see that there is one component
> (TOF2Q_cylPSD_monitor) that will also convert to Q, but I’ve never
> used it so I can’t vouch for it.
> Sorry I can’t be more help.
> Cheers,
> Andrew
>> On 12 Dec 2017, at 01:14, 韩泽华 <hanzh at ihep.ac.cn
>> <mailto:hanzh at ihep.ac.cn>> wrote:
>> Dear all
>>     I'm a new hand on McStas.I hope for some help from you.
>>     Recently I've been trying to make a series of simulations of a
>> Total Scattering Diffractometer, which is almost like NIMROD. Now I'm
>> facing two problems.
>>     First, I want to make a simulation with a D2O sample and then
>> detect Q. I've got "D2O-coh.sqw" and "D2O-inc.sqw", but I couldn't
>> get a correct result. Could you offer me some "*.instr" files or
>> codes containing a D2O sample or H2O sample together with a Q detector?
>>     Second, I want to get a result of the Q-resolution of the
>> Diffratometer with a Vanadium sample. Can I use a Detector Component
>> to get the Q-resolution directly, even though at a certain angle? If
>> it can be, please offer me some "*.instr" files or codes as well. If
>> it can't be, then what should I do to get enough data to calculate
>> the Q-resolution afterwards?
>>     Finally I'd like to remind that all my simulations are based on a
>> Total Scattering Diffractometer.
>>     I'd appreciate all your help and suggestions.
>>     PS: I may have sent it yesterday, but with no reply, I think I
>> need to send it once again. May you forgive my disturbance.
>>     A new user
>>     _______________________________________________
>> mcstas-users mailing list
>> mcstas-users at mcstas.org <mailto:mcstas-users at mcstas.org>
>> https://mailman2.mcstas.org/mailman/listinfo/mcstas-users
> _______________________________________________
> mcstas-users mailing list
> mcstas-users at mcstas.org
> https://mailman2.mcstas.org/mailman/listinfo/mcstas-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20171212/428b5e74/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mcplot.png
Type: image/png
Size: 57394 bytes
Desc: not available
URL: <http://mailman2.mcstas.org/pipermail/mcstas-users/attachments/20171212/428b5e74/attachment-0001.png>
-------------- next part --------------

   double vi_x, vi_y, vi_z, Q;


COMPONENT Source = Source_div(xwidth=0.03, yheight=0.05, focus_aw=0.5, focus_ah=0.5, E0=5, dE=0.2, gauss=1)

COMPONENT KI_saver = Arm()
   vi_x=vx; vi_y=vy; vi_z=vz;

COMPONENT Sample = Incoherent(radius=0.02, thickness=0.001, focus_ah=10, focus_aw=180, target_x=1)
   Q = V2K * sqrt( SQR(vx-vi_x) + SQR(vy-vi_y) + SQR(vz-vi_z) );

COMPONENT QRes = Monitor_nD(
      options="banana, theta limits=[10,150] bins=100, user1 limits=[0 3.5] bins=300",
      username1="Q / AA-1")


More information about the mcstas-users mailing list