def MergeOutputs(primarydataset, inputlist):
    inputfiles = [fpath for ver, fpath in inputlist.iteritems()]
    movecommand = 'mv {oldfolder}/%s {newfolder}/%s.root'.format(
        oldfolder=workingpath, newfolder=destinypath)
    haddcommand = 'hadd -f {newfolder}/%s.root %s'.format(
        newfolder=destinypath)
    print haddcommand % (primarydataset, ' '.join(
        [workingpath + '/' + nodir(fpath) for fpath in inputfiles]))
    if len(inputfiles) == 1:
        os.system(movecommand % (nodir(inputfiles[0]), primarydataset))
    elif len(inputfiles) > 1:
        os.system(haddcommand % (primarydataset, ' '.join(
            [workingpath + '/' + nodir(fpath) for fpath in inputfiles])))
    else:
        mylog.warning('nothing found in category %s' % primarydataset)
def executeCommandToTmp(xsweight_, integratedGenWeight_, inputfile_):
    execfile = './exe.AppendEventInfo'
    execcommand = '%s {xs:.10e} {integratedGenWeight:.2e} {integratedLuminosity:.3e} {inputfile} %s/{outputfile} ' % (
        execfile, workingpath)
    #execcommand='{exefile %.10f %f %s {outfolder}/%s'.format(exefile=execfile, outfolder=oldfolder)
    #os.system( '%s %.10f %f %s tmp/%s' %( xsweight_, integratedGenWeight_, inputfile_, nodir(inputfile_) ) )
    print inputfile_
    print nodir(inputfile_)
    print type(xsweight_)
    print type(integratedGenWeight_)
    print type(datalumi[2018])
    print type(inputfile_)
    print type(nodir(inputfile_))
    execcommand.format(xs=xsweight_,
                       integratedGenWeight=integratedGenWeight_,
                       integratedLuminosity=datalumi[2018],
                       inputfile=inputfile_,
                       outputfile=nodir(inputfile_))
    os.system(
        execcommand.format(xs=xsweight_,
                           integratedGenWeight=integratedGenWeight_,
                           integratedLuminosity=datalumi[2018],
                           inputfile=inputfile_,
                           outputfile=nodir(inputfile_)))
예제 #3
0
def executeCommand( inputfile_ ):
    execfile='./exe.AppendBTagCalibration'
    command='%s {ifile} %s/{newfile}' %(execfile,newfolder)
    os.system( command.format( ifile=inputfile_, newfile=nodir(inputfile_) ) )