def download(inputdataset,downloaddir,listfilename):
  log.info("downloading datasets")
  with subprocess_in_env(envscript = rsrc('downloadenv.sh')) as check_call:
    check_call('dq2-get -H {} {}'.format(downloaddir ,inputdataset))
  
  with open(listfilename,'w') as listfile:
    for file in os.listdir(downloaddir):
      listfile.write('{}/{}\n'.format(os.path.abspath(downloaddir),file))
def extractFitResults(fitarchive,postfitworkdir,modelname,outputyaml):
  log.info("extract and format fit results")
  with subprocess_in_env(envscript = rsrc('fitenv.sh')) as check_call:
    check_call('{script} {fitarchive} {workdir} {model} {output}'.format(
      script = './post_fit.sh',
      fitarchive = fitarchive,
      workdir = postfitworkdir,
      model = modelname,
      output = outputyaml
      )
    )
def runFit(fitworkdir,fitinputroot,fitoutputgz,fitcodearchive):
  log.info("run histfitter")
  with subprocess_in_env(envscript = rsrc('fitenv.sh')) as check_call:
    check_call('{script} {workdir} {input} {output} {code}'.format(
      script = './run_fit_recast.sh',
      workdir = fitworkdir,
      input = fitinputroot,
      output =  fitoutputgz,
      code = fitcodearchive
      )
    )
def prepareAndYields(model,efficiencyFile,xsectionFile,inputroot,outputroot,outputyield,outputlog):
  log.info("prepare for histfitter and produce yields")
  with subprocess_in_env(envscript = rsrc('prepareenv.sh'), outlog = outputlog, errlog = outputlog) as check_call:
    check_call('python preparehistfit.py {inputroot} {inputeff} {xsecfile} {modelName} {outputroot} {outputyield}'.format(
        inputroot   = inputroot,
        inputeff    = efficiencyFile,
        xsecfile    = xsectionFile,
        modelName   = model,
        outputroot  = outputroot,
        outputyield = outputyield)
    )
def createminiroot(inputlist,outminifile,outputlog):
  log.info("creating mini ntuple")
  with subprocess_in_env(envscript = rsrc('minienv.sh'), outlog = outputlog, errlog = outputlog+'.err') as check_call:
    check_call('./DileptonAnalysis -m {} -mc -truth -maxsyst 1 -unblind -nomllalpgenfilter -f {}'.format(outminifile,inputlist,outputlog))
Beispiel #6
0
def third_task(workdir,argument):
  log.info("executing third task with argument {}".format(argument))
  with subprocess_in_env() as check_call:
    check_call('echo {} > {}/third.txt'.format(argument,workdir))
Beispiel #7
0
def second_task(workdir,argument,suffix):
  log.info("executing second task with argument {}".format(argument))
  with subprocess_in_env() as check_call:
    check_call('echo {} > {}/second-{}.txt'.format(argument,workdir,suffix))
Beispiel #8
0
def first_task(workdir,argument):
  log.info("executing first task with argument {}".format(argument))
  with subprocess_in_env() as check_call:
    # check_call('echo {} {}'.format(argument,workdir))
    check_call('echo {} > {}/first.txt'.format(argument,workdir))