TWIST experiment GEANT Monte Carlo (UNITs/DEFAULTs are in square brackets)
C
LIST
C
C This is gen369.ffcards: Like gen335 (standard surface muons to match
C set35) from 2004, but with the rate of delta ray production increased
C by a factor of 3 (in gtelec.F etc).  -RPM 07.07.23
C
C Note that the number of events is defined by the number of Black Box
C Michel spectrum samples (SRVU).
C This file is for development and debugging purposes. It differs 
C from what is needed to run Westgrid production and needs to be edited
C in the following way:
C
C (1) RUNG 1 -> RUNG production run number
C (2) TRIG 10 -> TRIG 999999999
C (3) DEBU -1 1000000 1 -> DEBU -1 1000000 5000
C (4) uncomment the cards SRVU and SRVC and set them as required
C
C Note for item (1) above:  
C For production running, using the Michel server,
C the sample number is computed as (RUNG - IBRUN) 
C (see SRVU card settings below).
C While preparing the ffcards for a given gen, IBRUN remains a constant 
C number, while, RUNG gets incremented in each ffcard.
C For the case of 1 sample/run, RUNG gets incremented by 1 
C through running the ffcard generating script, mkffcards.pl 
C For the case of N samples/run, RUNG gets incremented by N
C through running the ffcard generating script, mkmultsmplffcard.pl 
C
C   
C Additionally, you must (at a minimum) verify that these cards conform
C to the data set (w/o TEC) you want to simulate:
C
C BFLD, RATE, PGUN, MSOR, (ROOM, GABS and GCAP), COLM, DPOL 
C  
C =====================================================================
C
C **** Geant FFKEYs: see GEANT manual for more details ****
C
C ========== RUNG: IDRUN IDEVT ==========
C == IDRUN ==   User run number [1]
C == IDEVT ==   User event number [0]
C
C Note: IDRUN must be .LT. the CFM limit (currently 35000)
C
RUNG 1
C
C ========== TIME: TIMINT TIMEND ITIME    ==========
C == TIMINT  == Time used for initialization
C               NOTE: FFCARD input for TIMINT is ignored/overwritten
C == TIMEND  == Time required for termination [100 seconds]
C == ITIME   == Test every ITIME events
C               NOTE: User must optimize TIMEND/ITIME so that ITIME is
C                     as large as is save! - Program termination is
C                     initiated as soon as the time left on a particular
C                     queue is smaller than TIMEND.
TIME 0.0 100. -1
C
C ========== TRIG: NEVENT ==========
C
C == NEVENT ==  Number of events to be processed
C This number will not be used as long as it is bigger than the that
C in the Michel decay sample. 
C
C TRIG 10
TRIG 999999999
C TRIG 4938
C
C ========== NETT: NETT ==========
C
C == NETT == Number of Events To Tape [0]
C            The GEANT run is terminated with IEORUN when 
C            either:
C               NETT > 0 .and. Number of Events To Tape = NETT
C            or:
C               IEVENT = NEVENT (set by TRIG above)
C            which ever happens first.
C
NETT 0
C
C ========== RLUX: LUX ISEED ==========
C
C            The RANLUX random number generator 
C            For more information, see:
C                 http://wwwinfo.cern.ch/asdoc/shortwrupsdir/v115/top.html
C
C            LUX:   RANLUX Luxury Level
C                   Higher means 
C            ISEED: RANLUX initial seed (when seeded with only one INTEGER)
C                   Note that *any* initial seed should be good.
C                   ISEED=0 means "use RUNG as the seed".
C
RLUX 3 1
C
C ========== RNDM: NRNDM(1) NRNDM(2) ==========
C
C            NRNDM(1) and NRNDM(2) are used for restarting the generator 
C            from a break point. RANLUX will then skip over 
C            NRNDM(1) + 10**9*NRNDM(2) numbers to reach the break point
C            again (slow).
C
C            Initial value of RANLUX extra seeds NRNDM(1), NRNDM(2)
C            in call to RLUXGO(Lux,ISEED,NRNDM(1),NRNDM(2))
C
C            To reproduce an event from a "blind analysis" run made with 
C            micheld server, set IDECAY in the SRVU ffcard in addition to the
C            random seeds.
RNDM 0 0
C
C ========== RLXn: IVEC(25) ==========
C
C            You can also use these to restart the generator from a break 
C            point, using 25 32-bit integers.  More efficient than RNDM, 
C            but less convenient.
C
C            Initial state of RANLUX random number generator
C
C RLX1 3581912 5574638 6409493 1188367 13993016
C RLX2 10082780 8942804 10259692 6705902 13910431
C RLX3 5182377 8365843 981434 10328133 5335947
C RLX4 12452237 5251499 8980566 6033477 15107937
C RLX5 9138526 1822325 15433747 1746609 3071024
C
C ========= SORD: ISTORD =========
C
C          Stack ordering is required for mu->e g nu nu in order for the decay
C          gamma to be tracked after all other particles in the simulation;
C          i.e. daughters of muons are tracked in the order they are generated.
C          For details, see GEANT manual BASE040-2 and TRAK310-1
C
C          0 = Stack ordering is not activated
C          1 = Stack ordering is     activated (E614GEANT default)
C
C          See GEANT manual BASE040-2 and TRAK310-1
C
SORD 1
C
C ========= AUTO: IGAUTO =========
C
C          1 = Automatic computation of STMIN,STEMAX,DEEMAX,TMAXFD (default)
C                                    (except EPSIL)
C          0 = Tracking media parameters taken from the argument list of GSTMED
C                              (unless parameters are < 0 )
C
AUTO 0
C
C ========== PHYS: IPHYS ==========
C
C          0 = all physics processed off
C          1 = physics processes switched on/off via GEANT cards (default)
C         -1 = physics processes off for positron only
C
C PHYS 0
C
C ========== ANNI: IANNI ==========
C
C          0 = no positron annihilation effect
C          1 = positron annihilation with generation of secondaries (default)
C          2 = same without generation of secondaries
C
C ANNI 0
C
C ========== BREM: IBREM ==========
C
C          0 = no Bremsstrahlung effect
C          1 = Bremsstrahlung with generation of secondaries (default)
C          2 = same without generation of secondaries
C
C BREM 0
C
C ========== COMP: ICOMP ==========
C
C          0 = no Compton scattering
C          1 = Compton scattering with generation of secondaries (default)
C          2 = same without generation of secondaries
C
C COMP 0
C
C ========== DCAY: IDCAY ==========
C
C          0 = no particle decays
C          1 = unstable particle decay with generation of secondaries (default)
C          2 = same without generation of secondaries
C
C DCAY 0
C
C ========== DRAY: IDRAY ==========
C
C          0 = no delta rays effect
C          1 = delta rays with generation of secondaries (default)
C          2 = same without generation of secondaries
C          Note: DRAY 1 is only possible for reduced Landau fluctuations
C                (LOSS 1). When full Landau fluctuations (LOSS 2) then
C                IDRAY = 0 regardless of the setting here.
C
DRAY 1
C
C ========== HADR: IHADR ==========
C
C          0     = no hadron interactions effect
C          1,4,5 = hadron interactions with generation of secondaries
C          2     = same without generation of secondaries
C
C          GHEISHA hadronic shower code if IHADR = 1
C          FLUKA   hadronic shower code if IHADR = 4 (default)
C          FLUKA/MICAP had. shower code if IHADR = 5
C
C HADR 0
C
C ========== LOSS: ILOSS ==========
C
C          0 = no energy loss effect
C          1 = delta ray and reduced Landau fluctuations
C          2 = full Landau fluctuations and no delta rays (default)
C          3 = same as 1
C          4 = average Energy loss and no fluctuations
C
LOSS 1
C LOSS 2
C LOSS 0
C
C ========== STRA: ISTRA ==========
C
C          0 = Urban model for energy loss for thin layer (default)
C          1 = PAI model    "    "     "    "    "    "
C          2 = ASHO model for 1<delta<=30
C
C STRA 1
C
C ========== MULS: IMULS ==========
C
C          0 = no multiple scattering
C          1 = Moliere or single Coulomb scattering (default)
C          2 = same as 1
C          3 = Gaussian scattering with Rossi formula
C
C MULS 0
C
C ========== MUNU: IMUNU ==========
C
C          0 = no muon  nuclear interaction effect
C          1 = muon nucl. inter. with gen. of secondaries (default)
C          2 = same without generation of secondaries
C          Note: (IMUNU .NE. 0) only for GHEISHA!
C
C MUNU 0
C
C ========== PAIR: IPAIR ==========
C
C          0 = no gamma->e+e- pair production
C          1 = pair production with generation of secondaries (default)
C          2 = same without generation of secondaries
C
C PAIR 0
C
C ========== PHOT: IPHOT ==========
C
C          0 = no photo-electric effect
C          1 = photo-electric effect with generation of secondaries (default)
C          2 = same without generation of secondaries
C
C PHOT 0
C
C *** The ENERGY RANGE of the cross section and energy loss tables can
C     be fixed by the user with the data card :
C                   'ERAN'   EKMIN  EKMAX    NEKBIN
C     which defines nkbin bins from Ekmin to Ekmax in a logarithmic scale
C     The default is, 196 bins from 10 KeV to 100 MeV kinetic energy but
C     in logarithmic scale. NEKBIN must be 50<NEKBIN<200
C
C     WARNING: for Hadrons, GEANT tabulates the energy-loss tables
C     for a proton-kinetic energy equivalent. As a consequence, the value
C     given for EKMAX must be at least 7 times the maximum kinetic energy
C     of particles to be tracked (ratio proton/pion mass):
C     EKMAX = 500MeV for 120MeV/c pions ==> ERAN 0.00001 0.5 196
C
ERAN 0.00001 0.1 196
C
C ========== CUTS: CUTGAM CUTELE CUTNEU CUTHAD CUTMUO
C
C *** Low energy cutoffs - no tracking below these values [GeV] ***
C
C     CUTGAM   Kinetic energy cut for gammas [500 keV]
C     CUTELE   Kinetic energy cut for electrons [20 keV]
C     CUTHAD   Kinetic energy cut for hadrons [50 keV]
C     CUTNEU   Kinetic energy cut for neutral hadrons [50 keV]
C     CUTMUO   Kinetic energy cut for muons [10 keV]
C
CUTS 0.00002 0.00002 0.0005 0.0005 0.00001
C
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C         **** Geant User FFKEYs for debugging purposes ****
C
C ========== DEBU: IDEMIN IDEMAX ITEST ==========
C == IDEMIN  == First event to debug. If negative the debug flag IDEBUG
C               is set for the initialization phase [0]
C == IDEMAX ==  Last event to debug [0]
C == ITEST  ==  Print control frequency (for all events!) [0]
C
C DEBU -1 1000000 1
DEBU -1 1000000 5000
C DEBU 0 0 0
C DEBU 1 10 1
C
C    *** The convention for GDEBUG is followed (see GEANT manual) ***
C       Note: ISWIT(1) -> ISWIT(3) are active only when DEBU is on
C
C == ISWIT(1) = 2: the content of the temporary stack for secondaries in
C                  the common /GCKING/ is printed;
C == ISWIT(2) = 1: the current point of the track is stored in the JDXYZ
C                  bank via the routine GSXYZ;
C             = 2: the current information on the track is printed via
C                  the routine GPCXYZ;
C             = 3: the current step is drawn via the routine GDCXYZ;
C             = 4: the current point of the track is stored in the JDXYZ
C                  bank via the routine GSXYZ. When the particle stops
C                  the track is drawn via the routine GDTRAK and the
C                  space occupied by the track in the structure JDXYZ
C                  released;
C             = 5: print GEANT vertex information via GPVERT at the end
C                  of the event (in GUOUT)
C == ISWIT(3) = 1: the current point of the track is stored in the JDXYZ
C                  bank via the routine GSXYZ;
C == ISWIT(4) = 0: no input RAYFILE
C               1: read input RAYFILE
C             > 1: start reading at ISWIT(4)th input ray
C == ISWIT(5) = 1: RAYFILE is M13GEANT format
C             = 2: RAYFILE is REVMOC   format
C             = 3: RAYFILE is TECTRCK  format
C == ISWIT(8) = 0: Batch version
C             = 1: Interactive version
C == ISWIT(10)= 0: no digitization performed (for fast execution)
C             = 1: writes simulated TDC data to disk file
C               2: writes ASCII data to disk file
C               3: writes simulated TDC data and ASCII data to disk files
C
C SWIT 0 2 0 1 1 0 0 0 0 3
SWIT 0 0 0 0 0 0 0 0 0 1
C
C ========== HSTA: LHSTA
C == LHSTA ==   NHSTA names of required standard histograms
C
C               'TIME' provides histogram of CPU time per event
C
C HSTA 'TIME' 'SIZE' 'MULT' 'NTRA' 'STAK'
C
C ========== PRIN: LPRIN
C == LPRIN ==   NPRIN names of GEANT data structures to be printed
C
C PRIN 'PART' 'MATE' 'TMED' 'VOLU' 'SETS'
C
C ========== RGET: LRGET
C == LRGET ==   NRGET names of GEANT data structures to fetch from RZ
C
C RGET 'INIT'
C
C ========== RSAV: LRSAV
C == LRSAV ==   NRSAVE names of GEANT data structures to fetch from RZ
C
C RSAV 'INIT'
C
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C                ***** E614GEANT Run directives *****
C
C ========== MAXS: MAX_STEP MAX_LENGTH
C
C     max_step:   maximum number of steps for a track [1000]
C     max_length: maximum path length [4000 cm]
C
MAXS 100000 6000.
C
C ========== VCIN: IN_CUT(10) ==========
C
C     If the first argument is 'ALL ', the card applies to all particles;
C     if not, it applies to only secondary (including decay) particles.
C     If such a particle enters one of these volumes, stop tracking it.
C
C     in_cut:  volume name where the track is cut when entering
C              example: 'HRNG' - a list of up to nine choices
C
C     House-RiNG [HRNG] surrounds radially the tracking volume
C     G10-Ring-Foil-Support [GRFS] a daughter of HRNG
C     House-CoVer [HSCV] the "lid" upstream/downstream of tracking volume
C     House-FlaNSh [HFNS] a grand-daughter of HSCV
C     HElium-BaG [HEBG] a grand-daughter of EVOL
C     Envelope-VOLume [EVOL] the envelope of everything
C
C VCIN 'SEC ' 'HRNG' 'GRFS' 'HSCV' 'HFNS' 'HEBG' 'EVOL' 
C
C ========== VCOT: OUT_CUT(10) ==========
C
C     If the first argument is 'ALL ', the card applies to all particles;
C     if not, it applies to only secondary (including decay) particles.
C     If such a particle leaves one of these volumes, stop tracking it.
C
C     out_cut: volume name where the track is cut when exiting
C              example: 'HCTR' - a list of up to nine choices
C
C     House-CenTRe [HCTR] is the active tracking volume
C
C VCOT 'ALL ' 'HCTR'
C
C ========== STPL: ISTEP STEPLIM(9) ==> Step length limiting parameters
C
C   ISTEP = -1 will cause the target tracking to be the same as in all
C              other materials, i.e. as given for the first 5 steplim
C
C   STEPLIM
C   1st-5th: tmaxfd, stemax, deemax, epsil and  stmin for ALL materials
C              [-1.]  [-0.5]  [-0.25] [.0001]    [-.1]
C   6th-9th: stemax, deemax, epsil and stmin      for 'TARGET'  material
C             [.001]  [-0.25] [.0001]   [-.1]
C
STPL 0 5.0 -0.5 -0.25 0.0001 -0.1 -0.1 -0.0001 0.0001 0.0001
C
C ========== BFLD: JFIELD FIELD_MAX B_THETA B_PHI 
C                  DETECT_POS(1) DETECT_POS(2) DETECT_POS(3) ==========
C
C            Properties of the magnetic field.
C
C     jfield:   0 -> no magnetic field tracking (default)
C               1 -> tracking performed with GRKUTA
C               2 -> tracking performed with GHELIX
C               3 -> tracking performed with GHELX3
C              -1 -> track muon with GRKUTA / all others with GHELX3
C
C     From the GEANT code/manual:
C
C               GRKUTA for inhomogeneous fields
C               GHELIX for quasi-homogeneous fields tilted w.r.t. the reference
C               GHELX3 for one-component fields along the z axis
C
C               GRKUTA and GHELIX call the user subroutine GUFLD where the
C               components of the field at the given point are computed.
C               GHELX3 takes the value of the field in the tracking medium
C               parameter FIELDM.
C
C     field_max: maximum field [20.0 kGauss]
C
C     For jfield == 1
C
C     b_theta:   polar angle of detector wrt B-field [deg]
C     b_phi:     azimuthal angle of detector wrt B-field about z-axis [deg]
C
C     For jfield == 2
C
C     b_theta:   polar angle of B-field relative to z-axis [deg]
C     b_phi:     azimuthal angle of B-field about z-axis [deg]
C
C     These angles are used to establish the B-field components as --
C
C                Bz = field_max*cos(degrad*b_theta)
C                Bx = field_max*sin(degrad*b_theta)*cos(degrad*b_phi)
C                By = field_max*sin(degrad*b_theta)*sin(degrad*b_phi)
C
C     in the case of jfield .eq. 2
C
C     For a uniform field along the z-axis use: BFLD 3 20.0 
C     Note: b_theta/b_phi are ignored for jfield .eq. 3 !!!
C
C     detect_pos: x/y/z position of the detector wrt. B-field map center
C      
BFLD 1 19.986178  0.0 0.0 0.0 0.0 0.0
C BFLD 2 20.0 10.0 5.0 0.0 0.0 0.0
C setting for uniform 2 Tesla field:
C BFLD 3 20.0  0.0 0.0 0.0 0.0 0.0
C
C ========== FSTR: NSTRA M_STRA V_STRA
C
C     NSTRA (max.12!) Number of media with specified non-default thin
C                     layer option STRA
C     M_STRA(12) - List of tracking media numbers for thin layer option
C     V_STRA(12) - Value of thin layer option (must be REAL!);
C
C     i.e. v_stra(i) goes with m_stra(i)
C     in the CALL GSTPAR(m_stra(i),'STRA',v_stra(i))
C
C     NOTE: What's required is the TRACKING MEDIA number (not the MATERIAL
C           number). So, for example, HE-GAS (material) is 30, but
C           'HE IN MAGNET' is tracking medium 16. It is 16 that needs to
C           go into M_STRA. HOWEVER (!!!! NOTE !!!!) if you choose a
C           TRACKING MEDIA which refers to the same MATERIAL as another
C           TRACKING MEDIA, you MUST list all of them below, or else the
C           program will bomb!!!
C
C FSTR 7 30 31 33 36 15 16 19 0 0 0 0 0 1. 1. 1. 1. 1. 1. 1. 0. 0. 0. 0. 0.
C
C ======== ANCT: IANCT CTMIN CTMAX ========
C
C          ANgle CuT on cos(theta) of positron decay spectrum; especially 
C          for eliminating tracks outside our acceptance that take a long 
C          time to simulate.
C
C          CTMIN and CTMAX are the limits on cos(theta) 
C          [defaults: -0.2 and 0.2]
C
C          IANCT: 0 or negative -> No cut.  [default]
C                 1 -> Produce no positrons between CTMIN and CTMAX.
C                 2 -> Produce no positrons outside CTMIN and CTMAX.
C
ANCT 0 -0.2 0.2
C
C ========== PMLT: NPRT(1) NPRT(2) ==========
C
C     This card specifies the exact number of initial particles
C               (including the trigger particle): 
C                   >0 produces a fixed multiplicity
C                   =0 statistical multiplicities according to the values 
C                      in the RATE card
C
C     NOTE: nprt(1) < 0 is not allowed (that is to say, you don't even get
C                       a trigger particle and hence no events)
C
C            PMLT gives the initial particle multiplicity [1 -1]
C            when nprt(1) == 1 and nprt(2) <  0 no pile up
C            when nprt(1) == 0 and nprt(2) == 0 statistical multiplicity
C            when nprt(1) >= 0 and nprt(2) <  0 only muon     pile up
C            when nprt(1) == 1 and nprt(2) >= 0 only positron pile up
C
PMLT 0 0
C
C ========== RATE: RATE_MUON RATE_POSITRON TCOIN_PLUS TCOIN_MINUS ==========
C
C     The 'rate' is the mean number of particles per second
C     The 'coincidence window' defines the trigger position relative
C     to the beginning and end of the event gate
C
C     rate_muon:     surface beam muon rate [MHz]
C     rate_positron: beam positron rate [MHz]
C     tcoin_plus:    coincidence window after  trigger [us]
C     tcoin_minus:   coincidence window before trigger [us]
C
RATE 0.002713 0.007769 10. -7.
C
C ========== MDCT: DECAY_TIME ==========
C
C     The minimum trigger muon decay time in the simulation (in us)
C
C     decay_time: minimum muon decay time [0 us]
C
C MDCT 1.0
C
C ========== PGUN: IPGUN PGUN(13) ==========
C
C     Particle GUN -- basically a particle beam, from any source
C                     position, at any angle.
C     PGUN must be used in conjunction with one of the following cards:
C                     MSOR, PNCL, SLGT, CONE
C     PGUN controls elements common to all these.
C
C     Note: The element PGUN(11) controls the momentum bite;
C               PGUN(11)=1.007 means a 0.7% momentum bite.
C
C     You can now have two different particle types for pile-up.
C     You specify the particle types on the PGUN line, then list
C     the PGUN properties on the following two lines. All the
C     various particle source cards (MSOR, etc) now have two lines,
C     in the same manor, corresponding to the particles specified
C     here. You can turn on different sources for each particle.
C 
C     FYI, particle type 65 is a mu+ with spin; type 2 is a e+.
C
C     IPGUN    = GEANT Particle type [65] (default)
C     PGUN( 1) = Particle gun origin x [0 cm] 
C     PGUN( 2) = Particle gun origin y [0 cm]
C     PGUN( 3) = Particle gun origin z [-142.5 cm]
C     PGUN( 4) = Particle gun aim - rotation around x-axis [0 deg]
C     PGUN( 5) = Particle gun aim - rotation around y-axis [0 deg]
C     PGUN( 6) = Particle gun aim - rotation around z-axis [0 deg]
C     PGUN( 7) = sigma of x position [1 cm]   
C     PGUN( 8) = sigma of y position [1 cm]   
C     PGUN( 9) = sigma of z position [0 cm]   
C     PGUN(10) = flat x width [0 cm] which is then smeared with sigma_x, 
C                only for IMSOR==3
C     PGUN(11) = flat y width [0 cm] which is then smeared with sigma_y, 
C                only for IMSOR==3
C     PGUN(12) = Particle momentum [29.79 MeV/c]
C     PGUN(13) = 1 +- deltaP/P [1.0 -> deltaP/P = 0]
C
C September 2002, info from Glen
C FWHM_x = 27mm   => sigma_x = 27mm/2.35 = 11.5mm
C FWHM_y = 18mm   => sigma_y = 18mm/2.35 = 7.7mm
C
C Beam positron profiles for 2004 data were measured at -54 cm.
C
PGUN 65  2
0. 0. -191.944  0. 0. 0.  0.5  0.5   0. 0.9 0.9  29.6 1.007
0. 0. -54.0     0. 0. 0.  1.15 0.77  0. 0.9 0.9  29.6 1.007
C PGUN (65) 0. 0. -153.0 0. 0. 0. 0.45 0.5 0. 0.9 0.9 29.79 1.0
C PGUN ( 2) 0. 0.    0.  0. 0. 0. 0.   0.  0. 0.9 0.9 52.83 1.0
C
C ========== MSOR: IMSOR PSOR(9) ==========
C
C            surface Muon SOuRce generator
C
C     It is possible to specify some properties of the muon beam at 
C     the focal point (with PGUN): i.e where the focal point is, the
C     overall aim of the beam, the beam cross section, particle momentum 
C     and flat momentum spread, but launch these rays at the PSOR(1) 
C     location, z0, with some flat distribution PSOR(2) around z0. The 
C     rectangular angle spread in the horizontal and vertical direction, 
C     in the absence of a magnetic field, is defined by PSOR(3)(4), and
C     a flag exists which eliminates all muon momenta above the surface 
C     muon edge, PSOR(9).
C
C     IMSOR    = Use-Flag: any positive integer to use [1]
C                    =1 : uniform direction into rectangular aperture, 
C                         gaussian beam spot from PGUN.
C                    =2 : gaussian distributed direction, 
C                         gaussian beam spot from PGUN.
C                    =3 : direction in combo with vertex(not at focus),
C                         position and direction are correlated.
C                    =4 : read in beam properties and employ,
C                         requires z position of Particle Gun == z where 
C                         the measurements were made (see PGUN card).
C                    =5 : read in profiles to generate random rays from
C                         profiles are Y vs X, dX vs X, dY vs Y arrays (DRG's code)
C                         for this msor, need to setenv TEC_X_VS_Y, ...
C                    =6 : read profiles to generate random rays from
C                         a profile of Y vs X array.  For dX and dY generate
C                         random gaussian different for each Y vs X as also found
C                         in the profile file.
C
C     PSOR( 1) = Beam origin position in z [-300 cm]
C     PSOR( 2) = flat half-width of track start pos. [0 cm]
C If IMSOR = 1
C     PSOR( 3) = horizontal divergence [15 mrad]
C     PSOR( 4) = vertical   divergence [10 mrad]
C If IMSOR = 2
C     PSOR( 3) = horizontal opening angle sigma [15 mrad]
C     PSOR( 4) = vertical   opening angle sigma [10 mrad]
C If IMSOR = 3
C     PSOR( 3) = horizontal opening angle sigma [15 mrad]
C     PSOR( 4) = vertical   opening angle sigma [10 mrad]
C     PSOR( 5) = error function width factor in dx [0 cm]
C     PSOR( 6) = error function width factor in dy [0 cm]
C     PSOR( 7) = x to dx correlation factor(not at focus) [0]
C     PSOR( 8) = y to dy correlation factor(not at focus) [0]
C
C All cases
C     PSOR( 9) = Surface muons: no = 0, yes > 0 (default)
C         This used to be PSOR( 5)
C
C September 2002, info from Glen:
C From measurements with pion beam: FWHM_x = 15mrad, FWHM_y=18mrad
C
MSOR 6 5
-191.944 0. 13. 15. 0. 0. -0.009 -0.009 1.
-295.0   0. 15. 18. 0. 0. -0.009 -0.009 0.
C MSOR -182. 0. 13. 15. -0.009 -0.009 1.
C MSOR -174.450836 0. 13. 15. -0.009 -0.009 1.
C
C ========== PNCL: IPNCL PNCL(2) ==========
C
C     PeNCiL ray generator
C
C     Origin is defined by PGUN. Direction specified here is relative
C     to that in PGUN; all particles produced are in the same direction.
C
C     IPNCL    = Use-Flag: any positive integer to use [OFF]
C     PNCL( 1) = RAYTRACE theta [mrad]
C     PNCL( 2) = RAYTRACE phi [mrad]
C
PNCL -1 -1
15. 10.
15. 10.
C
C ========== SLGT: ISLGT SLGT(1) ==========
C
C     Search LiGhT beam generator
C
C     A bunch of rays inside a cone (NOT a double-sided cone).
C     Cone's origin and central axis are defined by PGUN.
C
C     ISLGT    = Use-Flag: any positive integer to use [OFF]
C     SLGT( 1) = circular emittance [deg]
C
SLGT -1 -1
20.0 
0.1 
C
C ========== CONE: ICONE CONE(2) ==========
C
C     Rays on the surface of a CONE with opening angle theta, in a
C     range of +-delta_theta/2. The cos of the angle is sampled flat 
C     within the specified limits.
C
C     ICONE    = Use-Flag: any positive integer to use [OFF]
C     CONE( 1) = theta [deg]
C     CONE( 2) = delta_theta [deg]
C
CONE -1 -1
-60. 0. 
2. 1.
C
C ========== CON2: ICON2 CON2(2) ==========
C
C     Rays on the surface of a CONE with opening angle theta, in a
C     range of +-delta_theta/2. The *angle* (not the cosine)
C     is sampled flat within the specified limits.
C
C     ICON2    = Use-Flag: any positive integer to use [OFF]
C     CON2( 1) = theta [deg]
C     CON2( 2) = delta_theta [deg]
C
CON2 -1 -1
90. 180.
90. 180.
C
C ========== PCON: PCON(3) ==========
C
C     Muon decay positrons on the surface of a CONE with opening angle
C     theta, in a range of +-delta_theta/2 and set momentum in a 
C     range of 1 +- deltaP/P. The cos of the angle is sampled flat
C     within the specified limits.
C     - works in conjunction with mdcay_mod = 11; i.e. MUBR 11
C
C     PCON(1) = Set momentum [50.0 MeV/c]
C     PCON(2) = Momentum spread, 1 +- deltaP/P [1.0 -> deltaP/P = 0]
C     PCON(3) = Opening angle theta [60.0 deg]
C     PCON(4) = delta_theta [deg]
C
C PCON 50.0 1.0 60.0 0.0
C
C ========== COSM: CPART CYWIND CZWIND1 CZWIND2 CXWIND1 CXWIND2 ==========
C
C     COSMic Ray generator
C
C     mu+ and mu- (in ratio 1.25:1) uniformly distributed in x and z
C     within the specified window.  See source file "cosang.F" for 
C     details on momentum distribution.
C
C     cpart:  any positive integer to use cosmic generator [OFF]
C     cywind: 'window' height above detector (y) in cm
C     czwind: the z coord of ends of the rectangular 'window'
C     cxwind: the x coord of ends of the rectangular 'window' 
C
COSM -1 130.8 -146.5 146.5 -132.0 132.0
C
C ========== ROOM: P_ATM TEMP_C ==========
C
C     Atmospheric pressure == P_atm [760 Torr]
C     Room temperature     == temp_C [20 deg C]
C
C gen235 used ROOM 753.4 28.4
ROOM 756.8 27.19
C
C ========== GABS: IGAS GAS_MIXTURE ==========
C
C     Properties of the gas degrader ("absorber")
C
C     Identity of Gas     == igas  = 20 -> He/CO2 (default)
C                                  = 21 -> He/Ar
C                                  = 22 -> He/Xe
C     Gas mixture ratio   == gas_mixture
C
C     Note: This is the fraction by VOLUME of the heavier gas [0.5];
C               (converted internally to fraction by weight)
C
C gen235 used GABS 20 0.69
GABS 20 0.67
C
C ========== PABR: IPLASTIC  PLAS_LNGTH PLAS_POSITN ==========
C
C     Properties of the plastic degrader ("absorber")
C
C     iplastic    ==  0 -> no plastic degrader
C                 == 31 -> Mylar (default)
C                 == 26 -> Scintillator
C     plas_thkns  == [0.004 cm] (full length)
C     plas_side   == [16 cm]    (full length)
C
PABR 0 0.004 8.0
C PABR 31 0.004 8.0
C
C ========== HEBG: IBAG_GAS ==========
C
C     Gas in Helium bag between end of beampipe and detector volume
C
C     ibag_gas == 13 --> magnetic air (default)
C                 16 --> magnetic helium
C         
HEBG 13
C 
C ========== TECM: ITECM ITEC_GRDW P_TECM ==========
C
C    itecm     == 0/>0 means do not/do insert a TEC [0]
C    itec_grdw == 0 -> no TEC Foil Grid [0]
C                 1 -> Aluminized Mylar Foil
C                 2 -> actual Foil Grid wires
C    P_tecm    == pressure in TEC [60 Torr]
C
C TECM 1 2 60.0
C
C ========== GCAP: N_ADMIX ==========
C
C     n_admix == Nitrogen admixture (by VOLUME) in Helium gas 
C                between chamber planes [0.02 -> 2%]
C
C September 2002, info from R.Openshaw: 
C There is about 2.7% N2 and 0.3% air in the He volume
C 
GCAP 0.03
C
C ========== YOKE: IYOKE ==========
C
C     iyoke ==  0 0/>0 means do not/do insert a YOKE [0]
C
C YOKE 1
C
C ========== DTRG: IDSTRG WIN5_POSITN DSTRIGGER(1,2,3,4) ==========
C
C     idstrg  < 0       do not insert a downstream trigger [-1]
C     idstrg == 0 -> 99 remove beam package and insert downstream trigger
C     idstrg  > 99      insert downstream trigger but keep beam package
C     mod(idstrg,100) == 0 trigger on any charge deposited
C                      > 0 trigger on mod(idstrg,100) particle type
C     win5_positn == the position of the window in downstream trigger
C                    default: -24.744 always wrt z_yoke
C                             -10.989 was the original flunsh position
C
C     dstrigger(1) == Slab horizontal dimension [cm]
C     dstrigger(2) == Slab vertical   dimension [cm]
C     dstrigger(3) == Slab Thickness [cm]
C     dstrigger(4) == Slab Global Position [cm]
C
C                 This includes mods to geometry, trigger and TDC map
C
DTRG -1 -24.744 15.5 20.0 0.158750 152.2
C DTRG -1 -10.989 15.5 20.0 0.158750 152.2
C DTRG  8 -24.744 15.5 20.0 0.158750 152.2
C
C ========== DSDK: IDSM DOWNSTREAM(1,2,3) ==========
C
C     idsm          ==  0 -> no plastic disk downstream (default)
C                   == 31 -> Mylar
C                   == 26 -> Scintillator etc.   
C
C     downstream(1) == Plastic Disk Radius [cm]
C     downstream(2) == Plastic Disk Thickness [cm]
C     downstream(3) == Plastic Disk Global Position [cm]
C
C DSDK 26 18.5 0.5 100.0
C
C ========== COLM: ICOLM NCOLM COLM1_MAT COLM1_X COLM1_Y COLM1_Z
C                              COLM1_THK COLM1_RIN COLM1_ROUT
C                              COLM2_MAT COLM2_X COLM2_Y COLM2_Z
C                              COLM2_THK COLM2_RIN COLM2_ROUT ==========
C
C      beam package muon collimators (1 or 2)
C
C      INTEGER*4 icolm       <=0 for no collimators,
C                            >= 1 for collimators (DEF=0)
C      INTEGER*4 ncolm       number of collimators 1 or 2 (DEF=2)
C      INTEGER*4 colm1_mat   first collimator material (DEF=31 Mylar)
C      REAL*4    colm1_x     first collimator x center location [cm] (DEF=0.)
C      REAL*4    colm1_y     first collimator y center location [cm] (DEF=0.)
C      REAL*4    colm1_z     first collimator z location [cm] from
C                            stop tgt (DEF=-212.682994cm)
C      REAL*4    colm1_thk   first collimator thickness [cm] (DEF=0.05cm)
C      REAL*4    colm1_rin   first collimator hole radius [cm] (DEF=1.25cm)
C      REAL*4    colm1_rout  first collimator outer radius [cm] (DEF=15.235cm)
C      INTEGER*4 colm2_mat   second collimator material (DEF=31 Mylar)
C      REAL*4    colm2_x     second collimator x center location [cm] (DEF=0.)
C      REAL*4    colm2_y     second collimator y center location [cm] (DEF=0.)
C      REAL*4    colm2_z     second collimator z location [cm] from
C                            stop tgt (DEF=-171.204994cm)
C      REAL*4    colm2_thk   second collimator thickness [cm] (DEF=0.05cm)
C      REAL*4    colm2_rin   second collimator hole radius [cm] (DEF=1.25cm)
C      REAL*4    colm2_rout  second collimator outer radius [cm] (DEF=15.235cm)
C
C Below line is for a single collimator at z=-161.,
C with radius 1.2cm, thickness 0.075cm
C COLM 1 1 39 0. 0. -177.844 0.0794 0.5 15.235 31 0. 0. -171.205 0.05 2.00 15.235
C
C Below line is for a two collimators:
C  - first with  z=-212.683, r=1.25cm, t=0.05cm, and
C  - second with z=-171.205, r=1.25cm, t=0.05cm
C COLM 1 2 31 0. 0. -212.683 0.05 1.25 15.235 31 0. 0. -171.205 0.05 1.25 15.235
C
C ========== PIBR: IPIBR ==========
C
C     Pion decay branch
C
C     ipibr == 1 : pi+ -> mu+ nu   mu has no spin (default)
C           == 2 : pi+ -> e+ nu
C           == 3 : pi+ -> mu+ n    mu has spin
C
PIBR 1
C ========== MUBR: MDCAY_MOD ==========
C
C     Muon decay branch
C
C     mdcay_mod == 1 : mu+ -> e+ nu nub (Michel Decay - default)
C               == 2 : mu+ -> e+ gamma nu nub (rad. muon decay)
C
C               == 11 : mu+ -> e+ with fixed P and Theta from PCON at cntr.
C               == 21 : same as 1, but with tgt stop dist. dev. by func_tgt
C
C MUBR 2
C
C ========== MCHL: MICHEL_RHO MICHEL_DELTA MICHEL_XSI MICHEL_ETA ==========
C
C     Set Michel parameters
C 
C     1st through 4th entries: rho [0.75], delta [0.75], xi [1.0], eta [0.0] 
C
C MCHL 0.75 0.75 1.00 0.00
C
C ========== SRVU: use micheld server  =============
C ISRVUSE,ISPECTRUM,IBRUN,IDECAY,ISRVNSAMPLES
C
C      ISRVUSE>0     To get a sample of Michel decays from a 
C                    micheld server [0].
C
C      ISPECTRUM     Request spectrum number [0].
C
C      IBRUN         Base run number[0]. The sample number used is (RUNG-IBRUN).
C                    Samples are numbered from zero within each spectrum.
C
C      IDECAY        is the initial offset in the sample buffer [0].
C                    To reproduce an event, set IDECAY as printed out by
C                    photo in addition to setting random seeds in the RNDM card.
C                    If the original run had default IDECAY==0, you can also
C                    calculate IDECAY value to reproduce an event of that run
C                    as (IEVENT-1), where IEVENT is printed out by GTRIGI.
C
C      ISRVNSAMPLES  Number of samples to read in (for a given spectrum) 
C                    per Geant run[1].
C
SRVU 1 44 0 0 5
C
C
C ========== SRVC: micheld connection parameters  =============
C
C ip1 ip2 ip3 ip4 port ntries delay_min delay_max
C
C Server address is:  ip1.ip2.ip3.ip4:port
C The default is 142.90.100.192:3469, that is, linbb.triumf.ca:3469
C
C Up to ntries [1] connection attempts are made. The time interval
C between two connection attempts starts at (randomized) delay_min [5s]
C and doubles (with randomization) till it gets to delay_max [1000s],
C then it stays around delay_max.
C
C nunatak2
C SRVC 192 168 0 12   3469   8 30 1000
C
C linbb:
SRVC 142 90 100 192  3469   8 30 1000
C
C ========== PMU0: polarization of muon at the origin =============
C  
C PMU0 sets polarization of muon with respect to its momentum in 
C initial event kinematics. The card has no effect on other muons,  
C e.g. those coming from pion decay. Default PMU0 is -1.
C
C PMU0 -0.935
C
C ========== DPOL: IF_DPOL TLIFE_DPOL(2) ==========
C
C     Set muon depolarization parameters
C
C     if_dpol:    =1 , depolarization with exponential model,
C                 =2 , depolarization with gaussian model,
C                 =0 or < 0 = off [0]
C
C     when if_dpol==1, then
C       tlife_dpol(1): exp. diffusion time of depol. in target [2.2E-6s]
C       tlife_dpol(2): exp. diffusion time of depol. in PC material [2.2E-6s]
C
C     when if_dpol==2, then
C       tlife_dpol(1): gaussian diffusion time of depol. in target [s]
C       tlife_dpol(1): gaussian diffusion time of depol. in PC material [s]
C
C Exponential model from data (with pure aluminum target),
C corresponding to lambda of 1.36e-6 1/ns.
C https://twist.phys.ualberta.ca/forum/view.php?bn=twist_physics&key=1141879111
DPOL 1 0.000735 0.000735
C
C ========== DCIC: ACL_DC(2) STEPCL_DC(2) SLGTCL_DC(2)
C
C     DC ion cluster simulation:
C
C     ACL_DC: Number of clusters needed for hit [1]
C     STEPCL_DC: The ion cluster separation [0.03cm]
C     SLGTCL_DC: The ion cluster time length [10ns]
C
C     (1) is for muon; (2) is for positron/electron
C
DCIC 1.0 1.6 0.0180 0.0140 100.0 100.0
C
C ========== TCIC: N_TEC_CLUSTERS(2) ACL_TC(2) SLGTCL_TC(2)
C
C     TC ion cluster simulation:
C
C     N_TEC_CLUSTERS: Number of ionization clusters in TCEL [11]
C     ACL_TC: Number of clusters needed for hit [1]
C     SLGTCL_TC: The ion cluster time length [10ns]
C
C     (1) is for muon; (2) is for positron/electron
C
C TCIC 11 11 1.0 1.0 0.001 0.001
C
C ========== PCIC: ACL_PC(2) STEPCL_PC(2) SLGTCL_PC(2)
C
C     PC ion cluster simulation:
C
C     ACL_PC: Number of clusters needed for hit [1]
C     STEPCL_PC: The ion cluster separation [0.03cm]
C     SLGTCL_PC: The ion cluster time length [10ns]
C
C     (1) is for muon; (2) is for positron/electron
C
PCIC 1.0 1.6 0.0180 0.0140 250.0 60.0
C
C ========== DCEF: EFFS_DC_ON ==========
C
C     Set flag to include DC chamber efficiency
C
C     effs_dc_on == 0 means do not invoke DC chamber efficiency [0]
C     effs_dc_on == 1 means do invoke DC chamber efficiency at wire level
C     effs_dc_on == 2 means do invoke DC chamber efficiency at hit  level
C
DCEF 0
C
C ========== DCDZ: DEAD_ZONE_DC_ON DEAD_ZONE_DC_FUZZ 
C                  TAU_HEAL_DC CELLDRIFT_DC ==========
C
C     dead_zone_dc_on   == 0/>0 means do not/do invoke dead-zone 
C                       due to a through going muon in DC efficiency [0]
C     dead_zone_dc_fuzz == gives the extended dead region beyond the
C                       muon track [0.06 cm]
C     tau_heal_dc       == mean time for dead zone to heal (ns) [3000]
C     celldrift_dc      == max drift in DC (ns) [700]
C
C Parameters from:
C https://twist.phys.ualberta.ca/forum/view.php?bn=twist_montecarlo&key=1133750300
DCDZ 1 0.06 3000.0 700.0
C
C ========== PCEF: EFFS_PC_ON ==========
C
C     Set flag to include PC chamber efficiency
C
C     effs_pc_on == 0 means do not invoke PC chamber efficiency [0]
C     effs_pc_on == 1 means do invoke PC chamber efficiency at wire level
C     effs_pc_on == 2 means do invoke PC chamber efficiency at hit  level
C
PCEF 0
C
C ========== PCDZ: DEAD_ZONE_PC_ON DEAD_ZONE_PC_FUZZ 
C                  TAU_HEAL_PC CELLDRIFT_PC ==========
C
C     dead_zone_pc_on   == 0/>0 means do not/do invoke dead-zone
C                       due to a through going muon in PC efficiency [0]
C     dead_zone_pc_fuzz == gives the extended dead region beyond the
C                       muon track [0.09 cm]
C     tau_heal_pc       == mean time for dead zone to heal (ns) [3000]
C     celldrift_pc      == max drift in PC (ns) [50]
C
C Parameters from:
C https://twist.phys.ualberta.ca/forum/view.php?bn=twist_montecarlo&key=1133750300
PCDZ 1 0.09 3000.0 50.0
C
C ========== TCEF: EFFS_TC_ON ==========
C
C     Set flag to include TEC chamber efficiency
C
C     effs_tc_on == 0 means do not invoke TEC chamber efficiency [0]
C     effs_tc_on == 1 means do invoke TEC chamber efficiency at wire level
C
C TCEF 0
C
C ========== DCRS: RESO_ON S0 S1 ==========
C
C     Set the drift chamber resolution function:
C
C     reso_on == 0 means do not invoke DC resolution [1]
C     reso_on == 1 means use Carl's function: sigma = s0 * exp(s1*t)
C     reso_on == 2 means use Vladimir's function: sigma = s0 + s1 * t**2
C
C     where t is the drift time in ns
C
C s0=1.5ns, according to Jingliang:
C https://twist.phys.ualberta.ca/forum/view.php?site=twist&bn=twist_software&key=1145661884
DCRS 1 1.5 0.0053
C
C ========== TCRS: TCRESO_ON TCS0 TCDSDT ==========
C
C     Set the drift chamber resolution funciton:
C
C     sigma = sigma0 + d(sigma)/dT * T  - where T is the drift time
C
C     tcreso_on == 0/>0 means do not/do invoke TC resolution [0]
C     tcs0      == sigma0 [5.0 ns]
C     tcdsdT    == d(sigma)/dT [0.01]
C
C TCRS 1 3.0 0.0
C
C ========== BOUT: M_FBU M_MCTR M_MCT2 M_MCSP 
C                  M_MCS2 M_MCS3 M_MCWI M_MUSR ==========
C
C     Set which event banks are written to YBOS file
C
C     Digitized data (simulates Fastbus output):
C     M_FBU  > 0  encodes the FBU1 and FBU2 banks in 'store_fbu'  [1]
C     Monte Carlo "Truth" banks:
C     M_MCTR > 0  stores the MCTR bank in 'store_mctr'            [1]
C                 (Contains particle starting parameters)
C     M_MCT2 > 0  stores the MCT2 bank in 'store_mct2'            [0]
C                 (Contains both starting and stopping parameters)
C     Information about detector plane hits:
C     M_MCSP > 0  store sp_data into the MCSP bank in 'store_mcsp'[0]
C     M_MCS2 > 0  store sp_data into the MCS2 bank in 'store_mcs2'[0]
C                 (MCS2 also contains momentum at each point.)
C     M_MCS3 > 0  store sp_data into the MCS3 bank in 'store_mcs3'[1]
C                 (MCS3 also contains GEANT step point)
C     Information about wire hits (not used?).
C     M_MCWI > 0  encodes the  MCWI bank in 'store_mcwi'          [0]
C     M_MUSR > 0  produces the MUSR users MC bank in store_musr   [0]
C
C Disable the space points bank
BOUT 1 0 1 0 0 0 0 0
C Enable the space points bank
C BOUT 1 0 1 0 1 0 0 0
C
C ========== UCUT: UCUT(1) UCUT(2) ==========
C
C     Set the minimum kinetic energy required of secondary to enter 
C     into the JVERT and JKINE GEANT bank structure and MCTR bank
C
C     UCUT(1) == Emin for gamma    [MeV] (default - 1MeV)
C     UCUT(2) == Emin for electron [MeV] (default - 1MeV)
C
UCUT 1.0 1.0
C
STOP