Code updates description 22July2009 Code has been modified to include scattering from air in air gaps and Al in Al windows. This is handled in two new subroutines, airgap.f and alwindow.f. One can simply copy the block of code in main_WUp.f for an air gap or Al window to include new gaps. These blocks of code are generic and can be put anywhere (well, the first instance of air gap and Al window have counters to see the transmission through those materials as a check, so copy the second instance instead of the first). The x,y,z,thx,thy, and energy values are updated at each new gap now so the blocks of code can be moved around. Also, the empty.f subroutine has been changed so that empty cells are fille with 4He gas or air in the case of running with an air target. Energies can change in air gaps, Al windows, and the target cells. Momentum transfer values for the n-liquid He interaction are determined from S(q) before each each target independently. The guide, incoil, and outcoil subroutines have not been altered to allow scattering from 4He or air. However, this should be a very small effect. The total scattering cross section for n-He at 2.2meV is 1.6b, 10 times less than n-14N. Also, the density of He at STP is half that of air. (see below) Also, these subroutines are old in the sense that they have not been modified to get the correct path length after bouncing from a wall (Kangfei's modification). Parameters that define the targets, air gaps, Al windows, and other beam geometries are now all in const.inc, as well as the number of events to run (one needs to rebuild the codes after any modification to const.inc). Make sure that the subroutine call for a given air gap or Al window in main_WUp.f includes the desired geometries from const.inc. The target.f subroutine now allows scattering from 4He gas and air in addition to the liquid helium. To model scattering in gas He, air, and Al the code assumes isotropic scattering in the center-of-mass frame. Cross sections are determined from simple power-law fits of ENDF interpreted cross sections (see http://www.nndc.bnl.gov/sigma/ ). n-14N is used for air since n-16O has a much smaller cross section. There are flags in const.inc to turn on He gas or air for the target. A convenient way to check attenuation values is to turn off the beam divergence by setting ng6index to a very small number in const.inc. Then compare number entering and leaving a gap. Note: despite the name, "ng6index", this parameter really reflects the divergence AFTER the PSM, since that is where we start the simulation. Some transmission benchmarks at En=2.2meV: Material Sigma (b) nden(/1E24) thickness (cm) transmission(%) 2K He 0.25 0.0219 41.6 80 4He gas 1.6 0.000025 41.6 99.3 air 18.3 0.000054 41.6 96 air 18.3 0.000054 3 99.7 Al 2.2 0.06026 0.1 98.7 Al 2.2 0.06026 0.01 99.85