CCNU LHCb computing farm


Contact your supervisor to get an account. About Linux basics and how to log in, see CcnuLhcbShell



  • Usually each user is allocated ~ 1GB disk space for home directory.
  • Bulk data should be put in your personal directory in /DATA
  • There is currently no limit on the CPU, RAM, and data disk usage.



  • ROOT 6.14.04: source /cvmfs/
  • ROOT 6.16.00: source /cvmfs/
  • ROOT 6.18.00: source /cvmfs/

There are other versions, or the same version with different versions of compiler, available. But try to stick to those listed here, as it's cached on CVMFS, meaning: 1) each version will take some cache volume; 2) a new version will be very slow when it's used for the first time. Add your version here if it's not in the above list yet, so the cache can be shared with others.

A tutorial of ROOT can be found in CcnuLhcbRoot

LHCb softwares

source /cvmfs/

How to use Dirac at hepfarm:

source /cvmfs/

source /cvmfs/


lb-run LHCbDirac dirac-bookkeeping-get-files --BK /LHCb/Collision18/Beam6500GeV-VeloClosed-MagDown/RealData/Turbo05/94000000/LEPTONS.MDST --DQFlags=OK --Output=Collision18_MagDown_Turbo05_Leptons.txt

Another way: One can also just setup the LHCb environment by: /cvmfs/ instead of three .sh files. Then the lhcb-proxy-init command should work provided that the certificates are installed correctly.

Access BKK:

The web service of lhcb bookkeepping is not stable recently. There is another way to access it, via command lines, as:

source /cvmfs/

source /cvmfs/

Then, try


if you get problem in this step, which means the grid certification is not correct, therefore, you should download them from your cern account, as

scp -r ~/

The last step :


it takes you ~ 1 mins to open it, depends on your internet speed.


The Urania package can be used to do the PID resampling Link1 link2. The CERN cetificate is necessary for using DataSets in CERN server, so please upload it and the precodures are same as that you've done for CERN server. Do not set any version of ROOT, then the package can be setup by

source /DATA/Install/setEnv/


using the version from LCG_96. Setup the environment:

source /cvmfs/
source /cvmfs/

export G4DATADIR=/DATA/Install/Geant4_data
export G4LEVELGAMMADATA=$G4DATADIR/PhotonEvaporation5.3
export G4RADIOACTIVEDATA=$G4DATADIR/RadioactiveDecay5.3
export G4REALSURFACEDATA=$G4DATADIR/RealSurface2.1.1

And compile one example:

mkdir test_example
cd test_example
cmake -DGeant4_DIR=/cvmfs/ /cvmfs/

And run the example:



This works on lxplus and should also work on other machines as long as the needed CVMFS repositories are installed. You will need to change the versions of packages if you use a different version.

source /cvmfs/
source /cvmfs/
export CXX=`which g++`
export CC=`which gcc`

export GEANT4DIR=/cvmfs/
mkdir B1_build
cd B1_build/
cmake -DGeant4_DIR=/cvmfs/ /cvmfs/



on hepfarm03 source /DATA/Install/setups/


The hep_ml package can be found by the Github,hep_ml

Example of GB weight

The error occours when the GB reweight is performed on hepfarm03 :

import _tkinter # If this fails your Python may not be configured for Tk
ImportError: cannot open shared object file: No such file or directory

It can be fixed by adding the following lines :

import matplotlib

Two examples are attched at the bottom table, and gbweight.tar,where the first one is a simple example and the second one needs more knowledge of Python but is much more convenient and useful.

Example of uBoost

Before you use the codes, please note that the signal and background training root files should be merged into one file and tagged by an extra variable, such as the variable named as 'labels' with value 0,1 for each sample.

Gauss simulation

Setup the environment & Install the Gauss package

Example for GaussDev _v49r12

LbLogin -c x86_64-slc6-gcc49-opt 
lb-dev Gauss/v49r12
cd ./GaussDev_v49r12
git lb-clone-pkg  Gen/DecFiles 
make install

About how to add a decay file. You can refer to this site:

Gauss simulation in the grid

cd GaussDev_v49r12
LbLogin -c x86_64-slc6-gcc49-opt 
./run bash
vi ./

Now, you need a ganga script to submit it. Here I have an example: /afs/

A Partial Wave Analysis program using Tensorflow(TFPWA)

This is a package and application for partial wave analysis (PWA) using TensorFlow. By using simple configuration file (and some scripts), PWA can be done fast and automatically.



Environment setting

git clone

GPU node(gpu6):

creat a new conda env
cd tf-pwa
conda config --add channels jiangyi15
conda install tf-pwa

CPU node(hepfarm,comput)

creat a new conda env
cd tf-pwa
conda config --add channels jiangyi15
conda install tf-pwa
conda install --file tensorflow_2_6_requirements.txt -c conda-forge

Mac M1 ROOT + Python(Gbreweight) + tensorflow(gpu) + TFPWA env set

Please check Command Line Tools for Xcode version <= 13.0, if not, please install Command_Line_Tools_for_Xcode_13.dmg Passwd:8iip

#install conda
chmod +x ~/Downloads/
sh ~/Downloads/
#install M1 tensorflow
creat a new conda env
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal
#install ROOT
conda install root -c conda-forge
#install TFPWA
git clone
cd tf-pwa
cp tensorflow_2_6_requirements.txt aaa.txt
Delete the first three lines of aaa.txt
conda install --file aaa.txt -c conda-forge
#install gbreweight dependence
pip install root_numpy
conda install hep_ml
conda install ***package***



texlive2020 has been installed for the server, comput . To use it, edit the file ~/.bashrc by adding the following sentences :

PATH=/home/lhcb/softwares/texlive/2020/bin/x86_64-linux:$PATH; export PATH
MANPATH=/home/lhcb/softwares/texlive/2020/texmf-dist/doc/man:$MANPATH; export MANPATH
INFOPATH=/home/lhcb/softwares/texlive/2020/texmf-dist/doc/info:$INFOPATH; export INFOPATH

to be added

Known issues


Some words for students

Before you ask the questions, please learn to use and understand the codes by yourself, find and fix bugs of codes by yourself, and even rewrite the codes to make them more convinient to use. Then remember to update twiki by yourself. Always keep it in the mind that it's useless and helpless to improve our skills, thoughts and abilities if we only know how to use the codes rather than understand them.

Other useful computing resources

  1. IHEP cluster. Contact your supervisor for an account.
  2. CERN box proved 1 TB for each registered user
  3. CERN GitLab for code versioning. Github and GitLab are good alternatives if you don't have a CERN account.
  4. For instant messaging, Mattermost is provided by CERN, and alternatives include gitter. Both of them have markdown support allowing you to have pretty math formula. Skype is also popular in HEP community.
  5. The SWAN project provides you a computing environment using Jupyter notebook with CERN box directly accessible.
  6. The WSL (Windows subsystem Linux) can enable you to run Ubuntu and a few other distributions as a subsystem in Windows 10. You can turn it on following these instructions -- there are more than one way -- you probably can find more up to date instructions from a search engine. And for graphic server, Xming could be used.
  7. CERN openstack service can provide up to 10 vCPU for each user for "private" projects.
  8. Some examples of LHCb software including EPM, Davinci, Gauss, PIDCalib and TMVA

for users

How to change your password

You can change your passwd on hepfarm02 by yppasswd

For administrator

How to configure the banner (on SLC6)

Edit the file: /etc/ssh/sshd_config to give the banner location:

# no default banner path
#Banner none
Banner /etc/mybanner

And put the content to /etc/mybanner. And then restart the sshd

service sshd restart


How to add new users

Follow these steps:

  1. Login hepfarm02 as root;
  2. Run the command `useradd -g lhcb -c "Full Name" XXXX`, where XXXX is the desired login;
  3. Run `passwd XXXX` to have the new user set his/her password. If the passwd is not set by user. A temeray password could be used and one should use `passwd -e XXXX` to force the user to change his/her passwd when logging in for the first time.
  4. make -C /var/yp
  5. Might need to restart the services:
/etc/init.d/ypserv restart
/etc/init.d/yppasswdd restart


  • It seems impossible to create the user home directory from hepfarm03 -- to be confirmed;
  • It seems the NIS system will automatically update the /etc/passwd file in hepfarm03 fairly fast, thus nothing need to do but wait for a while to be able to login hepfarm03. To be confirmed too.


  • How to change one's default shell?

How to disable user login

By changing the login shell of the user:

sudo chsh -s /sbin/nologin <username>

How to mount comput19 directories

Using sshfs:

sudo sshfs -o allow_other,default_permissions,IdentityFile=~/.ssh/id_rsa ~/links/ccnuC -p xxxx


fusermount -zu /home/dzhang/links/ccnuC


CcnuTeaching CCNULHCbFarm2

-- DongliangZhang - 2019-04-16

Topic attachments
I Attachment History Action Size Date Who Comment
Unix shell scriptsh r1 manage 54064.9 K 2021-12-16 - 02:55 ShiyangLi  
Compressed Zip archivetar gbweight.tar r1 manage 20.0 K 2019-05-01 - 03:35 WenhuaHu example of GB reweight
Texttxt r1 manage 3.9 K 2019-05-01 - 03:35 WenhuaHu example of GB reweight
Compressed Zip archivetar uBoost.tar r1 manage 340.0 K 2019-06-26 - 09:56 WenhuaHu example of uBoost
Edit | Attach | Watch | Print version | History: r38 < r37 < r36 < r35 < r34 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r35 - 2022-01-19 - HangYin
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback