beamEnergy=-999 if hasattr(runArgs,'ecmEnergy'): beamEnergy = runArgs.ecmEnergy / 2. else: raise RuntimeError("No center of mass energy found") #make the proc card fcard = open('proc_card_mg5.dat','w') fcard.write(proc_card + """ output %s -f """ % proc_name) fcard.close() #does mg5 to determine all the diagrams etc ... generates the process directory corresponding to proc_name process_dir = MadGraphUtils.new_process() if proc_name != "" and process_dir != proc_name: raise RuntimeError("Unexpected process_dir %s when expected %s" % (process_dir,proc_name)) #create the param_card if os.access('param_card.dat',os.R_OK): print("Deleting old param_card.dat") os.remove('param_card.dat') if param_card == "": param_card = "%s/Cards/param_card.dat" % process_dir if( MadGraphUtils.build_param_card(param_card_old=param_card,param_card_new='param_card.dat',params=param_card_extras) == -1): raise RuntimeError("Could not create param_card.dat") #create the run card: FIXME: Should check for success if os.access('run_card.dat',os.R_OK):
beamEnergy = -999 if hasattr(runArgs,'ecmEnergy'): beamEnergy = runArgs.ecmEnergy / 2. else: raise RuntimeError("No center of mass energy found.") extras = { 'lhe_version': '2.0', 'cut_decays': 'F', 'pdlabel': "'lhapdf'", 'lhaid': 263000, 'drjj': "0.0", } MG.build_run_card(run_card_old=MG.get_default_runcard(), run_card_new='run_card.dat', nevts=runArgs.maxEvents*3, rand_seed=runArgs.randomSeed, beamEnergy=beamEnergy, xqcut=0.0, extras=extras) MG.print_cards() paramcard = subprocess.check_call(['get_files','-data', 'MadGraph_param_card_dmT_WZhad.dat']) if not os.access('MadGraph_param_card_dmT_WZhad.dat', os.R_OK): print 'ERROR: Could not get param card' elif os.access('param_card.dat', os.R_OK): print ('ERROR: Old param card in the current directory. Dont wan\'t to' 'clobber it. Please move it first.') else: oldcard = open('MadGraph_param_card_dmT_WZhad.dat', 'r') newcard = open('param_card.dat', 'w') for line in oldcard: if '# MEtaD' in line:
beamEnergy = -999 if hasattr(runArgs,'ecmEnergy'): beamEnergy = runArgs.ecmEnergy / 2. else: raise RuntimeError("No center of mass energy found.") extras = { 'lhe_version': '2.0', 'cut_decays': 'F', 'pdlabel': "'lhapdf'", 'lhaid': 263000, 'drjj': "0.0", } MG.build_run_card(run_card_old=MG.get_default_runcard(), run_card_new='run_card.dat', nevts=runArgs.maxEvents*3, rand_seed=runArgs.randomSeed, beamEnergy=beamEnergy, xqcut=0.0, extras=extras) MG.print_cards() paramcard = subprocess.check_call(['get_files','-data', 'MadGraph_param_card_dmV_WZhad.dat']) if not os.access('MadGraph_param_card_dmV_WZhad.dat', os.R_OK): print 'ERROR: Could not get param card' elif os.access('param_card.dat', os.R_OK): print ('ERROR: Old param card in the current directory. Dont wan\'t to' 'clobber it. Please move it first.') else: oldcard = open('MadGraph_param_card_dmV_WZhad.dat', 'r') newcard = open('param_card.dat', 'w') for line in oldcard: if 'gxichi' in line:
beamEnergy = -999 if hasattr(runArgs, 'ecmEnergy'): beamEnergy = runArgs.ecmEnergy / 2. else: raise RuntimeError("No center of mass energy found") #make the proc card fcard = open('proc_card_mg5.dat', 'w') fcard.write(proc_card + """ output %s -f """ % proc_name) fcard.close() #does mg5 to determine all the diagrams etc ... generates the process directory corresponding to proc_name process_dir = MadGraphUtils.new_process() if proc_name != "" and process_dir != proc_name: raise RuntimeError("Unexpected process_dir %s when expected %s" % (process_dir, proc_name)) #create the param_card if os.access('param_card.dat', os.R_OK): print("Deleting old param_card.dat") os.remove('param_card.dat') if param_card == "": param_card = "%s/Cards/param_card.dat" % process_dir if (MadGraphUtils.build_param_card(param_card_old=param_card, param_card_new='param_card.dat', params=param_card_extras) == -1): raise RuntimeError("Could not create param_card.dat")