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 45: Line 45:
 
== Introduction to Python ==
 
== Introduction to Python ==
  
 +
<pre>
 
It is important that attendees make themselves familiar with the python programming language, at least at the level of writing simple scripts.
 
It is important that attendees make themselves familiar with the python programming language, at least at the level of writing simple scripts.
[http://doc.python.org/tutorial Tutorial]
+
 
 +
Extensive tutorial: [http://doc.python.org/tutorial Tutorial]
 +
 
 +
 
 +
<pre>
  
 
== Install a Virtual Machine on laptop (windows): CernVM ==
 
== Install a Virtual Machine on laptop (windows): CernVM ==

Revision as of 09:36, 17 June 2009

Your first time to run over a MicroDST at Nikhef

Prepare ssh on your Nikhef account

Follow these instructions: Configuring SSH access from Linux/Unix

Logon at Nikhef

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

Get software packages

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
getpack --user=CERNUSERNAME Ex/MicroDSTExample jpalac_20090610_1

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

Loop over events

SetupProject DaVinci v23r1
cd ~/cmtuser/DaVinci_v23r1/Ex/MicroDSTExample/python
python -i MicroDSTReadingExample.py --input /data/bfys/h71/Workshop/SeqDC06selBs2JpsiPhiWithMC_50.0_Kevt_NoPVReFit.dst

Plot

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

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: [http://doc.python.org/tutorial Tutorial]


<pre>

== Install a Virtual Machine on laptop (windows): CernVM ==

See talk by Pere Mato, slide 14:
[http://indico.cern.ch/conferenceDisplay.py?confId=52399 17 March 2009]

CernVM beginner's guide:
[https://twiki.cern.ch/twiki/bin/view/Atlas/CernVMGuideDetail CernVM beginner's guide]


''' 1a) Download VMware player under Windows '''

Download vmware player [http://www.vmware.com/download/player/ here]
<pre>
Unzip and put CernVM in fixed place. For example C:\Program Files\CernVM
Start vmplayer from desktop
Open CernVM from C:\Program Files\CernVM
Open in browser: http://192.168.204.128:8004/
                 (your number might be different!)
Create account. For example: use lxplus username and password
Virtual organization: lhcb
Change memory allocation in vmware player
  -> troubleshoot
     -> change memory allocation
         -> 1024 MB

1b) Download VMware player under MAC

1c) Download VMware player under Linux


2) Start CernVM

Follow CernVM beginner's guide step by step: CernVM beginner's guide

3) Start Exceed + SSH

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!)

4) Configure CernVM

(once for configuring cernvm:)
back to instructions afs
sudo conary update openafs=1.4.8-1-1
sudo conary update openafs-client=1.4.8-1-1
sudo conary update openafs-kernel=1.4.8-1-1
sudo /etc/init.d/afs start

5) CernVM session on ssh

Never do: ls /opt/ !! (It could start caching all atlas software...)

kinit user@CERN.CH (capitals!)
cd /opt/lhcb
source /opt/lhcb/LbLogin.csh
SetupProject Gaudi v21r0
python $GAUDIEXAMPLESROOT/python/HistoEx.py
SetupProject Bender v12r0
cd $BENDEREXAMPLEROOT/python/BenderExample/
./Phi.py

6) Create shared data folder on your laptop

Make folder C:\Data
Change properties of C:\Data
   -> sharing
     -> network sharing without wizard
       V share
          name: Data
       V allow 
Edit the 2kB VMware configuration file (in C:\Program Files\CernVM\ ) and add:

sharedFolder.maxNum = "1"

sharedFolder0.present = "TRUE"
sharedFolder0.enabled = "TRUE" 
sharedFolder0.readAccess = "TRUE"
sharedFolder0.writeAccess = "TRUE"
sharedFolder0.hostPath = "C:\Data"
sharedFolder0.guestName = "data"
sharedFolder0.expiration = "session"

usb.autoConnect.device1 = ""

NB: after editing the configuration file, restart VMware Player
In VMware:
  -> Share folders
     -> o always enabled
Add the following line to /etc/fstab:
sudo emacs -nw /etc/fstab
     .host:/ /mnt/hgfs vmhgfs defaults 0 0

sudo ln -s /usr/sbin/mount.vmhgfs /sbin

I edited Phi.py and put input data location: /mnt/hgfs/data/Bs2DsK_1.dst )
Data can be found here:
/afs/cern.ch/lhcb/group/calo/ecal/vol10/DATA
(or ask Niels or Vanya for a copy...)

Once everything is installed... Start CernVM

Start VMware Player (don't select 'Open', but 'Recent')

Login to your CernVM with your SSH.

source /opt/lhcb/LbLogin.csh
SetupProject Bender v12r0
./Phi.py

root 
TBrowser f
.q