[docs]defupdate(theory,observables):""" Upgrade the legacy theory and observable runcards with the new settings. Parameters ---------- theory : dict theory runcard observables : dict observable runcard Returns ------- new_theory : dict upgraded theory runcard new_obs : dict upgraded observable runcard """new_theory=theory.copy()new_obs=observables.copy()update_fns(new_theory)update_scale_variations(new_theory)update_target(new_obs)if"alphaqed"innew_theory:new_theory["alphaem"]=new_theory.pop("alphaqed")# TODO: update Yadism syntax and remove PTO everywhere?if"QED"innew_theory:new_theory["order"]=(new_theory["PTO"]+1,new_theory.pop("QED"))returnnew_theory,new_obs
[docs]defupdate_scale_variations(theory):""" Extract necessity to compute scale variations. Parameters ---------- theory : dict theory runcard """if"RenScaleVar"notintheory:theory["RenScaleVar"]=Trueif"FactScaleVar"notintheory:theory["FactScaleVar"]=True
[docs]defupdate_target(obs):""" Map TargetDIS string to a (Z,A) dict. Parameters ---------- obs : dict observable runcard """target=obs["TargetDIS"]ifnotisinstance(target,str):returniftarget=="proton":obs["TargetDIS"]={"Z":1.0,"A":1.0}# proton = 2212obs["TargetDISid"]="2212"eliftarget=="neutron":obs["TargetDIS"]={"Z":0.0,"A":1.0}# neutron = 2112obs["TargetDISid"]="2112"eliftarget=="isoscalar":obs["TargetDIS"]={"Z":1.0,"A":2.0}# deuteron = 10 0 001 002 0obs["TargetDISid"]="1000010020"eliftarget=="iron":obs["TargetDIS"]={"Z":23.403,"A":49.618,}# This target corresponds to NuTeV and has been determined through a# survey of the steel. See page 323 of the PhD thesis of David# Alexander Mason: https://inspirehep.net/files/15b639af43688d59f1ba65ec9cde7ec7# iron = 10 0 026 056 0obs["TargetDISid"]="1000260560"eliftarget=="lead":obs["TargetDIS"]={"Z":82.0,"A":208.0}# from hep-ex/0102049# lead = 10 0 082 208 0obs["TargetDISid"]="1000822080"eliftarget=="neon":obs["TargetDIS"]={"Z":10.0,"A":20.0}obs["TargetDISid"]="1000100200"eliftarget=="marble":A=(40+3*16+12)/5# A(CaCO3): average atomic massZ=(20+3*8+6)/5# Z(CaCO3): avaerage atomic numberobs["TargetDIS"]={"Z":Z,"A":A}obs["TargetDISid"]=f"1000{str(Z)}{str(A)}0"else:raiseValueError(f"Unknown TargetDIS '{target}'")
[docs]defupdate_fns(theory):""" Sets k{fl}Thr and ZM{fl} for all heavy flavours depending on the scheme. Parameters ---------- theory : dict theory runcard """fns=theory["FNS"]nf=theory["NfFF"]iffns=="ZM-VFNS":forflinhqfl:theory[f"ZM{fl}"]=Trueeliffns=="FONLL-FFNS"orfns=="FONLL-FFN0":# enforce correct settings moving all thresholds to 0 or oofork,flinenumerate(hqfl):ifk+4<=nf:theory[f"k{fl}Thr"]=0.0theory[f"ZM{fl}"]=Trueelifk+4>nf+1:theory[f"k{fl}Thr"]=np.inftheory[f"ZM{fl}"]=Trueelse:# We only consider a single massive contribution. This is to# prevent double counting when different FNS are combined# to produce FONLLtheory[f"k{fl}Thr"]=np.inftheory[f"ZM{fl}"]=Falseeliffns=="FFNS"orfns=="FFN0":# enforce correct settings moving all thresholds to 0 or oofork,flinenumerate(hqfl):ifk+4<=nf:theory[f"k{fl}Thr"]=0.0theory[f"ZM{fl}"]=Trueelse:# for these flavours the massive contribution is calculated,# but they do not contribute to the number of running flavorstheory[f"k{fl}Thr"]=np.inftheory[f"ZM{fl}"]=Falseelse:raiseValueError(f"Scheme '{fns}' not recognized.")if"PTODIS"notintheoryortheory["PTODIS"]isNone:theory["PTODIS"]=theory["PTO"]if"FONLLParts"notintheoryortheory["FONLLParts"]isNone:theory["FONLLParts"]="full"