2
c Example analysis for "p p > l+ l- [QCD]" process.
4
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
5
subroutine analysis_begin(nwgt,weights_info)
6
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
9
character*(*) weights_info(*)
10
integer j,kk,l,nwgt_analysis
11
common/c_analysis/nwgt_analysis
14
real * 8 bin,xmi,xms,pi
15
parameter (pi=3.14159265358979312d0)
19
if (nwgt_analysis*42.gt.nplots/4) then
20
write (*,*) 'error in analysis_begin: '/
21
& /'too many histograms, increase NPLOTS to',
31
call bookup(l+ 1,'V pt '//weights_info(kk)//cc(j)
33
call bookup(l+ 2,'V pt '//weights_info(kk)//cc(j)
34
& ,10.d0,0.d0,1000.d0)
35
call bookup(l+ 3,'V log[pt] '//weights_info(kk)//cc(j)
37
call bookup(l+ 4,'V y '//weights_info(kk)//cc(j)
39
call bookup(l+ 5,'V eta '//weights_info(kk)//cc(j)
41
call bookup(l+ 6,'mV '//weights_info(kk)//cc(j)
44
call bookup(l+ 7,'lm pt '//weights_info(kk)//cc(j)
46
call bookup(l+ 8,'lm pt '//weights_info(kk)//cc(j)
47
& ,10.d0,0.d0,1000.d0)
48
call bookup(l+ 9,'lm log[pt] '//weights_info(kk)//cc(j)
50
call bookup(l+10,'lm eta '//weights_info(kk)//cc(j)
52
call bookup(l+11,'lp pt '//weights_info(kk)//cc(j)
54
call bookup(l+12,'lp pt '//weights_info(kk)//cc(j)
55
& ,10.d0,0.d0,1000.d0)
56
call bookup(l+13,'lp log[pt] '//weights_info(kk)//cc(j)
58
call bookup(l+14,'lp eta '//weights_info(kk)//cc(j)
61
call bookup(l+15,'lmlp delta eta '//weights_info(kk)//cc(j)
63
call bookup(l+16,'lmlp azimt '//weights_info(kk)//cc(j)
65
call bookup(l+17,'lmlp log[pi-azimt] '//weights_info(kk)//cc(j)
66
$ ,0.05d0,-4.d0,0.1d0)
67
call bookup(l+18,'lmlp inv m '//weights_info(kk)//cc(j)
69
call bookup(l+19,'lmlp pt '//weights_info(kk)//cc(j)
71
call bookup(l+20,'lmlp log[pt] '//weights_info(kk)//cc(j)
74
call bookup(l+21,'total'//weights_info(kk)//cc(j),1.d0,-1.d0,1.d0)
81
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
82
subroutine analysis_end(xnorm)
83
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
86
double precision xnorm
88
integer kk,l,nwgt_analysis
89
common/c_analysis/nwgt_analysis
91
call open_topdrawer_file
94
call mopera(i,'+',i,i,xnorm,0.d0)
102
call multitop(l+ 1,3,2,'V pt',' ','LOG')
103
call multitop(l+ 2,3,2,'V pt',' ','LOG')
104
call multitop(l+ 3,3,2,'V log[pt]',' ','LOG')
105
call multitop(l+ 4,3,2,'V y',' ','LOG')
106
call multitop(l+ 5,3,2,'V eta',' ','LOG')
107
call multitop(l+ 6,3,2,'mV',' ','LOG')
109
call multitop(l+ 7,3,2,'lm pt',' ','LOG')
110
call multitop(l+ 8,3,2,'lm pt',' ','LOG')
111
call multitop(l+ 9,3,2,'lm log[pt]',' ','LOG')
112
call multitop(l+10,3,2,'lm eta',' ','LOG')
113
call multitop(l+11,3,2,'lm pt',' ','LOG')
114
call multitop(l+12,3,2,'lm pt',' ','LOG')
115
call multitop(l+13,3,2,'lm log[pt]',' ','LOG')
116
call multitop(l+14,3,2,'lm eta',' ','LOG')
118
call multitop(l+15,3,2,'lmlp deta',' ','LOG')
119
call multitop(l+16,3,2,'lmlp azi',' ','LOG')
120
call multitop(l+17,3,2,'lmlp azi',' ','LOG')
121
call multitop(l+18,3,2,'lmlp inv m',' ','LOG')
122
call multitop(l+19,3,2,'lmlp pt',' ','LOG')
123
call multitop(l+20,3,2,'lmlp pt',' ','LOG')
125
call multitop(l+21,3,2,'total',' ','LOG')
129
call close_topdrawer_file
134
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
135
subroutine analysis_fill(p,istatus,ipdg,wgts,ibody)
136
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
138
include 'nexternal.inc'
139
integer istatus(nexternal)
140
integer iPDG(nexternal)
141
double precision p(0:4,nexternal)
142
double precision wgts(*)
144
double precision wgt,var
145
integer i,kk,l,nwgt_analysis
146
common/c_analysis/nwgt_analysis
147
double precision www,ppl(0:3),pplb(0:3),ppv(0:3),ycut,xmv,ptv,yv
148
$ ,etav,ptl,yl,etal,ptlb,ylb,etalb,ptpair,azi,azinorm,xmll
150
double precision getrapidity,getinvm,getpseudorap,getdelphi
151
external getrapidity,getinvm,getpseudorap,getdelphi
153
parameter (pi=3.14159265358979312d0)
154
if (nexternal.ne.5) then
155
write (*,*) 'error #1 in analysis_fill: '/
156
& /'only for process "p p > l+ l- [QCD]"'
159
if (.not. (abs(ipdg(1)).le.5 .or. ipdg(1).eq.21)) then
160
write (*,*) 'error #2 in analysis_fill: '/
161
& /'only for process "p p > l+ l- [QCD]"'
164
if (.not. (abs(ipdg(2)).le.5 .or. ipdg(2).eq.21)) then
165
write (*,*) 'error #3 in analysis_fill: '/
166
& /'only for process "p p > l+ l- [QCD]"'
169
if (.not. (abs(ipdg(5)).le.5 .or. ipdg(5).eq.21)) then
170
write (*,*) 'error #4 in analysis_fill: '/
171
& /'only for process "p p > l+ l- [QCD]"'
174
if (ipdg(3).ne.-11.and.ipdg(3).ne.-13.and.ipdg(3).ne.-15) then
175
write (*,*) 'error #5 in analysis_fill: '/
176
& /'only for process "p p > l+ l- [QCD]"'
179
if (ipdg(4).ne.11.and.ipdg(4).ne.13.and.ipdg(4).ne.15) then
180
write (*,*) 'error #6 in analysis_fill: '/
181
& /'only for process "p p > l+ l- [QCD]"'
188
ppv(i)=ppl(i)+pplb(i)
193
C Variables of the vector boson
194
xmv=getinvm(ppv(0),ppv(1),ppv(2),ppv(3))
195
ptv=sqrt(ppv(1)**2+ppv(2)**2)
196
yv=getrapidity(ppv(0),ppv(3))
197
etav=getpseudorap(ppv(0),ppv(1),ppv(2),ppv(3))
198
C Variables of the leptons
199
ptl=sqrt(ppl(1)**2+ppl(2)**2)
200
yl=getrapidity(ppl(0),ppl(3))
201
etal=getpseudorap(ppl(0),ppl(1),ppl(2),ppl(3))
203
ptlb=sqrt(pplb(1)**2+pplb(2)**2)
204
ylb=getrapidity(pplb(0),pplb(3))
205
etalb=getpseudorap(pplb(0),pplb(1),pplb(2),pplb(3))
208
azi=getdelphi(ppl(1),pplb(1),ppl(2),pplb(2))
213
do kk=1,nwgt_analysis
216
call mfill(l+1,(ptv),(WWW))
217
call mfill(l+2,(ptv),(WWW))
218
if(ptv.gt.0.d0)call mfill(l+3,(log10(ptv)),(WWW))
219
call mfill(l+4,(yv),(WWW))
220
call mfill(l+5,(etav),(WWW))
221
call mfill(l+6,(xmv),(WWW))
223
call mfill(l+7,(ptl),(WWW))
224
call mfill(l+8,(ptl),(WWW))
225
if(ptl.gt.0.d0)call mfill(l+9,(log10(ptl)),(WWW))
226
call mfill(l+10,(etal),(WWW))
227
call mfill(l+11,(ptlb),(WWW))
228
call mfill(l+12,(ptlb),(WWW))
229
if(ptlb.gt.0.d0)call mfill(l+13,(log10(ptlb)),(WWW))
230
call mfill(l+14,(etalb),(WWW))
232
call mfill(l+15,(detallb),(WWW))
233
call mfill(l+16,(azi),(WWW))
235
# call mfill(l+17,(log10(azinorm)),(WWW))
236
call mfill(l+18,(xmll),(WWW))
237
call mfill(l+19,(ptpair),(WWW))
238
if(ptpair.gt.0)call mfill(l+20,(log10(ptpair)),(WWW))
239
call mfill(l+21,(0d0),(WWW))
243
if(abs(etav).lt.ycut)then
244
call mfill(l+1,(ptv),(WWW))
245
call mfill(l+2,(ptv),(WWW))
246
if(ptv.gt.0.d0)call mfill(l+3,(log10(ptv)),(WWW))
249
call mfill(l+4,(yv),(WWW))
250
call mfill(l+5,(etav),(WWW))
252
if(abs(etav).lt.ycut.and.ptv.gt.20.d0)then
253
call mfill(l+6,(xmv),(WWW))
254
call mfill(l+21,(0d0),(WWW))
257
if(abs(etal).lt.ycut)then
258
call mfill(l+7,(ptl),(WWW))
259
call mfill(l+8,(ptl),(WWW))
260
if(ptl.gt.0.d0)call mfill(l+9,(log10(ptl)),(WWW))
262
if(ptl.gt.20.d0)call mfill(l+10,(etal),(WWW))
263
if(abs(etalb).lt.ycut)then
264
call mfill(l+11,(ptlb),(WWW))
265
call mfill(l+12,(ptlb),(WWW))
266
if(ptlb.gt.0.d0)call mfill(l+13,(log10(ptlb)),(WWW))
268
if(ptlb.gt.20.d0)call mfill(l+14,(etalb),(WWW))
270
if( abs(etal).lt.ycut.and.abs(etalb).lt.ycut .and.
271
# ptl.gt.20.d0.and.ptlb.gt.20.d0)then
272
call mfill(l+15,(detallb),(WWW))
273
call mfill(l+16,(azi),(WWW))
275
# call mfill(l+17,(log10(azinorm)),(WWW))
276
call mfill(l+18,(xmll),(WWW))
277
call mfill(l+19,(ptpair),(WWW))
279
# call mfill(l+20,(log10(ptpair)),(WWW))
288
function getrapidity(en,pl)
290
real*8 getrapidity,en,pl,tiny,xplus,xminus,y
291
parameter (tiny=1.d-8)
294
if(xplus.gt.tiny.and.xminus.gt.tiny)then
295
if( (xplus/xminus).gt.tiny.and.(xminus/xplus).gt.tiny)then
296
y=0.5d0*log( xplus/xminus )
308
function getpseudorap(en,ptx,pty,pl)
310
real*8 getpseudorap,en,ptx,pty,pl,tiny,pt,eta,th
311
parameter (tiny=1.d-5)
313
pt=sqrt(ptx**2+pty**2)
314
if(pt.lt.tiny.and.abs(pl).lt.tiny)then
315
eta=sign(1.d0,pl)*1.d8
318
eta=-log(tan(th/2.d0))
325
function getinvm(en,ptx,pty,pl)
327
real*8 getinvm,en,ptx,pty,pl,tiny,tmp
328
parameter (tiny=1.d-5)
330
tmp=en**2-ptx**2-pty**2-pl**2
333
elseif(tmp.gt.-tiny)then
336
write(*,*)'Attempt to compute a negative mass'
344
function getdelphi(ptx1,pty1,ptx2,pty2)
346
real*8 getdelphi,ptx1,pty1,ptx2,pty2,tiny,pt1,pt2,tmp
347
parameter (tiny=1.d-5)
349
pt1=sqrt(ptx1**2+pty1**2)
350
pt2=sqrt(ptx2**2+pty2**2)
351
if(pt1.ne.0.d0.and.pt2.ne.0.d0)then
352
tmp=ptx1*ptx2+pty1*pty2
354
if(abs(tmp).gt.1.d0+tiny)then
355
write(*,*)'Cosine larger than 1'
357
elseif(abs(tmp).ge.1.d0)then