pineappl_cli 1.4.0

Read, write, and query PineAPPL grids
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
#![allow(missing_docs)]

use assert_cmd::Command;

const HELP_STR: &str = "Read out information of a grid

Usage: pineappl read <--bins|--channels|--ew|--fk-table|--fk-table-fac0|--fk-table-frg0|--get <KEY>|--keys|--orders|--orders-long|--orders-spaces|--qcd|--show> <INPUT>

Arguments:
  <INPUT>  Path to the input grid

Options:
  -b, --bins           Show the bins of a grid
      --channels       Show the channel definition of a grid
      --ew             For each order print a list of the largest EW order
      --fk-table       Check if input is an FK table
      --fk-table-fac0  Return the (squared) factorization scale of the FK-table
      --fk-table-frg0  Return the (squared) fragmentation scale of the FK-table
      --get <KEY>      Gets an internal key-value pair
      --keys           Show all keys stored in the grid
  -o, --orders         Show the orders of a grid, stripping zero powers
      --orders-long    Show the orders of a grid, including zero powers
      --orders-spaces  Show the orders of a grid, replacing zero powers with spaces
      --qcd            For each order print a list of the largest QCD order
      --show           Shows all key-value pairs stored in the grid
  -h, --help           Print help
";

const BINS_STR: &str = "b   etal    norm
-+----+----+----
0    2 2.25 0.25
1 2.25  2.5 0.25
2  2.5 2.75 0.25
3 2.75    3 0.25
4    3 3.25 0.25
5 3.25  3.5 0.25
6  3.5    4  0.5
7    4  4.5  0.5
";

const CHANNELS_STR: &str = "c    entry        entry
-+------------+------------
0 1 × ( 2, -1) 1 × ( 4, -3)
1 1 × (21, -3) 1 × (21, -1)
2 1 × (22, -3) 1 × (22, -1)
3 1 × ( 2, 21) 1 × ( 4, 21)
4 1 × ( 2, 22) 1 × ( 4, 22)
";

const ORDERS_STR: &str = "o      order
-+----------------
0 O(a^2)
1 O(as^1 a^2)
2 O(as^1 a^2 lf^1)
3 O(a^3)
4 O(a^3 lf^1)
";

const ORDERS_LONG_STR: &str = "o           order
-+--------------------------
0 O(as^0 a^2 lr^0 lf^0 la^0)
1 O(as^1 a^2 lr^0 lf^0 la^0)
2 O(as^1 a^2 lr^0 lf^1 la^0)
3 O(as^0 a^3 lr^0 lf^0 la^0)
4 O(as^0 a^3 lr^0 lf^1 la^0)
";

const ORDERS_SPACES_STR: &str = "o           order
-+--------------------------
0 O(     a^2               )
1 O(as^1 a^2               )
2 O(as^1 a^2      lf^1     )
3 O(     a^3               )
4 O(     a^3      lf^1     )
";

const FKTABLE_STR: &str = "no
multiple orders detected
";

const WRONG_ORDERS_STR: &str = "error: the argument '--orders' cannot be used with '--orders-long'

Usage: pineappl read <--bins|--channels|--ew|--fk-table|--fk-table-fac0|--fk-table-frg0|--get <KEY>|--keys|--orders|--orders-long|--orders-spaces|--qcd|--show> <INPUT>

For more information, try '--help'.
";

const KEYS_STR: &str = "arxiv
description
hepdata
initial_state_1
initial_state_2
lumi_id_types
mg5amc_repo
mg5amc_revno
nnpdf_id
pineappl_gitversion
results
runcard
runcard_gitversion
x1_label
x1_label_tex
x1_unit
y_label
y_label_tex
y_unit
";

const SHOW_STR: &str = r#"arxiv: 1505.07024
description: LHCb differential W-boson production cross section at 7 TeV
hepdata: 10.17182/hepdata.2114.v1/t4
initial_state_1: 2212
initial_state_2: 2212
lumi_id_types: pdg_mc_ids
mg5amc_repo: http://bazaar.launchpad.net/~maddevelopers/mg5amcnlo/3.1.2/
mg5amc_revno: 983
nnpdf_id: LHCBWZMU7TEV
pineappl_gitversion: v0.4.1-114-gdce19e0
results: ----------------------------------------------------------------------
   PineAPPL         MC        sigma      central         min      max 
                              1/100   sigma   1/1000   1/1000   1/1000
----------------------------------------------------------------------
 3.772955e+02  3.772821e+02   0.165   0.022   0.0357   0.0392   0.0313
 3.451417e+02  3.451342e+02   0.179   0.012   0.0217   0.0251   0.0172
 3.001260e+02  3.001231e+02   0.029   0.033   0.0096   0.0104   0.0076
 2.427612e+02  2.427624e+02   0.024   0.021   0.0049   0.0046   0.0060
 1.809773e+02  1.809799e+02   0.023   0.062   0.0143   0.0134   0.0154
 1.229334e+02  1.229354e+02   0.028   0.056   0.0157   0.0120   0.0200
 1.158685e+02  1.158603e+02   0.029   0.245   0.0708   0.0859   0.0514
 2.751727e+01  2.749798e+01   0.074   0.944   0.7014   0.7554   0.6281

runcard: <LesHouchesEvents version="3.0">
<header>
<!--
#*********************************************************************
#                                                                    *
#                        MadGraph5_aMC@NLO                           *
#                                                                    *
#                           Going Beyond                             *
#                                                                    *
#                   http://madgraph.hep.uiuc.edu                     *
#                   http://madgraph.phys.ucl.ac.be                   *
#                   http://amcatnlo.cern.ch                          *
#                                                                    *
#                     The MadGraph5_aMC@NLO team                     *
#                                                                    *
#....................................................................*
#                                                                    *
# This file contains all the information necessary to reproduce      *
# the events generated:                                              *
#                                                                    *
# 1. software version                                                *
# 2. proc_card          : code generation info including model       *
# 3. param_card         : model primary parameters in the LH format  *
# 4. run_card           : running parameters (collider and cuts)     *
# 5. pythia_card        : present only if pythia has been run        *
# 6. pgs_card           : present only if pgs has been run           *
# 7. delphes_cards      : present only if delphes has been run       *
#                                                                    *
#                                                                    *
#*********************************************************************
-->
<MGVersion>
3.1.1
</MGVersion>
<MGRunCard>
<![CDATA[
#***********************************************************************
#                        MadGraph5_aMC@NLO                             *
#                                                                      *
#                      run_card.dat aMC@NLO                            *
#                                                                      *
#  This file is used to set the parameters of the run.                 *
#                                                                      *
#  Some notation/conventions:                                          *
#                                                                      *
#   Lines starting with a hash (#) are info or comments                *
#                                                                      *
#   mind the format:   value    = variable     ! comment               *
#                                                                      *
#   Some of the values of variables can be list. These can either be   *
#   comma or space separated.                                          *
#                                                                      *
#   To display additional parameter, you can use the command:          *
#      update to_full                                                  *
#***********************************************************************
#
#*******************                                                 
# Running parameters
#*******************                                                 
#
#***********************************************************************
# Tag name for the run (one word)                                      *
#***********************************************************************
  tag_1	= run_tag ! name of the run 
#***********************************************************************
# Number of LHE events (and their normalization) and the required      *
# (relative) accuracy on the Xsec.                                     *
# These values are ignored for fixed order runs                        *
#***********************************************************************
  10000	= nevents ! Number of unweighted events requested 
  -1.0	= req_acc ! Required accuracy (-1=auto determined from nevents)
  -1	= nevt_job ! Max number of events per job in event generation. 
                 !  (-1= no split).
#***********************************************************************
# Normalize the weights of LHE events such that they sum or average to *
# the total cross section                                              *
#***********************************************************************
  average	= event_norm ! valid settings: average, sum, bias
#***********************************************************************
# Number of points per itegration channel (ignored for aMC@NLO runs)   *
#***********************************************************************
  0.0001	= req_acc_fo ! Required accuracy (-1=ignored, and use the 
 	                   ! number of points and iter. below)
# These numbers are ignored except if req_acc_FO is equal to -1
  5000	= npoints_fo_grid ! number of points to setup grids
  4	= niters_fo_grid ! number of iter. to setup grids
  10000	= npoints_fo ! number of points to compute Xsec
  6	= niters_fo ! number of iter. to compute Xsec
#***********************************************************************
# Random number seed                                                   *
#***********************************************************************
  0	= iseed ! rnd seed (0=assigned automatically=default))
#***********************************************************************
# Collider type and energy                                             *
#***********************************************************************
  1	= lpp1 ! beam 1 type (0 = no PDF)
  1	= lpp2 ! beam 2 type (0 = no PDF)
  3500.0	= ebeam1 ! beam 1 energy in GeV
  3500.0	= ebeam2 ! beam 2 energy in GeV
#***********************************************************************
# PDF choice: this automatically fixes also alpha_s(MZ) and its evol.  *
#***********************************************************************
  lhapdf	= pdlabel ! PDF set
  324900	= lhaid ! If pdlabel=lhapdf, this is the lhapdf number. Only 
              ! numbers for central PDF sets are allowed. Can be a list; 
              ! PDF sets beyond the first are included via reweighting.
#***********************************************************************
# Include the NLO Monte Carlo subtr. terms for the following parton    *
# shower (HERWIG6 | HERWIGPP | PYTHIA6Q | PYTHIA6PT | PYTHIA8)         *
# WARNING: PYTHIA6PT works only for processes without FSR!!!!          *
#***********************************************************************
  HERWIG6	= parton_shower 
  1.0	= shower_scale_factor ! multiply default shower starting
                                  ! scale by this factor
#***********************************************************************
# Renormalization and factorization scales                             *
# (Default functional form for the non-fixed scales is the sum of      *
# the transverse masses divided by two of all final state particles    * 
# and partons. This can be changed in SubProcesses/set_scales.f or via *
# dynamical_scale_choice option)                                       *
#***********************************************************************
  True	= fixed_ren_scale ! if .true. use fixed ren scale
  True	= fixed_fac_scale ! if .true. use fixed fac scale
  80.352	= mur_ref_fixed ! fixed ren reference scale 
  80.352	= muf_ref_fixed ! fixed fact reference scale
  -1	= dynamical_scale_choice ! Choose one (or more) of the predefined
           ! dynamical choices. Can be a list; scale choices beyond the
           ! first are included via reweighting
  1.0	= mur_over_ref ! ratio of current muR over reference muR
  1.0	= muf_over_ref ! ratio of current muF over reference muF
#*********************************************************************** 
# Reweight variables for scale dependence and PDF uncertainty          *
#***********************************************************************
  1.0, 2.0, 0.5	= rw_rscale ! muR factors to be included by reweighting
  1.0, 2.0, 0.5	= rw_fscale ! muF factors to be included by reweighting
  True	= reweight_scale ! Reweight to get scale variation using the 
            ! rw_rscale and rw_fscale factors. Should be a list of 
            ! booleans of equal length to dynamical_scale_choice to
            ! specify for which choice to include scale dependence.
  False	= reweight_pdf ! Reweight to get PDF uncertainty. Should be a
            ! list booleans of equal length to lhaid to specify for
            !  which PDF set to include the uncertainties.
#***********************************************************************
# Store reweight information in the LHE file for off-line model-       *
# parameter reweighting at NLO+PS accuracy                             *
#***********************************************************************
  False	= store_rwgt_info ! Store info for reweighting in LHE file
#***********************************************************************
# ickkw parameter:                                                     *
#   0: No merging                                                      *
#   3: FxFx Merging - WARNING! Applies merging only at the hard-event  *
#      level. After showering an MLM-type merging should be applied as *
#      well. See http://amcatnlo.cern.ch/FxFx_merging.htm for details. *
#   4: UNLOPS merging (with pythia8 only). No interface from within    *
#      MG5_aMC available, but available in Pythia8.                    *
#  -1: NNLL+NLO jet-veto computation. See arxiv:1412.8408 [hep-ph].    *
#***********************************************************************
  0	= ickkw 
#***********************************************************************
#
#***********************************************************************
# BW cutoff (M+/-bwcutoff*Gamma). Determines which resonances are      *
# written in the LHE event file                                        *
#***********************************************************************
  15.0	= bwcutoff 
#***********************************************************************
# Cuts on the jets. Jet clustering is performed by FastJet.            *
#  - If gamma_is_j, photons are also clustered                            *
#  - When matching to a parton shower, these generation cuts should be *
#    considerably softer than the analysis cuts.                       *
#  - More specific cuts can be specified in SubProcesses/cuts.f        *
#***********************************************************************
  1.0	= jetalgo ! FastJet jet algorithm (1=kT, 0=C/A, -1=anti-kT)
  0.7	= jetradius ! The radius parameter for the jet algorithm
  10.0	= ptj ! Min jet transverse momentum
  -1.0	= etaj ! Max jet abs(pseudo-rap) (a value .lt.0 means no cut)
  True	= gamma_is_j ! Wether to cluster photons as jets or not
#***********************************************************************
# Cuts on the charged leptons (e+, e-, mu+, mu-, tau+ and tau-)        *
# More specific cuts can be specified in SubProcesses/cuts.f           *
#***********************************************************************
  20.0	= ptl ! Min lepton transverse momentum
  4.5	= etal ! Max lepton abs(pseudo-rap) (a value .lt.0 means no cut)
  0.0	= drll ! Min distance between opposite sign lepton pairs
  0.0	= drll_sf ! Min distance between opp. sign same-flavor lepton pairs
  0.0	= mll ! Min inv. mass of all opposite sign lepton pairs
  30.0	= mll_sf ! Min inv. mass of all opp. sign same-flavor lepton pairs
#***********************************************************************
# Fermion-photon recombination parameters                              *
# If Rphreco=0, no recombination is performed                          *
#***********************************************************************
  0.1	= rphreco ! Minimum fermion-photon distance for recombination
  -1.0	= etaphreco ! Maximum abs(pseudo-rap) for photons to be recombined (a value .lt.0 means no cut)
  True	= lepphreco ! Recombine photons and leptons together
  True	= quarkphreco ! Recombine photons and quarks together
#***********************************************************************
# Photon-isolation cuts, according to hep-ph/9801442                   *
# Not applied if gamma_is_j                                            *
# When ptgmin=0, all the other parameters are ignored                  *
# More specific cuts can be specified in SubProcesses/cuts.f           *
#***********************************************************************
  20.0	= ptgmin ! Min photon transverse momentum
  -1.0	= etagamma ! Max photon abs(pseudo-rap)
  0.4	= r0gamma ! Radius of isolation code
  1.0	= xn ! n parameter of eq.(3.4) in hep-ph/9801442
  1.0	= epsgamma ! epsilon_gamma parameter of eq.(3.4) in hep-ph/9801442
  True	= isoem ! isolate photons from EM energy (photons and leptons)
#***********************************************************************
# Cuts associated to MASSIVE particles identified by their PDG codes.  *
# All cuts are applied to both particles and anti-particles, so use    *
# POSITIVE PDG CODES only. Example of the syntax is {6 : 100} or       *
# {6:100, 25:200} for multiple particles                               *
#***********************************************************************
  {}	= pt_min_pdg ! Min pT for a massive particle
  {}	= pt_max_pdg ! Max pT for a massive particle
  {}	= mxx_min_pdg ! inv. mass for any pair of (anti)particles
#***********************************************************************
# Use PineAPPL to generate PDF-independent fast-interpolation grid     *
# (https://zenodo.org/record/3992765#.X2EWy5MzbVo)                     *
#***********************************************************************
  True	= pineappl ! PineAPPL switch 
#***********************************************************************
#********************************************************************* 
#  Additional hidden parameters
#*********************************************************************
  5	= maxjetflavor # hidden_parameter
]]>
</MGRunCard>
<slha>
######################################################################
## PARAM_CARD AUTOMATICALY GENERATED BY MG5                       ####
######################################################################
###################################
## INFORMATION FOR MASS
###################################
BLOCK MASS # 
      6 1.725000e+02 # mt
      23 9.115350e+01 # mz
      24 8.035200e+01 # mw
      25 1.250000e+02 # mh
      1 0.000000e+00 # d : 0.0
      2 0.000000e+00 # u : 0.0
      3 0.000000e+00 # s : 0.0
      4 0.000000e+00 # c : 0.0
      5 0.000000e+00 # b : 0.0
      11 0.000000e+00 # e- : 0.0
      12 0.000000e+00 # ve : 0.0
      13 0.000000e+00 # mu- : 0.0
      14 0.000000e+00 # vm : 0.0
      15 0.000000e+00 # ta- : 0.0
      16 0.000000e+00 # vt : 0.0
      21 0.000000e+00 # g : 0.0
      22 0.000000e+00 # a : 0.0
      9000002 9.118800e+01 # ghz : mz
      9000003 8.041900e+01 # ghwp : mw
      9000004 8.041900e+01 # ghwm : mw
      250 9.118800e+01 # g0 : mz
      251 8.041900e+01 # g+ : mw
###################################
## INFORMATION FOR SMINPUTS
###################################
BLOCK SMINPUTS # 
      2 1.166379e-05 # gf
      3 1.180000e-01 # as (note that parameter not used if you use a pdf set)
###################################
## INFORMATION FOR DECAY
###################################
DECAY 6 1.377580e+00 # wt
DECAY 23 2.494300e+00 # wz
DECAY 24 2.084000e+00 # ww
DECAY 25 4.074680e-03 # wh
DECAY 1 0.000000e+00 # d : 0.0
DECAY 2 0.000000e+00 # u : 0.0
DECAY 3 0.000000e+00 # s : 0.0
DECAY 4 0.000000e+00 # c : 0.0
DECAY 5 0.000000e+00 # b : 0.0
DECAY 11 0.000000e+00 # e- : 0.0
DECAY 12 0.000000e+00 # ve : 0.0
DECAY 13 0.000000e+00 # mu- : 0.0
DECAY 14 0.000000e+00 # vm : 0.0
DECAY 15 0.000000e+00 # ta- : 0.0
DECAY 16 0.000000e+00 # vt : 0.0
DECAY 21 0.000000e+00 # g : 0.0
DECAY 22 0.000000e+00 # a : 0.0
DECAY 250 2.498770e+00 # g0 : wz
DECAY 251 2.092910e+00 # g+ : ww
###################################
## INFORMATION FOR QNUMBERS 9000001
###################################
BLOCK QNUMBERS 9000001 #  gha
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000002
###################################
BLOCK QNUMBERS 9000002 #  ghz
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000003
###################################
BLOCK QNUMBERS 9000003 #  ghwp
      1 3 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000004
###################################
BLOCK QNUMBERS 9000004 #  ghwm
      1 -3 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 9000005
###################################
BLOCK QNUMBERS 9000005 #  ghg
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 8 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 250
###################################
BLOCK QNUMBERS 250 #  g0
      1 0 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 0 # particle/antiparticle distinction (0=own anti)
###################################
## INFORMATION FOR QNUMBERS 251
###################################
BLOCK QNUMBERS 251 #  g+
      1 3 # 3 times electric charge
      2 1 # number of spin states (2s+1)
      3 1 # colour rep (1: singlet, 3: triplet, 8: octet)
      4 1 # particle/antiparticle distinction (0=own anti)
</slha>
<run_settings>
order = NLO
fixed_order = ON
shower = OFF
madspin = OFF
reweight = OFF
madanalysis = OFF
runshower = False
</run_settings>
<foanalyse>
<![CDATA[
#######################################################################
#                             
# This file contains the settings for analyses to be linked to fixed
# order runs. Analysis files are meant to be put (or linked) inside
# <PROCDIR>/FixedOrderAnalysis/ (<PROCDIR> is the name of the exported
# process directory). See the
# <PROCDIR>/FixedOrderAnalysis/analysis_*_template.f file for details
# on how to write your own analysis.
#                                                                               
#######################################################################
#
# Analysis format.
# Can either be 'topdrawer', 'root', 'HwU', 'LHE' or 'none'.
# When choosing HwU, it comes with a GnuPlot wrapper. When choosing
# topdrawer, the histogramming package 'dbook.f' is included in the
# code, while when choosing root the 'rbook_fe8.f' and 'rbook_be8.cc'
# are included. If 'none' is chosen, all the other entries below have
# to be set empty.
FO_ANALYSIS_FORMAT = HwU
#
#
# Needed extra-libraries (FastJet is already linked):
FO_EXTRALIBS = 
#
# (Absolute) path to the extra libraries. Directory names should be
# separated by white spaces.
FO_EXTRAPATHS =
#
# (Absolute) path to the dirs containing header files needed by the
# libraries (e.g. C++ header files):
FO_INCLUDEPATHS =                      
#
# User's analysis (to be put in the <PROCDIR>/FixedOrderAnalysis/
# directory). Please use .o as extension and white spaces to separate
# files.
FO_ANALYSE = LHCB_WP_7TEV.o
#
#
## When linking with root, the following settings are a working
## example on lxplus (CERN) as of July 2014. When using this, comment
## out the lines above and replace <PATH_TO_ROOT> with the physical
## path to root,
## e.g. /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.11/x86_64-slc6-gcc46-dbg/root/
#FO_ANALYSIS_FORMAT = root
#FO_EXTRALIBS = Core Cint Hist Matrix MathCore RIO dl Thread
#FO_EXTRAPATHS = <PATH_TO_ROOT>/lib
#FO_INCLUDEPATHS = <PATH_TO_ROOT>/include
#FO_ANALYSE = analysis_root_template.o
]]>
</foanalyse>
</header>
</LesHouchesEvents>

runcard_gitversion: 82de4ad
x1_label: etal
x1_label_tex: $\eta_{\bar{\ell}}$
x1_unit: 
y_label: dsig/detal
y_label_tex: $\frac{\mathrm{d}\sigma}{\mathrm{d}\eta_{\bar{\ell}}}$
y_unit: pb
"#;

const WRONG_ARGUMENTS_STR: &str = "error: the argument '--ew' cannot be used with '--qcd'

Usage: pineappl read <--bins|--channels|--ew|--fk-table|--fk-table-fac0|--fk-table-frg0|--get <KEY>|--keys|--orders|--orders-long|--orders-spaces|--qcd|--show> <INPUT>

For more information, try '--help'.
";

#[test]
fn help() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args(["read", "--help"])
        .assert()
        .success()
        .stdout(HELP_STR);
}

#[test]
fn bins() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--bins",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .success()
        .stdout(BINS_STR);
}

#[test]
fn channels() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--channels",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .success()
        .stdout(CHANNELS_STR);
}

#[test]
fn orders() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--orders",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .success()
        .stdout(ORDERS_STR);
}

#[test]
fn orders_long() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--orders-long",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .success()
        .stdout(ORDERS_LONG_STR);
}

#[test]
fn orders_spaces() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--orders-spaces",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .success()
        .stdout(ORDERS_SPACES_STR);
}

#[test]
fn fk_table() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--fk-table",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .failure()
        .stdout(FKTABLE_STR);
}

#[test]
fn wrong_orders() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--orders",
            "--orders-long",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .failure()
        .stderr(WRONG_ORDERS_STR);
}

#[test]
fn ew() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args(["read", "--ew", "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4"])
        .assert()
        .success()
        .stdout("a2,a3\n");
}

#[test]
fn get_arxiv() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--get=arxiv",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .success()
        .stdout("1505.07024\n");
}

#[test]
fn keys() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--keys",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .success()
        .stdout(KEYS_STR);
}

#[test]
fn qcd() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--qcd",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .success()
        .stdout("a2,as1a2\n");
}

#[test]
fn show() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--show",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .success()
        .stdout(SHOW_STR);
}

#[test]
fn wrong_arguments() {
    Command::cargo_bin("pineappl")
        .unwrap()
        .args([
            "read",
            "--ew",
            "--qcd",
            "../test-data/LHCB_WP_7TEV_opt.pineappl.lz4",
        ])
        .assert()
        .failure()
        .stderr(WRONG_ARGUMENTS_STR);
}