-
Notifications
You must be signed in to change notification settings - Fork 9
Installation
- Clone the analysis repository :
- either, go to your
github
and fork the DesyTau/CPinHToTauTau and (/or) the uhh-cms/cmsdb (not necessary though) repositories. Then clone using https/ssh :
[https] git clone --recursive https://github.com/<your_git_username>/CPinHToTauTau.git
[ssh] git clone --recursive [email protected]:<your_git_username>/CPinHToTauTau.git
- or,
git clone
directly
git clone --recursive https://github.com/DesyTau/CPinHToTauTau.git
- Then set
cmsdb
as follows:
If you have not forked the
cmsdb
, you can do the following
cd CPinHToTauTau/modules/cmsdb
git checkout master
git remote remove origin
git remote add desytau https://github.com/DesyTau/cmsdb.git
git remote add upstream https://github.com/uhh-cms/cmsdb.git
else, in addition, inside
CPinHToTauTau/modules/cmsdb
, do
git remote add origin <link_to_your_forked_repo>
- Check if everything is in place by:
git remote -v
You should see something like this:
desytau https://github.com/DesyTau/cmsdb.git (fetch)
desytau https://github.com/DesyTau/cmsdb.git (push)
origin <link_to_your_forked_repo> (fetch) # if use forked repo remote
origin <link_to_your_forked_repo> (push) # if use forked repo remote
upstream https://github.com/uhh-cms/cmsdb.git (fetch)
upstream https://github.com/uhh-cms/cmsdb.git (push)
- Besides, you need to pull the current
cmsdb
version fromDesyTau/cmsdb
:
git pull desytau master
You may encounter some conflicts between
DesyTau/cmsdb
anduhh-cms/cmsdb
that need to be resolved each time you pull... it is what it is! In case, if you do not see the conflicts, you can usegit pull desytau master --no-ff
... resolve the conflicts manually andcmsdb
done !
- Everything should be in a good shape now, go back to your local
CPinHToTauTau
repository:
cd ../..
# run the setup.sh.
# warning!!! want to use ROOT / SVFit / FastMTT? Do not source the environment here !!! skip this step ...
source setup.sh <your_favorite_name> e.g. babushcha
# Please follow the instructions below
Enjoy your perfectly github-linked local repository π₯
You have to install ClassicSVfit
first. The ClassicSVFit package is used for di-tau mass reconstruction.
Version used : fastMTT_19_02_2019
.
Installation path in the analysis:
cd modules
mkdir extern
cd extern
Installation instructions:
The installation is done without CMSSW
because of incompatibility of Columnflow
(using gfal
) and CMSSW
. It is possible to build the software without CMSSW
framework if the following prerequisites are satisfied (oldest software version the instructions were tested with):
ROOT (6.10/3 or newer)
GCC (6.3 or newer)
In order to install the code, execute:
# git clone https://github.com/SVfit/ClassicSVfit TauAnalysis/ClassicSVfit -b fastMTT_19_02_2019
git clone https://github.com/oponcet/ClassicSVfit.git TauAnalysis/ClassicSVfit -b fastMTT_19_02_2019
# It will become the same as the above commented line after a PR
export LIBRARY_PATH=$LIBRARY_PATH:$PWD/TauAnalysis/ClassicSVfit/lib
make -f TauAnalysis/ClassicSVfit/Makefile -j4
You can try running SVFit with :
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/TauAnalysis/ClassicSVfit/lib
./TauAnalysis/ClassicSVfit/exec/testClassicSVfit
If everything goes right, this should produce a root file.
In order to use ClassicSVFit
in Columnflow
, the pybind11 wrapper has been used. The wrapper for the different classes can be found here : pybind_wrapper.cpp [the last link will be updated soon]
The cloned ClassicSVFit
already contains the pybind11
and the wrapper
itself. A few more things to modify [hard-coded, please be patient !!!]
open TauAnalysis/ClassicSVfit/wrapper/CMakeList.txt
change L10 and L33
Now, this wrapper needs to be compiled with :
export LIBRARY_PATH=$LIBRARY_PATH:$PWD/TauAnalysis/ClassicSVfit/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/TauAnalysis/ClassicSVfit/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/lib/
cmake -S TauAnalysis/ClassicSVfit/wrapper/ -B TauAnalysis/ClassicSVfit/wrapper/
make -C TauAnalysis/ClassicSVfit/wrapper/
It should produce a .so
file which can be used as a module in Columnflow
. For example you can import it like :
from modules.extern.TauAnalysis.ClassicSVfit.wrapper.pybind_wrapper import *
Before starting each session and before configuring your ColumnFlow
setup, ensure that you import the necessary library. For ROOT
, if you're working in lxplus
, you can execute the following command:
LD_LIBRARY_PATH=/usr/local/lib
CPPYY_BACKEND_LIBRARY=/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/lib/libcppyy_backend3_9.so
source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/bin/thisroot.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/lib/
source setup.sh enveos
CPPYY_BACKEND_LIBRARY=/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/lib/libcppyy_backend3_9.so
source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/bin/thisroot.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/lib/
and then in one of your producer/selector/calibrator, import the ROOT module :
root = maybe_import("ROOT")
You can check if the module has succesfully been imported by just printing :
print("root module : ", root)
Then you can simply use it to plot some awkward
array like :
# Convert your awkward array to numpy array :
leps1_mass = ak.to_numpy(leps1["mass"])
# Create a TH1D histogram for metx
hist1 = root.TH1D("hist_mass_leps1", "mass", 50, 0, 5)
# Fill the histogram with metx values
for mass in leps1_mass: hist1.Fill(mass)
# Draw the histogram
hist1.Draw()
# Save the histogram in a root file
root_file = root.TFile("hist_mass1.root", "RECREATE")
hist1.Write()
root_file.Close()
See example of a producer using ROOT : svfit.py
Do the following before starting each session :
LD_LIBRARY_PATH=/usr/local/lib
CPPYY_BACKEND_LIBRARY=/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/lib/libcppyy_backend3_9.so
source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/bin/thisroot.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/modules/extern/TauAnalysis/ClassicSVfit/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/lib/
export LIBRARY_PATH=$LIBRARY_PATH:$PWD/TauAnalysis/ClassicSVfit/lib
source setup.sh hcp
CPPYY_BACKEND_LIBRARY=/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/lib/libcppyy_backend3_9.so
source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/bin/thisroot.sh
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/modules/extern/TauAnalysis/ClassicSVfit/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.30.04/x86_64-centosstream9-gcc113-opt/lib/
export LIBRARY_PATH=$LIBRARY_PATH:$PWD/TauAnalysis/ClassicSVfit/lib