2
c This file contains the default histograms for fixed order runs: it
3
c only plots the total rate as an example. It can be used as a template
4
c to make distributions for other observables.
6
c This uses the hbook package and generates histograms in the top-drawer
7
c format. This format is human-readable. After running, the histograms
8
c can be found in the Events/run_XX/ directory.
10
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
11
subroutine analysis_begin(nwgt,weights_info)
12
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
13
c This subroutine is called once at the start of each run. Here the
14
c histograms should be declared.
16
c Declare the histograms using 'bookup'.
17
c o) The first argument is an integer that labels the histogram. In
18
c the analysis_end and analysis_fill subroutines this label is used
19
c to keep track of the histogram. The label should be a number
20
c between 1 and NPLOTS/4=5000 (can be increased in dbook.inc).
21
c o) The second argument is a string that will apear above the
22
c histogram. Do not use brackets "(" or ")" inside this string.
23
c o) The third, forth and fifth arguments are the bin size, the
24
c lower edge of the first bin and the upper edge of the last
25
c bin. There is a maximum of 100 bins per histogram.
26
c o) When including scale and/or PDF uncertainties, declare a
27
c histogram for each weight, and compute the uncertainties from the
28
c final set of histograms
31
c When including scale and/or PDF uncertainties the total number of
32
c weights considered is nwgt
34
c In the weights_info, there is an text string that explains what each
35
c weight will mean. The size of this array of strings is equal to nwgt.
36
character*(*) weights_info(*)
38
integer kk,l,nwgt_analysis
39
common/c_analysis/nwgt_analysis
40
c Initialize the histogramming package (hbook):
42
c Fill the c_analysis common block with the number of weights that will
46
c loop over all the weights that are computed (depends on run_card
47
c parameters do_rwgt_scale and do_rwgt_pdf):
49
c make sure that there is a separate histogram initialized for each
52
c declare (i.e. book) the histograms
53
call bookup(l+1,'total rate '//weights_info(kk),
55
call bookup(l+2,'total rate Born '//weights_info(kk),
57
call bookup(l+3,'total rate QCD'//weights_info(kk),
59
call bookup(l+4,'total rate EW '//weights_info(kk),
66
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
67
subroutine analysis_end(xnorm)
68
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
69
c This subroutine is called once at the end of the run. Here the
70
c histograms are written to disk. Note that this is done for each
71
c integration channel separately. There is an external script that will
72
c read the top drawer files in each of the integration channels and
73
c combines them by summing all the bins in a final single top-drawer
74
c file to be put in the Events/run_XX directory.
76
c The histograms are put in a format to be written to file. Use the
77
c multitop() subroutine.
78
c o) The first argument is the histogram label
79
c o) The second and third arguments are not used (keep them to the
81
c o) Fourth argument is the label for the x-axis. Do not use
82
c brackets "(" or ")" inside this string.
83
c o) Fifth argument is the y-axis
84
c o) Final argument declares if the y-axis should be a linear 'LIN'
85
c or logarithmic 'LOG' scale.
88
double precision xnorm
91
integer kk,l,nwgt_analysis
92
common/c_analysis/nwgt_analysis
93
c This defines NPLOTS:
95
c Open the topdrawer file to write the histograms (do not remove the
97
call open_topdrawer_file
99
c Do not touch the folloing 4 lines. These lines make sure that the
100
c histograms will have the correct overall normalisation: cross section
103
call mopera(i,'+',i,i,xnorm,0.d0)
106
ytit='sigma per bin '
107
c Loop over the plots that are declared with bookup
108
do kk=1,nwgt_analysis
111
c convert them to a format suitable for writing
112
call multitop(l+i,3,2,'total rate',ytit,'LIN')
115
c Close the topdrawer file (Do not remove this call)
116
call close_topdrawer_file
122
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
123
subroutine analysis_fill(p,istatus,ipdg,wgts,ibody)
124
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
125
c This subroutine is called for each n-body and (n+1)-body configuration
126
c that passes the generation cuts. Here the histrograms are filled.
128
c This includes the 'nexternal' parameter that labels the number of
129
c particles in the (n+1)-body process
130
include 'nexternal.inc'
131
c This is an array which is '-1' for initial state and '1' for final
133
integer istatus(nexternal)
134
c This is an array with (simplified) PDG codes for the particles. Note
135
c that channels that are combined (i.e. they have the same matrix
136
c elements) are given only 1 set of PDG codes. This means, e.g., that
137
c when using a 5-flavour scheme calculation (massless b quark), no
138
c b-tagging can be applied.
139
integer iPDG(nexternal)
140
c The array of the momenta and masses of the initial and final state
141
c particles in the lab frame. The format is "E, px, py, pz, mass", while
142
c the second dimension loops over the particles in the process. Note
143
c that these are the (n+1)-body particles; for the n-body there is one
144
c momenta equal to all zero's (this is not necessarily the last particle
145
c in the list). If one uses IR-safe obserables only, there should be no
146
c difficulty in using this.
147
double precision p(0:4,nexternal)
148
c The weight of the current phase-space point is wgts(1). If scale
149
c and/or PDF uncertainties are included through reweighting, the rest of
150
c the array contains the list of weights in the same order as described
151
c by the weigths_info strings in analysis_begin
152
double precision wgts(*)
153
c The ibody variable is:
154
c ibody=1 : (n+1)-body contribution
155
c ibody=2 : n-body contribution (excluding the Born)
156
c ibody=3 : Born contribution
157
c The histograms need to be filled for all these contribution to get the
158
c physics NLO results. (Note that the adaptive phase-space integration
159
c is optimized using the sum of the contributions, therefore plotting
160
c them separately might lead to larger than expected statistical
164
double precision wgt,var
165
integer kk,l,nwgt_analysis
166
common/c_analysis/nwgt_analysis
167
! stuff for plotting the different splitorders
168
integer orders_tag_plot
169
common /corderstagplot/ orders_tag_plot
171
c Fill the histograms here using a call to the mfill() subroutine. The
172
c first argument is the histogram label, the second is the numerical
173
c value of the variable to plot for the current phase-space point and
174
c the final argument is the weight of the current phase-space point.
176
c loop over all the weights that are computed (depends on run_card
177
c parameters do_rwgt_scale and do_rwgt_pdf):
178
do kk=1,nwgt_analysis
181
c always fill the total rate
182
call mfill(l+1,var,wgt)
183
c only fill the total rate for the Born when ibody=3
184
if (ibody.eq.3) call mfill(l+2,var,wgt)
185
C fill the different partonic subchannels
186
if (orders_tag_plot.eq.402) call mfill(l+3,var,wgt)
187
if (orders_tag_plot.eq.600) call mfill(l+4,var,wgt)