Presentation is loading. Please wait.

Presentation is loading. Please wait.

Peter Willendrup, Kim Lefmann

Similar presentations


Presentation on theme: "Peter Willendrup, Kim Lefmann"— Presentation transcript:

1 Peter Willendrup, Kim Lefmann
A short introduction to Peter Willendrup, Kim Lefmann 1 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

2 McStas What is it? What is it good for? How is it done? Use?
Agenda McStas What is it? What is it good for? How is it done? Use? Tutorial examples 2 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

3 What is it? Flexible, general simulation utility for neutron scattering experiments. Originally designed for Monte Carlo Simulation of triple axis spectrometers Developed at RISØ National Laboratory, Roskilde, Denmark – primary (2 people) ILL (Institute Laue Langevin), Grenoble, France – primary (2 people) Apx users worldwide, some making contributions Original developer/maintainer Kristian Nielsen (KU), MSc Computer Science and Physics 3 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

4 What is it good for? Instrumentation Planning Optimization
Data analysis “I am seeing this strange effect, could it be due to....” “Toy” spectrometer for students and novice users 4 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

5 Three levels of source code: Instrument file (All users)
How is it done? Three levels of source code: Instrument file (All users) Component files (Some users) ANSI c code (no users) 5 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

6 How is it done? Instrument file: 6
Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

7 How is it done? Component file: 7
Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

8 How is it done? Resulting ANSI-C file: McStas is a (pre)compiler!
Input is .comp and .instr files + runtime functions for e.g. random numbers Output is a single c-file, which can be compiled using e.g. gcc. Can take input arguments if needed. 8 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

9 How about the neutron? Neutrons in McStas are neutron 'rays' or 'packages', representing a large number of neutrons emitted by the source (Initial Monte Carlo weight). Each As the neutron package carries the physical properties, reflecting interaction with components in the instrument Spatial coordinates: x,y,z Velocity components: vx,,vy,vz Time: t Spin components: sx,sy,sz Monte Carlo weight: p As physics take place, e.g. scattering in a sample or reflection on a monochromator, the weight is adjusted accordingly (taking local probabilities in the component into account). Coordinate systems: Global and local Global: Normally, neutrons originate at the origin... ;-) z axis is initial travelling dirction, y is gravitational axis Local: z axis is directed towards the 'next' component Focusing: Monte Carlo 'trick' to not spend time on 'useless' neutrons, e.g. send all neutrons in the direction that we are interested in, adjusting the weight accordingly... 9 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

10 Use? 10 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

11 Use? Detectors Detector data Neutron source 11
Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

12 Use? 12 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas

13 Lets go :-) ? Let's go through the tutorial...
McStas crash course, 2 independent sessions on sept 6 registrees for session 1 – Still room for more people 5 registrees for session 2 – Still room for more people -> If you are interested in attending, please come see us, a maximum of 12 people pr. session can attend. 13 Peter Willendrup, Kim Lefmann (RISØ) A gentle instroduction to McStas


Download ppt "Peter Willendrup, Kim Lefmann"

Similar presentations


Ads by Google