subroutine nplotter_Z_1jet(p,wt,wt2,switch) c--- Variable passed in to this routine: c c--- p: 4-momenta of particles in the format p(i,4) c--- with the particles numbered according to the input file c--- and components labelled by (px,py,pz,E) c c--- wt: weight of this event c c--- wt2: weight^2 of this event c c--- switch: an integer equal to 0 or 1, depending on the type of event c--- 0 --> lowest order, virtual or real radiation c--- 1 --> counterterm for real radiation implicit none include 'vegas_common.f' include 'constants.f' include 'histo.f' include 'jetlabel.f' include 'outputflags.f' double precision p(mxpart,4),wt,wt2 double precision yrap,pt,yraptwo,pttwo,r c--- Z->e+e-(31) or b bbar(33): both measured, rapidities and momenta of 3 and 4 can c--- be calculated, also the invariant mass m34 double precision y3,y4,y5,y34,pt3,pt4,pt5,pt34,m34,r35 double precision ylep, yjet, ptlep, ptjet,costheta, & p3(4),p4(4),p34(4) double precision ptzl(10),ptzu(10) data ptzl/0,20,40,60,80,100,120,140,170,200/ data ptzu/20,40,60,80,100,120,140,170,200,1000/ double precision ptzl2(30),ptzu2(30) data ptzl2/0,30,33,36,39,42,45,48,51,54,57,61,65,70,75,80,85,95, & 105,125,150,175,200,250,300,350,400,470,550,650/ data ptzu2/30,33,36,39,42,45,48,51,54,57,61,65,70,75,80,85,95, & 105,125,150,175,200,250,300,350,400,470,550,650,900/ double precision ptzl3(9),ptzu3(9) data ptzl3/0,45,55,65,75,85,105,150,200/ data ptzu3/45,55,65,75,85,105,150,200,900/ double precision ptzl4(11),ptzu4(11) data ptzl4/0,30,37,45,55,65,75,85,105,150,200/ data ptzu4/30,37,45,55,65,75,85,105,150,200,900/ double precision ptzl5(18),ptzu5(18) data ptzl5/ 0,18,22,26,30,34,38,42,46,50,54,60,70,80, & 100,150,200,300/ data ptzu5/ 18,22,26,30,34,38,42,46,50,54,60,70,80, & 100,150,200,300,800/ double precision ptzl6(15),ptzu6(15) data ptzl6/0,10,12.5,15,17.5,20,30,40,50,70,90,110,150,190,250/ data ptzu6/10,12.5,15,17.5,20,30,40,50,70,90,110,150,190,250,600/ double precision yzl(3), yzu(3) data yzl/0.0,1.0,2.0/ data yzu/1.0,2.0,2.4/ integer switch,n,nplotmax,nproc,exptid character*4 tag logical first common/nplotmax/nplotmax common/nproc/nproc common/exptid/exptid data first/.true./ save first ************************************************************************ * * * INITIAL BOOKKEEPING * * * ************************************************************************ if (first) then c--- Initialize histograms, without computing any quantities; instead c--- set them to dummy values tag='book' y3=1d3 y4=1d3 y5=1d3 y34=1d3 pt3=0d0 pt4=0d0 pt5=1d3 pt34=0d0 m34=0d0 r35=1d3 jets=1 c--- (Upper) limits for the plots ylep=6d0 yjet=3.2d0 ptlep=80d0 ptjet=100d0 goto 99 else c--- Add event in histograms tag='plot' endif ************************************************************************ * * * DEFINITIONS OF QUANTITIES TO PLOT * * * ************************************************************************ y3=yrap(3,p) y4=yrap(4,p) y34=yraptwo(3,4,p) pt3=pt(3,p) pt4=pt(4,p) pt34=pttwo(3,4,p) m34=dsqrt((p(3,4)+p(4,4))**2-(p(3,1)+p(4,1))**2 . -(p(3,2)+p(4,2))**2-(p(3,3)+p(4,3))**2) if(jets .gt. 0) then pt5=pt(5,p) y5=yrap(5,p) r35=R(p,3,5) else pt5=-1d0 y5=1d3 r35=1d3 endif ************************************************************************ * * * FILL HISTOGRAMS * * * ************************************************************************ c--- Call histogram routines 99 continue c--- Book and fill ntuple if that option is set, remembering to divide c--- by # of iterations now that is handled at end for regular histograms if (creatent .eqv. .true.) then call bookfill(tag,p,wt/dfloat(itmx)) endif c--- "n" will count the number of histograms n=nextnplot c--- Syntax of "bookplot" routine is: c c--- call bookplot(n,tag,titlex,var,wt,wt2,xmin,xmax,dx,llplot) c c--- n: internal number of histogram c--- tag: "book" to initialize histogram, "plot" to fill c--- titlex: title of histogram c--- var: value of quantity being plotted c--- wt: weight of this event (passed in) c--- wt2: weight of this event (passed in) c--- xmin: lowest value to bin c--- xmax: highest value to bin c--- dx: bin width c--- llplot: equal to "lin"/"log" for linear/log scale c call bookplot(n,tag,'y3',y3,wt,wt2,-ylep,ylep,0.2d0,'lin') c n=n+1 c call bookplot(n,tag,'y4',y4,wt,wt2,-ylep,ylep,0.2d0,'lin') c n=n+1 c call bookplot(n,tag,'y34',y34,wt,wt2,-ylep,ylep,0.2d0,'lin') c n=n+1 c call bookplot(n,tag,'pt3',pt3,wt,wt2,0d0,ptlep,2d0,'lin') c n=n+1 c call bookplot(n,tag,'pt4',pt4,wt,wt2,0d0,ptlep,2d0,'lin') c n=n+1 c call bookplot(n,tag,'pt34',pt34,wt,wt2,0d0,50d0,2d0,'lin') c n=n+1 c call bookplot(n, tag,'m34',m34,wt,wt2,70d0,110d0,0.5d0,'lin') c n=n+1 c call bookplot(n,tag,'DeltaR35',r35,wt,wt2,0d0,5d0,0.1d0,'lin') c n=n+1 c call bookplot(n,tag,'y5',y5,wt,wt2,-yjet,yjet,0.5d0,'lin') c n=n+1 c call bookplot(n,tag,'pt5',pt5,wt,wt2,0d0,ptjet,2d0,'lin') c n=n+1 if(exptid.ge.411.and.exptid.le.415) then call bookplot2(n,tag,'ptz',pt34,wt,wt2,ptzl,ptzu,10,'lin') else if(exptid.eq.416.or.(exptid.ge.4161.and.exptid.le.4166))then call bookplot2(n,tag,'ptz',pt34,wt,wt2,ptzl2,ptzu2,30,'lin') n=n+1 call bookplot2(n,tag,'ptz',pt34,wt,wt2,ptzl4,ptzu4,11,'lin') else if(exptid.eq.417.or.(exptid.ge.4171.and.exptid.le.4173))then call bookplot2(n,tag,'ptz',pt34,wt,wt2,ptzl5,ptzu5,18,'lin') n=n+1 call bookplot2(n,tag,'yz',abs(y34),wt,wt2,yzl,yzu,3,'lin') else if(exptid.eq.418) then call bookplot2(n,tag,'ptz',pt34,wt,wt2,ptzl6,ptzu6,15,'lin') endif n=n+1 call bookplot(n,tag,'yll',abs(y34),wt,wt2,0d0,2.40d0,0.2d0,'lin') n=n+1 call bookplot(n, tag,'mll',m34,wt,wt2,61d0,121d0,1d0,'lin') n=n+1 ************************************************************************ * * * FINAL BOOKKEEPING * * * ************************************************************************ c--- We have over-counted the number of histograms by 1 at this point n=n-1 c--- Ensure the built-in maximum number of histograms is not exceeded call checkmaxhisto(n) c--- Set the maximum number of plots, on the first call if (first) then first=.false. nplotmax=n endif return end