First we define a DAVINCI application. We place the code in a non-default location to avoid interfering with other development work. We use a supplied options file but just add a single line which limits the number of events analysed.
v = 'v20r0'
topdir='~/public/cmtTutorial'
master='Tutorial/Analysis/v7r4'
tutdir=topdir+'/DaVinci_'+v+'/'+master+'/solutions/DaVinci3'
dv = DaVinci(version=v,
user_release_area=topdir,
masterpackage=master,
platform='slc4_ia32_gcc34')
dv.optsfile=[tutdir+'/DVTutorial_3.py']
dv.extraopts='ApplicationMgr().EvtMax = 1000'
t = JobTemplate(name='TutorialAnalysis',
application=dv,
backend=Local())
We check out code from CVS and compile the package. Cheat by copying some code from the solutions directory before we compile.
dv.getpack('Tutorial/Analysis v7r4')
!cp $tutdir/*.{cpp,h} $tutdir/../../src
dv.make()
dataCERN = LHCbDataset(files=[ 'LFN:/lhcb/production/DC06/v1r0/00002042/DST/0000/00002042_00000001_2.dst', 'LFN:/lhcb/production/DC06/v1r0/00002042/DST/0000/00002042_00000003_2.dst'])
j = Job(t, inputdata=dataCERN)
j.submit() < wait for job to finish > < look at output > j.peek() total 57K -rw-r--r-- 0 Aug 12 13:10 __syslog__ -rw-r--r-- 35K Aug 12 13:10 stdout -rw-r--r-- 340 Aug 12 13:10 stderr -rw-r--r-- 86 Aug 12 13:10 __jobstatus__ -rw-r--r-- 20K Aug 12 13:10 DVHistos_3.root < look at stdout file > j.peek('stdout') < edit the code > j.application.make() < create new job > j = Job(t, inputdata=dataCERN)
data = LHCbDataset(files=[ 'LFN:/lhcb/production/DC06/v1r0/00002042/DST/0000/00002042_00000001_2.dst', 'LFN:/lhcb/production/DC06/v1r0/00002042/DST/0000/00002042_00000003_2.dst', 'LFN:/lhcb/production/DC06/v1r0/00002042/DST/0000/00002042_00000005_2.dst', 'LFN:/lhcb/production/DC06/v1r0/00002042/DST/0000/00002042_00000006_2.dst', 'LFN:/lhcb/production/DC06/v1r0/00002042/DST/0000/00002042_00000008_2.dst', 'LFN:/lhcb/production/DC06/v1r0/00002042/DST/0000/00002042_00000009_2.dst', 'LFN:/lhcb/production/DC06/v1r0/00002042/DST/0000/00002042_00000010_2.dst' ]) j = Job(t,inputdata=data, backend=Dirac()) j.application.extraopts='ApplicationMgr().EvtMax = 10000000' j.splitter=DiracSplitter(filesPerJob = 3) j.submit()
for js in j.subjobs: js.peek('DVHistos_3.root','ls -sh') 1.0K /afs/.../LocalAMGA/51/0/output/DVHistos_3.root 1.0K /afs/.../LocalAMGA/51/1/output/DVHistos_3.root 1.0K /afs/.../LocalAMGA/51/2/output/DVHistos_3.root
In the end lets store the job definition for our job on the Grid as a template for easy use in a later GANGA session:
t = JobTemplate(j) t.name='MyFirstGridAnalysis' templates
See About this document... for information on suggesting changes.