Skip to content

Commit

Permalink
Merge pull request #3764 from cms-sw/pdfchecks
Browse files Browse the repository at this point in the history
improving pdf checks
  • Loading branch information
efeyazgan authored Sep 20, 2024
2 parents c5d329d + c06cefe commit cc0dc94
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions bin/utils/request_fragment_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit cc0dc94

Please sign in to comment.