Getting started 
Setup the repo 
If you haven't already installed julia, you should first checkout the julia install section.
First time setup 
Clone the git repo:
git clone ssh://git@gitlab.cern.ch:7999/tla-atlas-run3/BjetTLA.jl.gitThen, move inside the repo directory and start julia with the --project flag:
cd BjetTLA.jl
julia --projectThis will launch a Julia REPL (Read-Eval-Print Loop) activating the project in current directory, defined by the Project.toml file.
At Julia REPL prompt, press ] once to enter Pkg mode and run:
(@BjetTLA) pkg> instantiateThis will download and precompile all the dependencies needed by this project. It might take a while. Once done, you can exit the Pkg mode pressing the ←Backspace button.
Now you should be able to load and use the BjetTLA functions with e.g.:
julia> using BjetTLA
julia> hists = BjetTLA.loop_one_proc("mRp150", BjetTLA.main_task; scouting=false);
[ Info: Try to use: /data/jiling/TLA/eos_ntuples/mc23d/Zprime_bb/nv8/user.sfranche.510393.MGPy8EG_S1_qqa_Ph25_mRp150_gASp1_qContentB.e8523_s4159_r16102.nv8_tree.root/merged.root
julia> histbundle_proc[end].dijet_mass |> integral
0.09370894432121052
julia> (histbundle_proc[end].dijet_mass |> integral) * BjetTLA.run2023_lumi
2414.645222796792On every session 
On every new terminal, to run the code in the REPL, the flag --project has to be used when starting julia from the repo's root directory (see above).
When running instead a jupyter notebook, it's possible to activate the project with:
using Pkg
Pkg.activate("..")  # Assuming we are in /notebooks the folder
using BjetTLAJulia install 
You can get a julia installation via the juliaup installer. This will download and setup the binaries needed for julia. On LXPLUS machines, or more in general, on linux or mac you just have to run
curl -fsSL https://install.julialang.org | shNote
This will create the folder ~/.julia and setup the installation at that location. Juliaup will also edit your ~/.bashrc and ~/.bash_profile adding the */bin/julia executable in your PATH.
CERN LXPLUS instruction 
By default, Julia caches compiled binary under ~/.julia/ folder. This becomes a problem for the very limited AFS home directory space. To change this, add to your ~/.bashrc file:
export JULIA_DEPOT_PATH=/eos/home-<u>/<usr>/.julia/Remember to source the ~/.bashrc again or re-login the session for the changes to take effect.
Note
Julia is also available via LCG, but using the central installation can be sometimes limiting (e.g. installing custom jupyter kernels) and it's not always up to date.
Setting up jupyter notebooks 
With IJulia we have jupyter kernels running julia-language backend. Via the Pkg manager you just have to execute:
(@v1.10) pkg> add IJuliaNow, when starting a jupyter session, you should see the possibility to start julia notebooks. You can also add custom kernels e.g. for running with multi-threads.
using IJulia
julia> installkernel("Julia (4 threads)", env=Dict("JULIA_NUM_THREADS"=>"4"))(Be mindful of resource usage, if you're running on shared nodes...)
Jupyter on LXPLUS (and other clusters) 
We can run jupyter also via ssh tunnel, instead of using swan. To do it, of course you need first to install jupyter (if you dont have it yet) on lxplus:
pip install jupyterlabThen, you should make sure that you're fowaridng a newtork port when connceting via ssh. This can be done by editing - on your laptop - the .ssh/config file and specify the 'LocalForward':
HOST lxplus9
    HostName LXPLUS9.CERN.CH
    ...
    LocalForward 1234 localhost:1234Now, from a terminal connected to lxplus, you should start jupyter adding the flags:
jupyter-lab --port=1234 --no-browserOnce the kernel sarts, you should be able to see something similar to:
...
[C 2024-05-23 19:06:45.333 ServerApp]
To access the server, open this file in a browser:
        file:///afs/cern.ch/user/s/sfranche/.local/share/jupyter/runtime/jpserver-1619301-open.html
    Or copy and paste one of these URLs:
        http://localhost:1234/lab?token=e97fbf2299c7f0a71ef70cef0105ddc49e23f230ac9da7d3
...You can now copy paste the URL starting with http://localhost:1234/ in your local browser and enjoy yourjupyter session.
Jupyter on AF UChicago 
When configure Jupyter notebooks, simply select ml-platform:julia as the image. The source Dockerfile can be found here.