May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN [email protected] May 23, 2007...

60
May 23, 2007 1 ALICE Offline Tutorial Markus Oldenburg – CERN [email protected] May 23, 2007 – University of São Paulo

Transcript of May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN [email protected] May 23, 2007...

Page 1: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 1

ALICE Offline Tutorial

Markus Oldenburg – [email protected]

May 23, 2007 – University of São Paulo

Page 2: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 2

ALICE Offline Tutorial

F.Carminati, P.Christakoglou, J.F.Grosse-Oetringhaus, P.Hristov, A.Peters, P.Saiz

April 13, 2007 – v1.3

based on:

Page 3: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 3

Part V: AliEn installation and Setup

available online at: http://cern.ch/Oldenburg -> Seminars

Page 4: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 4

Installation of the AliEn software.

Authentication – Possible problems.

General description of the shell:

Basic commands.

Basic functionalities.

Working with the file catalogue:

Copying files from/to the catalogue.

File catalogue structure.

Querying the file catalogue.

ROOT API

News on production.

Outline

Page 5: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 5

Remarks

Please follow through the tutorial by reading the pages, first.

Only then, do the things described in the ‘Try it out’ sections.

Reason: Only the ‘Try it out’ sections have the correct commands/directories and right version numbers, while the explanatory slides might differ.

Page 6: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 6

Installation – Getting the installer

Page 7: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 7

Installation – Selecting the version

Page 8: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 8

Installation – Reuse of software

Page 9: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 9

All the installation log files are stored in this directory!In case of installation problems please send the error

message along with the install.log file

Installation – Workspace directory

Page 10: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 10

Installation – Detecting the platftom

Page 11: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 11

Installation – Supported platforms

Page 12: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 12

Installation – Installation directory

Page 13: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 13

Installation – Selecting installation directory

Page 14: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 14

Installation – Overwriting files

Page 15: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 15

Installation – Selecting packages

Page 16: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 16

Installation – Progress bar

Page 17: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 17

Installation – Final window

Page 18: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 18

ROOT application

API client

Common libraries

Globus toolkit

Gcc compiler

Installation – Directory structure

Page 19: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 19

Download the alien installer from http://alien.cern.ch.

Make the file executable.

Run the installer.

Select v2-13

Platform should be i686.

Select installation directory.

Select the following packages:

Client

gShell

ROOT

xrootd

Installation – Try it out

Page 20: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 20

ROOT compilation with AliEn support

If not done already during your local ROOT installation, you have to enable the AliEn support in ROOT.Go to your $ROOTSYS directory and modify the cfg.sh script (see next slide).Execute the cfg.sh script. This will reconfigure ROOT.Recompile ROOT (do ‘make’ and ‘make map’ in $ROOTSYS). This will take only a few minutes.

Page 21: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 21

Root Configuration: Example script Put the following lines in a file called cfg.sh. #!/bin/sh

ALIEN_ROOT=<prefix>/alien

./configure \ --with-pythia6-uscore=SINGLE \ --enable-cern --enable-rfio \ --enable-mathmore --enable-mathcore --enable-roofit \ --enable-asimage --enable-minuit2 \ --enable-alien \ --with-alien-incdir=${ALIEN_ROOT}/api/include \ --with-alien-libdir=${ALIEN_ROOT}/api/lib

The last three lines are the important ones, which you might have ignored/commented out during the ROOT installation!Change the second line (‘ALIEN_ROOT…’) to point to your AliEn installation directory.

Page 22: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 22

Certificates should be stored under $HOME/.globus

Globus enforces privacy on your private key!(chmod 400)

Authentication – Preparing the certificates

Page 23: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 23

Authentication – Changes in env. variables

This should be your user name!

Page 24: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 24

Authentication command – Username is optional (default is the local username)

Put certificate password

Happens every 24 hours

Authentication – Getting a GRID proxy

Page 25: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 25

Authentication – Getting an AliEn token

Page 26: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 26

Globus related:Permissions on $HOME/.globus/userkey.pem are not private to the user – chmod 400 userkey.pemYour certificate authority is exotic and not known to the server.Your certificate has expired.Clock skew:

• Your local computer time is in the future with respect to the server's time.

• Your local computer time is more in the past than the certificate life time.

Authentication – Authentication problems I

Page 27: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 27

alien-token-init related:You have not gone through all 5 steps of the AliEn user registration.You have not given the AliEn user name as an argument to the token-init command and your local user name is not identical to the AliEn user name.The script wants to bootstrap the installation but you don't have write permissions on the installation path – Avoid bootstrapping by setting the GSHELL_ROOT environment variable.

Authentication – Authentication problems II

Page 28: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 28

Upload your certificates to your machines:Store them under e.g: /afs/cern.ch/user/<u>/<user>/.globus/Check that the key file is read only.

Get the setenv.sh file from the agenda (see below) and place it under e.g. /home/<user>/

Modify it accordingly/

Source it to set up your environment variables.

Get a valid grid proxy.

Get a valid alien token.

Check the information of your proxy/token by typing:

grid-proxy-info

alien-token-info

Agenda: http://indico.cern.ch/materialDisplay.py?contribId=2&amp;materialId=0&amp;confId=14960

Authentication – Try it out

Page 29: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 29

Standard bash shell with grid comandsMain bash features are available.Not all shell helper programs are available.Some local commands (like ls, cat etc) are overwritten with the corresponding GRID commands.File/path tab completion in the virtual GRID directory.

Message of the day.

Shell (1) – Accessing the shell

Page 30: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 30

Tab completion working!!!

Shell (1) – Basic commands I

Page 31: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 31

Shell (1) – Basic commands II

Page 32: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 32

Shell (1) – Basic commands III

Page 33: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 33

Shell (1) – whereis command

Page 34: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 34

Shell (1) – Viewing the files I

Page 35: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 35

Shell (1) – Viewing the files II

Page 36: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 36

Define your preferred editor via the variable EDITOR:'emacs''emacs -nw''xemacs''xemacs -nw''pico''vi' (DEFAULT)'vim'The file is temporary in /tmp on your local disk and then is uploaded once you exit the editor!

Shell (1) – Editing files

Page 37: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 37

Shell (1) – Clear old versions

Page 38: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 38

Access the alien shell.

Check your user name by typing whoami.

List the contents of your home directory.

Check the working directory.

Create the following directory structure in your AliEn space:

$HOME/bin (if it is not there)

$HOME/Tutorial/ESD and $HOME/Tutorial/Kine

$HOME/Tutorial/ESD/output and $HOME/Tutorial/Kine/output

Get the information of the file (whereis): /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/ESD/AliAnalysisTaskPt.cxx

Shell (1) – Try it out

Page 39: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 39

GOLDEN RULEIf you want to access your local directory structure while you

are in the shell you should start by having the prefix “file:”

e.g: cp file:/home/pchrist/gshell.sh gshell.sh

Shell (2) – Copying files from/to the F.C.

Page 40: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 40

MARKUS OLDENBURG AN INTERNAL NOTE

IS ON THE WAY

Shell (2) – File catalogue structure

The path name will be:for ‘real’ data: /data/<Year>/<AcceleratorPeriod>/<RunNumber>/for simulated data: /sim/<Year>/<ProductionType>/<RunNumber>/

Subdirectories will be called:Raw/cond/ reco/<PassX>/ESD/reco/<PassX>/AOD/…

File names will look like this: <xxxx>.AliESD.root

For further information see:http://indico.cern.ch/conferenceDisplay.py?confId=3280http://cern.ch/Oldenburg/MetaData/MetaData.doc

Page 41: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 41

aliensh:[alice] [1] find -x pp

/alice/cern.ch/user/p/pchrista/production/pp/PDC06/*

AliESDs.root > pp.xml

Redirect the output

to

the xml collection.

Shell (2) – Querying the F.C. I

Page 42: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 42

aliensh:[alice] [1] find -x pp

/alice/data/2008/LHC08a/*/reco/Pass3/*

AliESDs.root

Run:collision_system=”pp” and

Run:stop<"2008-03-20 10:20:33" and

Run:start>"2008-03-19" > pp.xml

Shell (2) – Querying the F.C. II

Page 43: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 43

Create the following directory structure locally:

$HOME/AliEn/PDC06/001 and $HOME/AliEn/PDC06/002

$HOME/AliEn/Tags

$HOME/AliEn/Local/ESD and $HOME/AliEn/Local/Kine

$HOME/AliEn/Interactive/ESD and $HOME/AliEn/Interactive/Kine

$HOME/AliEn/Batch

Copy all the files under the AliEn directory /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/ESD/ to your local $HOME/AliEn/Local/ESD

ESD.par - ANALYSIS.par - AliAnalysisTaskPt.h - AliAnalysisTaskPt.cxx - runESDAnalysis.C - demoLocal.C

Shell (2) – Try it out I

Page 44: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 44

Copy all the AliEn files under /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/Kine/ to your local $HOME/AliEn/Local/Kine:

AliAnalysisTaskRLPt.h - AliAnalysisTaskRLPt.cxx - runKineAnalysis.C - demoLocal.C

Copy all the AliEn files under /alice/cern.ch/user/p/pchrist/Tutorial/TAGS/ to your local $HOME/AliEn/Tags:

ESD.par - CreateTags.C - runTagCreator.C

Copy all the root files under /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/001/ and /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/002/ your local $HOME/AliEn/PDC06/001 and $HOME/AliEn/PDC06/002

Shell (2) – Try it out II

Page 45: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 45

Shell (2) – Try it out III

Query the f.c. and get all the tag files (*.tag.root) under: /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/*

Get the output on your terminal.

Redirect the results to the tag10.xml collection: the output will not be stored in your AliEn working directory but rather in your local working directory.

Repeat the previous exercise limiting the number of output files to 5 (find -l 5 ...).

Query the f.c. for all the *Merged*.tag.root files under: /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/ and redirect the result to the tag.xml file.

Exit the shell and copy the xml to your local $HOME/AliEn/Interactive/ESD and $HOME/AliEn/Interactive/Kine.

Page 46: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 46

p+p min bias @ 14TeV --- NEvents ~ 50M:

/alice/cern.ch/user/a/aliprod/prod2006_2/output_pp/ (5.4M)

/alice/sim/2006/pp_minbias/ (~45M)

/alice/sim/2006/pp_x_vertex_1cm/ (1.1M)

/alice/sim/2006/pp_x_vertex_05cm/ (1.1M)

/alice/sim/2006/pp_minbias_full/ (1.1M)• All RUNS have been tested and merged tag files have been

produced at the RUN level for all RunIds.

p+p min bias @ 900GeV --- NEvents = 200K:

/alice/sim/2006/pp_900GeV/• All RUNS have been tested and merged tag files have been

produced at the RUN level for all RunIds.

Muon events --- NEvents = 864K:

/alice/sim/2006/muon/ (64K)

/alice/sim/2006/muon_signle/ (800K)

Production status (= available data)

Page 47: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 47

ROOT – ROOT API

Page 48: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 48

ROOT - Connecting

Page 49: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 49

ROOT – Accessing a GRID file

Page 50: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 50

AliEn software comes with a precompiled library with gcc 3.2.3 which is also shipped with AliEn.

In the latest AliEn version 2.13 it will check automatically for the correct versions (and recompile if necessary). The following steps are not necessary in this case.

Otherwise: if you are using a different version of gcc (check it with gcc –v) then do the following:

cd $ALIEN/api/src ./recompile.gapicd $ALIEN/api/libCopy all the libgapiUI.so.2* files to the libgapiUI.so.3*

Or link your gcc to the version shipped with AliEn and compile everything with this.

ROOT – Problems with gcc versions

Page 51: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 51

Get the alienroot and alienaliroot executables from indico (= the agenda, see slide 28).

Store them under your /home/<username>/bin

Open the setenv.sh file, use it in your own .bashrc (or wherever you set your environment).You might want to modify the path definition:

export PATH=$PATH:$ALIEN/api/bin:$ALIEN/globus/bin:/home/<username>/bin

Once finished, get a token, type alienroot and then:

root [0] TGrid::Connect(“alien://”);

If it works without error messages you have installed everything successfully. If not then go back to the previous pages of this tutorial.

ROOT – Try it out

Page 52: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 52

BACKUP

AliEn Exercises

Page 53: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 53

Go to your $ROOTSYS and change the cfg.sh file – change the location where you installed the grid software (it should be e.g. /home/trn2301/alice/AliEn).

Source the script and then type make and make map.

Write the following script, name it alienroot, make it executable, place it in your $HOME/bin directory and add it

in your $PATH. #!/bin/bashexport ALIEN=/home/trn2301/alienexport ROOTSYS=/home/trn2301/rootexport PATH=$ROOTSYS/bin:$PATHexport LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH:$ALIEN/api/lib

if [ -e /tmp/gclient_env_$UID ]; thensource /tmp/gclient_env_$UID;root.exe $*

fi

ROOT – Try it out I

Page 54: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 54

AliEn Tutorial

Solutions

Panos Christakoglou

University of Athens - CERN

Page 55: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 55

1. Download the installer from the web[bash]$ wget http://alien.cern.ch/alien-installer

2. Make the file executable[bash]$ chmod a+x alien-installer

3. Run the installer[bash]$ ./alien-installer

For the solutions, we assume that the user name is trn2301 with the following attributes:● Local home directory: /home/trn2301● Alien home directory: /alice/cern.ch/user/t/trn2301

change the names accordingly to match your case!!!

Installation – Try it out

[bash]$ --> Your local bash shell[aliensh]$ --> Your alien bash shellNo notation --> inside a file

Page 56: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 56

1. Upload your certificates to your machines[bash]$ scp -r <username>@lxplus.cern.ch:~/.globus .

2. Get a valid token[bash]$ alien-token-init trn2301//the username is optional and should be put if the local username

isn't the same as the alien one

3. Get your proxy info[bash]$ grid-proxy-info

4. Get your token info[bash]$ alien-token-info

[bash]$ --> Your local bash shell[aliensh]$ --> Your alien bash shellNo notation --> inside a file

Authentication – Try it out

Page 57: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 57

1. Access the shell[bash]$ aliensh

2. Check your user name[aliensh]$ whoami

3. List the contents of your alien directory[aliensh]$ ls

4. Check the alien working direcory[aliensh]$ pwd

5. Create the following directory structure in your AliEn space: $HOME/bin (if it is not there) - $HOME/Tutorial/ESD and $HOME/Tutorial/Kine -$HOME/Tutorial/ESD/output and $HOME/Tutorial/Kine/output

[aliensh]$ mkdir -p bin Tutorial/ESD/output Tutorial/Kine/output

6. Get the information of the file: /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/ESD/AliAnalysisTaskPt.cxx

[aliensh]$ whereis /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/ESD/AliAnalysisTaskPt.cxx

[bash]$ --> Your local bash shell[aliensh]$ --> Your alien bash shellNo notation --> inside a file

Shell (1) – Try it out

Page 58: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 58

[bash]$ --> Your local bash shell[aliensh]$ --> Your alien bash shellNo notation --> inside a file

Shell (2) – Try it out I

1. Create the following directory structure locally: $HOME/AliEn/PDC06/001 and $HOME/AliEn/PDC06/002 - $HOME/AliEn/Tags - $HOME/AliEn/Local/ESD and $HOME/AliEn/Local/Kine - $HOME/AliEn/Interactive/ESD and $HOME/AliEn/Interactive/Kine - $HOME/AliEn/Batch

[bash]$ mkdir -p $HOME/AliEn/PDC06/001 $HOME/AliEn/PDC06/002 $HOME/AliEn/Tags $HOME/AliEn/Local/ESD $HOME/AliEn/Local/Kine $HOME/AliEn/Interactive/ESD $HOME/AliEn/Interactive/Kine $HOME/AliEn/Batch

2. Copy all the files under the AliEn directory /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/ESD/ to your local $HOME/AliEn/Local/ESD

[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/ESD/ file:/home/trn2301/AliEn/Local/

Page 59: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 59

[bash]$ --> Your local bash shell[aliensh]$ --> Your alien bash shellNo notation --> inside a file

Shell (2) – Try it out II

3. Copy all the AliEn files under /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/Kine/ to your local $HOME/AliEn/Local/Kine[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/LOCAL/Kine/ file:/home/trn2301/AliEn/Local/

4. Copy all the AliEn files under /alice/cern.ch/user/p/pchrist/Tutorial/TAGS/ to your local $HOME/AliEn/Tags:[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/TAGS/ file:/home/trn2301/AliEn/

5. Copy all the root files under /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/001/ and /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/002/ your local $HOME/AliEn/PDC06/001 and $HOME/AliEn/PDC06/002[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/001/ file:/home/trn2301/AliEn/PDC06/[aliensh]$ cp /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/002/ file:/home/trn2301/AliEn/PDC06/

Page 60: May 23, 20071 ALICE Offline Tutorial Markus Oldenburg – CERN Markus.Oldenburg@cern.ch May 23, 2007 – University of São Paulo.

May 23, 2007 60

[bash]$ --> Your local bash shell[aliensh]$ --> Your alien bash shellNo notation --> inside a file

Shell (2) – Try it out III

7. Query the f.c. and get all the tag files (*.tag.root) under: /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/*[aliensh]$ find -x tag /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/* *tag.root (Get the output on your terminal)[aliensh]$ find -x tag /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/* *tag.root > tag10.xml (Redirect the results to the tag10.xml collection)

8. Repeat the previous exercise limiting the number of output files to 5 (find -l 5 ...).[aliensh]$ find -l 5 -x tag /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/* *tag.root > tag10.xml

9. Query the f.c. for all the *Merged*.tag.root files under: /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/ and redirect the result to the tag.xml file.[aliensh]$ find -x tag /alice/cern.ch/user/p/pchrist/Tutorial/PDC06/* *Merged*tag.root > tag.xml

10. Exit the shell and copy the xml to your local $HOME/AliEn/Interactive/ESD and $HOME/AliEn/Interactive/Kine.[aliensh]$ exit[bash]$ cp tag.xml $HOME/AliEn/Interactive/ESD[bash]$ cp tag.xml $HOME/AliEn/Interactive/Kine