From c06cefe91789e8880ff5b83c527a33d81025586c Mon Sep 17 00:00:00 2001 From: Efe Date: Fri, 20 Sep 2024 11:05:17 +0200 Subject: [PATCH] improving pdf checks --- bin/utils/request_fragment_check.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/bin/utils/request_fragment_check.py b/bin/utils/request_fragment_check.py index b3d94d8dfd1b..597835b6ad1f 100755 --- a/bin/utils/request_fragment_check.py +++ b/bin/utils/request_fragment_check.py @@ -1222,7 +1222,7 @@ def root_requests_from_ticket(ticket_prepid, include_docs=False): if jhu_pdf: jhu_pdf = jhu_pdf[0].split('=')[1].split('/')[1] print("The PDF set used by JHUGEN is:"+ str(jhu_pdf)) if "UL" in pi and jhu_pdf not in UL_PDFs: - warnings.append("The gridpack uses PDF = "+str(jhu_pdf)+" but not the recommended sets for UL requests: "+str(UL_PDFs_N[0])+" "+str(UL_PDFs[0])+" or "+str(UL_PDFs_N[1])+" "+str(UL_PDFs[1])) + warnings.append("The gridpack uses PDF = "+str(jhu_pdf)+" but not the recommended sets for UL requests: "+str(UL_PDFs_N)+" "+str(UL_PDFs)) if "Run3" in pi: pdflist_4f_run3_N,pdflist_4f_run3,pdflist_5f_run3_N,pdflist_5f_run3,pdflist_Pb_5f_run3_N,pdflist_Pb_5f_run3=run3_pdf_check(pi) if (jhu_pdf not in pdflist_4f_run3) and (jhu_pdf not in pdflist_5f_run3): @@ -1259,20 +1259,6 @@ def root_requests_from_ticket(ticket_prepid, include_docs=False): pw_processes = 'dy','ggh','glugluh','tth','hzj','hwj','ggzh' if not any(i in dn.lower() for i in pw_processes): warnings.append("Please check manually if nFinal="+str(nFinal) + " for this process is OK, i.e. equal to the number of final state particles before decays) ") -# if os.path.isfile(file_pwg_check) is True : -# print("grep from powheg pwhg_checklimits files") -# nemit = os.popen('grep emitter '+file_pwg_check+' | grep process | head -n 1').read().replace('process','').replace('\n','').split(',') -# nemitsplit = nemit[1].split() -# nemitsplit_pr = nemitsplit[2:] -# nemitsplit = [x for x in nemitsplit_pr if x!=nemitsplit[0] and x!=nemitsplit[1]] -# nemitsplit = [100 if x == "***" else x for x in nemitsplit] -# nemitsplit_wo_leptons = [int(x) for x in nemitsplit] -# nemitsplit_wo_leptons = [abs(x) for x in nemitsplit_wo_leptons] -# nemitsplit_wo_leptons = [x for x in nemitsplit_wo_leptons if x < 11 or x > 18] -# nfinstatpar = len(nemitsplit_wo_leptons)-nemitsplit_wo_leptons.count(0) -# if nfinstatpar == nFinal : print("[OK] nFinal(="+str(nFinal) + ") is equal to the number of final state particles before decays (="+str(nfinstatpar)+")") -# if nfinstatpar != nFinal : -# warnings.append("nFinal(="+str(nFinal) + ") may not be equal to the number of final state particles before decays (="+str(nfinstatpar)+")") if os.path.isfile(my_path+'/'+pi+'/'+'runcmsgrid.sh') is True: runcmsgrid_file = my_path+'/'+pi+'/'+'runcmsgrid.sh' with open(runcmsgrid_file,'r+') as f: @@ -1321,7 +1307,7 @@ def root_requests_from_ticket(ticket_prepid, include_docs=False): pw_pdf = int(re.split(r'\s+', line)[1]) print("Powheg PDF used is: "+str(pw_pdf)) if "UL" in pi and pw_pdf not in UL_PDFs_N: - warnings.append("The gridpack uses PDF="+str(pw_pdf)+" but not the recommended sets for UL requests: "+str(UL_PDFs_N[0])+" "+str(UL_PDFs[0])+" or "+str(UL_PDFs_N[1])+" "+str(UL_PDFs[1])) + warnings.append("The gridpack uses PDF="+str(pw_pdf)+" but not the recommended sets for UL requests: "+str(UL_PDFs_N)+" "+str(UL_PDFs)) if "Run3" in pi: pdflist_4f_run3_N,pdflist_4f_run3,pdflist_5f_run3_N,pdflist_5f_run3,pdflist_Pb_5f_run3_N,pdflist_Pb_5f_run3=run3_pdf_check(pi) if (pw_pdf not in pdflist_4f_run3_N) and (pw_pdf not in pdflist_5f_run3_N): @@ -1487,7 +1473,7 @@ def root_requests_from_ticket(ticket_prepid, include_docs=False): warnings.append("bwcutoff set to "+str(test_bw[0])+". Note that large bwcutoff values can cause problems in production.") print("The MG5_aMC PDF set is:"+str(mg_pdf)) if "UL" in pi and int(mg_pdf) != UL_PDFs_N[0] and int(mg_pdf) != UL_PDFs_N[1]: - warnings.append("The gridpack uses PDF="+str(mg_pdf)+" but not the recommended sets for UL requests: "+str(UL_PDFs_N[0])+" "+str(UL_PDFs[0])+" or "+str(UL_PDFs_N[1])+" "+str(UL_PDFs[1])) + warnings.append("The gridpack uses PDF="+str(mg_pdf)+" but not the recommended sets for UL requests: "+str(UL_PDFs_N)+" "+str(UL_PDFs)) if "Run3" in pi: pdflist_4f_run3_N,pdflist_4f_run3,pdflist_5f_run3_N,pdflist_5f_run3,pdflist_Pb_5f_run3_N,pdflist_Pb_5f_run3=run3_pdf_check(pi) if (str(mg_pdf) not in pdflist_4f_run3_N) and (str(mg_pdf) not in pdflist_5f_run3_N): @@ -1576,7 +1562,7 @@ def root_requests_from_ticket(ticket_prepid, include_docs=False): if mg_me_pdf_list.count(str(UL_PDFs_N[0])) > 1 or mg_me_pdf_list.count(str(UL_PDFs_N[1])) > 1: warnings.append("At least one of the default PDF sets ("+UL_PDFs_N+") appear as variation as well or listed more than once.") else: - warnings.append("pdfsets in runcmsgrid file does not contain one of the recommended sets:"+str(UL_PDFs_N[0])+"("+str(UL_PDFs[0])+") or "+str(UL_PDFs_N[1])+"("+str(UL_PDFs[1])+")") + warnings.append("pdfsets in runcmsgrid file does not contain one of the recommended sets:"+str(UL_PDFs_N)+"("+str(UL_PDFs)+")") print("Your runcmsgrid file contains these sets:") print(mg_me_pdf_list) if (mg_me_pdf_list.count(str(UL_PDFs_N[0])) > 0 and mg_me_pdf_list.count(str(UL_PDFs_N[0])+"@0") != 0) or (mg_me_pdf_list.count(str(UL_PDFs_N[1])) > 0 and mg_me_pdf_list.count(str(UL_PDFs_N[1])+"@0") != 0):