*--------1---------2---------3---------4---------5---------6---------7-- * This module generates masks for those tracks, which are spread * into the spatial angle d(Theta) * d(Phi). Every Phy-sector of the * pad detector may have an individual set of masks depending on the * XY-beam offset and(or) beamtilt. All length values are in mm., * all angles are in degrees. * * inputs: * ----- * GEVC +1 NEVTYP (1=standard ph., 4=background) * +4 NSPPRC (1=DIS, ... 401=beam_gas, 402=beam_wall) * GKI +1 IRAD (0=without ISR/FSR) * +2 GENPL (E_lepton) * +3 GENPP (E_proton) * +5 GENX (Bjorken x) * +6 GENQ2 (q2) * STR +1 PX * +2 PY * +3 PZ * +4 E * +5 PCODE (11=electron) * SVX +1 XV * +2 YV * +3 ZV * +4 VTYPE (1=primary vertex) subroutine GENMASK * initialize BCS *---------------------------------- include './Include/bcs.inc' * initialize user variables *---------------------------------- include './Include/padgeom.inc' include './Include/trkdata.inc' include './Include/mskdata.inc' integer NGEVC, NGKI, NSTR, NSVX integer NROWT, NCOLT, NCOLV, NROWV integer NEVTYP, NSPPRC, VTYPE, Tpoint, Vpoint real GENQ2 integer EvenRadRing(4), OddRadRing(4) integer EvenPhiSect(4), OddPhiSect(4) integer EvenSectMask(6), OddSectMask(6) integer EvenIndex(6), OddIndex(6) integer EvenDecade, OddDecade integer EvenSectNum, OddSectNum integer EvenPattern, OddPattern logical Fevent, Match data Fevent /.TRUE./ * event processing *---------------------------------- if (Fevent) then Integral = 0 do J = 1, 12 SubSet(J) = 0 Limit(J) = 0 do I = 1, MaskNumExp BookShelf(I, J) = 0 SProject(I, J) = 0. Weight(I, J) = 0. Yield(I, J) = 0. end do end do end if Fevent = .FALSE. NGEVC = IW(NAMIND('GEVC')) NGKI = IW(NAMIND('GKI ')) NSTR = IW(NAMIND('STR ')) NSVX = IW(NAMIND('SVX ')) if ((NGEVC.le.0).or.(NGKI.le.0).or. + (NSTR.le.0).or.(NSVX.le.0)) return NSPPRC = IW(NGEVC + 2) GENQ2 = RW(NGKI + 6) if ((NSPPRC.ne.45).or.(GENQ2.gt.100.)) return * loop over interaction products *---------------------------------- NCOLT = IW(NSTR + 1) NROWT = IW(NSTR + 2) NCOLV = IW(NSVX + 1) NROWV = IW(NSVX + 2) do IROW = 1, NROWT Tpoint = NCOLT * (IROW - 1) + NSTR + 2 PX = RW(Tpoint + 1) PY = RW(Tpoint + 2) PZ = RW(Tpoint + 3) PCODE = IW(Tpoint + 5) Vpoint = IW(Tpoint + 9) Vpoint = NCOLV * (Vpoint - 1) + NSVX + 2 XV = RW(Vpoint + 1) YV = RW(Vpoint + 2) ZV = RW(Vpoint + 3) VTYPE = IW(Vpoint + 4) if ((abs(PCODE).eq.11).and.(VTYPE.eq.1).and.(PZ.lt.-2.)) then * tracing the particle through detector *---------------------------------- call HELIX * Sector validation *---------------------------------- do I = 1, 4 EvenPhiSect(I) = 0 OddPhiSect(I) = 0 end do do I = 1, 4 do J = 1, 6 if ((EvenMinPhiArray(J).le.EvenPhi(I)).and. + (EvenPhi(I).lt.EvenMaxPhiArray(J))) then EvenPhiSect(I) = J end if if ((OddMinPhiArray(J).le.OddPhi(I)).and. + (OddPhi(I).lt.OddMaxPhiArray(J))) then OddPhiSect(I) = J end if end do end do * Radius validation *---------------------------------- do I = 1, 4 EvenRadRing(I) = 0 OddRadRing(I) = 0 end do do I = 1, 4 do J = 1, 8 if ((RadDivision(J).le.EvenR(I)).and. + (EvenR(I).lt.RadDivision(J + 1))) then EvenRadRing(I) = J end if if ((RadDivision(J).le.OddR(I)).and. + (OddR(I).lt.RadDivision(J + 1))) then OddRadRing(I) = J end if end do end do * Track signature in every sector *---------------------------------- do I = 1, 6 EvenSectMask(I) = 0 OddSectMask(I) = 0 end do do I = 1, 6 do J = 1, 4 if (EvenPhiSect(J).eq.I) then EvenSectMask(I) = EvenSectMask(I) + + 1000 * EvenRadRing(J) / 10**(J - 1) end if if (OddPhiSect(J).eq.I) then OddSectMask(I) = OddSectMask(I) + + 1000 * OddRadRing(J) / 10**(J - 1) end if end do end do * Criterion for every sector *---------------------------------- do I = 1, 6 EvenIndex(I) = 0 OddIndex(I) = 0 end do do I = 1, 6 EvenDecade = EvenSectMask(I) OddDecade = OddSectMask(I) do J = 1, 4 if ((EvenDecade / 10**(4 - J)).gt.0) then EvenIndex(I) = EvenIndex(I) + 1 end if if ((OddDecade / 10**(4 - J)).gt.0) then OddIndex(I) = OddIndex(I) + 1 end if EvenDecade = EvenDecade - (EvenDecade / + 10**(4 - J)) * 10**(4 - J) OddDecade = OddDecade - (OddDecade / + 10**(4 - J)) * 10**(4 - J) end do end do * Criterion match *---------------------------------- EvenSectNum = 12 OddSectNum = 13 EvenPattern = 0 OddPattern = 0 do I = 1, 6 if (Criterion.le.EvenIndex(I)) then EvenSectNum = 2 * I - 1 EvenPattern = EvenSectMask(I) SubSet(EvenSectNum) = SubSet(EvenSectNum) + 1 end if if (Criterion.le.OddIndex(I)) then OddSectNum = 2 * I OddPattern = OddSectMask(I) SubSet(OddSectNum) = SubSet(OddSectNum) + 1 end if end do * Check for repetitive masks *---------------------------------- if (EvenSectNum.lt.12) then if (SubSet(EvenSectNum).eq.1) then I = EvenSectNum / 2 + 1 BookShelf(1, EvenSectNum) = EvenPattern SProject(1, EvenSectNum) = Rspacal Weight(1, EvenSectNum) = 1. Limit(EvenSectNum) = 1 Match = .TRUE. else Match = .FALSE. do I = 1, Limit(EvenSectNum) if (BookShelf(I, EvenSectNum).eq.EvenPattern) then Weight(I, EvenSectNum) = Weight(I, EvenSectNum) + 1. SProject(I, EvenSectNum) = SProject(I, EvenSectNum)+ + Rspacal Match = .TRUE. end if end do end if if (.not.Match) then I = EvenSectNum / 2 + 1 Limit(EvenSectNum) = Limit(EvenSectNum) + 1 BookShelf(Limit(EvenSectNum), EvenSectNum) = EvenPattern SProject(Limit(EvenSectNum), EvenSectNum) = Rspacal Weight(Limit(EvenSectNum), EvenSectNum) = 1. end if end if if (OddSectNum.lt.13) then if (SubSet(OddSectNum).eq.1) then I = OddSectNum / 2 BookShelf(1, OddSectNum) = OddPattern SProject(1, OddSectNum) = Rspacal Weight(1, OddSectNum) = 1. Limit(OddSectNum) = 1 Match = .TRUE. else Match = .FALSE. do I = 1, Limit(OddSectNum) if (BookShelf(I, OddSectNum).eq.OddPattern) then Weight(I, OddSectNum) = Weight(I, OddSectNum) + 1. SProject(I, OddSectNum) = SProject(I, OddSectNum)+ + Rspacal Match = .TRUE. end if end do end if if (.not.Match) then I = OddSectNum / 2 Limit(OddSectNum) = Limit(OddSectNum) + 1 BookShelf(Limit(OddSectNum), OddSectNum) = OddPattern SProject(Limit(OddSectNum), OddSectNum) = Rspacal Weight(Limit(OddSectNum), OddSectNum) = 1. end if end if * Statistics *---------------------------------- if ((EvenSectNum.lt.12).or.(OddSectNum.lt.13)) then Integral = Integral + 1 end if end if end do return end