/*************************************************************************** * McStas instrument definition URL=http://www.mcstas.org * * Instrument: Test_Magnetic_Majorana * * %Identification * Written by: Peter Christiansen and Peter Willendrup * Date: August 2006 * Origin: RISOE * Release: McStas CVS_080624 * Version: $Revision: 1.3 $ * %INSTRUMENT_SITE: tests * * This instrument demonstrates how to use the Pol_simpleBfield * component with a Majorana field. * * %Description * This instrument demonstrates how to use the component * Pol_simpleBfield with a so called Majorana field. * * See: * Seeger et al. NIM A: Volume 457, Issues 1-2 , 11 January 2001, Pages 338-346 * * Note that there are some sytematic fluctuation with the current solution. * * Example: mcrun Test_Magnetic_Majorana.instr * * %Parameters * * Blarge: [T] Large linear decreasing field along x axis (+Blarge to -Blarge). * Bsmall: [T] Constant small component of field along y axis. * magnetLength: [m] Magnet length. * * %Link * * %End ****************************************************************************/ /* Change name of instrument and input parameters with default values */ DEFINE INSTRUMENT Test_Magnetic_Majorana(Blarge=1.0, Bsmall=0.003, magnetLength=1.0) /* The DECLARE section allows us to declare variables or small */ /* functions in C syntax. These may be used in the whole instrument. */ DECLARE %{ %} /* The INITIALIZE section is executed when the simulation starts */ /* (C code). You may use them as component parameter values. */ INITIALIZE %{ %} /* Here comes the TRACE section, where the actual */ /* instrument is defined as a sequence of components. */ TRACE /* The Arm() class component defines reference points and orientations */ /* in 3D space. Every component instance must have a unique name. Here, */ /* Origin is used. This Arm() component is set to define the origin of */ /* our global coordinate system (AT (0,0,0) ABSOLUTE). It may be used */ /* for further RELATIVE reference, Other useful keywords are : ROTATED */ /* EXTEND GROUP PREVIOUS. Also think about adding a neutron source ! */ /* Progress_bar is an Arm displaying simulation progress. */ COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT source = Source_simple(radius = 0.001, dist = 1.0, xw = 0.001, yh = 0.001, Lambda0 = 15, dLambda = 14.0, flux = 1) AT (0, 0, 0) RELATIVE Origin COMPONENT polSetter = Set_pol(px=1) AT (0, 0, 0.5) RELATIVE Origin COMPONENT pollambdaMonitor1x = PolLambda_monitor(xw=0.1, yh=0.1, nlam=100, Lmin=0.0, Lmax=30.0, npol=21, mx=1, my=0, mz=0, filename="pollambdaMon1x.data") AT (0, 0, 0.7) RELATIVE Origin COMPONENT pollambdaMonitor1y = PolLambda_monitor(xw=0.1, yh=0.1, nlam=100, Lmin=0.0, Lmax=30.0, npol=21, mx=0, my=1, mz=0, filename="pollambdaMon1y.data") AT (0, 0, 0.75) RELATIVE Origin COMPONENT pollambdaMonitor1z = PolLambda_monitor(xw=0.1, yh=0.1, nlam=100, Lmin=0.0, Lmax=30.0, npol=21, mx=0, my=0, mz=1, filename="pollambdaMon1z.data") AT (0, 0, 0.8) RELATIVE Origin COMPONENT armMagnet = Arm() AT (0,0,1) RELATIVE Origin // The By field is set to rotate the spin 180 degrees for neutrons of wavelenth // 5 AA COMPONENT msf = Pol_simpleBfield(xw=0.08, yh=0.08, length=magnetLength, Bx=Blarge, By=Bsmall, Bz=0, fieldFunction=majorana_magnetic_field) AT (0, 0, 0) RELATIVE armMagnet COMPONENT msfCp = COPY(msf) AT (0, 0, 0) RELATIVE armMagnet COMPONENT armMagnetEnd = Arm() AT (0,0,magnetLength) RELATIVE armMagnet COMPONENT pollambdaMonitor2x = PolLambda_monitor(xw=0.1, yh=0.1, nlam=100, Lmin=0.0, Lmax=30.0, npol=21, mx=1, my=0, mz=0, filename="pollambdaMon2x.data") AT (0, 0, 0.1) RELATIVE armMagnetEnd COMPONENT pollambdaMonitor2y = PolLambda_monitor(xw=0.1, yh=0.1, nlam=100, Lmin=0.0, Lmax=30.0, npol=21, mx=0, my=1, mz=0, filename="pollambdaMon2y.data") AT (0, 0, 0.1) RELATIVE armMagnetEnd COMPONENT pollambdaMonitor2z = PolLambda_monitor(xw=0.1, yh=0.1, nlam=100, Lmin=0.0, Lmax=30.0, npol=21, mx=0, my=0, mz=1, filename="pollambdaMon2z.data") AT (0, 0, 0.1) RELATIVE armMagnetEnd COMPONENT mpollambdaMonitor2x = MeanPolLambda_monitor(xw=0.1, yh=0.1, nlam=100, Lmin=0.0, Lmax=30.0, mx=1, my=0, mz=0, filename="mpollambdaMon2x.data") AT (0, 0, 0.1) RELATIVE armMagnetEnd COMPONENT mpollambdaMonitor2y = MeanPolLambda_monitor(xw=0.1, yh=0.1, nlam=100, Lmin=0.0, Lmax=30.0, mx=0, my=1, mz=0, filename="mpollambdaMon2y.data") AT (0, 0, 0.1) RELATIVE armMagnetEnd COMPONENT mpollambdaMonitor2z = MeanPolLambda_monitor(xw=0.1, yh=0.1, nlam=100, Lmin=0.0, Lmax=30.0, mx=0, my=0, mz=1, filename="mpollambdaMon2z.data") AT (0, 0, 0.1) RELATIVE armMagnetEnd /* This section is executed when the simulation ends (C code). Other */ /* optional sections are : SAVE */ FINALLY %{ %} /* The END token marks the instrument definition end */ END