subroutine rec_event * c Implicit none * include 'nt.inc' include 'flags.inc' include 'parcut.inc' * integer ibinx logical first data first /.true./ save first logical srtd,TLT_ACCEPT,MCDIFF real empz,eppz,xe,ye,ze,Ee,EinCone,eTh real rn,xx,x_r,y_r integer i real R_min,MC_Ee_Corr save R_min,MC_Ee_Corr c real xda,q2da,YJB,WDA,YDA real protmass,EpBeam save protmass,EpBeam real b0(3),c_box(2,3) data b0/0.,-10.5,8.5/ save b0,c_box c real xl_smear(8),xl_reso(8) data xl_reso/0.002,0.003,0.003,0.003,0.006,0.01,0.01,0.006/ data xl_smear/0.004,0.005,0.004,0.004,0.012,0.020,0.015,0.012/ save xl_smear,xl_reso c real RND_GAUS,xl_true c real detacut real etamx c c c SELECTION_TYPE = 1 --> DIS+LPS c = 0 --> DIS c c if(first)then first=.false. protmass=0.93827203 EpBeam=820.0 MC_Ee_Corr=0.9875 R_min = 80.0 c_box(1,1)=10. ! x cut box1 c c_box(1,1)=13. ! x cut box1 (original GB) c_box(2,1)=7. ! y cut box1 c_box(1,2)=3.5 ! x cut box2 c_box(2,2)=11. ! y cut box2 c_box(1,3)=4.5 ! x cut box3 c_box(2,3)=11. ! y cut box3 endif RECONS=-1 TLT_ACCEPT=.TRUE. ng(1)=ng(1)+1 c if(selection_type(1).eq.SEL_LPS) then c--- base selection LPSTAG if(lpstag.ne.1) return ng(2)=ng(2)+1 c spectrometer selection if(lpssta.lt.lpssta_select(1).or.lpssta.gt.lpssta_select(2)) & return if(realdata(1).gt.0) then if((lpssta.lt.5.and..not.lpstake456)) return if(lpssta.gt.4) then if(.not.lpstake123) return if(runnr.le.27183) return endif endif endif c ng(3)=ng(3)+1 c xlr=lpsxl pt2r=lpspx**2+lpspy**2 c if(montecarlo(1).gt.0) then c xl smearing in Monte Carlo if(xlr.gt.0.95) then xl_true=trupos(3)/EpBeam if(abs(xlr-xl_true)/xl_true.le.2*xl_reso(lpssta)) then ccc* xlr=xlr+0.8*(xlr-trupos(3)/EpBeam) call rnorml(RND_GAUS,1) xlr=xlr+xl_smear(lpssta)*RND_GAUS*xl_true endif endif endif c c TRIGGER BITS c flt if(.not.btest(FLTpsW(2),14)) return if(.not.btest(SltW(6),0)) return c c---------------------------------------------- if(selection_type(1).eq.SEL_LPS) then c---------------------------------------------- if(realdata(1).gt.0) then c ATTENZIONE: LR USA BTEST(TLTW(4),7) ! if(.not.btest(tltw(4),23)) TLT_ACCEPT=.FALSE. endif c---------------------------------------------- else c---------------------------------------------- if(runnr.lt.25340) then if(.not.btest(tltw(4),0)) return else if(.not.btest(tltw(4),16)) return endif c---------------------------------------------- endif c---------------------------------------------- c if(TLT_ACCEPT) ng(4)=ng(4)+1 if(sincand.lt.1) return c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c electron energy and angle c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Ee=SiEcorr(3,1) EinCone=SiEnin(1) if(montecarlo(1).gt.0) then Ee=Ee*MC_Ee_Corr EinCone=EinCone*MC_Ee_Corr endif eTh=sith(1) etamx=sietamax(1) c~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ c if(Ee.lt.calene_cut(1)) return if(TLT_ACCEPT) ng(5)=ng(5)+1 c xe=sipos(1,1) ye=sipos(2,1) ze=sipos(3,1) c electron quality if(ze.gt.-120.) then if(sqrt(xe**2+ye**2).gt.R_min) then if(EinCone.gt.ecincone_cut(1) .or. & sitrkp(1).lt.etrkp_cut(1) .or. & sidca(1).gt.dca_cut(1)) then return endif endif endif c c srtd HCUT if(xe.ne.0.and.ye.ne.0) then if(abs(xe-b0(1)).lt.c_box(1,1).and.abs(ye).lt.c_box(2,1)) return if(abs(xe-b0(2)).lt.c_box(1,2).and.abs(ye).lt.c_box(2,2)) return if(abs(xe-b0(3)).lt.c_box(1,3).and.abs(ye).lt.c_box(2,3)) return endif c if(TLT_ACCEPT) ng(6)=ng(6)+1 if(abs(zvtx).gt.vz_cut(1)) return IF(TLT_ACCEPT) ng(7)=ng(7)+1 c E-Pz Empz=siccempz(1)+Ee*(1-cos(eTh)) if(empz.lt.empzmin_cut(1).or.empz.gt.empzmax_cut(1)) return if(TLT_ACCEPT) ng(8)=ng(8)+1 c c--- DIS DA variables -- xda=SixDA(1) q2DA=SiQ2DA(1) YJB=SiYJB(1) YDA=SiYDA(1) Wda=q2da*(1-xda)/xda+protmass*protmass if(Wda.gt.0) Wda=sqrt(Wda) c --- c yjb cut if(YJB.lt.YJB_Cut(1)) return if(TLT_ACCEPT) ng(9)=ng(9)+1 if(YDA.lt.yda_cut_min(1).or.YDA.gt.yda_cut_max(1)) return if(TLT_ACCEPT) ng(10)=ng(10)+1 if(Q2DA.lt.q2da_cut(1)) return if(TLT_ACCEPT) ng(11)=ng(11)+1 c c------------------------------------------- if(selection_type(1).eq.SEL_DIS) then c------------------------------------------- RECONS=1 c c-------------------------------------------- elseif(selection_type(1).eq.SEL_LPS) then c-------------------------------------------- c xl if(xlr.gt.lpsxl_cut(1)) return if(TLT_ACCEPT) ng(12)=ng(12)+1 c pt2 if(pt2r.gt.lpspt2_cut(1)) return if(TLT_ACCEPT) ng(13)=ng(13)+1 c lpsdist if(lpssta.lt.5) then if(lpsdist.lt.lpdist_cut(1)) return else if(lpsdist.lt.lpdist_cut(2)) return endif if(TLT_ACCEPT) ng(14)=ng(14)+1 c lpsdpot if(dpot_min.lt.lpdpot_cut(1)) return if(TLT_ACCEPT) ng(15)=ng(15)+1 c c E+Pz EpPz=2*EpBeam*lpsxl+Ee*(1+cos(eTh))+SiCCHmom(4,1)+SiCCHmom(3,1) if(eppz.gt.eppz_cut(1)) return if(TLT_ACCEPT) ng(16)=ng(16)+1 c c Ok, all cuts passed. c RECONS=1 c call hfill(71,xlr,pt2r,wei) if(TLT_ACCEPT) call hfill(72,xlr,pt2r,wei) c c For real data ONLY, check also TLT c For MC check if it is a background (will set RECONS < -100) if(REALDATA(1).gt.0) then if(.not.TLT_ACCEPT) RECONS=-1 else call BACKGROUNDS endif c if(RECONS.gt.0) then c acceptance bin ixlr=ibinx(xlr,XACC,nxb(1)) ipt2r=ibinx(pt2r,YACC,nyb(1)) IREC=IXLR+IPT2R*NXB(1) c analysis bin (coarser) ixlran=ibinx(xlr,xan,nxan(1)) ipt2ran=ibinx(pt2r,yan,nyan(1)) IRECAN=IXLRAN+NXAN(1)*IPT2RAN endif endif c if(REALDATA(1).gt.0) then if(TLT_ACCEPT) call hfill(20010,xlr,pt2r,1.) else if(RECONS.gt.0.or.RECONS.lt.-100) then call hfill(20010,xlr,pt2r,1.) call hfill(20011,xlr,pt2r,wei) call hfill(20012,xlr,pt2r,wei*wei) endif endif c c RECONS < -100 is a 'background' c if(recons.gt.0.or.recons.lt.-100) then c c control plots c c call hf1e( ioff+9001,xlr,wei,wei) call hf1e( ioff+9002,pt2r,wei,wei) call hf1e( ioff+9003,float(lpssta),wei,wei) call hf1e( ioff+9004,dpot_min,wei,wei) call hf1e( ioff+9005,lpsdist,wei,wei) call hf1e( ioff+9006,empz,wei,wei) call hf1e( ioff+9007,q2da,wei,wei) call hf1e( ioff+9008,wda,wei,wei) call hf1e( ioff+9009,zvtx,wei,wei) call hf1e( ioff+9010,Ee,wei,wei) call hf1e( ioff+9011,eTh,wei,wei) if(xda.gt.0) call hf1e(ioff+9012,log10(xda),wei,wei) call hf1e( ioff+9013,yda,wei,wei) call hf1e( ioff+8001,xlr,wei,wei) call hf1e( ioff+8002,pt2r,wei,wei) call hf1e( ioff+9000,pt2r,wei,wei) call hf1e( ioff+9014,etamx,wei,wei) call hf1e( ioff+9015,lpspx,wei,wei) call hf1e( ioff+9016,lpspy,wei,wei) call hfill(ioff+9017,xlr,pt2r,wei) call hfill(ioof+9018,xlr,pt2r,wei*wei) if(montecarlo(1).gt.0) then call hf1(2100,pt2r,1.) call hf1(2101,xlr,1.) call hf1(2102,pt2r,1.) call hf1(2103,float(lpssta),1.) call hf1(2104,dpot_min,1.) call hf1(2105,lpsdist,1.) call hf1(2106,empz,1.) call hf1(2107,q2da,1.) call hf1(2108,wda,1.) call hf1(2109,zvtx,1.) call hf1(2110,Ee,1.) call hf1(2111,eTh,1.) if(xda.gt.0) call hf1(2112,log10(xda),1.) call hf1(2113,yda,1.) call hf1(2114,etamx,1.) call hf1(2115,lpspx,1.) call hf1(2116,lpspy,1.) call hfill(2117,xlr,pt2r,1.) call hf1(1101,xlr,1.) call hf1(1102,pt2r,1.) endif c endif c 999 return end