McStasMcXtrace / McCode

The home of the McStas (neutrons) and McXtrace (x-rays) Monte-Carlo ray-tracing instrument simulation codes.
https://github.com/McStasMcXtrace/McCode/wiki
GNU General Public License v3.0
77 stars 52 forks source link

No neutron can reach the chopper when changing input wavelength in ILL_IN6.instr #1415

Closed XuShuqi7 closed 1 year ago

XuShuqi7 commented 1 year ago

Hi all,

I tried to simulate the neutron transmission measurements performed at the time-of-flight spectrometer IN6 by using McStas 3.1 with the ILL_IN6.instr file. The simulation with the default inputs worked perfectly. Nevertheless, when I changed the neutron wavelength from 4.14 to 5.12 Angstrom, no neutron can reach the chopper as indicated in the output. I would like to know if I missed some steps when changing the neutron wavelength ? Thank you very much for your answers!

Shuqi

The simulation outputs are put bellow.

4.14 Angstrom: Screenshot 2023-03-08 at 10 17 27

5.12 Angstrom: Screenshot 2023-03-08 at 10 18 48

McStas code generator version 3.1 (Nov. 24, 2021)
Copyright (C) DTU Physics and Risoe National Laboratory, 1997-2021
Additions (C) Institut Laue Langevin, 2003-2019
All rights reserved

Components are (C) their authors, see component headers.

- Component library: McStas-3.1, built Nov. 24, 2021

INFO: No output directory specified (--dir)
INFO: Using directory: "ILL_IN6_20230308_101622"
INFO: Regenerating c-file: ILL_IN6.c
CFLAGS=

WARNING:
 The parameter powder_format of Sample is intitalized 
 using a static {,,,} vector.
  -> Such static vectors support literal numbers ONLY.
  -> Any vector use of variables or defines must happen via a 
     DECLARE/INITIALIZE pointer.

-----------------------------------------------------------

Generating single GPU kernel or single CPU section layout: 
-> SPLIT N at component Cradle
-> SPLIT N at component Sample

-----------------------------------------------------------

Generating GPU/CPU -DFUNNEL layout:
-> SPLIT within buffer at component Cradle
-> SPLIT within buffer at component Sample

-----------------------------------------------------------
INFO: Recompiling: ./ILL_IN6.out
./ILL_IN6.c:1852:48: warning: address of array 'detector.filename' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if (!detector.p1 || !detector.m || !detector.filename)
                                     ~~~~~~~~~~^~~~~~~~
./ILL_IN6.c:2059:5: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
  m=abs(m); n=abs(n); p=abs(p); /* make sure dimensions are positive */
    ^
./ILL_IN6.c:2059:5: note: use function 'labs' instead
  m=abs(m); n=abs(n); p=abs(p); /* make sure dimensions are positive */
    ^~~
    labs
./ILL_IN6.c:2059:15: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
  m=abs(m); n=abs(n); p=abs(p); /* make sure dimensions are positive */
              ^
./ILL_IN6.c:2059:15: note: use function 'labs' instead
  m=abs(m); n=abs(n); p=abs(p); /* make sure dimensions are positive */
              ^~~
              labs
./ILL_IN6.c:2059:25: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
  m=abs(m); n=abs(n); p=abs(p); /* make sure dimensions are positive */
                        ^
./ILL_IN6.c:2059:25: note: use function 'labs' instead
  m=abs(m); n=abs(n); p=abs(p); /* make sure dimensions are positive */
                        ^~~
                        labs
./ILL_IN6.c:3348:7: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
  if (abs(m) == 1) {/* n>1 on Y, m==1 on X: 1D, no X axis*/
      ^
./ILL_IN6.c:3348:7: note: use function 'labs' instead
  if (abs(m) == 1) {/* n>1 on Y, m==1 on X: 1D, no X axis*/
      ^~~
      labs
./ILL_IN6.c:3356:14: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
  } else if (abs(n)==1) {/* m>1 on X, n==1 on Y: 1D, no Y axis*/
             ^
./ILL_IN6.c:3356:14: note: use function 'labs' instead
  } else if (abs(n)==1) {/* m>1 on X, n==1 on Y: 1D, no Y axis*/
             ^~~
             labs
./ILL_IN6.c:3404:21: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
                  1,abs(m),1,abs(n),
                    ^
./ILL_IN6.c:3404:21: note: use function 'labs' instead
                  1,abs(m),1,abs(n),
                    ^~~
                    labs
./ILL_IN6.c:3404:30: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
                  1,abs(m),1,abs(n),
                             ^
./ILL_IN6.c:3404:30: note: use function 'labs' instead
                  1,abs(m),1,abs(n),
                             ^~~
                             labs
./ILL_IN6.c:8570:123: warning: format specifies type 'long' but the argument has type 'unsigned long long' [-Wformat]
            { printf("Monitor_nD: %s cannot reallocate Vars->Mon2D_Buffer[%li] (%li). Skipping.\n", Vars->compcurname, i, (Vars->Neutron_Counter+Vars->Buffer_Block)*sizeof(double)); Vars->Flag_List = 1; }
                                                                                ~~~                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                %llu
./ILL_IN6.c:9131:123: warning: format specifies type 'long' but the argument has type 'long long' [-Wformat]
        if (Vars->Flag_Verbose) printf("Monitor_nD: %s write monitor file %s List (%lix%li).\n", Vars->compcurname, fname,Vars->Neutron_Counter,Vars->Coord_Number);
                                                                                   ~~~                                    ^~~~~~~~~~~~~~~~~~~~~
                                                                                   %lli
./ILL_IN6.c:14347:6: warning: address of array 'opt3' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if(opt3 && strlen(opt3))
     ^~~~ ~~
./ILL_IN6.c:14348:52: warning: address of array 'opt3' will always evaluate to 'true' [-Wpointer-bool-conversion]
    stracpy(_MonokMonitor_var._parameters.options, opt3 ? opt3 : "", 16384);
                                                   ^~~~ ~
./ILL_IN6.c:14769:6: warning: address of array 'opt1' will always evaluate to 'true' [-Wpointer-bool-conversion]
  if(opt1 && strlen(opt1))
     ^~~~ ~~
./ILL_IN6.c:14770:53: warning: address of array 'opt1' will always evaluate to 'true' [-Wpointer-bool-conversion]
    stracpy(_M_theta_t_all_var._parameters.options, opt1 ? opt1 : "", 16384);
                                                    ^~~~ ~
./ILL_IN6.c:15393:126: warning: format specifies type 'double' but the argument has type 'long' [-Wformat]
  if (!tiltH) printf("Monochromator_curved: %s: Warning: not enough memory to allocate tilts (NH=%g).\n", NAME_CURRENT_COMP, NH);
                                                                                                 ~~                          ^~
                                                                                                 %ld
./ILL_IN6.c:15296:14: note: expanded from macro 'NH'
  #define NH (_comp->_parameters.NH)
             ^~~~~~~~~~~~~~~~~~~~~~~
./ILL_IN6.c:15399:126: warning: format specifies type 'double' but the argument has type 'long' [-Wformat]
  if (!tiltV) printf("Monochromator_curved: %s: Warning: not enough memory to allocate tilts (NV=%g).\n", NAME_CURRENT_COMP, NV);
                                                                                                 ~~                          ^~
                                                                                                 %ld
./ILL_IN6.c:15297:14: note: expanded from macro 'NV'
  #define NV (_comp->_parameters.NV)
             ^~~~~~~~~~~~~~~~~~~~~~~
./ILL_IN6.c:19002:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19023:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19041:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19075:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19096:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19117:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19138:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19156:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19174:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19195:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19216:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19238:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19259:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19280:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19298:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19319:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19340:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19361:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19382:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19403:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19424:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19458:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19479:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19500:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
./ILL_IN6.c:19521:22: warning: add explicit braces to avoid dangling else [-Wdangling-else]
      if (!ABSORBED) DEBUG_STATE();
                     ^
./ILL_IN6.c:1192:39: note: expanded from macro 'DEBUG_STATE'
#define DEBUG_STATE() if(!mcdotrace); else \
                                      ^
41 warnings generated.
INFO: ===
begin instrument: ILL_IN6
  Creator: McStas 3.1 - Nov. 24, 2021
  Source: ILL_IN6.instr
  Parameters:  lambda(double) dlambda(double) SPEED(double) M1(double) M2(double) M3(double) MONITOR(double) CHA_WIDTH(double) TOF_DELAY(double) TOF_CHA_RESOL(double) ELPEAK(double) RATIO(double) mFC(double) PHASE(double) Sqw_coh(string) Sqw_inc(string) radius(double) thickness(double)
  Trace_enabled: yes
  Default_main: yes
  Embedded_runtime: yes
end instrument
begin simulation: .
  Format: McStas
  URL: http://www.mccode.org
  Creator: McStas 3.1 - Nov. 24, 2021
  Instrument: ILL_IN6.instr
  Ncount: 1000000
  Trace: no
  Gravitation: no
  Seed: 1678266987829009
  Directory: .
  Param: lambda=4.14
  Param: dlambda=0.075
  Param: SPEED=-1
  Param: M1=-1
  Param: M2=-1
  Param: M3=-1
  Param: MONITOR=1
  Param: CHA_WIDTH=-1
  Param: TOF_DELAY=-1
  Param: TOF_CHA_RESOL=128
  Param: ELPEAK=-1
  Param: RATIO=1
  Param: mFC=0
  Param: PHASE=-360
  Param: Sqw_coh=Rb_liq_coh.sqw
  Param: Sqw_inc=Rb_liq_inc.sqw
  Param: radius=0.01
  Param: thickness=0.005
end simulation
loading system configuration
mcrun ILL_IN6.instr -d /Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101630 -n 1000000  lambda=4.14  dlambda=0.075  SPEED=-1  M1=-1  M2=-1  M3=-1  MONITOR=1  CHA_WIDTH=-1  TOF_DELAY=-1  TOF_CHA_RESOL=128  ELPEAK=-1  RATIO=1  mFC=0  PHASE=-360  Sqw_coh=Rb_liq_coh.sqw  Sqw_inc=Rb_liq_inc.sqw  radius=0.01  thickness=0.005
INFO: Using directory: "/Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101630"
INFO: Using existing c-file: ./ILL_IN6.c
INFO: Using existing binary: ./ILL_IN6.out
INFO: ===
Instrument Simulation ILL_IN6 (ILL_IN6.instr)
  using computed monochromator take-off angles: 75.4011 76.1933 76.9908 [deg]
Wavelength               [AA]  4.14
Neutron velocity         [m/s] 955.564
Monochr. Bragg angle     [deg] 38.0966
Incident Energy          [meV] 4.77282
Focusing Energy transfer[meV] 0
Travel time: Supp./Fermi [us]  209.301
Travel time: Supp./Det.  [us]  3294.39
TOF Delay                [us]  282.75
TOF Dead Time            [us]  2.37202
TOF Period (1 cycle)     [us]  6034.37
TOF Channel width        [us]  47.125
CHOP Fermi Phase         [deg] -6.24325
CHOP Suppressor Phase    [deg] 0
CHOP Fermi Speed         [rpm] 4971.52
CHOP Suppressor Speed    [rpm] 4971.52
Number of time channels        128
Current Elastic Peak Ch.       64
Elast. peak ch. for 0-delay    70
Time window:                   min=0.56114 max=6.59314 delay=0.28275 tof-width=6.032 [ms]
[ILL_IN6] Initialize
Source_gen: component VCS (square 0.03 x 0.2)
            focusing distance dist=2.55 area=0.03 x 0.2
            spectra 4.065 to 4.215 AA (4.605 to 4.951 meV)
            T1=216.8 K (2.093 AA), T2=33.9 K (5.292 AA), T3=16.7 K (7.539 AA)
  Flux is dPhi/dlambda in [n/s/cm2].
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/HOPG.rfl' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/HOPG.trm' (Table_Read_Offset)
FermiChopper: Suppressor: Frequency nu=82.8587 [Hz] 4971.52 [rpm], time frame=0.0241375 [s] phase=0 [deg]
FermiChopper: FermiM: Frequency nu=82.8587 [Hz] 4971.52 [rpm], time frame=0.0241375 [s] phase=-6.24325 [deg]
Isotropic_Sqw: Sample: is a hollow cylinder: radius=0.010000 thickness=0.005000 height=0.055000 [J Comp Phys 228 (2009) 5251]
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_inc.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_inc.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_inc.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_inc.sqw' (Table_Read_Offset)
Isotropic_Sqw: Sample: Temperature set to T=350 [K]
Isotropic_Sqw: Sample: S(q,w) data from Rb_liq_inc.sqw (inc) assumed to be classical (symmetrised in energy).
Isotropic_Sqw: Sample: Applying exp(hw/2kT) factor with T=350 [K] on Rb_liq_inc.sqw file (classical/symmetric) using 'Frommhold' quantum correction
Isotropic_Sqw: Sample: Generated Rb_liq_inc.sqw incoherent Sqw
                   q=[0.1:10 Angs-1] w=[0:101.849 meV] |S|=0.985192 size=[101x10185] sigma=0.5 [barns]
                   normalization factor S(q,w)*0.492586 (auto) \int q^2 S(q) dq=676.701
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_coh.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_coh.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_coh.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_coh.sqw' (Table_Read_Offset)
Isotropic_Sqw: Sample: Temperature set to T=350 [K]
Isotropic_Sqw: Sample: S(q,w) data from Rb_liq_coh.sqw (coh) assumed to be classical (symmetrised in energy).
Isotropic_Sqw: Sample: Applying exp(hw/2kT) factor with T=350 [K] on Rb_liq_coh.sqw file (classical/symmetric) using 'Frommhold' quantum correction
Isotropic_Sqw: Sample: Generated Rb_liq_coh.sqw coherent Sqw
                   q=[0.1:10 Angs-1] w=[0:101.849 meV] |S|=0.887933 size=[101x10185] sigma=6.32 [barns]
                   normalization factor S(q,w)*0.477012 (auto) \int q^2 S(q) dq=698.369

Trace ETA 12 [s] % 84 90 FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.652036 in slit does not match its length=0.012 (slit exit expected).
*** TRACE end *** 

Save [ILL_IN6]
Detector: Mon_SuppInL_I=7.2893e+09 Mon_SuppInL_ERR=4.46844e+06 Mon_SuppInL_N=2.66961e+06 "Mon_SuppInL_1678266990.L"
Detector: Mon_SuppInT_I=7.67757e+09 Mon_SuppInT_ERR=4.59414e+06 Mon_SuppInT_N=2.80193e+06 "Mon_SuppInT_1678266990.t"
FermiChopper: Suppressor
              Mean velocity     v     = 954.885 [m/s]
              Mean wavelength   lambda= 4.14294 [Angs]
              Mean energy       omega = 4.76605 [meV]
              Mean arrival time t     = 0.00228313 [s]
              Mean phase              = 70.2904 [deg] (use phase=-(this value) to optimize)
              Slit pack divergence    = 154.011 [deg] (full width)
              Opening time      dt    = 0.295824 [s]
              Intensity reaching FC   = 3.63103e+09 [n/s]
              Intensity passing  FC   = 9.71376e+08 [n/s]
FermiChopper: Suppressor: Lost events anaylsis
              Already inside:            0
              By Top/Bottom of cylinder: 153353
              At cylinder entrance:      951522
              Hit cyl. entrance sides:   0
              Can't prop. to slit pack:  29036
              At slit pack entrance:     240249
              On absorbing slit coating: 187667
              Exiting slit pack:         0
              Too many iterations:       0
              Prop. in wrong direction : 0
              Mad neutron (no control):  3
              At cylinder exit:          462222
Warning:      Can not reach slit wall:   0
Warning:      Can not reach slit output: 5
Detector: Mon_SuppOutT_I=9.63937e+08 Mon_SuppOutT_ERR=775361 Mon_SuppOutT_N=1.55082e+06 "Mon_SuppOutT_1678266990.t"
FermiChopper: FermiM
              Mean velocity     v     = 957.077 [m/s]
              Mean wavelength   lambda= 4.13345 [Angs]
              Mean energy       omega = 4.78795 [meV]
              Mean arrival time t     = 0.000160791 [s]
              Mean phase              = 6.04292 [deg] (use phase=-(this value) to optimize)
              Slit pack divergence    = 2.10061 [deg] (full width)
              Opening time      dt    = 0.00403485 [s]
              Intensity reaching FC   = 6.35765e+08 [n/s]
              Intensity passing  FC   = 2.57412e+07 [n/s]
FermiChopper: FermiM: Lost events anaylsis
              Already inside:            0
              By Top/Bottom of cylinder: 26298
              At cylinder entrance:      23320
              Hit cyl. entrance sides:   0
              Can't prop. to slit pack:  2
              At slit pack entrance:     1064
              On absorbing slit coating: 956673
              Exiting slit pack:         0
              Too many iterations:       0
              Prop. in wrong direction : 0
              Mad neutron (no control):  0
              At cylinder exit:          78
Warning:      Can not reach slit wall:   0
Warning:      Can not reach slit output: 1
Detector: Mon_FermiOutdT_I=2.53261e+07 Mon_FermiOutdT_ERR=125639 Mon_FermiOutdT_N=40773 "Mon_FermiOutdT_1678266990.t"
Detector: MonokMonitor_I=66822.7 MonokMonitor_ERR=322.652 MonokMonitor_N=43039 "MonokMonitor_1678266990.U1_L"
Detector: Mon_SampleInT_I=826008 Mon_SampleInT_ERR=4537.8 Mon_SampleInT_N=33248 "Mon_SampleInT_1678266990.t"
Detector: Mon_SampleInXY_I=445485 Mon_SampleInXY_ERR=2151.01 Mon_SampleInXY_N=43039 "Mon_SampleInXY_1678266990.x_y"
Detector: Out_I=707623 Out_ERR=2107.06 Out_N=136750 "out.dat"
Detector: M_theta_t_all_I=122887 M_theta_t_all_ERR=882.078 M_theta_t_all_N=23661 "M_theta_t_all_1678266991.A_E"
Detector: Detector_nM_I=230497 Detector_nM_ERR=1206.45 Detector_nM_N=44600 "Detector_nM.dat"

Finally [ILL_IN6: /Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101630]. Time: 12 [s] 
Isotropic_Sqw: Sample: 520011 neutron events (out of 683937) that should have
               scattered were transmitted because scattering conditions
WARNING        could not be satisfied after 100 tries.
Isotropic_Sqw: Sample: 491 neutron events (out of 163926) reached
WARNING        unrealistic weight. The S(q,w) norm might be too high.
Isotropic_Sqw: Sample: Scattering fraction=0.0754681 of incoming intensity
               Absorption fraction           =0.123033
               Single   scattering intensity =671618 (coh=617659 inc=53959.3)
               Multiple scattering intensity =36004.8
INFO: Placing instr file copy ILL_IN6.instr in dataset /Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101630
loading system configuration

mcplot-pyqtgraph /Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101630
loading system configuration

q              - quit
p              - save png
s              - save svg
l              - log toggle
t              - textinfo toggle
c              - cycle colormap
F1/h           - help
F5             - replot
click          - display subplot
right-click/b  - back
Meta + click   - sweep monitors
x              - expand subplots
Active colormap: jet
INFO: No output directory specified (--dir)
INFO: Using directory: "ILL_IN6_20230308_101800"
INFO: Using existing c-file: ./ILL_IN6.c
INFO: Using existing binary: ./ILL_IN6.out
INFO: ===
begin instrument: ILL_IN6
  Creator: McStas 3.1 - Nov. 24, 2021
  Source: ILL_IN6.instr
  Parameters:  lambda(double) dlambda(double) SPEED(double) M1(double) M2(double) M3(double) MONITOR(double) CHA_WIDTH(double) TOF_DELAY(double) TOF_CHA_RESOL(double) ELPEAK(double) RATIO(double) mFC(double) PHASE(double) Sqw_coh(string) Sqw_inc(string) radius(double) thickness(double)
  Trace_enabled: yes
  Default_main: yes
  Embedded_runtime: yes
end instrument
begin simulation: .
  Format: McStas
  URL: http://www.mccode.org
  Creator: McStas 3.1 - Nov. 24, 2021
  Instrument: ILL_IN6.instr
  Ncount: 1000000
  Trace: no
  Gravitation: no
  Seed: 1678267080637234
  Directory: .
  Param: lambda=4.14
  Param: dlambda=0.075
  Param: SPEED=-1
  Param: M1=-1
  Param: M2=-1
  Param: M3=-1
  Param: MONITOR=1
  Param: CHA_WIDTH=-1
  Param: TOF_DELAY=-1
  Param: TOF_CHA_RESOL=128
  Param: ELPEAK=-1
  Param: RATIO=1
  Param: mFC=0
  Param: PHASE=-360
  Param: Sqw_coh=Rb_liq_coh.sqw
  Param: Sqw_inc=Rb_liq_inc.sqw
  Param: radius=0.01
  Param: thickness=0.005
end simulation
loading system configuration
mcrun ILL_IN6.instr -d /Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101816 -n 1000000  lambda=5.12  dlambda=0.075  SPEED=-1  M1=-1  M2=-1  M3=-1  MONITOR=1  CHA_WIDTH=-1  TOF_DELAY=-1  TOF_CHA_RESOL=128  ELPEAK=-1  RATIO=1  mFC=0  PHASE=-360  Sqw_coh=Rb_liq_coh.sqw  Sqw_inc=Rb_liq_inc.sqw  radius=0.01  thickness=0.005
INFO: Using directory: "/Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101816"
INFO: Using existing c-file: ./ILL_IN6.c
INFO: Using existing binary: ./ILL_IN6.out
INFO: ===
Instrument Simulation ILL_IN6 (ILL_IN6.instr)
  using computed monochromator take-off angles: 98.6567 99.4659 100.271 [deg]
Wavelength               [AA]  5.12
Neutron velocity         [m/s] 772.663
Monochr. Bragg angle     [deg] 49.733
Incident Energy          [meV] 3.12058
Focusing Energy transfer[meV] 0
Travel time: Supp./Fermi [us]  258.845
Travel time: Supp./Det.  [us]  4074.22
TOF Delay                [us]  1622.25
TOF Dead Time            [us]  12.1174
TOF Period (1 cycle)     [us]  4956.12
TOF Channel width        [us]  38.625
CHOP Fermi Phase         [deg] -9.40093
CHOP Suppressor Phase    [deg] 0
CHOP Fermi Speed         [rpm] 6053.13
CHOP Suppressor Speed    [rpm] 6053.13
Number of time channels        128
Current Elastic Peak Ch.       64
Elast. peak ch. for 0-delay    106
Time window:                   min=3.22447 max=8.16847 delay=1.62225 tof-width=4.944 [ms]
[ILL_IN6] Initialize
Source_gen: component VCS (square 0.03 x 0.2)
            focusing distance dist=2.55 area=0.03 x 0.2
            spectra 5.045 to 5.195 AA (3.031 to 3.214 meV)
            T1=216.8 K (2.093 AA), T2=33.9 K (5.292 AA), T3=16.7 K (7.539 AA)
  Flux is dPhi/dlambda in [n/s/cm2].
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/HOPG.rfl' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/HOPG.trm' (Table_Read_Offset)
FermiChopper: Suppressor: Frequency nu=100.885 [Hz] 6053.13 [rpm], time frame=0.0198245 [s] phase=0 [deg]
FermiChopper: FermiM: Frequency nu=100.885 [Hz] 6053.13 [rpm], time frame=0.0198245 [s] phase=-9.40093 [deg]
Isotropic_Sqw: Sample: is a hollow cylinder: radius=0.010000 thickness=0.005000 height=0.055000 [J Comp Phys 228 (2009) 5251]
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_inc.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_inc.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_inc.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_inc.sqw' (Table_Read_Offset)
Isotropic_Sqw: Sample: Temperature set to T=350 [K]
Isotropic_Sqw: Sample: S(q,w) data from Rb_liq_inc.sqw (inc) assumed to be classical (symmetrised in energy).
Isotropic_Sqw: Sample: Applying exp(hw/2kT) factor with T=350 [K] on Rb_liq_inc.sqw file (classical/symmetric) using 'Frommhold' quantum correction
Isotropic_Sqw: Sample: Generated Rb_liq_inc.sqw incoherent Sqw
                   q=[0.1:10 Angs-1] w=[0:101.849 meV] |S|=0.985192 size=[101x10185] sigma=0.5 [barns]
                   normalization factor S(q,w)*0.492586 (auto) \int q^2 S(q) dq=676.701
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_coh.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_coh.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_coh.sqw' (Table_Read_Offset)
Opening input file '/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1//data/Rb_liq_coh.sqw' (Table_Read_Offset)
Isotropic_Sqw: Sample: Temperature set to T=350 [K]
Isotropic_Sqw: Sample: S(q,w) data from Rb_liq_coh.sqw (coh) assumed to be classical (symmetrised in energy).
Isotropic_Sqw: Sample: Applying exp(hw/2kT) factor with T=350 [K] on Rb_liq_coh.sqw file (classical/symmetric) using 'Frommhold' quantum correction
Isotropic_Sqw: Sample: Generated Rb_liq_coh.sqw coherent Sqw
                   q=[0.1:10 Angs-1] w=[0:101.849 meV] |S|=0.887933 size=[101x10185] sigma=6.32 [barns]
                   normalization factor S(q,w)*0.477012 (auto) \int q^2 S(q) dq=698.369
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.926872 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.933554 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.919655 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.942841 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.961236 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.920582 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.927732 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.963861 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.943869 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.927101 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.948613 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.93123 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.964537 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.967793 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.948368 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.929586 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.937504 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.944465 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.968569 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.928415 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.96665 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.921224 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.961494 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.943833 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.943835 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.95511 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.924246 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.936262 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.927717 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.917939 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.961935 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.92754 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.948109 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.93854 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.917478 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.942945 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.923212 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.919809 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.917755 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.967111 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.948669 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.930065 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.955232 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.935783 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.941251 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.940024 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.960093 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.932218 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.954385 in slit does not match its length=0.012 (slit exit expected).
FermiChopper: Suppressor: ABSORB Neutron propagation time v*dt/length=0.929553 in slit does not match its length=0.012 (slit exit expected).
*** TRACE end *** 

Save [ILL_IN6]
Detector: Mon_SuppInL_I=0 Mon_SuppInL_ERR=0 Mon_SuppInL_N=0 "Mon_SuppInL_1678267096.L"
Detector: Mon_SuppInT_I=0 Mon_SuppInT_ERR=0 Mon_SuppInT_N=0 "Mon_SuppInT_1678267096.t"
FermiChopper: Suppressor
              Mean velocity     v     = 771.151 [m/s]
              Mean wavelength   lambda= 5.13004 [Angs]
              Mean energy       omega = 3.10838 [meV]
              Mean arrival time t     = 0.00536089 [s]
              Mean phase              = -162.003 [deg] (use phase=-(this value) to optimize)
              Slit pack divergence    = 154.011 [deg] (full width)
              Opening time      dt    = 0.242964 [s]
              Intensity reaching FC   = 1.21687e+09 [n/s]
              Intensity passing  FC   = 266427 [n/s]
FermiChopper: Suppressor: Lost events anaylsis
              Already inside:            0
              By Top/Bottom of cylinder: 76774
              At cylinder entrance:      515183
              Hit cyl. entrance sides:   0
              Can't prop. to slit pack:  1860
              At slit pack entrance:     130910
              On absorbing slit coating: 11871
              Exiting slit pack:         0
              Too many iterations:       0
              Prop. in wrong direction : 0
              Mad neutron (no control):  0
              At cylinder exit:          352
Warning:      Can not reach slit wall:   0
Warning:      Can not reach slit output: 170
Detector: Mon_SuppOutT_I=0 Mon_SuppOutT_ERR=0 Mon_SuppOutT_N=0 "Mon_SuppOutT_1678267096.t"
FermiChopper: FermiM: No neutron can reach the chopper.
Detector: Mon_FermiOutdT_I=0 Mon_FermiOutdT_ERR=0 Mon_FermiOutdT_N=0 "Mon_FermiOutdT_1678267096.t"
Detector: MonokMonitor_I=0 MonokMonitor_ERR=0 MonokMonitor_N=0 "MonokMonitor_1678267096.U1_L"
Detector: Mon_SampleInT_I=0 Mon_SampleInT_ERR=0 Mon_SampleInT_N=0 "Mon_SampleInT_1678267096.t"
Detector: Mon_SampleInXY_I=0 Mon_SampleInXY_ERR=0 Mon_SampleInXY_N=0 "Mon_SampleInXY_1678267096.x_y"
Detector: Out_I=0 Out_ERR=0 Out_N=0 "out.dat"
Detector: M_theta_t_all_I=0 M_theta_t_all_ERR=0 M_theta_t_all_N=0 "M_theta_t_all_1678267097.A_E"
Detector: Detector_nM_I=0 Detector_nM_ERR=0 Detector_nM_N=0 "Detector_nM.dat"

Finally [ILL_IN6: /Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101816]. Time: 8 [s] 
INFO: Placing instr file copy ILL_IN6.instr in dataset /Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101816
loading system configuration

mcplot-pyqtgraph /Users/shuqixu/Downloads/My_Mcstas/test_ILL_IN6/ILL_IN6_20230308_101816
loading system configuration

q              - quit
p              - save png
s              - save svg
l              - log toggle
t              - textinfo toggle
c              - cycle colormap
F1/h           - help
F5             - replot
click          - display subplot
right-click/b  - back
Meta + click   - sweep monitors
x              - expand subplots
Active colormap: jet
willend commented 1 year ago

Dear @XuShuqi7,

I have had a look - you are right, there is a bug. The issue is a set of hard-coded limits and the "slit" keyword on this monitor:

COMPONENT Mon_SuppInT = Monitor_nD(
  xwidth = 0.052, yheight = 0.098,
  options="t slit limits=[0.0042 0.0045]", bins=iTOF_CHA_RESOL)
AT (0,0,-0.07-0.001) RELATIVE SuppPos

These ToF limits only works with the first wavelength, and "slit" means that neutrons with other ToF are absorbed.

Please find attached a corrected instrument file that now gives reasonable output for all of the standard wavelengths: mcrun ILL_IN6.instr lambda=4.1,4.6,5.1,5.9 -L

ILL_IN6.instr.txt

Screenshot 2023-03-08 at 20 02 01 Screenshot 2023-03-08 at 20 01 37
XuShuqi7 commented 1 year ago

Dear @willend,

thank you very much for your prompt reply and the updated instrument file! I succeeded in using it for my simulations.

Shuqi