I am assuming that you have Linux installed on your system. Make yourself familiar with some basic Linux commands before going ahead.
Miniconda is a tool that helps you install and manage software, especially Python packages, by creating isolated environments. This keeps your main system clean and makes sure everything works smoothly. It’s particularly useful when setting up tools like ROOT because it handles all the necessary dependencies and prevents conflicts with other software.
curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.shFollow the prompts to complete the installation. When terms and conditions show up (which nobody reads!) press Q to skip. Keep the path as default, and type 'yes' when it asks to load on startup. Once done, restart the terminal. If everything is done correctly, your terminal prompt should say
(base)
in the beginning.
More information on managing miniconda environments can be found here.
ROOT is a powerful data analysis framework commonly used in experimental particle physics. It provides essential tools for data processing, statistical analysis, and visualization, making it ideal for handling large datasets from experiments such as those at the Large Hadron Collider. ROOT enables physicists to manage complex data, create visual plots, fit models, and perform advanced statistical analyses, making it a crucial tool in the field of particle physics.
To install ROOT, visit the official ROOT website (build from source). There, you will find detailed instructions on how to build and install for linux. Make sure that you have installed the dependencies first (including git).
Jupyter Notebook is an interactive web application that lets you create and share documents with live code, visualizations, and text (just like Google Colab, except it runs on your local machine). Make sure to install jupyter in the conda environment in which ROOT was installed (base environment from the previous instructions) to ensure its compatibility with ROOT. If it's not base environment, activate the same environment in which ROOT was built.
conda activate base #or any other environment in which ROOT was built conda install jupyter
The .bashrc
file is a configuration script that runs each time you start a new terminal session in Linux or macOS. It helps set up
your shell environment by defining settings, functions, and shortcuts. Be careful while editing this. One useful feature in
.bashrc
is creating aliases - shortcuts that replace long commands with simpler ones. The following are common aliases that I like.
Feel free to copy them and put them in your .bashrc
(completely optional).
#Prompt asks for confirmation before running the following: alias mv='mv -i' alias cp='cp -i' alias rm="rm -i" #Running ROOT without the web-browser (with TBrowser): alias root="root --web=off" #Changing the text and the color displayed at the prompt (for WSL): PS1='\[\033[0;34m\]custom_name:\w\[\033[0m\]>>'
Windows Subsystem for Linux (WSL) is a feature in Windows that allows users to run a Linux environment directly on their Windows machine without needing a virtual machine or dual-boot setup. WSL provides a compatibility layer that translates Linux system calls into Windows system calls, with WSL 1 using this translation and WSL 2 running a real Linux kernel in a lightweight virtual machine for better performance and compatibility. It integrates tightly with Windows, allowing access to the Windows file system, interoperability between Linux and Windows applications, and shared networking. This makes it easy for developers and users to run Linux tools and commands alongside their Windows applications seamlessly, without rebooting.
To activate Windows Subsystem for Linux (WSL) and update the kernel using the Windows GUI, follow these steps:
wsl --set-default-version 2
sudo apt-get update # finds all the upgradable packages sudo apt-get upgrade # downloads and installs all the upgradable packages
To configure Windows Terminal to open a specific Linux distribution by default, follow these steps:
After selecting the default profile, the changes are automatically saved. You can close the settings tab. To verify, close and reopen Windows Terminal. It should now open directly to the selected Linux distribution by default.
You can follow the rest of the instructions using the Windows terminal running linux. To set up your work environment, start with installing Miniconda and follow the rest of the instructions.
Once you are familiar with basic linux commands, add the following useful lines to the .bashrc
file.
#Pointing jupyter notebook to the right browser: alias notebook="BROWSER=/mnt/c/Program\ Files\ \(x86\)/Microsoft/Edge/Application/msedge.exe jupyter notebook --NotebookApp.use_redirect_file=False" #Opening the present working directory using the Windows file manager: alias openpwd="/mnt/c/Windows/explorer.exe ." #Making sure that the duplicate tab opens in the same working directory: PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND; "}'printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"'
Once you are registered in the CERN Human Resource database, your Primary CERN Account, CERN e-mail address & mailbox are created automatically. Instructions about the next steps will be emailed there. The following list contains some useful links for account and services management.
Once, your CERN account is active, you will have to generate a certificate. CERN Grid certificates are digital credentials used to authenticate
and securely access CERN's computing resources. You can generate the certificate
here. Follow the on-screen instructions and give the certificate file a
passowrd. The certificate file is a .p12
file, which expires in a year. It's important to keep this file safe and backed up, as it
serves as your digital identity for accessing CERN's grid services.
I am listing the important links related to certificates below.
To integrate the certificate into a web browser, follow these steps:
.p12
certificate file to your computer..p12
file and follow the prompts, including entering the password set during certificate generation.After importing, the browser will use the certificate for authenticating with CERN services, allowing you to securely access required resources such as CMS-DAS and other internal pages. If the browser says Your connection isn't private .. for cmsweb pages, you can do Advanced > Continue to cmsweb.cern.ch (unsafe) for access. A browser-window will pop-up where you have to select the CERN certificate for processing further.
To setup the certificate on the user interface from where you have to work you should follow these steps.
.globus
directory of your home area. If the directory doesn't exist, create it first. If
any old certificate files already exist, remove them.
cd ~ mkdir .globus cd ~/.globus mv /path/to/mycert.p12 . #Remove existing certificates (if any) rm -f usercert.pem rm -f userkey.pem
openssl
to create the keys, and make them read-only using chmod
. This step asks for the password to decrypt the
.p12
file. Then, it asks the user to create a new PEMl password [important], which is required to use the certificate while
working with the grid.
openssl pkcs12 -in mycert.p12 -clcerts -nokeys -out usercert.pem openssl pkcs12 -in mycert.p12 -nocerts -out userkey.pem chmod 400 userkey.pem chmod 400 usercert.pem
voms-proxy-init --rfc --voms cms -valid 192:00