User Tools

Site Tools


start:davinciexample

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
start:davinciexample [2010/02/04 16:04] – created nchiapstart:davinciexample [2012/03/29 11:29] (current) – [Create Python Configuration] added links to particle table and loki references 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]].
  
  
Line 58: Line 58:
 </code> </code>
  
-===== Prepare Data Files ===== +For more details about the names used in the DecayDescriptor, [[davinci:particletable | look at the ParticleTable]].  
-  * run the Bookkeeping-Gui +For a list of availbale funtors for CombinationCut and MotherCut, [[loki:lists | check the Loki references]]. 
 + 
 +=====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> <code>lhcb_bkk</code>
   * select    * select 
Line 67: Line 104:
   * double-click on **Nb of Files/Events** and select all files   * double-click on **Nb of Files/Events** and select all files
  
-**if you want to run on the grid** +  click **Advanced Save** 
-  * click "Save Files"+  * 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.
  
-**if you want to run locally** +===== More Info ===== 
-  * click **Advanced Save**  +You can find more info at following locations: 
-  * give Filename, select PFN(s) and CERN +  * [[ganga:ganga | Ganga]]  
-  * click "save"+  * [[davinci:davinci | DaVinci]]
start/davinciexample.1265295841.txt.gz · Last modified: 2010/02/04 16:04 by nchiap