@@ -9,40 +9,62 @@ program dyaa
99 real (dp) s, t, u, x1, x2, jacobian
1010 end type
1111
12- type (pineappl_lumi) :: lumi
13- integer , dimension (2 ) :: pdg_ids
14- real (dp), dimension (1 ) :: ckm_factors
12+ type (pineappl_channels) :: channels
13+ integer , dimension (2 ) :: pdg_ids
14+ real (dp), dimension (1 ) :: factors
1515
1616 type (pineappl_grid) :: grid
17- integer , dimension (4 ) :: orders
18- real (dp), dimension (25 ) :: bins
19-
20- type (pineappl_keyval) :: key_vals
2117
2218 integer :: i
2319
24- integer :: order_idx, lumi_idx , calls
20+ integer :: order_idx, channel_idx , calls
2521 real (dp), parameter :: hbarc2 = 389379372.1_dp
2622 real (dp) :: x1, x2, q2, weight, s, t, u, jacobian, ptl, mll, yll, ylp, ylm
2723 type (psp2to2) :: tmp
2824
29- ! create a new luminosity function for the photon-photon initial state
30- lumi = pineappl_lumi_new()
25+ channels = pineappl_channels_new( 2 )
26+ ! create a new channel for the photon-photon initial state
3127 pdg_ids = [ 22 , 22 ]
32- ckm_factors = [ 1.0_dp ]
33- call pineappl_lumi_add(lumi, 1 , pdg_ids, ckm_factors)
34-
35- ! only O(alphas^0 alpha^2 log^0(xiR^2) \log^0(xiF^2)
36- orders = [ 0 , 2 , 0 , 0 ]
37- ! we bin in rapidity from 0 to 2.4 in steps of 0.1
38- bins = [ (i * 0.1_dp , i = 0 , 24 ) ]
39-
40- ! create the PineAPPL grid with default interpolation and binning parameters
41- key_vals = pineappl_keyval_new()
42- grid = pineappl_grid_new(lumi, 1 , orders, 24 , bins, key_vals)
43-
44- call pineappl_keyval_delete(key_vals)
45- call pineappl_lumi_delete(lumi)
28+ factors = [ 1.0_dp ]
29+ call pineappl_channels_add(channels, 1 , pdg_ids, factors)
30+
31+
32+ grid = pineappl_grid_new2( &
33+ ! number of bins
34+ 24 , &
35+ ! one-dimensional fill limits: we bin in rapidity from 0 to 2.4 in steps of 0.1
36+ [ (i * 0.1_dp , i = 0 , 24 ) ], &
37+ ! number of orders
38+ 1 , &
39+ ! perturbative orders: only O(alpha^2)
40+ [ 0_1 , 2_1 , 0_1 , 0_1 , 0_1 ], &
41+ channels, &
42+ pineappl_pid_basis_pdg, &
43+ [ &
44+ pineappl_conv(pineappl_conv_type_unpol_pdf, 2212 ), &
45+ pineappl_conv(pineappl_conv_type_unpol_pdf, 2212 ) &
46+ ], &
47+ 3 , &
48+ [ &
49+ pineappl_interp(1e2_dp , 1e8_dp , 40 , 3 , pineappl_reweight_meth_no_reweight, pineappl_map_applgrid_h0, pineappl_interp_meth_lagrange), &
50+ pineappl_interp(2e-7_dp , 1.0_dp , 50 , 3 , pineappl_reweight_meth_applgrid_x, pineappl_map_applgrid_f2, pineappl_interp_meth_lagrange), &
51+ pineappl_interp(2e-7_dp , 1.0_dp , 50 , 3 , pineappl_reweight_meth_applgrid_x, pineappl_map_applgrid_f2, pineappl_interp_meth_lagrange) &
52+ ], &
53+ [ &
54+ pineappl_kinematics(pineappl_kinematics_tag_scale, 0 ), &
55+ pineappl_kinematics(pineappl_kinematics_tag_x, 0 ), &
56+ pineappl_kinematics(pineappl_kinematics_tag_x, 1 ) &
57+ ], &
58+ [ &
59+ pineappl_scale_func_form(pineappl_scale_func_form_tag_scale, pineappl_scale_func_form_body(0 , 0 )), &
60+ pineappl_scale_func_form(pineappl_scale_func_form_tag_scale, pineappl_scale_func_form_body(0 , 0 )), &
61+ pineappl_scale_func_form(pineappl_scale_func_form_tag_no_scale, pineappl_scale_func_form_body(0 , 0 )) &
62+ ] &
63+ )
64+
65+ ! The `pineappl_scale_func_form_body` objects have to defined with two fields - if not required, the value(s) will be ignored
66+
67+ call pineappl_channels_delete(channels)
4668
4769 ! number of phase-space points that are generated before cuts
4870 calls = 10000000
@@ -76,18 +98,18 @@ program dyaa
7698 ! renormalisation and factorisation scale
7799 q2 = 90.0_dp ** 2
78100 order_idx = 0
79- lumi_idx = 0
101+ channel_idx = 0
80102
81103 ! fill
82104 ! - 'grid'
83- ! - for PDF parameters 'x1, x2, q2',
84105 ! - for perturbative order O(alpha^2) ('order_idx = 0' corresponds to the first four powers
85106 ! given in 'orders' above)
86107 ! - for the bin of the differential distribution corresponding to 'abs(yll)'
87- ! - for the first partonic channel ('lumi_idx = 0' corresponds to the lumi entry created
88- ! above in 'lumi')
108+ ! - for the first partonic channel ('channel_idx = 0' corresponds to the channel created
109+ ! above in 'channels')
110+ ! - for PDF parameters 'x1, x2, q2',
89111 ! - with the given 'weight'
90- call pineappl_grid_fill (grid, x1, x2, q2, order_idx, abs (yll), lumi_idx , weight)
112+ call pineappl_grid_fill2 (grid, order_idx, abs (yll), channel_idx, [ x1, x2, q2 ] , weight)
91113 end do
92114
93115 ! set metadata - this isn't strictly needed, but usually useful (plot script, ...)
@@ -100,10 +122,6 @@ program dyaa
100122 call pineappl_grid_set_key_value(grid, ' x1_unit' , ' ' )
101123 call pineappl_grid_set_key_value(grid, ' y_unit' , ' pb' )
102124
103- ! the following are the default values
104- ! call pineappl_grid_set_key_value(grid, 'initial_state_1', '2212') ! proton
105- ! call pineappl_grid_set_key_value(grid, 'initial_state_2', '2212') ! proton
106-
107125 ! optimize the grid representation (makes the file smaller)
108126 call pineappl_grid_optimize(grid)
109127
0 commit comments