From 0c0231149fe50d3d58ec1a3407bfdd2bb638951b Mon Sep 17 00:00:00 2001 From: Andre Govinda Stahl Leiton Date: Mon, 18 Dec 2023 05:01:52 +0100 Subject: [PATCH] Add nuclear PDF variations for Powheg and MadGraph5 --- .../PbPb_5p36TeV/pdflist_5f_run3.dat | 52 ++++++++++++ bin/Powheg/Templates/runGetSource_template.sh | 3 +- bin/Powheg/make_rwl.py | 79 ++++++++++++++++++- bin/Powheg/run_pwg_condor.py | 20 ++++- 4 files changed, 146 insertions(+), 8 deletions(-) create mode 100644 bin/MadGraph5_aMCatNLO/cards/production/PbPb_5p36TeV/pdflist_5f_run3.dat diff --git a/bin/MadGraph5_aMCatNLO/cards/production/PbPb_5p36TeV/pdflist_5f_run3.dat b/bin/MadGraph5_aMCatNLO/cards/production/PbPb_5p36TeV/pdflist_5f_run3.dat new file mode 100644 index 000000000000..069a277b7867 --- /dev/null +++ b/bin/MadGraph5_aMCatNLO/cards/production/PbPb_5p36TeV/pdflist_5f_run3.dat @@ -0,0 +1,52 @@ +904400 EPPS21nlo_CT18Anlo_Pb208 107 +325300 NNPDF31_nnlo_as_0118_mc_hessian_pdfas 103 +316200 NNPDF31_nnlo_as_0118_mc 101 +306000 NNPDF31_nnlo_hessian_pdfas 1 +322500 NNPDF31_nnlo_as_0108 1 +322700 NNPDF31_nnlo_as_0110 1 +322900 NNPDF31_nnlo_as_0112 1 +323100 NNPDF31_nnlo_as_0114 1 +323300 NNPDF31_nnlo_as_0117 1 +323500 NNPDF31_nnlo_as_0119 1 +323700 NNPDF31_nnlo_as_0122 1 +323900 NNPDF31_nnlo_as_0124 1 +305800 NNPDF31_nlo_hessian_pdfas 103 +303200 NNPDF30_nnlo_as_0118_hessian 1 +292200 NNPDF30_nlo_nf_5_pdfas 1 +331300 NNPDF40_nnlo_pdfas 103 +331600 NNPDF40_nnlo_hessian_pdfas 53 +332100 NNPDF40_nnlo_pch_as_01180 101 +332300 NNPDF40_nlo_pch_as_01180 1 +332500 NNPDF40_lo_pch_as_01180 1 +332700 NNPDF40_nnlo_as_01160 1 +332900 NNPDF40_nnlo_as_01170 1 +333100 NNPDF40_nnlo_as_01175 1 +333300 NNPDF40_nnlo_as_01185 1 +333500 NNPDF40_nnlo_as_01190 1 +333700 NNPDF40_nnlo_as_01200 1 +14000 CT18NNLO 59 +14066 CT18NNLO_as_0116 1 +14067 CT18NNLO_as_0117 1 +14069 CT18NNLO_as_0119 1 +14070 CT18NNLO_as_0120 1 +14100 CT18ZNNLO 59 +14200 CT18ANNLO 1 +14300 CT18XNNLO 1 +27400 MSHT20nnlo_as118 65 +27500 MSHT20nnlo_as_smallrange 1 +27550 MSHT20nnlo_as_largerange 1 +93300 PDF4LHC21_40_pdfas 43 +61200 HERAPDF20_NNLO_EIG 29 +42780 ABMP16als118_5_nnlo 30 +315000 NNPDF31_lo_as_0118 1 +315200 NNPDF31_lo_as_0130 1 +262000 NNPDF30_lo_as_0118 1 +263000 NNPDF30_lo_as_0130 1 +14600 CT18ANLO 59 +14666 CT18ANLO_as_0116 1 +14667 CT18ANLO_as_0117 1 +14669 CT18ANLO_as_0119 1 +14670 CT18ANLO_as_0120 1 +3211600 TUJU21_nlo_208_82 59 +3216600 TUJU21_nnlo_208_82 59 +30025400 nNNPDF30_nlo_as_0118_A208_Z82 201 diff --git a/bin/Powheg/Templates/runGetSource_template.sh b/bin/Powheg/Templates/runGetSource_template.sh index 5a9cddf5c984..f10416915e10 100644 --- a/bin/Powheg/Templates/runGetSource_template.sh +++ b/bin/Powheg/Templates/runGetSource_template.sh @@ -34,6 +34,7 @@ fi is5FlavorScheme=$isFiveFlavor defaultPDF=$defaultPDF +period=$period if [[ $$is5FlavorScheme -eq 1 ]]; then echo "INFO: The process $$process uses the 5F PDF scheme" @@ -48,7 +49,7 @@ grep -q "MGcosa" powheg.input; test $$? -eq 1 || forX0jj=1 cd $$WORKDIR cd $${name} -python ../make_rwl.py $${is5FlavorScheme} $${defaultPDF} $${forMiNNLO} $${forX0jj} +python ../make_rwl.py $${is5FlavorScheme} $${defaultPDF} $${forMiNNLO} $${forX0jj} $${period} if [ -s ../JHUGen.input ]; then cp -p ../JHUGen.input JHUGen.input diff --git a/bin/Powheg/make_rwl.py b/bin/Powheg/make_rwl.py index a912454acd0b..f58e28d6dfb0 100644 --- a/bin/Powheg/make_rwl.py +++ b/bin/Powheg/make_rwl.py @@ -19,11 +19,9 @@ is5FlavorScheme = str(sys.argv[1]) CentralPDF = str(sys.argv[2]) # ToDo: clean forMiNNLO,forX0jj up and define specific set of PDF which is called per process or via external argument (e.g. Run2UL) -# switch for time being to "Run2UL if you need UL style PDF set -Period="Run3" # "Run2UL" forMiNNLO = bool(int(sys.argv[3])) if len(sys.argv) > 3 else False forX0jj = bool(int(sys.argv[4])) if len(sys.argv) > 4 else False -process = str(sys.argv[5]) if len(sys.argv) > 5 else '' +Period = str(sys.argv[5]) if len(sys.argv) > 5 else "Run3" if forMiNNLO: @@ -305,6 +303,81 @@ [3200, 292400, 'NNPDF30_nnlo_nf_4_pdfas' ,1], ], } +### sets for Run3 Heavy Ions +elif Period == "Run3_Pb": + if int(is5FlavorScheme) == 1: + print("Going to use Run 3 5FS Pb nuclear PDFs") + # 5F (n)PDF + pdf_sets = { + # weight id, LHAPDF id, name, replicas to be written + "PDF_variation1 , hessian" : + [ + # Proton PDFs + [2000, 325300, 'NNPDF31_nnlo_as_0118_mc_hessian_pdfas', 103], + [2200, 306000, 'NNPDF31_nnlo_hessian_pdfas', 1], + [2201, 322500, 'NNPDF31_nnlo_as_0108', 1], + [2202, 322700, 'NNPDF31_nnlo_as_0110', 1], + [2203, 322900, 'NNPDF31_nnlo_as_0112', 1], + [2204, 323100, 'NNPDF31_nnlo_as_0114', 1], + [2205, 323300, 'NNPDF31_nnlo_as_0117', 1], + [2206, 323500, 'NNPDF31_nnlo_as_0119', 1], + [2207, 323700, 'NNPDF31_nnlo_as_0122', 1], + [2208, 323900, 'NNPDF31_nnlo_as_0124', 1], + [2300, 305800, 'NNPDF31_nlo_hessian_pdfas', 103], + [2500, 303200, 'NNPDF30_nnlo_as_0118_hessian', 1], + [2501, 292200, 'NNPDF30_nlo_nf_5_pdfas', 1], + [2600, 331600, 'NNPDF40_nnlo_hessian_pdfas', 53], + [2700, 332700, 'NNPDF40_nnlo_as_01160', 1], + [2701, 332900, 'NNPDF40_nnlo_as_01170', 1], + [2702, 333100, 'NNPDF40_nnlo_as_01175', 1], + [2703, 333300, 'NNPDF40_nnlo_as_01185', 1], + [2704, 333500, 'NNPDF40_nnlo_as_01190', 1], + [2705, 333700, 'NNPDF40_nnlo_as_01200', 1], + [2800, 332300, 'NNPDF40_nlo_pch_as_01180', 1], + [4000, 14000, 'CT18NNLO', 59], + [4100, 14066, 'CT18NNLO_as_0116', 1], + [4101, 14067, 'CT18NNLO_as_0117', 1], + [4102, 14069, 'CT18NNLO_as_0119', 1], + [4103, 14070, 'CT18NNLO_as_0120', 1], + [4200, 14100, 'CT18ZNNLO', 59], + [4300, 14200, 'CT18ANNLO', 1], + [4301, 14300, 'CT18XNNLO', 1], + [5000, 27400, 'MSHT20nnlo_as118', 65], + [5100, 27500, 'MSHT20nnlo_as_smallrange', 1], + [5101, 27550, 'MSHT20nnlo_as_largerange', 1], + [6000, 93300, 'PDF4LHC21_40_pdfas', 43], + [7000, 61200, 'HERAPDF20_NNLO_EIG', 29], + [8000, 42780, 'ABMP16als118_5_nnlo', 30], + # Reference proton PDF of EPPS21nlo nuclear PDF + [4400, 14600, 'CT18ANLO', 59], + [4500, 14666, 'CT18ANLO_as_0116', 1], + [4501, 14667, 'CT18ANLO_as_0117', 1], + [4502, 14669, 'CT18ANLO_as_0119', 1], + [4503, 14670, 'CT18ANLO_as_0120', 1], + # Pb208 nuclear PDFs + [9000, 904400, 'EPPS21nlo_CT18Anlo_Pb208', 107], + [9200, 3211600, 'TUJU21_nlo_208_82', 59], + [9300, 3216600, 'TUJU21_nnlo_208_82', 59], + ], + "PDF_variation2 , replica" : + [ + # Proton PDFs + [3000, 316200, 'NNPDF31_nnlo_as_0118_mc', 101], + [3200, 331300, 'NNPDF40_nnlo_pdfas', 103], + [3400, 332100, 'NNPDF40_nnlo_pch_as_01180', 101], + # Pb208 nuclear PDFs + [9400, 30025400, 'nNNPDF30_nlo_as_0118_A208_Z82', 201], + ], + # Require latest LHAPDF nCTEQ15 PDF sets + #"PDF_variation3 , symmhessian" : + #[ + # Pb208 nuclear PDFs + #[9700, 117150, 'nCTEQ15WZSIH_208_82', 39], + #[9800, 119150, 'nCTEQ15WZSIH_FullNuc_208_82', 39], + #], + } + else: + raise Exception("ERROR[make_rwl.py]: There are no 4FS nuclear PDFs!") # no idea what to do else: print("Unclear which PDF to use. Please check make_rwl.py") diff --git a/bin/Powheg/run_pwg_condor.py b/bin/Powheg/run_pwg_condor.py index 83a14a7f8b55..4071c1f4dab0 100755 --- a/bin/Powheg/run_pwg_condor.py +++ b/bin/Powheg/run_pwg_condor.py @@ -272,7 +272,7 @@ def runSingleXgrid(parstage, xgrid, folderName, nEvents, powInputName, seed, pro # ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -def runGetSource(parstage, xgrid, folderName, powInputName, process, noPdfCheck, tagName, svnRev) : +def runGetSource(parstage, xgrid, folderName, powInputName, process, noPdfCheck, tagName, svnRev, ion) : # parstage, xgrid are strings! print 'Getting and compiling POWHEG source...' @@ -302,6 +302,11 @@ def runGetSource(parstage, xgrid, folderName, powInputName, process, noPdfCheck, fourFlavorProcesses = ["ST_tch_4f", "bbH", "Wbb_dec", "Wbbj", "WWJ", "ZZJ", "Zgam", "ZgamJ", "VV_dec_ew"] template_dict["isFiveFlavor"] = int(process not in fourFlavorProcesses) template_dict["defaultPDF"] = 325300 if template_dict["isFiveFlavor"] else 325500 + # switch for time being to "Run2UL if you need UL style PDF set + template_dict["period"] = "Run3" # "Run2UL" + if ion == "Pb": + template_dict["defaultPDF"] = 904400 + template_dict["period"] = "Run3_Pb" powhegResProcesses = ["b_bbar_4l", "HWJ_ew", "HW_ew", "HZJ_ew", "HZ_ew", "vbs-ssww-nloew", "WWJ", "ZZJ", "HJJ_ew", "LQ-s-chan", "gg4l", "Zgam", "ZgamJ", "VV_dec_ew"] if process in powhegResProcesses: @@ -474,6 +479,7 @@ def runhnnlo(folderName, njobs, QUEUE): parser.add_argument('--fordag' , dest="fordag", default= 0, help='If 1, deactivate submission, expect condor DAG file to be created [0]') parser.add_argument('--slc6' , dest="slc6", default= 0, help='If 1, use slc6 singularity [0]') parser.add_argument('--svn' , dest="svnRev", default= 0, help='SVN revision. If 0, use tarball [0]') + parser.add_argument('--ion' , dest="ion", default= '', help='Ion type. Options: Pb []') args = parser.parse_args () @@ -481,6 +487,8 @@ def runhnnlo(folderName, njobs, QUEUE): if args.parstage != '0' and '/' in args.prcName: raise RuntimeError(message2) + elif args.ion and args.ion not in ['Pb']: + raise RuntimeError("ERROR[run_pwg_condor.py]: Invalid ion type: "+args.ion) QUEUE = args.doQueue EOSfolder = args.folderName @@ -609,6 +617,8 @@ def runhnnlo(folderName, njobs, QUEUE): if args.prcName=="ST_tch_4f" or args.prcName=="bbH" or args.prcName=="Wbb_dec" or args.prcName=="Wbbj" or args.prcName=="WWJ" or args.prcName=="ZZJ" or args.prcName=="Zgam" or args.prcName=="ZgamJ" or args.prcName=="VV_dec_ew": default_pdf = "325500" # for 4 flavours + if args.ion == "Pb": + default_pdf = "904400" # EPPS21nlo_CT18Anlo_Pb208 for line in open(args.folderName+'/powheg.input') : n_column = line.split() @@ -623,6 +633,8 @@ def runhnnlo(folderName, njobs, QUEUE): if test_pdf1 != default_pdf : # print "PDF in card: ", test_pdf1, "PDF default: ", default_pdf, test_pdf1==default_pdf message = "The input card does not have the standard Ultralegacy PDF (NNPDF31 NNLO, 325300 for 5F, 325500 for 4F): {0}. Either change the card or run again with -d 1 to ignore this message.\n".format(test_pdf1) + if args.ion == "Pb": + message = "The input card does not have the standard nuclear PDF (EPPS21nlo_CT18Anlo_Pb208, 904400): {0}. Either change the card or run again with -d 1 to ignore this message.\n".format(test_pdf1) if args.noPdfCheck == '0' : raise RuntimeError(message) @@ -638,7 +650,7 @@ def runhnnlo(folderName, njobs, QUEUE): prepareJob(tagName, '', '.',args.prcName) runGetSource(args.parstage, args.xgrid, args.folderName, - powInputName, args.prcName, args.noPdfCheck, tagName, args.svnRev) + powInputName, args.prcName, args.noPdfCheck, tagName, args.svnRev, args.ion) if QUEUE == 'none': print 'Direct compiling... \n' @@ -683,7 +695,7 @@ def runhnnlo(folderName, njobs, QUEUE): prepareJob(tagName, '', '.',args.prcName) runGetSource(args.parstage, args.xgrid, args.folderName, - powInputName, args.prcName, args.noPdfCheck, tagName, args.svnRev) + powInputName, args.prcName, args.noPdfCheck, tagName, args.svnRev, args.ion) os.system('sed -i "s/^numevts.*/numevts '+args.numEvents+'/" '+ args.folderName+'/powheg.input') @@ -706,7 +718,7 @@ def runhnnlo(folderName, njobs, QUEUE): prepareJob(tagName, '', '.',args.prcName) runGetSource(args.parstage, args.xgrid, args.folderName, - powInputName, args.prcName, args.noPdfCheck, tagName, args.svnRev) + powInputName, args.prcName, args.noPdfCheck, tagName, args.svnRev, args.ion) runSingleXgrid(args.parstage, args.xgrid, args.folderName, args.numEvents, powInputName, args.rndSeed,