How to Submit SiD Simulation and Reconstruction Jobs Using ILCDirac

Interfaces for all the SiD simulation and reconstruction software packages are available in ILCDIRAC and allow easy definition and submission of jobs using python. This page includes python examples for all possible steps. It also explains the use of a flexible job submission script, that allows to directly submit common job configurations from the command line and let's you get started immediately.

Python Examples

The following statements are required to create an ILCDirac job.

# import ILCDIRAC classes
from ILCDIRAC.Interfaces.API.DiracILC import DiracILC
from ILCDIRAC.Interfaces.API.ILCJob import ILCJob

# create an instance of ILCDIRAC and define a repository file to store the submitted job IDs
dirac = DiracILC ( True , "myRepositoryFile.txt" )

# create a new job
job = ILCJob ( )

# add any step to be executed here

job.setSystemConfig ( "x86_64-slc5-gcc43-opt" ) # need to correspond to a config defined in the dirac configuration
job.setName ( "myJob" ) # just an identifier

# the following statements are optional
job.setOutputSandbox ( [ "*.log" , "*.mac", "*.xml", "*.lcsim" ] ) # beeing able to retrieve the steering files is useful for debugging
job.setInputSandbox ( [ "file1", "file2", ... ] ) # required if the job needs input
job.setOutputData ( [ "outputFile1", "outputFile2", ... ], "CERN-SRM", "/my/storage/path" ) # other possible storage elements are RAL-SRM, IN2P3-SRM, etc.
job.setCPUTime( cpuLimit ) # maximum is 300000 seconds
job.setJobGroup( "myGroup" ) # helps finding jobs that belong together
job.setBannedSites( [ "Site1", "Site2", ... ] )
job.setDestination( "LCG.CERN.ch" )

# submit the job
dirac.submit ( job )

In addition any one of the following steps can be added before the submit command to define what is being executed in the job.

If several steps are defined, the output of one step is automatically used as the input for the following step (if no input is defined). Only certain combinations are supported, though. LCSim can follow an SLIC or SlicPandora step and SlicPandora can follow an LCSim step.

SLIC

res = job.setSLIC ( appVersion = "v2r9p8" , # has to be available in the dirac configuration
		detectorModel = "clic_sid_cdr" , # dirac will retrieve the detector geometry automatically from www.lcsim.org
		macFile = "mySlicMacro.mac" , # steering file
		inputGenfile = "LFN:/my/files/input.stdhep", # optional input file, if an LFN is given it is automatically added to the input sandbox
		nbOfEvents = 100 ,
		startFrom = 0 , # only set if you want to skip events from the input file
		outputFile = "slicOutput.slcio" # don't forget to add it also to the outputdata!
		)
# checking the return value is not required, but considered good practice
if not res['OK']:
	print res['Message']
	sys.exit(2)

Overlay background

This step will download the required background files and overlay them in the next LCSim step present.

res = job.addOverlay( detector = "SID", # need to set which background samples to use
		energy = "3tev", # need to set which background samples to use
		BXOverlay = 60, # number of bunch crossings per signal event
		NbGGtoHadInts = 3.2, # number of events per bunch crossing
		NSigEventsPerJob = 100 # number of signal events
		)
# checking the return value is not required, but considered good practice
if not res['OK']:
	print res['Message']
	sys.exit(2)

LCSim with background overlay

res = job.setLCSIM ( appVersion = "CLIC_CDR" , # has to be available in the dirac configuration
		xmlfile = "myLcsim.xml" , # steering file
		aliasproperties = "mtAlias.properties" , # optional
		evtstoprocess = 100, # optional, default is -1
		inputslcio = [ "input1.slcio", "LFN:/my/files/input2.slcio", ... ], # can be a list of files, LFNs will be added to the input sandbox automatically
		outputFile = "lcsimOutput.slcio" # don't forget to add it also to the outputdata!
		)
# checking the return value is not required, but considered good practice
if not res['OK']:
	print res['Message']
	sys.exit(2)

SlicPandora

res = job.setSLICPandora ( appVersion = "CLIC_CDR" , # has to be available in the dirac configuration
		detectorgeo = "clic_sid_cdr" , # pandora.xml or detector name, dirac will then retrieve the detector geometry automatically from www.lcsim.org
		inputslcio = [ "input1.slcio", "LFN:/my/files/input2.slcio", ... ], , # can be a list of files, LFNs will be added to the input sandbox automatically
		pandorasettings = "myPandoraSettings.xml" , # optional, if none given a default settings file will be taken
		nbevts = 100 , # optional, default is -1
		outputFile = "slicPandoraOutput.slcio" # don't forget to add it also to the outputdata!
		)
# checking the return value is not required, but considered good practice
if not res['OK']:
	print res['Message']
	sys.exit(2)

Job Submission Script

Where to get it

Command Line Parameters

Examples

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r3 - 2011-06-09 - ChristianGrefe
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CLIC All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback