User Tools

Site Tools


start:davinciexample

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
start:davinciexample [2010/02/04 15:36] – created nchiapstart:davinciexample [2010/02/05 15:27] – restructured nchiap
Line 1: Line 1:
 ====== DaVinci Example ====== ====== DaVinci Example ======
  
-This example creates a simplified version of the algorithm described in [[https://twiki.cern.ch/twiki/bin/view/LHCb/DaVinciTutorial4 | DaVinciTutorial4]].+This example creates a simple selection for J/psi -> mu+ mu- using the Particle Selection Framework (i.e. CombineParticle). It is a simplified version of the algorithm described in [[https://twiki.cern.ch/twiki/bin/view/LHCb/DaVinciTutorial4 | DaVinciTutorial4]].
  
  
 ===== Preparations ===== ===== Preparations =====
-  * login to *lxplus*+  * login to **lxplus**
   * make sure you have a [[https://lhcb.physik.uzh.ch/grid:grid | Grid]]-Certificate   * make sure you have a [[https://lhcb.physik.uzh.ch/grid:grid | Grid]]-Certificate
   *   *
Line 58: Line 58:
 </code> </code>
  
-===== Prepare Data Fiel =====+=====Running===== 
 +  * Set environment for Ganga 
 +<code>SetupProject Ganga</code>
  
 +  * maybe you need to create a new config file
 +<code>ganga -g</code>
 +
 +  * start
 +<code>ganga</code>
 +
 +  * prepare job
 +<code python>
 +t = JobTemplate( application = DaVinci( ))
 +t.application.optsfile = File( "~/example/myOptions.py" )
 +</code>
 +
 +  * add input data
 +<code python>
 +t.inputdata = browseBK()
 +# select MC / MC09 / Beam5TeV-VeloClosed-MagDown-Nu1 / MC09-Sim03Reco02-withTruth / 24142000 / DST
 +# you could instead use an python option file with the data locations 
 +# (see below on how to generate one)
 +#t.application.optsfile.append(  File( "~/example/myOptions.py" )  )
 +# the Ganga-Manual marks this as depreciated
 +</code>
 +
 +  * create a job and run it
 +<code python>
 +j = Job( t, backend = Interactive() )
 +j.submit()
 +</code>
 +
 +
 +==== Running outside Ganga (locally)====
 +=== Prepare Data Files ===
 +  * run the Bookkeeping-GUI
 +<code>lhcb_bkk</code>
 +  * select 
 +
 +<file>MC / MC09 / Beam5TeV-VeloClosed-MagDown-Nu1 / MC09-Sim03Reco02-withTruth / 24142000 / DST</file>
 +
 +  * double-click on **Nb of Files/Events** and select all files
 +
 +  * click **Advanced Save**
 +  * give Filename (e.g. "myFiles.py"), select **PFN(s)** and **CERN**
 +  * click **save**
 +
 +=== Run ===
 +<code>
 +SetupProject DaVinci
 +gaudirun.py myOptions.py myFiles.py
 +</code>
 +
 +
 +===== Looking at the output =====
 +The Algorithm creates a file called histograms.root. 
 +  * If run with gaudirun.py it should be in the working directory. 
 +  * If run with ganga it can be found at **~/gangadir/workspace/<username>/LocalAMGA/<jobNr>/output/**
 +Start root and have a look at the histograms.
 +
 +===== More Info =====
 +You can find more info at following locations:
 +  * [[ganga:ganga | Ganga]] 
 +  * [[davinci:davinci | DaVinci]]
start/davinciexample.txt · Last modified: 2012/03/29 11:29 by nchiap