Home / Grid tools & services / Data access & analysis

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 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.sh
				or 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 %Quit 

			 Commands in Ganga 
				[1]:   help('index') 
				[2]:   help()    {type "q" or Ctrl-D to leave help} 
					help>   index
					help>   [any item listed by index]    {not all items are documented} 
					help>   Job 
					help>   jobs    {job registry}
					help>   jobtree 

			 Commands 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

applications
  • 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.

 Python 
		 ipython 
		 pyqt
		 Optik  	{python package} 
		 matplotlib 
		sip 		{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

Ganga tutorials

Communication

See also

Documentation for Ganga system experts

↑ Top