~maddevelopers/mg5amcnlo/2.7.3-lepcoll

« back to all changes in this revision

Viewing changes to madgraph/various/histograms.py

  • Committer: olivier-mattelaer
  • Date: 2021-04-15 15:17:31 UTC
  • mfrom: (78.75.499 3.0)
  • Revision ID: olivier-mattelaer-20210415151731-oq9o5fen2y141m5o
merge with 3.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/env python
 
1
#! /usr/bin/env python2
2
2
################################################################################
3
3
#
4
4
# Copyright (c) 2010 The MadGraph5_aMC@NLO Development team and Contributors
1435
1435
                         wgts[0] in range(91200, 91303) or \
1436
1436
                         wgts[0] in range(91400, 91433) or \
1437
1437
                         wgts[0] in range(91700, 91801) or \
1438
 
                         wgts[0] in range(91900, 91931):
 
1438
                         wgts[0] in range(91900, 90931) or \
 
1439
                         wgts[0] in range(92000, 92031):
1439
1440
                        # PDF4LHC15 Hessian sets
1440
1441
                        pdf_stdev = 0.0
1441
1442
                        for pdf in pdfs[1:]:
1443
1444
                        pdf_stdev = math.sqrt(pdf_stdev)
1444
1445
                        pdf_up   = cntrl_val+pdf_stdev
1445
1446
                        pdf_down = cntrl_val-pdf_stdev
 
1447
                    elif wgts[0] in range(244400, 244501) or \
 
1448
                         wgts[0] in range(244600, 244701) or \
 
1449
                         wgts[0] in range(244800, 244901) or \
 
1450
                         wgts[0] in range(245000, 245101) or \
 
1451
                         wgts[0] in range(245200, 245301) or \
 
1452
                         wgts[0] in range(245400, 245501) or \
 
1453
                         wgts[0] in range(245600, 245701) or \
 
1454
                         wgts[0] in range(245800, 245901) or \
 
1455
                         wgts[0] in range(246000, 246101) or \
 
1456
                         wgts[0] in range(246200, 246301) or \
 
1457
                         wgts[0] in range(246400, 246501) or \
 
1458
                         wgts[0] in range(246600, 246701) or \
 
1459
                         wgts[0] in range(246800, 246901) or \
 
1460
                         wgts[0] in range(247000, 247101) or \
 
1461
                         wgts[0] in range(247200, 247301) or \
 
1462
                         wgts[0] in range(247400, 247501): 
 
1463
                        # use Gaussian (68%CL) method (NNPDF)
 
1464
                        pdf_stdev = 0.0
 
1465
                        pdf_diff = sorted([abs(pdf-cntrl_val) for pdf in pdfs[1:]])
 
1466
                        pdf_stdev = pdf_diff[67]
 
1467
                        pdf_up   = cntrl_val+pdf_stdev
 
1468
                        pdf_down = cntrl_val-pdf_stdev
1446
1469
                    else:
1447
 
                        # use Gaussian method (NNPDF)
 
1470
                        # use Gaussian (one sigma) method (NNPDF)
1448
1471
                        pdf_stdev = 0.0
1449
1472
                        for pdf in pdfs[1:]:
1450
1473
                            pdf_stdev += (pdf - cntrl_val)**2
2382
2405
        else:
2383
2406
            output, _ = p.communicate()
2384
2407
            output.decode()
2385
 
            if not output:
2386
 
                gnuplot_output_list=gnuplot_output_list_v5
2387
 
            elif float(output.split()[1]) < 5. :
 
2408
            try:
 
2409
                version = float(output.split()[1])
 
2410
            except:
 
2411
                version = 5
 
2412
            if version < 5. :
2388
2413
                gnuplot_output_list=gnuplot_output_list_v4
2389
2414
            else:
2390
2415
                gnuplot_output_list=gnuplot_output_list_v5