Setup of Athena

I assume that we are working with Athena release 14.2.20 at cern, and it has already been setup, via

source ~/cmthome/ -tag=14.2.20,32
or similar commands on your account.

In the tutorial we will work with the UserAnalysis-package which we will therefore check out in our Athena working directory, via

cmt co -r UserAnalysis-00-13-04 PhysicsAnalysis/AnalysisCommon/UserAnalysis
go to
cd PhysicsAnalysis/AnalysisCommon/UserAnalysis/cmt
and type
cmt config
I guess the gmake step is not necessary, so you might skip this command. We change now to
cd PhysicsAnalysis/AnalysisCommon/UserAnalysis/share
and edit the following lines in the main joboption file
// ServiceMgr.EventSelector.InputCollections = [ "AOD.pool.root" ]
ServiceMgr.EventSelector.InputCollections = ["/afs/" ]
where we just give an example input file. Now we test the whole setup so far, via
root AnalysisSkeleton.aan.root

Now, we want to run the exact same job with ganga!

Since we have already a setup Athena enviroment and we are in the run-directory, we well just type

get_files -jo
as we will need the for our Ganga test.

Starting with Ganga

Start again a clean shell and setup ganga with the lines given above. If you start ganga for the first time, type
ganga -g
This creates a file, named .gangarc. Ganga will produce quite a lot of files during its runtime. The directory of the files can be changed by editing the .gangarc file and add the following line
gangadir = /project/atlas/Users/yourusernamehere/gangadir

Now we can start the first time Ganga, by simply typing



will give you an opverview of your jobs. Jobs can be killed and removed via
To quit again, just press CTRL-D.

Simple Ganga Jobs

Now go to your project directory
cd /project/atlas/Users/yourusernamehere
and create
echo ' running...'
echo "----------------------"
echo "HELLO!"
echo "----------------------"
and Do not forget to modify the following to your directory structure+
j = Job()
The imprtant point is here that we have chosen LCG() as backend, i.e. the script will be executed on the grid. Now start ganga again and submit the job to the LCG-grid
the status can be tested with
You can see the output of the job when it has finished under
if 0 was the job ID. This was our first grid-job submitted via ganga!

Using Ganga on the batch system

Now, we setup Athena 14.2.20 again and go to the UserAnalysis package, which we have checked out before

source ~/cmthome/ -tag=14.2.20
cd /afs/
cmt config
Currently there is a problem in Athena 14.x.y which introduces some Python conflicts. Here is a workaround. You have to delete /afs/ out of the Python Path Variable $PYTHONPATH. In order to so, just print it via
The take the above entry away and set the remain variable again
export PYTHONPATH=...
We change to the run directroy and create a file named
config["Athena"]["ATLAS_SOFTWARE"] = "/afs/"
j = Job()
This Ganga Job means the following
  • Line 1 defines the job
  • Line 2 sets it as an Athena job
  • Line 3 makes a tarball of the local packages which are to be sent to the Grid for execution
  • Line 4 tells ganga that this package should be compiled at the host
  • Line 5 points the job to the job options
  • Line 6 sets the number of events
  • Line 7 tells the job to run on the Local machine
  • Line 8 submits the job
Now we are running a script locally, by starting ganga and type
To run this job on the batch system, we only have to change the following in the previously defined Ganga Job.

Athena Analysis within Ganga

Now we want to have our own analysis code running with ganga. In order to simulate that, we will just edit two lines (260) on PhysicsAnalysis/AnalysisCommon/UserAnalysis/src/AnalysisSkeleton.cxx to

  m_h_elecpt     = new TH1F("elec_pt","pt el",50,0,250.*GeV);
  sc = m_thistSvc->regHist("/AANT/GangaDemo/elec_pt",m_h_elecpt);
So, if the directory GangaDemo will appear in our output root file, then we are sure that our version has been used. Before starting, we test if everything is compiling
cd PhysicsAnalysis/AnalysisCommon/UserAnalysis/cmt
cmt config

Again, We change to the run directroy and create a file named

config["Athena"]["ATLAS_SOFTWARE"] = "/afs/"
j = Job()'AnalysisExample'
j.outputdata.location = '$HOME/Athena/Ganga_Output'
and run it in ganga via

Ganga can also handle job-Splitting and job-Merging. For this, you just have to decomment the following lines in the above Job definition

Obviously you have to use a larger input sample for this to be effective.

Further comments


-- MaxBaak - 11 Sep 2008

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2008-09-12 - unknown
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback