arguements = [
                   str(recoVar),
                   'RunFile.txt',
                   'EnergyResolution_PandoraSettings' + pandoraSettings + '_DetectorModel_' + str(detModel) + '_Reco_Stage_' + str(recoVar) + '_' + eventType + '.root'
                 ]
    outputFiles = arguements[2:]

    genericApplication = GenericApplication()
    genericApplication.setScript('SingleParticleResolution.exe')
    genericApplication.setArguments(' '.join(arguements))
    genericApplication.setDependency({'Marlin':'ILCSoft-01-17-07'})

    job = UserJob()
    job.setJobGroup(JobIdentificationString)
    job.setInputSandbox(['LFN:/ilc/user/s/sgreen/EnergyResolutionTarBall/lib.tar.gz', 'RunFile.txt']) 
    job.setInputData(allRootFilesToUse)
    job.setOutputData(outputFiles,OutputPath='/OptimisationStudies/EnergyResolution/Detector_Model_' + str(detModel) + '/Reco_Stage_' + str(recoVar) + '/' + eventType)
    job.setName(JobIdentificationString)
    job.setBannedSites(['LCG.IN2P3-CC.fr','LCG.IN2P3-IRES.fr','LCG.KEK.jp','OSG.CIT.us'])
    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')
Exemplo n.º 2
0
from DIRAC.Core.Base import Script
Script.parseCommandLine()
from ILCDIRAC.Interfaces.API.DiracILC import DiracILC
from ILCDIRAC.Interfaces.API.NewInterface.UserJob import *
from ILCDIRAC.Interfaces.API.NewInterface.Applications import *
  
dirac = DiracILC( True , "CLICdet_repo.cfg" )
job = UserJob( )
job.setName( "example" )
job.setInputData(["/ilc/user/p/proloff/stdhep/2f_samples_23_04_2013/whizard_SM_bb_500_90deg.stdhep"])
job.setCLICConfig("ILCSoft-2017-12-21")
job.setOutputSandbox( ["*.root","*.slcio","*.log"] )


ddsim = DDSim()
ddsim.setSteeringFile("CLICPerformance/examples/clic_steer.py")
ddsim.setVersion("ILCSoft-2017-12-21_gcc62")
ddsim.setDetectorModel("CLIC_o3_v14")
ddsim.setInputFile("/ilc/user/p/proloff/stdhep/2f_samples_23_04_2013/whizard_SM_bb_500_90deg.stdhep")
ddsim.setOutputFile("ddsim_output.slcio")
ddsim.setStartFrom(0)
ddsim.setNumberOfEvents(10)
res1 = job.append(ddsim)
if not res1['OK']:
   print res1['Message']
   sys.exit(2)


# -------------------- Comment if gg_had overlay not wanted -----------------------------------------------------#
over = OverlayInput()
over.setBXOverlay(30)
     lcsimFinalize.setDetectorModel( detector + '.zip' )
     lcsimFinalize.setOutputRecFile( outputFile+'_REC.slcio' )
     lcsimFinalize.setOutputDstFile( outputFile+'_DST.slcio' )
     result = job.append( lcsimFinalize )
     if not result['OK']:
         print result['Message']
         sys.exit(2)
 elif marlinVer or slicPandoraVer:
     defaultOutputFile = outputFile + '.slcio'
     if not defaultOutputFile in outputData:
         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 ''
                mokkaSteeringTemplate = setOutputFile(mokkaSteeringTemplate, outputFile)
                mokkaSteeringTemplate = setStartNumber(mokkaSteeringTemplate, startEvent)

                with open("MokkaSteering.steer", "w") as steeringFile:
                    steeringFile.write(mokkaSteeringTemplate)

                MokkaApplication = Mokka()
                MokkaApplication.setVersion(getMokkaVersion(calibConfigFile))
                MokkaApplication.setSteeringFile("MokkaSteering.steer")
                MokkaApplication.setNumberOfEvents(eventsPerJob)
                MokkaApplication.setStartFrom(startEvent)

                job = UserJob()
                job.setJobGroup("HighEnergyPhotons")
                job.setOutputSandbox(["*.log", "*.gear", "*.mac", "*.steer", "*.xml"])
                job.setOutputData(outputFile, OutputPath=outputPath)
                job.setInputData(hepevtFile)
                job.setName("HighEnergyPhotons_Detector_Model_" + str(detectorModelNumber))
                job.setBannedSites(["LCG.IN2P3-CC.fr", "LCG.IN2P3-IRES.fr", "LCG.KEK.jp"])

                res = job.append(MokkaApplication)
                if not res["OK"]:
                    print res["Message"]
                    exit()
                job.dontPromptMe()
                job.submit(diracInstance)
                os.system("rm *.cfg")

# Tidy Up
os.system("rm MokkaSteering.steer")
Exemplo n.º 5
0
#            outputFiles = []
#            outputFiles.append('MarlinReco_' + slcioFileNoPath[:-6] + '_Default.root')
            #outputFiles.append('MarlinReco_' + slcioFileNoPath[:-6] + '.slcio') # Not saving the output collections to speed up processing.
#            if eventType == 'Z_uds':
#                outputFiles.append('MarlinReco_' + slcioFileNoPath[:-6] + '_Muon.root')
#                outputFiles.append('MarlinReco_' + slcioFileNoPath[:-6] + '_PerfectPhoton.root')
#                outputFiles.append('MarlinReco_' + slcioFileNoPath[:-6] + '_PerfectPhotonNK0L.root')
#                outputFiles.append('MarlinReco_' + slcioFileNoPath[:-6] + '_PerfectPFA.root')

job = UserJob()
job.setJobGroup('TestingHadd')
#job.setInputSandbox(['hadd.C']) # Local files
#            job.setOutputSandbox(['*.log','*.gear','*.mac','*.steer','*.xml'])

job.setInputData(arguements[1:])
job.setOutputData('HaddTest.root',OutputPath='/Testing') # On grid
job.setName('TestingHadd')
job.setBannedSites(['LCG.IN2P3-CC.fr','LCG.IN2P3-IRES.fr','LCG.KEK.jp'])
job.dontPromptMe()
job.setCPUTime(1000)
res = job.append(genericApplication)

if not res['OK']:
    print res['Message']
    exit()
job.submit(diracInstance)
os.system('rm *.cfg')

# Tidy Up
#os.system('rm MarlinSteering.steer')
def SubmitMokkaJob(jobInfo):
    #########################
    # Unpack job information
    #########################
    jobDescription = jobInfo['jobDescription']
    eventsPerFile = jobInfo['eventsPerFile']
    eventsPerJob = jobInfo['eventsPerJob']
    stdhepFormat = jobInfo['stdhepFormat']
    stdhepFile = jobInfo['stdhepFile']
    eventType = jobInfo['eventType']
    energy = jobInfo['energy']
    detectorModel = jobInfo['detectorModel']
    mokkaSteeringFile = jobInfo['mokkaSteeringFile']
    diracInstance = jobInfo['diracInstance']
    idx = jobInfo['idx']

    base = open(mokkaSteeringFile, 'r')
    mokkaSteeringTemplateContent = base.read()
    base.close()

    matchObj = re.match(
        stdhepFormat, os.path.basename(stdhepFile),
        re.M | re.I)  # "whizard_ee_nunuww_nunuqqqq_1400GeV.100.stdhep"
    generatorSerialNumber = ''

    if matchObj:
        jobSet = int(matchObj.group(1))
        runNumber = int(matchObj.group(2))
        generatorSerialNumber = str((1000 * jobSet) + runNumber)
    else:
        print 'Wrong stdhep format.  Please check.'
        return

    for startEvent in xrange(0, eventsPerFile, eventsPerJob):
        print 'Checking ' + eventType + ', ' + str(
            energy
        ) + 'GeV jobs.  Detector model ' + detectorModel + '.  Generator serial number ' + str(
            generatorSerialNumber) + '.  Start event number ' + str(
                startEvent) + '.'
        description = eventType + '_' + str(
            energy) + 'GeV_GeneratorSerialNumber_' + str(generatorSerialNumber)
        outputFile = 'MokkaSim_Detector_Model_' + detectorModel + '_' + description + '_' + str(
            eventsPerJob) + '_' + str(startEvent) + '.slcio'
        outputPath = '/' + jobDescription + '/MokkaJobs/Detector_Model_' + detectorModel + '/' + eventType + '/' + str(
            energy) + 'GeV'

        #########################
        # Check if output exists
        #########################
        lfn = '/ilc/user/s/sgreen/' + outputPath + '/' + outputFile
        if DoesFileExist(lfn):
            print 'Output file already exists, skipping job.'
            continue

        #########################
        # Edit Mokka Template
        #########################
        mokkaSteeringContent = mokkaSteeringTemplateContent
        mokkaSteeringContent = re.sub('LcioOutputFile', outputFile,
                                      mokkaSteeringContent)
        mokkaSteeringContent = re.sub('StartEventNumber', str(startEvent),
                                      mokkaSteeringContent)

        mokkaSteeringFilename = 'MokkaSteering_' + eventType + '_' + str(
            idx) + '_' + str(startEvent) + '.steer'
        with open(mokkaSteeringFilename, 'w') as steeringFile:
            steeringFile.write(mokkaSteeringContent)

        #########################
        # Mokka Application
        #########################
        MokkaApplication = Mokka()
        MokkaApplication.setVersion(
            '0706P08'
        )  # Version info for offical CLIC productions as of 8-6-16
        MokkaApplication.setSteeringFile(mokkaSteeringFilename)
        MokkaApplication.setNumberOfEvents(eventsPerJob)
        MokkaApplication.setStartFrom(startEvent)
        MokkaApplication.setDbSlice(
            'LFN:/ilc/user/s/sgreen/PhysicsAnalysis/MokkaJobs/CLICMokkaDatabase/CLICMokkaDB.sql'
        )

        #########################
        # User Job Settings
        #########################
        job = UserJob()
        job.setJobGroup(jobDescription)
        job.setOutputSandbox(["*.log", "*.gear", "*.mac", "*.steer", "*.xml"])
        job.setOutputData(outputFile, OutputPath=outputPath)
        job.setInputData(stdhepFile)
        jobDetailedName = jobDescription + '_' + detectorModel + '_' + eventType + '_' + str(
            energy) + 'GeV_GeneratorSerialNumber_' + str(
                generatorSerialNumber) + '_' + str(eventsPerJob) + '_' + str(
                    startEvent)
        job.setName(jobDetailedName)
        job.setBannedSites([
            'LCG.IN2P3-CC.fr', 'LCG.IN2P3-IRES.fr', 'LCG.KEK.jp',
            'OSG.PNNL.us', 'OSG.CIT.us', 'LCG.LAPP.fr',
            'LCG.UKI-LT2-IC-HEP.uk', 'LCG.Tau.il', 'LCG.Weizmann.il',
            'OSG.BNL.us', 'OSG.MIT.us'
        ])
        #        job.setCPUTime(43200) # Mokka jobs take a long time so set no limit.

        res = job.append(MokkaApplication)
        if not res['OK']:
            print res['Message']
            exit()

        print 'Submitting ' + eventType + ', ' + str(
            energy
        ) + 'GeV jobs.  Detector model ' + detectorModel + '.  Generator serial number ' + str(
            generatorSerialNumber) + '.  Start event number ' + str(
                startEvent) + '.'

        job.dontPromptMe()
        job.submit(diracInstance)
        os.system('rm ' + mokkaSteeringFilename)
        print 'Job submitted to grid.'
Exemplo n.º 7
0
    "hnunu_rec_6265_photonrereco_3_0_TeV_ntuple160620_233_25.root"
])
job.setOutputData(
    ["hnunu_rec_6265_photonrereco_3_0_TeV_ntuple160620_233_25.root"],
    "160620_" + jobGroup, "CERN-SRM")
job.setInputData([
    #job.setParametricInputData([
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_233.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_234.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_235.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_236.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_237.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_238.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_239.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_24.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_240.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_241.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_242.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_243.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_244.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_245.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_246.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_247.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_248.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_249.slcio",
    "/ilc/prod/clic/3tev/h_nunu/ILD/REC/00006265/000/h_nunu_rec_6265_25.slcio"
])
job.setName("h_nunu_rec_6265_3TeV")
#job.setDestination("LCG.CERN.ch")
#job.setCPUTime(300000)
ma = Marlin()
ma.setVersion('ILCSoft-01-17-09_gcc48')
        xmlTemplate = xmlGeneration.produceXml()

        with open("MarlinSteering.steer" ,"w") as SteeringFile:
            SteeringFile.write(xmlTemplate)

        ma = Marlin()
        ma.setVersion('ILCSoft-01-17-07')
        ma.setSteeringFile('MarlinSteering.steer')
        ma.setGearFile(gearFileLocal)
        ma.setInputFile(slcioFilesGridFilesString)

        inputSandbox = [pandoraSettingsFile]
        job = UserJob()
        job.setJobGroup(jobDescription)
        job.setInputSandbox(inputSandbox) # Local files
        job.setInputData(inputDataString)
        job.setOutputSandbox(['*.log','*.gear','*.mac','*.steer'])
        job.setOutputData(outputFiles,OutputPath=outputPath) # On grid
        job.setName(jobDescription + '_Detector_Model_' + str(detModel) + '_Reco_' + str(recoVar))
        job.setBannedSites(['LCG.IN2P3-CC.fr','LCG.IN2P3-IRES.fr','LCG.KEK.jp','OSG.PNNL.us','OSG.CIT.us'])
        job.dontPromptMe()
        res = job.append(ma)

        if not res['OK']:
            print res['Message']
            exit()
        job.submit(diracInstance)
        os.system('rm *.cfg')

# Tidy Up
if tidyUp:
                       'runfile.txt',
                       'AnalysePerformance_PandoraSettings' + pandoraSettings + '_DetectorModel_' + str(detModel) + '_Reco_Stage_' + str(recoVar) + '_' + eventType + '_' + str(energy) + 'GeV.root',
                       'AnalysePerformance_PandoraSettings' + pandoraSettings + '_DetectorModel_' + str(detModel) + '_Reco_Stage_' + str(recoVar) + '_' + eventType + '_' + str(energy) + 'GeV.txt'
                     ]

        outputFiles = arguements[1:]

        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='/OptimisationStudies/AnalysePerformance/Detector_Model_' + str(detModel) + '/Reco_Stage_' + str(recoVar) + '/' + eventType + '/' + str(energy) + 'GeV')

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

        if not res['OK']:
            print res['Message']
            exit()
        job.submit(diracInstance)
        os.system('rm *.cfg')
        os.system('rm runfile.txt')
            lcsimFinalize.setDetectorModel(detector + '.zip')
            lcsimFinalize.setOutputRecFile(outputFile + '_REC.slcio')
            lcsimFinalize.setOutputDstFile(outputFile + '_DST.slcio')
            result = job.append(lcsimFinalize)
            if not result['OK']:
                print result['Message']
                sys.exit(2)
        elif marlinVer or slicPandoraVer:
            defaultOutputFile = outputFile + '.slcio'
            if not defaultOutputFile in outputData:
                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 ''
Exemplo n.º 11
0
from DIRAC.Core.Base import Script
Script.parseCommandLine()
from ILCDIRAC.Interfaces.API.DiracILC import DiracILC
from ILCDIRAC.Interfaces.API.NewInterface.UserJob import *
from ILCDIRAC.Interfaces.API.NewInterface.Applications import *

dirac = DiracILC(True, "CLICdet_repo.cfg")
job = UserJob()
job.setName("example")
job.setInputData([
    "/ilc/user/p/proloff/stdhep/2f_samples_23_04_2013/whizard_SM_bb_500_90deg.stdhep"
])
job.setCLICConfig("ILCSoft-2017-12-21")
job.setOutputSandbox(["*.root", "*.slcio", "*.log"])

ddsim = DDSim()
ddsim.setSteeringFile("CLICPerformance/examples/clic_steer.py")
ddsim.setVersion("ILCSoft-2017-12-21_gcc62")
ddsim.setDetectorModel("CLIC_o3_v14")
ddsim.setInputFile(
    "/ilc/user/p/proloff/stdhep/2f_samples_23_04_2013/whizard_SM_bb_500_90deg.stdhep"
)
ddsim.setOutputFile("ddsim_output.slcio")
ddsim.setStartFrom(0)
ddsim.setNumberOfEvents(10)
res1 = job.append(ddsim)
if not res1['OK']:
    print res1['Message']
    sys.exit(2)

# -------------------- Comment if gg_had overlay not wanted -----------------------------------------------------#
Exemplo n.º 12
0
lcsimFinalize.setNumberOfEvents(nEvts)
lcsimFinalize.setSteeringFile(xmlPostPandora)
lcsimFinalize.setAliasProperties(aliasFile)
lcsimFinalize.setDetectorModel(detector + '.zip')
lcsimFinalize.setOutputRecFile(outputFile + '_REC.slcio')
lcsimFinalize.setOutputDstFile(outputFile + '_DST.slcio')
result = job.append(lcsimFinalize)
if not result['OK']:
    print result['Message']
    sys.exit(2)

job.setOutputSandbox(outputSandbox)
job.setInputSandbox(inputSandbox)

# This appears to send the input data file into the first program in the list; here it is SLIC
job.setInputData([inputFile])

# Add the two files created in the final lcsim stage to the output data (retrieved using eg. dirac-wms-job-get-output-data)
outputData = []
outputData.append(outputFile + '_REC.slcio')
outputData.append(outputFile + '_DST.slcio')

# Can store data on the grid using the specified storage element
if storeOutput == True:
    job.setOutputData(outputData, storagePath, storageElement)

# This sets the queue for the job to be run
job.setCPUTime(cpuLimit)

job.setSystemConfig(systemConfig)
def SubmitMokkaJob(jobInfo):
    #########################
    # Unpack job information
    #########################
    jobDescription = jobInfo['jobDescription']
    eventsPerFile = jobInfo['eventsPerFile']
    eventsPerJob = jobInfo['eventsPerJob'] 
    stdhepFormat = jobInfo['stdhepFormat']
    stdhepFile = jobInfo['stdhepFile']
    eventType = jobInfo['eventType'] 
    energy = jobInfo['energy']
    detectorModel = jobInfo['detectorModel'] 
    mokkaSteeringFile = jobInfo['mokkaSteeringFile'] 
    diracInstance = jobInfo['diracInstance'] 
    idx = jobInfo['idx']

    base = open(mokkaSteeringFile,'r')
    mokkaSteeringTemplateContent = base.read()
    base.close()

    matchObj = re.match(stdhepFormat, os.path.basename(stdhepFile), re.M|re.I) # "whizard_ee_nunuww_nunuqqqq_1400GeV.100.stdhep"
    generatorSerialNumber = ''

    if matchObj:
        jobSet = int(matchObj.group(1))
        runNumber = int(matchObj.group(2))
        generatorSerialNumber = str((1000*jobSet)+runNumber)
    else:
        print 'Wrong stdhep format.  Please check.'
        return

    for startEvent in xrange(0, eventsPerFile, eventsPerJob):
        print 'Checking ' + eventType + ', ' + str(energy) + 'GeV jobs.  Detector model ' + detectorModel + '.  Generator serial number ' + str(generatorSerialNumber) + '.  Start event number ' + str(startEvent) + '.'
        description = eventType + '_' + str(energy) + 'GeV_GeneratorSerialNumber_' + str(generatorSerialNumber)
        outputFile = 'MokkaSim_Detector_Model_' + detectorModel + '_' + description + '_' + str(eventsPerJob) + '_' + str(startEvent) + '.slcio'
        outputPath = '/' + jobDescription + '/MokkaJobs/Detector_Model_' + detectorModel + '/' + eventType + '/' + str(energy) + 'GeV'

        #########################
        # Check if output exists
        #########################
        lfn = '/ilc/user/s/sgreen/' + outputPath + '/' + outputFile
        if DoesFileExist(lfn):
            print 'Output file already exists, skipping job.'
            continue

        #########################
        # Edit Mokka Template 
        #########################
        mokkaSteeringContent = mokkaSteeringTemplateContent
        mokkaSteeringContent = re.sub('LcioOutputFile',outputFile,mokkaSteeringContent)
        mokkaSteeringContent = re.sub('StartEventNumber',str(startEvent),mokkaSteeringContent)

        mokkaSteeringFilename = 'MokkaSteering_' + eventType + '_' + str(idx) + '_' + str(startEvent) + '.steer'
        with open(mokkaSteeringFilename ,'w') as steeringFile:
            steeringFile.write(mokkaSteeringContent)

        #########################
        # Mokka Application
        #########################
        MokkaApplication = Mokka()
        MokkaApplication.setVersion('0706P08') # Version info for offical CLIC productions as of 8-6-16
        MokkaApplication.setSteeringFile(mokkaSteeringFilename)
        MokkaApplication.setNumberOfEvents(eventsPerJob)
        MokkaApplication.setStartFrom(startEvent)
        MokkaApplication.setDbSlice('LFN:/ilc/user/s/sgreen/PhysicsAnalysis/MokkaJobs/CLICMokkaDatabase/CLICMokkaDB.sql')

        #########################
        # User Job Settings
        #########################
        job = UserJob()
        job.setJobGroup(jobDescription)
        job.setOutputSandbox( ["*.log", "*.gear", "*.mac", "*.steer", "*.xml" ] )
        job.setOutputData(outputFile, OutputPath=outputPath)
        job.setInputData(stdhepFile)
        jobDetailedName = jobDescription + '_' + detectorModel + '_' + eventType + '_' + str(energy) + 'GeV_GeneratorSerialNumber_' + str(generatorSerialNumber) + '_' +  str(eventsPerJob) + '_' + str(startEvent)
        job.setName(jobDetailedName)
        job.setBannedSites(['LCG.IN2P3-CC.fr','LCG.IN2P3-IRES.fr','LCG.KEK.jp','OSG.PNNL.us','OSG.CIT.us','LCG.LAPP.fr','LCG.UKI-LT2-IC-HEP.uk','LCG.Tau.il','LCG.Weizmann.il','OSG.BNL.us', 'OSG.MIT.us'])
#        job.setCPUTime(43200) # Mokka jobs take a long time so set no limit. 

        res = job.append(MokkaApplication)
        if not res['OK']:
            print res['Message']
            exit()

        print 'Submitting ' + eventType + ', ' + str(energy) + 'GeV jobs.  Detector model ' + detectorModel + '.  Generator serial number ' + str(generatorSerialNumber) + '.  Start event number ' + str(startEvent) + '.'

        job.dontPromptMe()
        job.submit(diracInstance)
        os.system('rm ' + mokkaSteeringFilename)
        print 'Job submitted to grid.'
Exemplo n.º 14
0
lcsimFinalize.setNumberOfEvents( nEvts )
lcsimFinalize.setSteeringFile( xmlPostPandora )
lcsimFinalize.setAliasProperties( aliasFile )
lcsimFinalize.setDetectorModel( detector + '.zip' )
lcsimFinalize.setOutputRecFile( outputFile+'_REC.slcio' )
lcsimFinalize.setOutputDstFile( outputFile+'_DST.slcio' )
result = job.append( lcsimFinalize )
if not result['OK']:
    print result['Message']
    sys.exit(2)

job.setOutputSandbox ( outputSandbox )
job.setInputSandbox ( inputSandbox )

# This appears to send the input data file into the first program in the list; here it is SLIC
job.setInputData( [ inputFile ] )

# Add the two files created in the final lcsim stage to the output data (retrieved using eg. dirac-wms-job-get-output-data)
outputData = []
outputData.append( outputFile+'_REC.slcio' )
outputData.append( outputFile+'_DST.slcio' )

# Can store data on the grid using the specified storage element
if storeOutput == True:
    job.setOutputData ( outputData, storagePath, storageElement )

# This sets the queue for the job to be run
job.setCPUTime( cpuLimit )

job.setSystemConfig ( systemConfig )