|
1 | | -export ROOT_INCLUDE_PATH=path-to-json-include // if not in O2Physics environment |
| 1 | +# Invariant mass fitter |
| 2 | +Invariant mass fitter is implemented in the class `HFInvMassFitter` (`HFInvMassFitter.cxx/h` files), and its run is executed via `runMassFitter.C` macro. |
| 3 | +Fitter is configured in `config_massfitter.json`.\ |
| 4 | +The fitter is **not** a part of O2Physics source code. |
2 | 5 |
|
| 6 | +## Dependencies |
| 7 | +1. ROOT |
| 8 | + |
| 9 | +2. RapidJSON. Download the header-only (no compilation needed) RapidJSON library, see the link https://rapidjson.org. |
| 10 | + |
| 11 | +## How to run |
| 12 | +### As a ROOT macro |
| 13 | +The `runMassFitter.C` can be compiled as ROOT macro. |
| 14 | +``` |
| 15 | +source path-to-root-install/bin/thisroot.sh |
| 16 | +export ROOT_INCLUDE_PATH=$ROOT_INCLUDE_PATH:path-to-json-include |
3 | 17 | root -l -x -b -q "HFInvMassFitter.cxx" "runMassFitter.C(\"config_massfitter.json\")" |
| 18 | +``` |
| 19 | +If you have O2Physics compilation and enter into its environment there is no need to set environment variables (skip first two lines above). |
4 | 20 |
|
| 21 | +### As a CMake project |
| 22 | +It is also possible to compile the fitter as a CMake project or insert it into existing one if any. |
| 23 | +Use the `CMakeLists_HFInvMassFitter.txt` (rename it into `CMakeLists.txt` before usage).\ |
| 24 | +Compile the fitter with the following steps: |
| 25 | +``` |
| 26 | +mkdir build |
| 27 | +cd build |
| 28 | +source path-to-root-install/bin/thisroot.sh |
| 29 | +cmake -DHFFITTER_RAPIDJSON_INCLUDE_DIRS=path-to-json-include .. |
| 30 | +make |
| 31 | +``` |
| 32 | +and run the fitter: |
| 33 | +``` |
| 34 | +./runMassFitter ../config_massfitter.json |
| 35 | +``` |
| 36 | +### Directly from the terminal |
| 37 | +Compile the fitter with the following steps: |
| 38 | +``` |
| 39 | +mkdir build |
| 40 | +cd build |
| 41 | +source path-to-root-install/bin/thisroot.sh |
5 | 42 |
|
6 | | -Step 1: Generate ROOT dictionary: |
| 43 | +# Generate ROOT dictionary: |
7 | 44 | rootcling -f G__HFInvMassFitter.cxx -c ../HFInvMassFitter.h ../HFInvMassFitterLinkDef.h |
8 | 45 |
|
9 | | -Step 2: Compile source code: |
| 46 | +# Compile source code: |
10 | 47 | g++ -fPIC -I$(root-config --incdir) -I path-to-json-include -c ../HFInvMassFitter.cxx ../runMassFitter.C G__HFInvMassFitter.cxx |
11 | 48 |
|
12 | | -Step 3: Link the executable: |
| 49 | +# Link the executable: |
13 | 50 | g++ -o runMassFitter HFInvMassFitter.o runMassFitter.o G__HFInvMassFitter.o $(root-config --libs) -lRooFit -lRooFitCore -lEG |
| 51 | +``` |
| 52 | +and run the fitter: |
| 53 | +``` |
| 54 | +./runMassFitter ../config_massfitter.json |
| 55 | +``` |
0 commit comments