UMC V7 Update History Takeshi K. Komatsubara (KEK) draft: 23-September-2002 (Tue) revised: 22-January-2003 (Wed) Mods from UMC V6 (for E787) to make V7 (for E949) !!Important Notice!! -------------------- - In alldat.F, the following parameters have new default values. IRSTSC = 2 [new RS thickness: T 0.700cm, L2-18 1.905cm, L19 0.9525cm] ITRVER = 3 [Trigger definitions: E949] THSMBL = 5.0 [Threshold for BVL analog-sum] IRSVER = 2 [RS subsystem: RS+BVL] IBMCUT = 1010 [cuts on the beam file: used in E787 96-97 and 98] ITAPWR = 1 [option in TAPWRT: write MONT bank] MODRFT = 61 [UTC tracking: 2nd bit obsolete] EVCPMX = 200. [pre-event CPU time limit in seconds (not important)] MODEVP = 0 [nuclear evaporation (not yet installed): off] B0FCTR = 1.0 [correction factor to the B-field: no correction] IMSCTF = 0 [multiple scattering in STEP: still the very old one] ATLBV = 87. [attenuation length in BV] ATLRS = 150. [attenuation length in RS] ATLBL = 180. [attenuation length in BL] BETABV = 0.5817 [velocity of light over c in BV] BETARS = 0.5230 [velocity of light over c in RS] BETABL = 0.5671 [velocity of light over c in BL] If a different value is set in your own .par file, please check alldat.F and find the value you need. - The source codes are converted from .cdf files to .F files. - UMC v7 is set to /e949/src/umc/ and is managed by CVS. - EGS v4 is set to /e949/src/egs/ and is managed by CVS. - Modify setup.com for UMC: setenv UMC_INCLUDE $UMC_SOURCE setenv IFLAGS "-I. -I$UMC_INCLUDE -I$KOFIA_INCLUDE -I$E949INC" - UMC v7 source code is compiled on LINUX-g77. Misc. bug fixes, updates ------------------------ geomrs.F -- Fix RSPC part in assigning region type labels NOT determined by the medium(S.Kabe) ... no difference to the UMC results Fixed a bug in handling a weired case and let the code stop. Printout Y, Thickness and Y+T of the RS scintillators Let the code stop in case a thickness is negative geomrs1.F -- (NEXT(L,I),L=1,6) --> (NEXT(L2,I),L2=1,6) Fixed a bug in handling a weired case and let the code stop. Character*10 for STACK DO L=1,7 --> DO L=1,5 for SHORT(L,I) Printout Y, Thickness and Y+T of the RS scintillators Let the code stop in case a thickness is negative ausgrs1.F -- (new subroutine) with L=20,21 = !!right!!,**left** BVL module. trigl0.F -- Use FVISBV and FVISBL in ESUMTO howfec1.F -- A bug on ACCEL is fixed. howfbf.F -- NEXT is the array with (4,8), so NEXT(7,4) does not exist. Put 999999 into IRNEW. electr_umc.F -- Bugs are fixed to avoid core dump. (S.Kabe) 1) Skip a division by 0. 2) When directional cosines U,V,W are going to be normalized, there are chances that (1.D0-DBLE(W(NP))**2) is negative because W(NP) can exceed 1 from the calculation W(NP)=W(NP)+1.E-4*XTMP/ABS(XTMP) (See code below). This produces core dump because of negative argument in calculating SQRT(1.D0-DBLE(W(NP))**2). The solution is to normalize directional cosines by calling subroutine-NORM. chkloop.F -- A patch is added to avoid core dump. (S.Kabe) (IRR.GT.NRTOT) --> (IRR.GT.NRTOT .AND. IRR.LT.100000) as in howfar. tapwrt.F -- Fixed the bug for writting non-tdc hit data onto UTMT Modified routines: ------------------ [parameters] alldat.F -- Set the E949 default to IRSVER, IBMCUT, ITAPWR, MODRFT, EVCPMX, MODEVP Add comments on ISEED=-1 and <= -2 (See umctrig.F) Add B0FCTR used in subroutine-FLDMAP. Add IMSCTF used in subroutine-MSCAT1 and MSCAT1_DBL. Set ITRVER = 3 as a default of E949 trigger Introduce THSMBL for BVL (5.0, same as THSMBV) Add ATLxx for attenuation length and BETAxx for velocity-of-light in SC Add IRSTSC (see geomrs1.F, geomrs.F) Set IRSTSC=2 as a default geodat.F -- Change ZTOTTG to ZMAXTG (downstream end of target scintillation fibers) Change the default value of ZMAXTG from 220.0 (by S.Kabe) to 111.07950 (=ZTOTMG/2) so that geomtg1 and geombf's Z dimensions are exactly the same as in v6. Add BVL parameters, with correct dimensions by Djaffe setup.F -- Add the BVL geometrical parameters to NAMGEO Add the missed parameters to NAMGEO: 2*'NSTRAW', 'RSTRAW', 2*'LSTRAW', 2*'TSTRAW','TSKIN', 2*'WSKIN', 2*'DPC' to NAMGEO . Change VV(NPARG) from REAL to DOUBLE PRECISION Add printing of decimal digit indicators LAYRRS, LAYRBL Add a simple algorithm to calculate IRS_SRT, IRS_END, IBVL_SRT, and IBVL_END from NAMGEO Add B0FCTR to /conpar/. Add IMSCTF to /conpar/. Add THSMBL to /TRGPAR/. Add ATLBV,ATLRS,ATLBL,BETABV,BETARS,BETABL to /conpar/ Add IRSTSC to /conpar/. EXTERNAL EGS4BD for egs4bd.F in /e949/src/egs/ . [RS+BVL: IRSVER=2] geomrs1.F -- Get S.Kabe/D.Jaffe's RS+BVL algorithm Use the local variables TSCNRSL(1-19) to set the RS thickness Use IRSTSC in conpar.cmn to put TTRGRS,TSCNRS, TSCN19 or the parameters in TSCNRS_new(1-19,IRSTSC) into TSCNRSL(1-19) howfrs1.F -- Get S.Kabe/D.Jaffe's RS+BVL algorithm ausgrs1.F -- (new subroutine) Copied from ausgrs.F, for RS+BVL in E949 Energy scoring for RS and BVL subsystem. Use ATLRS/ATLBL and BETARS/BETABL in conpar.cmn Store HAFLRS,HAFLBL in uener.cmn Set SIZE(3,ISCNPT(20))/2. to be the Half-length for BL [trigger] trigl0.F -- RS energy sum upto Layer19 (remind that the L0 BVL bits are not created yet) Set trigger conditions for E949 (ITRVER.GE.3) Calculating ESUMBL, ESECBL(24) and BLVETO for BVL trgwrd.F -- Add BLVETO to TT_C2 Add modifications on the E949 External Conditions l1hex.F -- Modify layers used for hextant sum. range.F -- Modifications to maximum RS layer number to take BVL into account (D.Jaffe). [geometry] geomu.F -- Add LRTYPE(8) = stailess steel of barrel veto liner. Always print out NRTOT to the logfile (ILP). geomtg.F -- (old target of E787) ZTOTTG is given (ZTOTTG = 23.495) by the DATA statement within this routine. geomtg1.F -- The downstream end of target scintillation fibers and the regions in the TG system is ZMAXTG, not ZTOTMG/2. geomec1.F -- Change in format of printing geometrical parameters. geombf.F -- Modify FORMAT statements The downstream end of the buffer region between target and drift chamber/endcaps is ZMAXTG, not ZTOTMG/2. ( see geomtg1.F ) Change flag for exiting particle from 999 to 999999 geomrs.F -- Use the local variables TSCNRSL(1-21) to set the RS thickness Use IRSTSC in conpar.cmn to put TTRGRS,TSCNRS or the parameters in TSCNRS_new(1-21,IRSTSC) into TSCNRSL(1-21) [howfar] howfar.F -- Add irr.cmn and IRRTMP for TRKCYL Increase dimension NHFCOD,ERRNAM from 16 to 18 for additional entries for call summary. Check IQUIT after calling CHKLOOP, and goto 999 if IQUIT (S.Kabe) Modify some IF statements on NTRY The particle is to be discarded if IRR.ge.100000 (999999) (IRR.GT.NRTOT .AND. IRR.LT.99999) ---> (IRR.GT.NRTOT .AND. IRR.LT.100000) howfrs.F -- Check and take many diagnostics by S.Kabe into v7. howfbv.F -- Check and take diagnostics by S.Kabe into v7. howfdc1.F -- Check and take diagnostics by S.Kabe into v7. Add IHFCODE = 6 with step of <5000*ALLERR (S.Kabe) Comment out HFILL(10-15,... temporarily howfec1.F -- Check and take diagnostics by S.Kabe into v7. howftg1.F -- Check and take diagnostics by S.Kabe into v7. When a charged track is found in a case "intersection not found" during the transportation, adjust the distance between the charged track and boundary with 1.0x10^{-5} cm. howfbf.F -- Recover the track point if it is outside a cylinder too many times. If the track point is exactly on either inner cylinder or outer cylinder, i.e. DNEAR = 0, project to slightly inside or outside cylinder reffering to directional cosines. regrs.F -- New IS is calculated from actual position of track if IWAY=2, IS=25 and IRR<=NRSECT are given Replace IR with IRR [ausgab] ausgab.F -- RETURN immediately if global pointer IRRR.GE.100000 (999999), as in howfar. Call GEOMRS for E787's RS, and CALL GEOMRS1 for E949's RS+BVL ausgrs.F -- This routine is now restricted to E787's RS. Comment out IF(IRSVER....), because this routine is always called when RS+BVL is valid. Use ATLRS and BETARS in conpar.cmn Store HAFLRS in uener.cmn ausgbv.F -- Use ATLBV and BETABV in conpar.cmn Store HAFLBV in uener.cmn rscham.F -- Check and take diagnostics by S.Kabe into v7. straw_cham.F -- Check and take diagnostics by S.Kabe into v7. [boundary calculation] recocyl.F -- Recover if the cylinder is a polygon sect_rot.F -- Change variables to double precision chkcap_csi.F -- Set CHKCAP_CSI=-9999 for illegal exit Recover the track point if it is outside of a cylinder too many times. trkcyl.F -- Warning messages are suppressed if a particle flies in the target region trkpen.F -- The lowest limit of the absolute value of any directional cosines is changed from 1.E-5 to 1.E-15 trkgap_csi.F -- Add a flag INOUT to indicate inside/outside of cylinder. Call COMPCIR_CSI with INOUT (S.Kabe) [step] step.F -- Remove the stright step for charged track and set the the step size for charged particle to 1mm (Shaomin) *** This is a big change to the charged-track kinematics *** Comment out the following IF statement: IF((IRR.EQ.IB4UTG+IRTG-1) .OR. (IRR.EQ.IB4VTG+IRTG-1)) $ USTEP=AMIN1(USTEP,.1) (B4 step-length restriction, a bug fix in v6), and ALL steps everywhere to be < 1 mm. Call STRAIT_STEP from STEP, instead of STRAIT. benct.F -- The name of Subroutine Bend (in bend.F), called from Subroutines Ausgdc and Step, is changed to Benct (to avoid problem for compile) fldmap.F -- Introduce the field correction factor B0FCTR b0map --> b0map * B0FCTR mscat1.F -- Introduce a switch IMSCTF: = 0 the OLD formula, used in E787 (default) TH0=14.1*SQRT(DRL)*(1.+ALOG10(DRL)/9.)/P/BETAM = 1 more accurate formular in NMI B58, 6(1991) and in PDB. TH0=13.6*SQRT(DRL)*(1.+0.038*ALOG(DRL))/P/BETAM mscat1_dbl.F -- Same changes as in mscat1.F, with double precision. [EGS] [UMC administration] umc.F -- Continuation of UMC job can be done by giving a parameter INSEED = -1 in a .par file. (S.Kabe) umctrig.F -- Add instructions (still commented out) of how to use CHKTRIAL (by S.Kabe) to UINIT, UEVENT and UEND. umclog.F -- NCALL is moved to /EVENT_COM/ in restart.cmn (S.Kabe) Sorting date and time are shown in *.run file. (S.Kabe) CPU time limit LIMIT is set to be 0 (no limit) for UNIX chkloop.F -- Calculate current mean of CPU time of event. (S.Kabe) (It looks the MEAN should never be calculated ...) ustart.F -- Changes to the function wght for E949 Set the new weight fuction for E949 (with the beamfile analysis to the km21 with 19ct condition) [random number] wrseed.F -- Commom variables NCALL, NCALLS in restart.cmn are used in writing/reading the seed bank for the continuation of run. [data I/O] tdput.F -- Change a format of warning message of array overflow. tapini.F -- ITRVER=3 --> IYEAR=02, ITRVER>=4 --> IYEAR=03 add #ifdef G77, IBUF(I)=99, IBUF(I+1)=99, IBUF(I+2)=99 tapwrt.F -- introduce mods to tapwrt by JoeM. (Make bank RDCT to be read by TDCUNP for RS times) IRSVER=0/1/2 --> ABANK for timing = RSMT/RDMT/RDCT Rename NLAYRS --> NLAY_RSBANK (NLAY_RSBANK should be 21 even for RS+BVL.) ITRVER=3 --> IYEAR=02, ITRVER>=4 --> IYEAR=03 Changed RD TDC 1ns/count to 0.5ns/count Created a separate BVL TDC bank as the real data Comment out un-used format statements evtdmp.F -- Add energy banks of barrel veto liner. evtclr.F -- Add energy banks of barrel veto liner. (S.Kabe) evtfin.F -- Add energy banks of barrel veto liner. (S.Kabe) foilat.F -- The number of UTC strip hits was changed to be from a sampling from an uniform distribtion along the phi angle. (Shaomin). prscal.F -- Change printout-format for ITRVER.GE.3 in E949-02 Add NBLVET to format(10040 for E949 BVL [Makefile] Makefile -- Remove bend.o fiowa_init.o fiowa_wrhist.o decsfi.o Add ausgrs1.o benct.o chktrial.o norm.o recogap_csi.o recopen.o strait_step.o New routines: ------------- [RS+BVL] ausgrs1.F -- Copied from ausgrs.cdf, for RS+BVL in E949 Energy scoring for RS and BVL subsystem. [UMC administration] chktrial.c -- Get the exact no. of events to be reconstructed (S.Kabe). (See umctrig.F.) [boundary calculation] norm.F -- Normalize directional cosines (S.Kabe) recogap_csi.F -- recovery for gaps in CsI-EC (S.Kabe) recopen.F -- recovery for pentagrams (S.Kabe) [step] strait_step.F -- subroutine "straight" called from STEP Transport a neutral particle by a distance S. (NOT rotate according to radius of curvature) [Photo-Nuclear interaction] source_phtnuc/ -- The 'photo-nuclear' code that was used in UMC v5-bvl.1 are stored into this subdirectory. nascat.cdf pnevap.cdf neutrons_r_us.cdf npelas.cdf phtnuc.cdf step.cdf Remind that: - The routines are NOT compiled by Makefile, nor put into umc.a. - step.cdf and phtnuc.cdf are completely different from the routines in v7/source/ . * Minor modifications to the routines: -------------------------------------- - Add IMPLICIT NONE geombf.F trkcyl.F - Replace BEND with BENCT, BENDMX with BENCTMX. ausgdc.F step.F electr_umc.F - Add protection code to avoid core dump in calculating SQRT(X**2 + Y**2). howftg1.F ustart.F - Replace ENCODE/DECODE detested by g77 geomrs.F geomrs1.F - Comment out the $$IF IBM parts pican.F tapini.F - Use CALL FEXPAND instead of CALL DECSFI for UNIX IO. hatch_umc.F mlut2.F mskfil.F pican.F setup.F tdcdc.F tflash.F tgtbr.F umclog.F ustart.F zflash.F - Change the name of common blocks (/GAMMA/ --> /WGAMMA/, /MUON/ --> /MUON/) wmugnr.F - Include event number in format of warning ausgbv.F ausgab.F chkgap_csi.F chkpen.F chtrap.F linlin.F tdget.F lincirc.F howfbv.F howfdc1.F howfec1.F howftg1.F trkcyl.F howfar.F howfbf.F ausgrs.F tdput.F - 2003-Jan: The following fifty-one .F files were changed/fixed for Linux g77. See http://www.phy.bnl.gov/e949/software/mc/tutorial/how_to_UMConLinux.txt for details. arrec.F ausgrs.F ausgrs1.F austrk.F chkb2.F chkb21.F chkb4.F dmptg1.F drfini.F drift1.F electr_umc.F evtdmp.F geombv.F geomrs.F geomrs1.F geomtg1.F hatch_umc.F howfar.F howfbf.F howfrs.F howfrs1.F howftg.F howftg1.F l1hex.F lev0rr.F lev1.F mlut2.F mskfil.F ncint3.F phtnuc.F pican.F ranmar.F recocyl.F scf.F setup.F spectr.F tadcdc.F tapini.F tapwrt.F tdcdc.F tflash.F tgtbr.F trigl0.F trkcyl_col.F trkcyl_csi.F trkpent_csi.F umclog.F ustart.F wscat.F wscat1.F zflash.F Modified common blocks: ----------------------- [trigger] trgl0.cmn -- Add ESUMBL, ESECBL and BLVETO for BVL tr0scl.cmn -- Add NBLVET for E949 BVL [parameters] conpar.cmn -- Add B0FCTR (see fldmap.F) Add IMSCTF (see mscat1.F, mscat1_dbl.F) Add ATLBV,ATLRS,ATLBL,BETABV,BETARS,BETABL (see ausgrs.F, ausgrs1.F, ausgbv.F) Add IRSTSC (see geomrs1.F, geomrs.F) trgpar.cmn -- Add THSMBL for BVL parnam.cmn -- Adjusted numbers of params COMMON/PARNAM/ NAMIO(NPARI), NAMCON(NPARC), NAMGEO(NPARG), NAMTRG(NPART) --> COMMON/PARNAM/ NAMIO, NAMCON, NAMGEO, NAMTRG for Linux g77. [geometry] geopar.cmn -- Add BVL parameters to /geopar/ Introduce more BVL parameters /GEOPAR_BV/ Replace ZTOTTG in /geopar/ by ZMAXTG Delete ROUTTG, because this variable is unused anywhere. geompt.cmn -- Increased ISCNRS dimension from (21,24) to (45,24) to accomodate scintillators of BVL (45 = 19(new RS) + 2(Left & Right)*13(BVL)). geomrs.cmn -- Increased ISCNPT dimension from 25 to 50 for BVL Add YHEIGHT, YIRL, IHEIGHT, SHORT, SHORTLEN, ISHORT for BVL [ausgab] uener.cmn -- Add ERANGE_BVL, ELOSBL, ERANGS_BVL, ERANGM_BVL, ERANGP_BVL, ERNGSS_BVL for BVL. Add new parameters for single-end hits:HAFLBV,HAFLRS,HAFLBL New common blocks: ------------------ [RS+BVL] scn_num.cmn --- new for BVL [old drift chamber] dccath.cmn --- COMMON/DCCATH/ is used in both drfini.F and wscat.F. [howfar] irr.cmn -- IRRTMP between HOWFAR and TRKCYL [UMC administration] restart.cmn --- NEVENT_IN, NCALLS, NCALL for chkloop, chktrial, ... Deleted common blocks: ---------------------- Deleted auxiliary files: ------------------------ How to put new parameters into UMC common blocks: a summary. ------------------------------------------------------------ CAUTION: If you introduce parameters by a new common block, not by the common blocks below, the function of overwriting their values by a .par input file (with the routines below) does not work. o The names of new parameters should be in Character*6 (to meet the names in parnam.cmn). o Choose and edit the corresponding common block. iopar.cmn : IO conpar.cmn : Control geopar.cmn : Geometrical trgpar.cmn : Trigger o Set the default values to alldat.F : except for geopar.cmn geodat.F : geopar.cmn o In setup.F, add the names to the corresponding Data statement NAMIO : IO NAMCON : Control NAMGEO : Geometrical NAMTRG : Trigger according to the common block. Please remind EQUIVALENCE (ILP,VPARI(1),IVPARI(1)), (B0,VPARC(1),IVPARC(1)), $ (ZOFFTG,VPARG(1),IVPARG(1)) EQUIVALENCE (DELTIM,VPART(1),IVPART(1)) The first parameter in each common block is equivalent to VPARx and IVPARx (so do NOT add a new parameter to the top of the common block!). o In parnam.cmn, change the parameters NPARI = 14 for NAMIO NPARC = 86 for NAMCON NPARG = 252 for NAMGEO NPART = 29 for NAMTRG . -- End of this note