outputData.append( defaultOutputFile )
 
 job.setOutputSandbox ( outputSandbox )
 job.setInputSandbox ( inputSandbox )
 if inputSlcios:
     job.setInputData( inputSlcios )
 elif inputFile:
     job.setInputData( [ inputFile ] )
 if storeOutput == True:
     job.setOutputData ( outputData, storagePath, storageElement )
 job.setCPUTime( cpuLimit )
 job.setSystemConfig ( systemConfig )
 job.setName ( detector+"_"+process+"_"+jobTitle )
 job.setJobGroup( detector+"_"+process+"_"+jobTitle )
 if destination:
     job.setDestination( destination )
 else:
     job.setBannedSites( bannedSites )
 
 if debug:
     print ''
     print 'Jobs to submit:'
     nTotal = len(lfnlist)*nJobs/mergeSlcioFiles
     if inputFile:
         print '  Number of input files:', len(lfnlist)
         if maxFiles > 0:
             print '  Maximum input files to use:', maxFiles
             nTotal = maxFiles*nJobs/mergeSlcioFiles
         if mergeSlcioFiles > 1:
             print '  Merged input files per job:', mergeSlcioFiles
     if nJobs != 1:
        if doesFileExist(lfn):
            continue

        genericApplication = GenericApplication()
        genericApplication.setScript('AnalysePerformance')
        genericApplication.setArguments(' '.join(arguements))
        genericApplication.setDependency({'ROOT':'5.34'})

        job = UserJob()
        job.setJobGroup(JobIdentificationString)
        job.setInputSandbox(['LFN:/ilc/user/s/sgreen/AnalysePerformanceTarBall/lib.tar.gz', 'runfile.txt']) 
        job.setInputData(rootFilesToProcess)
        job.setOutputData(outputFiles,OutputPath=outputPath)

        job.setName(JobIdentificationString)
        job.setBannedSites(['LCG.IN2P3-CC.fr','LCG.IN2P3-IRES.fr','LCG.KEK.jp','OSG.PNNL.us','OSG.CIT.us','LCG.LAPP.fr'])
        job.setDestination('LCG.CERN.ch')
        job.dontPromptMe()
        #job.setCPUTime(1000)
        res = job.append(genericApplication)

        if not res['OK']:
            print res['Message']
            exit()
        print 'Submitting job. (' + str(detModel) + ', ' + str(recoVar) + ', ' + eventType + ', ' + str(energy) + ')'
        job.submit(diracInstance)
        os.system('rm *.cfg')
        os.system('rm runfile.txt')

# Tidy Up
                outputData.append(defaultOutputFile)

        job.setOutputSandbox(outputSandbox)
        job.setInputSandbox(inputSandbox)
        if inputSlcios:
            job.setInputData(inputSlcios)
        elif inputFile:
            job.setInputData([inputFile])
        if storeOutput == True:
            job.setOutputData(outputData, storagePath, storageElement)
        job.setCPUTime(cpuLimit)
        job.setSystemConfig(systemConfig)
        job.setName(detector + "_" + process + "_" + jobTitle)
        job.setJobGroup(detector + "_" + process + "_" + jobTitle)
        if destination:
            job.setDestination(destination)
        else:
            job.setBannedSites(bannedSites)

        if debug:
            print ''
            print 'Jobs to submit:'
            nTotal = len(lfnlist) * nJobs / mergeSlcioFiles
            if inputFile:
                print '  Number of input files:', len(lfnlist)
                if maxFiles > 0:
                    print '  Maximum input files to use:', maxFiles
                    nTotal = maxFiles * nJobs / mergeSlcioFiles
                if mergeSlcioFiles > 1:
                    print '  Merged input files per job:', mergeSlcioFiles
            if nJobs != 1:
    job.setInputSandbox(["LFN:/ilc/user/s/sgreen/EnergyResolutionTarBall/lib.tar.gz", "RunFile.txt"])
    job.setInputData(allRootFilesToUse)
    outputPath = (
        "/"
        + jobDescription
        + "/EnergyResolution/Detector_Model_"
        + str(detModel)
        + "/Reco_Stage_"
        + str(recoVar)
        + "/"
        + eventType
    )
    job.setOutputData(outputFiles, OutputPath=outputPath)
    job.setName(JobIdentificationString)
    job.setBannedSites(
        ["LCG.IN2P3-CC.fr", "LCG.IN2P3-IRES.fr", "LCG.KEK.jp", "OSG.PNNL.us", "OSG.CIT.us", "LCG.LAPP.fr"]
    )
    job.setDestination("LCG.CERN.ch")

    job.dontPromptMe()
    res = job.append(genericApplication)

    if not res["OK"]:
        print res["Message"]
        exit()
    job.submit(diracInstance)

    # Tidy Up
    os.system("rm *.cfg")
    os.system("rm RunFile.txt")