subroutine nplotter_tt_tot(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 mttl(7),mttu(7) data mttl/345,400,470,550,650, 800,1100/ data mttu/400,470,550,650,800,1100,1600/ double precision yttl(5),yttu(5) data yttl/0.0,0.3,0.6,0.9,1.3/ data yttu/0.3,0.6,0.9,1.3,2.5/ double precision pTttl(6),pTttu(6) data pTttl/ 0,20,45, 75,120,190/ data pTttu/20,45,75,120,190,300/ double precision pTtl(8),pTtu(8) data pTtl/ 0, 60,100,150,200,260,320,400/ data pTtu/60,100,150,200,260,320,400,500/ double precision ytl(5),ytu(5) data ytl/0.0,0.4,0.8,1.2,1.6/ data ytu/0.4,0.8,1.2,1.6,2.5/ double precision y3l(5),y3u(5) data y3l/2.0,2.5,3.0,3.5,4.0/ data y3u/2.5,3.0,3.5,4.0,4.5/ double precision pTbl(27),pTbu(27) data pTbl/0.0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5, & 7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.5,12.5,14.0,16.5,23.5/ data pTbu/ 0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5, & 7.0,7.5,8.0,8.5,9.0,9.5,10.0,10.5,11.5,12.5,14.0,16.5,23.5,40.0/ 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 if(exptid.eq.1571) then call bookplot2(n,tag,'mtt',m34,wt,wt2,mttl,mttu,7,'lin') n=n+1 call bookplot2(n,tag,'ytt',abs(y34),wt,wt2,yttl,yttu,5,'lin') n=n+1 call bookplot2(n,tag,'pTtt',pt34,wt,wt2,pTttl,pTttu,6,'lin') n=n+1 call bookplot2(n,tag,'y3',abs(y3),wt,wt2,ytl,ytu,5,'lin') n=n+1 call bookplot2(n,tag,'pT3',pt3,wt,wt2,pTtl,pTtu,8,'lin') n=n+1 call bookplot2(n,tag,'y4',abs(y4),wt,wt2,ytl,ytu,5,'lin') n=n+1 call bookplot2(n,tag,'pT4',pt4,wt,wt2,pTtl,pTtu,8,'lin') n=n+1 call bookplot2(n,tag,'yt5',abs(y5),wt,wt2,ytl,ytu,5,'lin') n=n+1 call bookplot2(n,tag,'pT5',pt5,wt,wt2,pTtl,pTtu,8,'lin') n=n+1 elseif(nproc.eq.158.or.(nproc.ge.701.and.nproc.le.704)) then if((y3.ge.2.0.and.y3.lt.4.5).or.(tag.eq.'book')) then call bookplot2(n,tag,'pTb',pt3,wt,wt2,pTbl,pTbu,27,'lin') endif n=n+1 call bookplot(n,tag,'yb',y3,wt,wt2,0d0,5.0d0,0.5d0,'lin') n=n+1 if((y3.ge.2.0.and.y3.lt.2.5).or.(tag.eq.'book')) then call bookplot2(n,tag,'pTby',pt3,wt,wt2,pTbl,pTbu,27,'lin') endif n=n+1 if((y3.ge.2.5.and.y3.lt.3.0).or.(tag.eq.'book')) then call bookplot2(n,tag,'pTby',pt3,wt,wt2,pTbl,pTbu,27,'lin') endif n=n+1 if((y3.ge.3.0.and.y3.lt.3.5).or.(tag.eq.'book')) then call bookplot2(n,tag,'pTby',pt3,wt,wt2,pTbl,pTbu,27,'lin') endif n=n+1 if((y3.ge.3.5.and.y3.lt.4.0).or.(tag.eq.'book')) then call bookplot2(n,tag,'pTby',pt3,wt,wt2,pTbl,pTbu,27,'lin') endif n=n+1 if((y3.ge.4.0.and.y3.le.4.5).or.(tag.eq.'book')) then call bookplot2(n,tag,'pTby',pt3,wt,wt2,pTbl,pTbu,27,'lin') endif n=n+1 endif ************************************************************************ * * * 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