Difference between revisions of "LHCb Software At Nikhef: Prepare for Workshop 22-24 June 2009"

From LHCb Wiki
Jump to navigation Jump to search
Line 3: Line 3:
 
The B-Fys workshop will not take place at a high energy physics lab. For these reasons, it is recommended that people install a virtual machine on their laptops in order to be able to run LHCb software locally, without necessity of an internet connection. Whereas this is not a "standard" way of performing analysis at the moment, it might be beneficial to set this up anyway. In what follows, there are explanations on how to run either with an internet connection to nikhef, or with a local virtual machine. Once the installation has been done and the environment set correctly, running on the virtual machine should be the same as running at Nikhef.
 
The B-Fys workshop will not take place at a high energy physics lab. For these reasons, it is recommended that people install a virtual machine on their laptops in order to be able to run LHCb software locally, without necessity of an internet connection. Whereas this is not a "standard" way of performing analysis at the moment, it might be beneficial to set this up anyway. In what follows, there are explanations on how to run either with an internet connection to nikhef, or with a local virtual machine. Once the installation has been done and the environment set correctly, running on the virtual machine should be the same as running at Nikhef.
  
Gaudi Tutorial
+
Gaudi [https://twiki.cern.ch/twiki/bin/view/LHCb/LHCbSoftwareTrainingBasicsTutorial Basics]
  
 
Bender [http://www.nikhef.nl/pub/experiments/bfys/lhcb/computing/20080522_NIKHEF_Bender-Tutorial.pdf Tutorial]
 
Bender [http://www.nikhef.nl/pub/experiments/bfys/lhcb/computing/20080522_NIKHEF_Bender-Tutorial.pdf Tutorial]

Revision as of 11:52, 18 June 2009

Introduction

The B-Fys workshop will not take place at a high energy physics lab. For these reasons, it is recommended that people install a virtual machine on their laptops in order to be able to run LHCb software locally, without necessity of an internet connection. Whereas this is not a "standard" way of performing analysis at the moment, it might be beneficial to set this up anyway. In what follows, there are explanations on how to run either with an internet connection to nikhef, or with a local virtual machine. Once the installation has been done and the environment set correctly, running on the virtual machine should be the same as running at Nikhef.

Gaudi Basics

Bender Tutorial

Running at Nikhef

Logon at Nikhef

ssh user@ribble.nikhef.nl
ssh stbc-16   (on stoomboot)

Set the environment

Here we set the environment for DaVinci, but it could also another LHCb application, like Bender or Panoramix.

mkdir cmtuser
cd cmtuser
source /project/bfys/lhcb/sw/setup.sh   # for sh, bash, ksh, zsh
source /project/bfys/lhcb/sw/setup.csh  # for csh, tcsh
SetupProject --build-env DaVinci v23r1 # makes a DaVinci_v23r1 directory if one doesn't already exist
SetupProject DaVinci v23r1 # exports environment variables to the shell

(NB: zsh-users should add 'setopt SH_WORD_SPLIT' to their .zshrc )

Running on a virtual machine on your very own laptop

This assumes you have successfully installed a CernVM on your computer. The installation varies between Windows, Mac OS and Linux, so see section further down for instructions on how to set it up. It also assumes you have set up basic login scripts, and installed AFS, X11R6, CVS and SVN if necessary. Also note that you have to run an application like DaVinci, Bender or Panoramix at least once while connected to the network in order to cache the necessary software.

Log onto your CernVM

This could mean starting the virtual machine and CernVM, starting it and logging in "remotely" from a terminal (Linux, Mac) or Exceed (Windows). Linux/Mac login

ssh -Y -p 2222 CernVMUserName@localhost

Windows login

Start exceed
Start ssh
Connect to vm with ssh to 192.168.204.128
     (Your number might be different!)
     (fink tunnel x11 connections in ssh!)

AFS access

If you need access to CERN AFS areas,

klog user@CERN.CH

Where user is your CERN AFS username. Note the UPPER CASE for the domain name. Be careful: Never do: ls /opt/ !! (It could start caching all atlas software...).

Set the environment

This is the same as in the remote login to Nikhef, except that the LHCb environment should be set when you log in if you have set up your CernVM correctly.

SetupProject --build-env DaVinci v23r1 # makes a DaVinci_v23r1 directory if one doesn't already exist
SetupProject DaVinci v23r1 # exports environment variables to the shell

The main difference here is that if you do not have the necessary software installed, CernVM will pull it and cache it for you. So the first time you do this you should have an interned connection.

Running over some events on a DST or MicroDST

After the environment has been set (either by remote login to Nikhef or CERN, or in the local CernVM on your laptop, we can start some simple analysis:

Get a nice package full of example scripts (new Bender Examples package exists too...)

If you haven't already got an examples package, get it, as you might need to perform modifications to some of the scripts. This has to be done when you have access to the internet.

getpack -p anonymous Ex/MicroDSTExample v2r5
cd ~/cmtuser/DaVinci_v23r1/Ex/MicroDSTExample/scripts
python -i MicroDSTReadingExample.py --input /data/bfys/h71/Workshop/SeqDC06selBs2JpsiPhiWithMC_50.0_Kevt_NoPVReFit.dst

Plot some of the histograms made by the script

>>> massPlots[443].plot()
>>> massPlots[531].plot()
>>> massResPlots[531].plot()
>>> propTimePlots[531].plot()
>>> Ctrl-D

Some more examples, using Gaudi or Bender environments and example scripts. Note we run them directly without getpacking them.

SetupProject Gaudi v21r0
python $GAUDIEXAMPLESROOT/python/HistoEx.py
SetupProject Bender v12r0
cd $BENDEREXAMPLEROOT/python/BenderExample/
./Phi.py

Introduction to Python

It is important that attendees make themselves familiar with the python programming language, at least at the level of writing simple scripts.

Extensive tutorial: Tutorial

Cheat Sheet: Cheat Sheet


/user/h71> python
>>> hello = "Hello world"
>>> print hello
>>> Ctrl-D