Data analysis with Ganga
Page under construction
You need a Grid certificate to run Ganga on the Grid. Knowledge of Python will be helpful to make efficient use of Ganga.
Ganga is a job submission system with line-commands using IPython, or alternatively a graphical user interface (GUI). Ganga will in future interface to multiple backends (LCG, Panda, NorduGrid, …), presently it works on LCG. The PYTHON scripting interface for working with jobs in GANGA is called the GPI (Ganga Public Interface).
Useful links
- Ganga -- project portal page pointing to user guides, instructions for installation, instructions for Ganga developers, communications
- Working with Ganga -- in-depth introduction (part of the Ganga site): setting up and running jobs
-
WorkBookGanga -- short introduction to use and installation of Ganga,
setup of environment and simple test on lxplus or local installations.
The section "Ganga" in the Analysis Workbook is a copy of this page. - Distributed Analysis using GANGA -- more details on setup, use of Athena, setup for use with DQ2
- GangaWithAtlantis -- Using Ganga with Atlantis
Ganga configuration file
Ganga uses a configuration file .gangarc, which contains extensive documentation of the options.
The options can be overwritten with the "-o" control in commands.
For example, the default is not to run the monitoring loop of jobs for scripts.
You can enable the monitoring by using a cmd line parameter -o[PollThread]autostart=True.
Summary of important Ganga commands
Optional parameters are shown in […], comments in {…}
To find the latest version of Ganga at CERN
> source /afs/cern.ch/sw/ganga/install/etc/setup-atlas.shor list the AFS install directory at CERN> ls /afs/cern.ch/sw/ganga/install/slc3_gcc323/
Selected Ganga commands
> ganga --help {Summary of commands}> ganga athena --help {list of options for plugin athena}> ganga {Start Ganga in line-mode}> ganga --gui [--config-path=GangaAtlas/Atlas.ini] {Start Ganga in GUI-mode}> ganga --g {Force creation of configuration file $HOME/.gangarc}> Ctrl-D {terminate session with confirmation} or %Exit or %QuitCommands in Ganga[1]: help('index')[2]: help() {type "q" or Ctrl-D to leave help}help> indexhelp> [any item listed by index] {not all items are documented}help> Jobhelp> jobs {job registry}help> jobtreeCommands in Ganga: Job configuration and datasets, some examples[1]: d = DQ2Dataset(dataset='mydatasetname')[2]: d.list_locations_num_files() {number of files per SE}[2]: j=Job()[3]: j.inputdata.min_num_files=1 {job will only be submitted to sites which hold at least 1 file of the DQ2Dataset}[4]: j.inputdata.names = ['filesname1.root','filename2.root', …] {input LFNs, tedious for larger datasets}Documentation of Ganga plugins[1]: plugins("backends") {to see which backends are available for ATLAS}[2]: plugins() {to see which plugins are available for ATLAS}
General and ATLAS specific plugins
- Athena -- AOD analysis
- AthenaMC -- small full chain productions: simulation, reconstruction etc using the official transformations
- Root
- Executable
Athena and AthenaMC -- CVS location of submission scripts
Display and set the parameters of an application or include the application in a job; example Athena
[1]: print Athena()[2]: a = Athena()[3]: a.atlas_release='12.0.5'[4]: a.max_events='10'[5]: j = Job(application=a) ; print j
Job operations
[1]: print jobs {get list of your jobs}
[2]: jobs[4].remove() {remove job 4}
[3]: jobs.clean() {remove all jobs}
For more details see the "Ganga introduction" and the documentation of individual applications and backends. You can prepare jobs in templates, copy a job, and exchange a jobs with other users as a text-file (export/import).
Working with Ganga on the Grid
Ganga installation
Example of installation of version 4.2.12 from Ganga download --
> mkdir $HOME/GANGA> cd GANGA> wget http://cern.ch/ganga/download/ganga-install> python ganga-install --extern=GangaAtlas,GangaGUI,GangaPlotter 4.2.12
The following external dependencies are downloaded and installed together with Ganga. Python is downloaded to keep Ganga and Python in sync; evolving versions of Python are not necessarily compatible.
PythonipythonpyqtOptik {python package}matplotlibsip {python module}
Presentations of Ganga and Tutorials
Ganga has been evolving rapidly, the tutorials on TWiki refer normally to the Ganga version, e.g. GangaTutorial417 referes to version 4.1.7. We list only the latest tutorials.
Presentations of Ganga
- Distributed Analysis-- Analysis Model Workshop (2006-10-04), Dietrich Liko
Ganga tutorials
- Ganga Tutorial -- Overview week (2006-10-04)
- Ganga - an introduction -- very good introduction and examples using local installation (2006-10-24, Peter Oettl)
- GangaTutorial427 -- latest tutorial (Frédéric Brochu)
- GangaGUITutorial427 -- same as above but for GUI (Alvin Tan)
- GangaTutorialAtCCIN2P3 -- local installation at CC-Lyon, adds to GangaTutorial427
Communication
- Ganga HyperNews Forum
- FAQ -- check here first before submitting questions
See also
- How to use GANGA -- for B-physics production and analysis (oct 2006). The B-Phys group has written an extensive manual, which is regularly kept up-to-date.
- Claire Bourdario's page -- check what is general and could be used here
Documentation for Ganga system experts
- GANGA: Interfacing to s/w framework and the Grid (2007) -- uses SOFTWARE/OO, replace with more recent reference TBD