Skip to content

Commit 407861d

Browse files
Merge branch 'master' into parallelize-evolve
2 parents 6be5f47 + a8060ca commit 407861d

File tree

12 files changed

+129
-1042
lines changed

12 files changed

+129
-1042
lines changed

examples/cpp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ merge-grids: merge-grids.cpp
8686
modify-grid: modify-grid.cpp
8787
$(CXX) $(CXXFLAGS) $< $(PINEAPPL_DEPS) -o $@
8888

89-
PHONY: clean
89+
.PHONY: clean
9090

9191
clean:
9292
rm -f $(PROGRAMS) *.pineappl *.lz4

examples/fortran/Makefile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ PINEAPPL_LIBS != pkg-config pineappl_capi --libs
44
LHAPDF_LIBS != pkg-config lhapdf --libs
55

66
PROGRAMS = \
7-
dyaa-deprecated \
7+
dyaa \
88
test \
9-
test-deprecated \
10-
lhapdf_example \
11-
lhapdf_example-deprecated
9+
lhapdf_example
1210

1311
all: $(PROGRAMS)
1412

@@ -18,22 +16,16 @@ test-examples: $(PROGRAMS)
1816
pineappl.o: pineappl.f90
1917
$(FC) $(FFLAGS) -c $< -o $@
2018

21-
dyaa-deprecated: dyaa-deprecated.f90 pineappl.o
19+
dyaa: dyaa.f90 pineappl.o
2220
$(FC) $(FFLAGS) $< pineappl.o $(PINEAPPL_LIBS) -o $@
2321

2422
test: test.f90 pineappl.o
2523
$(FC) $(FFLAGS) $< pineappl.o $(PINEAPPL_LIBS) -o $@
2624

27-
test-deprecated: test-deprecated.f90 pineappl.o
28-
$(FC) $(FFLAGS) $< pineappl.o $(PINEAPPL_LIBS) -o $@
29-
3025
lhapdf_example: lhapdf_example.f90 pineappl.o
3126
$(FC) $(FFLAGS) $< pineappl.o $(LHAPDF_LIBS) $(PINEAPPL_LIBS) -o $@
3227

33-
lhapdf_example-deprecated: lhapdf_example-deprecated.f90 pineappl.o
34-
$(FC) $(FFLAGS) $< pineappl.o $(LHAPDF_LIBS) $(PINEAPPL_LIBS) -o $@
35-
36-
PHONY: clean
28+
.PHONY: clean
3729

3830
clean:
3931
rm -f *.o *.mod $(PROGRAMS)
Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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

examples/fortran/lhapdf_example-deprecated.f90

Lines changed: 0 additions & 118 deletions
This file was deleted.

examples/fortran/lhapdf_example-deprecated.output

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)