@@ -25,30 +25,21 @@ std::vector<std::size_t> unravel_index(std::size_t flat_index, const std::vector
2525}
2626
2727extern " C" void generate_fake_ekos (
28- const int * pids_in,
29- const double * x_in,
30- const int * pids_out,
31- const double * x_out,
28+ const int * /* pids_in*/ ,
29+ const double * /* x_in*/ ,
30+ const int * /* pids_out*/ ,
31+ const double * /* x_out*/ ,
3232 double * eko_buffer,
3333 void * params_state,
34- pineappl_conv_type conv_type,
35- double fac1,
34+ pineappl_conv_type /* conv_type*/ ,
35+ double /* fac1*/ ,
3636 std::size_t pids_in_len,
3737 std::size_t x_in_len,
3838 std::size_t pids_out_len,
3939 std::size_t x_out_len
4040) {
41- // Ignore unused variables
42- (void ) pids_in;
43- (void ) x_in;
44- (void ) pids_out;
45- (void ) x_out;
46- (void ) conv_type;
47- (void ) fac1;
48-
4941 // Check to get the μ0 of the PDF from the `params_state`
50- const double mu0_scale = static_cast <LHAPDF::PDF*> (params_state)->q2Min ();
51- (void ) mu0_scale; // Mark as unused variable
42+ const double _ = static_cast <LHAPDF::PDF*> (params_state)->q2Min ();
5243
5344 std::size_t flat_len = pids_in_len * x_in_len * pids_out_len * x_out_len;
5445 // NOTE: The EKO has to have as shape: (pids_in, x_in, pids_out, x_out)
@@ -133,8 +124,12 @@ int main() {
133124
134125 // Get the shape of the evolve info objects
135126 std::vector<std::size_t > evinfo_shape (5 );
136- std::vector<uint8_t > max_orders = {2 , 3 };
137- pineappl_grid_evolve_info_shape (grid, max_orders.data (), evinfo_shape.data ());
127+ // NOTE: The argument of `pineappl_grid_evolve_info_shape` must follow the following orders:
128+ // - `grid`: PineAPPL Grid
129+ // - `order_mask`: array of booleans to mask the order(s) to apply the Evolution to,
130+ // `nullptr` selects all the orders
131+ // - `evinfo_shape`: placeholder to store the shape of the Evolution Operator
132+ pineappl_grid_evolve_info_shape (grid, nullptr , evinfo_shape.data ());
138133
139134 // Get the values of the evolve info parameters. These contain, for example, the
140135 // information on the `x`-grid and `PID` used to interpolate the Grid.
@@ -144,7 +139,12 @@ int main() {
144139 std::vector<int > pids_in (evinfo_shape[2 ]);
145140 std::vector<double > x_in (evinfo_shape[3 ]);
146141 std::vector<double > ren1 (evinfo_shape[4 ]);
147- pineappl_grid_evolve_info (grid, max_orders.data (), fac1.data (),
142+ // NOTE: The argument of `pineappl_grid_evolve_info` must follow the following orders:
143+ // - `grid`: PineAPPL Grid
144+ // - `order_mask`: array of booleans to mask the order(s) to apply the Evolution to,
145+ // `nullptr` selects all the orders
146+ // The rest of the arguments are placeholders to store data
147+ pineappl_grid_evolve_info (grid, nullptr , fac1.data (),
148148 frg1.data (), pids_in.data (), x_in.data (), ren1.data ());
149149
150150 // ------------------ Construct the Operator Info ------------------
@@ -183,8 +183,10 @@ int main() {
183183 // - `grid`: PineAPPL Grid
184184 // - `op_info`: operator info
185185 // - `operator`: callback that returns an evolution operator
186- // - `max_orders`: max orders to apply the evolution
186+ // - `order_mask`: array of booleans to mask the order(s) to apply the Evolution to,
187+ // `nullptr` selects all the orders
187188 // - `params_state`: parameters that get passed to `operator`
189+ // - `nb_convolutions`: the number of convolutions/Evolution Operators required
188190 // - `x_in`: x-grid of the Grid
189191 // - `x_out`: x-grid of the FK table
190192 // - `pids_in`: PIDs basis representation of the Grid
@@ -193,10 +195,11 @@ int main() {
193195 // - `xi`: scale variation
194196 // - `ren1`: values of the renormalization scales
195197 // - `alphas_table`: values of alphas for each renormalization scales
196- pineappl_fktable* fktable = pineappl_grid_evolve (grid, opinfo_slices.data (),
197- generate_fake_ekos, max_orders.data (), pdf.get (), x_in.data (),
198- x_in.data (), pids_in.data (), pids_out.data (),
199- tensor_shape.data (), xi.data (), ren1.data (), alphas_table.data ());
198+ pineappl_grid* fktable = pineappl_grid_evolve (grid, opinfo_slices.data (),
199+ generate_fake_ekos, nullptr , pdf.get (),
200+ conv_types.size (), x_in.data (), x_in.data (),
201+ pids_in.data (), pids_out.data (), tensor_shape.data (),
202+ xi.data (), ren1.data (), alphas_table.data ());
200203
201204 // ------------------ Compare Grid & FK after convolution ------------------
202205 // how many bins does this grid have?
@@ -211,13 +214,15 @@ int main() {
211214
212215 // [ convolve the FK Table ]
213216 std::vector<double > dxsec_fktable (bins);
214- pineappl_fktable_convolve (fktable, xfx, pdf_states, nullptr ,
215- nullptr , 1 , nullptr , dxsec_fktable.data ());
217+ auto as_one = [](double /* q2*/ , void * /* pdf*/ ) { return 1.0 ; };
218+ pineappl_grid_convolve (fktable, xfx, as_one, pdf_states, nullptr ,
219+ nullptr , nullptr , nullptr , 1 ,
220+ mu_scales.data (), dxsec_fktable.data ());
216221
217222 // Print the results
218223 print_results (dxsec_grid, dxsec_fktable);
219224
220- pineappl_fktable_write (fktable, " evolved-grid.pineappl.lz4" );
225+ pineappl_fktable_write (fktable, " evolved-grid-identity .pineappl.lz4" );
221226
222227 pineappl_grid_delete (grid);
223228 pineappl_fktable_delete (fktable);
0 commit comments