Subroutine ZCHARM2( Dch_pt , Dch_eta , & lamb_pt , lamb_eta ) C# ---------------------------------------------------------------- C# C@# zcharm2: ZES CHARM ( Dch, Lamb ) variables C# C# ---------------------------------------------------------------- C# C# input : ZEUS MDST C# C# ---------------------------------------------------------------- C# C# output : variables set to -1. in the case of no candidates C# C# Dch_pt, Dch_eta - Max(pt) and Min(|eta|) of all C# candidates with D+->K- pi+ pi+ and (cc) C# ( CTD+REG ,only right charges ) C# C# lamb_pt, lamb_eta - Max(pt) and Min(|eta|) of all C# candidates with Lambda_c+ ->p K- pi+ and (cc) C# ( CTD+REG ,only right charges ) C# C# ---------------------------------------------------------------- C# Editor : Don Hochman, hochman@mail.desy.de C# C# Version 1.0, Date : 99-05-6 C# ---------------------------------------------------------------- * Implicit NONE * #include "partap.inc" #include "zdskey.inc" #include "zrevt.inc" #include "vctpar.inc" #include "vctvtx.inc" #include "vctrhl.inc" #include "vcevtctd.inc" #include "vcevtreg.inc" * Real Dch_pt, Dch_eta, lamb_pt, lamb_eta * Integer n4v, i, j, k, j2, j3, jerr, ntrkus * Real piv , piby2, piml2 , doti, vdot , vmod, vdotn &, maspi / 0.13956995 /, dmaspi / 0.2791399 / &, maspr / 0.93827231 / &, sqmpi / 0.01947977 /, sqmka / 0.24371698 / &, sqmpr / 0.88035587 / &, gls(4), glt(4), vectus(4,300), rp1, rt1 &, vp1, vt1, vf1, vp2, vt2, vf2, vp3, vt3, vf3 &, vp4, vt4, vf4, vp5, vt5, vf5, vpt &, vr1(4), vr2(4), vr3(4), vr4(4), vr5(4) &, vmdc, ptdc, pmdc, etdc, tmdc &, vmlc, ptlc, pmlc, etlc, tmlc * Parameter ( piv = 3.1415926 ) Parameter ( piby2 = piv * 0.5 ) Parameter ( piml2 = piv * 2.0 ) * Integer ntrkm2 / 2 /, ntrkm3 / 3 /, ntrkm5 / 5 / * * Inlusive D+ selection criteria : * * only right charge combinations * * mdcmni < M(D+) < mdcmxi , Pt(tracks) > ptcuti, * Real mdcmni / 1.69 /, mdcmxi / 2.10 /, ptcutd / 0.25 / * * Inlusive Lambda_c selection criteria : * * only right charge combinations * * mlcmni < M(LC) < mlcmxi , Pt(tracks) > ptcuti, * Real mlcmni / 2.09 /, mlcmxi / 2.50 /, ptcutl / 0.25 / * Dch_pt = -1. Dch_eta = -1. lamb_pt = -1. lamb_eta = -1. * if ( zdskey_gaftyp(1:3) .ne. 'EVT' ) Return * if ( coutab(VCEVTCTD) .le. 0 ) goto 999 * Call VCGetCTD(jerr) if ( jerr .ne. 0 ) then print 7,ZDSKEY_nr1,ZDSKEY_nr2,jerr 7 format(/,' !!! ZCHARM2: ZDSKEY_nr1,nr2 =',i6,i7 &,' , VCGetCTD error =',i9,/) goto 999 endif * if ( COUTAB(VCTVTX) .le. 0 ) goto 999 * Call Fettab(VCTVTX,ID,1) * if ( VCTVTX_NDF .gt. 0 .and. VCTVTX_Chi2 .gt. 0. ) goto 9 print 8,ZDSKEY_nr1,ZDSKEY_nr2,VCTVTX_Chi2,VCTVTX_NDF 8 format(/,' !!! ZCHARM2: corrupted CTD tracking : ZDSKEY_nr1 =' &,i6,' , ZDSKEY_nr2 =',i7, &/, ' VCTVTX_Chi2 =',e13.4,' , VCTVTX_NDF =' &,i4,/) goto 999 9 continue * n4v = COUTAB(VCTPAR) if ( n4v .lt. ntrkm3 ) goto 999 c ntrkus = 0 c do 11 i = 1 , n4v c Call Fettab(VCTPAR,ID,i) c Call Fettab(VCTRHL,ID,VCTPAR_VCTRHL) c rp1 = VCTRHL_pgevc rt1 = (piby2 - atan(vctrhl_tdip)) c vt1 = vctpar_par(1) vf1 = vctpar_par(2) if ( VCTPAR_par(3).eq.0. .or. sin(vt1).eq.0. ) goto 11 vpt = rp1*sin(rt1)*abs(VCTRHL_qovr/VCTPAR_par(3)) c vp1 = vpt / sin(vt1) c ntrkus = ntrkus + 1 vectus(1,ntrkus) = vt1 vectus(2,ntrkus) = vf1 vectus(3,ntrkus) = sign(vp1,VCTPAR_par(3)) vectus(4,ntrkus) = vpt c if ( ntrkus .eq. 300 ) goto 12 c 11 continue c if ( ntrkus .lt. ntrkm3 ) goto 999 c 12 continue c do 301 i = 1 , ntrkus c vt1 = vectus(1,i) vf1 = vectus(2,i) vp1 = vectus(3,i) vpt = vectus(4,i) if ( vpt .lt. ptcutd ) goto 301 c vr1(1) = vpt* cos(vf1) vr1(2) = vpt* sin(vf1) vr1(3) = abs(vp1) * cos(vt1) vr1(4) = sqrt(vp1**2 + sqmka) c do 201 j = 1 , ntrkus-1 if ( i .eq. j ) goto 201 c vt2 = vectus(1,j) vf2 = vectus(2,j) vp2 = vectus(3,j) vpt = vectus(4,j) if ( vpt .lt. ptcutd ) goto 201 c c remove wrong charge combinations c if ( vp1*vp2 .gt. 0. ) goto 201 c vr2(1) = vpt* cos(vf2) vr2(2) = vpt* sin(vf2) vr2(3) = abs(vp2) * cos(vt2) vr2(4) = sqrt(vp2**2 + sqmpi) c call vadd(vr1,vr2,glt,4) c do 101 k = j+1 , ntrkus if ( k .eq. i ) goto 101 c vt3 = vectus(1,k) vf3 = vectus(2,k) vp3 = vectus(3,k) vpt = vectus(4,k) if ( vpt .lt. ptcutd ) goto 101 c c remove wrong charge combinations c if ( vp1*vp3 .gt. 0. ) goto 101 c vr3(1) = vpt* cos(vf3) vr3(2) = vpt* sin(vf3) vr3(3) = abs(vp3) * cos(vt3) vr3(4) = sqrt(vp3**2 + sqmpi) c call vadd(vr3,glt,gls,4) vmdc = sqrt(-doti(gls,gls)) c if ( vmdc .lt. mdcmni .or. vmdc .gt. mdcmxi ) goto 101 c ptdc = vmod(gls,2) pmdc = vmod(gls,3) tmdc = acos(gls(3)/pmdc) etdc = abs(alog(tan(tmdc*0.5))) c c D+or D- candidates c if ( ptdc .gt. Dch_pt ) Dch_pt = ptdc if ( etdc .lt. Dch_eta .or. Dch_eta .lt. 0. ) Dch_eta = etdc c 101 continue c 201 continue c 301 continue c c do 601 i = 1 , ntrkus c vt1 = vectus(1,i) vf1 = vectus(2,i) vp1 = vectus(3,i) vpt = vectus(4,i) if ( vpt .lt. ptcutl ) goto 601 c vr1(1) = vpt* cos(vf1) vr1(2) = vpt* sin(vf1) vr1(3) = abs(vp1) * cos(vt1) vr1(4) = sqrt(vp1**2 + sqmpr) c do 501 j = 1 , ntrkus if ( i .eq. j ) goto 501 c vt2 = vectus(1,j) vf2 = vectus(2,j) vp2 = vectus(3,j) vpt = vectus(4,j) if ( vpt .lt. ptcutl ) goto 501 c c remove wrong charge combinations c if ( vp1*vp2 .gt. 0. ) goto 501 c vr2(1) = vpt* cos(vf2) vr2(2) = vpt* sin(vf2) vr2(3) = abs(vp2) * cos(vt2) vr2(4) = sqrt(vp2**2 + sqmka) c call vadd(vr1,vr2,glt,4) c do 401 k = 1 , ntrkus if ( k .eq. i .or. & k .eq. j ) goto 401 c vt3 = vectus(1,k) vf3 = vectus(2,k) vp3 = vectus(3,k) vpt = vectus(4,k) if ( vpt .lt. ptcutl ) goto 401 c c remove wrong charge combinations c if ( vp1*vp3 .lt. 0. ) goto 401 c vr3(1) = vpt* cos(vf3) vr3(2) = vpt* sin(vf3) vr3(3) = abs(vp3) * cos(vt3) vr3(4) = sqrt(vp3**2 + sqmpi) c call vadd(vr3,glt,gls,4) vmlc = sqrt(-doti(gls,gls)) c if ( vmlc .lt. mlcmni .or. vmlc .gt. mlcmxi ) goto 401 c ptlc = vmod(gls,2) pmlc = vmod(gls,3) tmlc = acos(gls(3)/pmlc) etlc = abs(alog(tan(tmlc*0.5))) c c Lambda_c+ or Lambda_c- candidates c if ( ptlc .gt. lamb_pt ) lamb_pt = ptlc if ( etlc .lt. lamb_eta .or. lamb_eta .lt. 0. ) lamb_eta = etlc c 401 continue c 501 continue c 601 continue c * 999 if ( coutab(VCEVTREG) .le. 0 ) Return * Call VCGetREG(jerr) if ( jerr .ne. 0 ) then print 17,ZDSKEY_nr1,ZDSKEY_nr2,jerr 17 format(/,' !!! ZCHARM2: ZDSKEY_nr1,nr2 =',i6,i7 &,' , VCGetREG error =',i9,/) Return endif * if ( COUTAB(VCTVTX) .le. 0 ) Return * Call Fettab(VCTVTX,ID,1) * if ( VCTVTX_NDF .gt. 0 .and. VCTVTX_Chi2 .gt. 0. ) goto 19 print 18,ZDSKEY_nr1,ZDSKEY_nr2,VCTVTX_Chi2,VCTVTX_NDF 18 format(/,' !!! ZCHARM2: corrupted REG tracking : ZDSKEY_nr1 =' &,i6,' , ZDSKEY_nr2 =',i7, &/, ' VCTVTX_Chi2 =',e13.4,' , VCTVTX_NDF =' &,i4,/) Return 19 continue * n4v = COUTAB(VCTPAR) if ( n4v .lt. ntrkm3 ) Return c ntrkus = 0 c do 21 i = 1 , n4v c Call Fettab(VCTPAR,ID,i) c Call Fettab(VCTRHL,ID,VCTPAR_VCTRHL) c rp1 = VCTRHL_pgevc rt1 = (piby2 - atan(vctrhl_tdip)) c vt1 = vctpar_par(1) vf1 = vctpar_par(2) if ( VCTPAR_par(3).eq.0. .or. sin(vt1).eq.0. ) goto 21 vpt = rp1*sin(rt1)*abs(VCTRHL_qovr/VCTPAR_par(3)) c vp1 = vpt / sin(vt1) c ntrkus = ntrkus + 1 vectus(1,ntrkus) = vt1 vectus(2,ntrkus) = vf1 vectus(3,ntrkus) = sign(vp1,VCTPAR_par(3)) vectus(4,ntrkus) = vpt c if ( ntrkus .eq. 300 ) goto 22 c 21 continue c if ( ntrkus .lt. ntrkm3 ) Return c 22 continue c do 1301 i = 1 , ntrkus c vt1 = vectus(1,i) vf1 = vectus(2,i) vp1 = vectus(3,i) vpt = vectus(4,i) if ( vpt .lt. ptcutd ) goto 1301 c vr1(1) = vpt* cos(vf1) vr1(2) = vpt* sin(vf1) vr1(3) = abs(vp1) * cos(vt1) vr1(4) = sqrt(vp1**2 + sqmka) c do 1201 j = 1 , ntrkus-1 if ( i .eq. j ) goto 1201 c vt2 = vectus(1,j) vf2 = vectus(2,j) vp2 = vectus(3,j) vpt = vectus(4,j) if ( vpt .lt. ptcutd ) goto 1201 c c remove wrong charge combinations c if ( vp1*vp2 .gt. 0. ) goto 1201 c vr2(1) = vpt* cos(vf2) vr2(2) = vpt* sin(vf2) vr2(3) = abs(vp2) * cos(vt2) vr2(4) = sqrt(vp2**2 + sqmpi) c call vadd(vr1,vr2,glt,4) c do 1101 k = j+1 , ntrkus if ( k .eq. i ) goto 1101 c vt3 = vectus(1,k) vf3 = vectus(2,k) vp3 = vectus(3,k) vpt = vectus(4,k) if ( vpt .lt. ptcutd ) goto 1101 c c remove wrong charge combinations c if ( vp1*vp3 .gt. 0. ) goto 1101 c vr3(1) = vpt* cos(vf3) vr3(2) = vpt* sin(vf3) vr3(3) = abs(vp3) * cos(vt3) vr3(4) = sqrt(vp3**2 + sqmpi) c call vadd(vr3,glt,gls,4) vmdc = sqrt(-doti(gls,gls)) c if ( vmdc .lt. mdcmni .or. vmdc .gt. mdcmxi ) goto 1101 c ptdc = vmod(gls,2) pmdc = vmod(gls,3) tmdc = acos(gls(3)/pmdc) etdc = abs(alog(tan(tmdc*0.5))) c c D+or D- candidates c if ( ptdc .gt. Dch_pt ) Dch_pt = ptdc if ( etdc .lt. Dch_eta .or. Dch_eta .lt. 0. ) Dch_eta = etdc c 1101 continue c 1201 continue c 1301 continue c c do 1601 i = 1 , ntrkus c vt1 = vectus(1,i) vf1 = vectus(2,i) vp1 = vectus(3,i) vpt = vectus(4,i) if ( vpt .lt. ptcutl ) goto 1601 c vr1(1) = vpt* cos(vf1) vr1(2) = vpt* sin(vf1) vr1(3) = abs(vp1) * cos(vt1) vr1(4) = sqrt(vp1**2 + sqmpr) c do 1501 j = 1 , ntrkus if ( i .eq. j ) goto 1501 c vt2 = vectus(1,j) vf2 = vectus(2,j) vp2 = vectus(3,j) vpt = vectus(4,j) if ( vpt .lt. ptcutl ) goto 1501 c c remove wrong charge combinations c if ( vp1*vp2 .gt. 0. ) goto 1501 c vr2(1) = vpt* cos(vf2) vr2(2) = vpt* sin(vf2) vr2(3) = abs(vp2) * cos(vt2) vr2(4) = sqrt(vp2**2 + sqmka) c call vadd(vr1,vr2,glt,4) c do 1401 k = 1 , ntrkus if ( k .eq. i .or. & k .eq. j ) goto 1401 c vt3 = vectus(1,k) vf3 = vectus(2,k) vp3 = vectus(3,k) vpt = vectus(4,k) if ( vpt .lt. ptcutl ) goto 1401 c c remove wrong charge combinations c if ( vp1*vp3 .lt. 0. ) goto 1401 c vr3(1) = vpt* cos(vf3) vr3(2) = vpt* sin(vf3) vr3(3) = abs(vp3) * cos(vt3) vr3(4) = sqrt(vp3**2 + sqmpi) c call vadd(vr3,glt,gls,4) vmlc = sqrt(-doti(gls,gls)) c if ( vmlc .lt. mlcmni .or. vmlc .gt. mlcmxi ) goto 1401 c ptlc = vmod(gls,2) pmlc = vmod(gls,3) tmlc = acos(gls(3)/pmlc) etlc = abs(alog(tan(tmlc*0.5))) c c Lambda_c+ or Lambda_c- candidates c if ( ptlc .gt. lamb_pt ) lamb_pt = ptlc if ( etlc .lt. lamb_eta .or. lamb_eta .lt. 0. ) lamb_eta = etlc c 1401 continue c 1501 continue c 1601 continue * End