Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "wrapper/pybind11"]
path = wrapper/pybind11
url = https://github.com/pybind/pybind11.git
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In order to install the code, execute:
cmsrel CMSSW_9_4_4
cd CMSSW_9_4_4/src
cmsenv
git clone https://github.com/SVfit/ClassicSVfit TauAnalysis/ClassicSVfit -b fastMTT_19_02_2019
git clone --recursive https://github.com/SVfit/ClassicSVfit TauAnalysis/ClassicSVfit -b fastMTT_19_02_2019
git clone https://github.com/SVfit/SVfitTF TauAnalysis/SVfitTF
cd $CMSSW_BASE/src
scram b -j 4
Expand Down Expand Up @@ -51,6 +51,22 @@ If everything goes right, this should produce a root file.

### `ClassicSVFit/FastMTT` in `Python` from C++ needs a *Wrapper* 🎁


#### Installation of pybind11:

Tested with pybind11 v2.13.0 dev1.

Git clone pybind11 module in `/wrapper` if `--recursive` is not used, and then compile:

```bash
git submodule add [email protected]:pybind/pybind11.git
mkdir build
cd build
cmake ..
make check -j 4
```


TThis wrapper has been developed with the purpose of using it with the [ColumnFlow](https://columnflow.readthedocs.io/en/latest/) columnar Python-based framework. In order to use `ClassicSVFit` in Python, the [pybind11](https://pybind11.readthedocs.io/en/stable/basics.html) wrapper has been used. The wrapper for the different classes can be found here : [pybind_wrapper.cpp](https://github.com/oponcet/ClassicSVfit/blob/fastMTT_19_02_2019/wrapper/pybind_wrapper.cpp).

The cloned `ClassicSVFit` already contains the `pybind11` and the `wrapper` itself. A few more things to modify [hard-coded, please be patient !!!]
Expand All @@ -70,3 +86,32 @@ It should produce a `.so` file which can be used as a module in Python. For exam
```py
from modules.extern.TauAnalysis.ClassicSVfit.wrapper.pybind_wrapper import *
```


### Wrapper example :

You can run the example of fasttMTT, but before you need to export the right library like

```bash
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:yourpath/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
```

The try running the python example `[`svfit_wrapper_example.py`](wrapper/svfit_wrapper_example.py)`:

```bash
python3 svfit_wrapper_example.py
```

>output should looks like:
```bash
tau1P4mtt : Name: TLorentzVector Title: A four vector with (-,-,-,+) metric
tau1P4mtt : Name: TLorentzVector Title: A four vector with (-,-,-,+) metric
ditauMass : 105.58224459511314
```


1 change: 1 addition & 0 deletions wrapper/pybind11
Submodule pybind11 added at f33f6a
35 changes: 0 additions & 35 deletions wrapper/pybind11/.appveyor.yml

This file was deleted.

38 changes: 0 additions & 38 deletions wrapper/pybind11/.clang-format

This file was deleted.

77 changes: 0 additions & 77 deletions wrapper/pybind11/.clang-tidy

This file was deleted.

73 changes: 0 additions & 73 deletions wrapper/pybind11/.cmake-format.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions wrapper/pybind11/.codespell-ignore-lines

This file was deleted.

1 change: 0 additions & 1 deletion wrapper/pybind11/.gitattributes

This file was deleted.

9 changes: 0 additions & 9 deletions wrapper/pybind11/.github/CODEOWNERS

This file was deleted.

Loading