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): 
   print("Deleting old run_card.dat")
   os.remove('run_card.dat')
if run_card == "": run_card = MadGraphUtils.get_default_runcard(proc_dir=process_dir)
if MadGraphUtils.build_run_card(run_card_old=run_card,run_card_new='run_card.dat',nevts=nevents,rand_seed=runArgs.randomSeed,beamEnergy=beamEnergy,extras=run_card_extras)==-1:
   raise RuntimeError("Could not create run_card.dat")


#ready to generate
MadGraphUtils.generate(run_card_loc='run_card.dat',param_card_loc='param_card.dat',mode=0,njobs=1,run_name='Test',proc_dir=process_dir)

stringy = 'madgraph.'+str(runArgs.runNumber)+'.MadGraph_'+str(proc_name)

if "post_lhe_hook" in dir():
   print("Calling post_lhe_hook....")
   post_lhe_hook()

MadGraphUtils.arrange_output(run_name='Test',proc_dir=process_dir,outputDS=stringy+'._00001.events.tar.gz')
Esempio n. 2
0
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')
Esempio n. 3
0
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):
    print("Deleting old run_card.dat")
    os.remove('run_card.dat')
if run_card == "":
    run_card = MadGraphUtils.get_default_runcard(proc_dir=process_dir)
if MadGraphUtils.build_run_card(run_card_old=run_card,
                                run_card_new='run_card.dat',
                                nevts=nevents,
                                rand_seed=runArgs.randomSeed,
                                beamEnergy=beamEnergy,
                                extras=run_card_extras) == -1:
    raise RuntimeError("Could not create run_card.dat")

#ready to generate
MadGraphUtils.generate(run_card_loc='run_card.dat',
                       param_card_loc='param_card.dat',
                       mode=0,
                       njobs=1,
                       run_name='Test',
                       proc_dir=process_dir)
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')
output -f
"""
)
fcard.close()

beamEnergy = -999
if hasattr(runArgs, "ecmEnergy"):
    beamEnergy = runArgs.ecmEnergy / 2.0
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: