Changeset 2899
- Timestamp:
- 07/13/10 15:35:20 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mcstas-1.x/lib/sources/ESS_moderator_long.comp
r2168 r2899 2 2 * 3 3 * Mcstas, neutron ray-tracing package 4 * Copyright (C) 1997-20 06, All rights reserved4 * Copyright (C) 1997-2010, All rights reserved 5 5 * Risoe National Laboratory, Roskilde, Denmark 6 6 * Institut Laue Langevin, Grenoble, France … … 13 13 * Version: $Revision: 1.23 $ 14 14 * Origin: Risoe 15 * Release: McStas 1. 9.115 * Release: McStas 1.12b 16 16 * 17 17 * A parametrised pulsed source for modelling ESS long pulses. … … 84 84 * branch_tail: (1) limit for switching between pulse and tail 85 85 * (suggested value: tau/d - default defined this way) 86 * branchframe: (1) limit for switching between 1st and 2nd pulse 87 * (if only one pulse wanted: 1) 86 * twopulses: (1) Flag for selecting one or two pulses. 0 is one pulse. 88 87 * 89 88 * %E … … 95 94 T=50, tau=287e-6, tau1=0, tau2=20e-6, d=2e-3, n=20, 96 95 n2=5, chi2=0.9, I0=6.9e11, I2=27.6e10, 97 branch1=1, branch2=0.5, branch_tail=0.14350, branchframe=0)96 branch1=1, branch2=0.5, branch_tail=0.14350, twopulses=0) 98 97 OUTPUT PARAMETERS (M, F, l_range, w_mult) 99 98 STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p) … … 101 100 DECLARE 102 101 %{ 103 double l_range, w_mult ;102 double l_range, w_mult, branchframe; 104 103 105 104 double M(double l, double temp) … … 129 128 } 130 129 130 if (twopulses) { 131 branchframe = 0.5; 132 printf("ESS_moderator_long: %s: INFO: Running with TWO pulses\n", NAME_CURRENT_COMP); 133 } else { 134 branchframe = 0; 135 printf("ESS_moderator_long: %s: INFO: Running with ONE pulse\n", NAME_CURRENT_COMP); 136 } 137 131 138 l_range = l_high-l_low; 132 139 w_mult = size*size*1.0e4; /* source area correction */ 133 140 w_mult *= l_range; /* wavelength range correction */ 134 141 w_mult *= 1/mcget_ncount(); /* Correct for number of rays */ 135 w_mult *= freq; /* Correct for frequency*/142 w_mult *= 50.0/3.0; /* Correct for baseline frequency setting */ 136 143 %} 137 144 TRACE … … 236 243 } 237 244 } 238 if (rand01()<branchframe) 239 { 240 t+=1/freq; 241 p/=(branchframe); 242 } 243 else 244 p/=(1-branchframe); 245 if (rand01()<branchframe){ 246 t+=1/freq; 247 } 245 248 %} 246 249
