-
Notifications
You must be signed in to change notification settings - Fork 645
[PWGHF] runMassFitter: add main() function and missing header, provide Readme #11611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
dae9dbf
runMassFitter: add main() function and missing header
lubynets 17c6851
linter fix: avoid magic number
lubynets 7b16886
provide CMakeLists for HFInvMassFitter
lubynets 5a48d6d
init README - describe compilation from the command line
lubynets d8be2d6
describe compilation as Root macro
lubynets 1327d91
write compilation instruction in Readme; rename CMakeLists.txt
lubynets 0c92c7b
update author list; clang-format
lubynets 6ee04ff
MegaLinter fixes
alibuild 888a27f
Merge pull request #6 from alibuild/alibot-cleanup-ml-11611
lubynets 074758f
address O2 linter error
lubynets 9041445
clarify paths in readme
lubynets 4ea2b03
add language specification for bash commands in ReadMe
lubynets 0a69981
fix wording: invariant-mass
lubynets File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| project(HFInvMassFitter) | ||
|
|
||
| set(HFFITTER_RAPIDJSON_INCLUDE_DIRS "" CACHE STRING "Location of rapidjson include directories") | ||
|
|
||
| find_package(ROOT REQUIRED COMPONENTS RooFit RooFitCore) | ||
|
|
||
| include_directories(${ROOT_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${HFFITTER_RAPIDJSON_INCLUDE_DIRS}) | ||
|
|
||
| set(SOURCES | ||
| HFInvMassFitter.cxx | ||
| runMassFitter.C | ||
| ) | ||
|
|
||
| add_executable(runMassFitter ${SOURCES} "HFInvMassFitter.h") | ||
|
|
||
| ROOT_GENERATE_DICTIONARY(G__HFInvMassFitter | ||
| HFInvMassFitter.h LINKDEF HFInvMassFitterLinkDef.h | ||
| MODULE runMassFitter | ||
| ) | ||
|
|
||
| target_link_libraries(runMassFitter PRIVATE ${ROOT_LIBRARIES} ROOT::EG ROOT::RooFit ROOT::RooFitCore) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // Copyright 2019-2020 CERN and copyright holders of ALICE O2. | ||
| // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. | ||
| // All rights not expressly granted are reserved. | ||
| // | ||
| // This software is distributed under the terms of the GNU General Public | ||
| // License v3 (GPL Version 3), copied verbatim in the file "COPYING". | ||
| // | ||
| // In applying this license CERN does not waive the privileges and immunities | ||
| // granted to it by virtue of its status as an Intergovernmental Organization | ||
| // or submit itself to any jurisdiction. | ||
|
|
||
| /// \file HFInvMassFitterLinkDef.h | ||
| /// \brief HFInvMassFitter dictionary definition file | ||
| /// | ||
| /// \author Zhen Zhang <zhenz@cern.ch> | ||
| /// \author Mingyu Zhang <mingyu.zang@cern.ch> | ||
| /// \author Xinye Peng <xinye.peng@cern.ch> | ||
| /// \author Biao Zhang <biao.zhang@cern.ch> | ||
| /// \author Oleksii Lubynets <oleksii.lubynets@cern.ch> | ||
|
|
||
| #ifndef PWGHF_D2H_MACROS_HFINVMASSFITTERLINKDEF_H_ | ||
| #define PWGHF_D2H_MACROS_HFINVMASSFITTERLINKDEF_H_ | ||
|
|
||
| #ifdef __CINT__ | ||
| #pragma link off all globals; | ||
| #pragma link off all classes; | ||
| #pragma link off all functions; | ||
| #pragma link C++ class HFInvMassFitter + ; | ||
| #endif | ||
|
|
||
| #endif // PWGHF_D2H_MACROS_HFINVMASSFITTERLINKDEF_H_ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Invariant mass fitter | ||
| Invariant mass fitter is implemented in the class `HFInvMassFitter` (`HFInvMassFitter.cxx/h` files), and its run is executed via `runMassFitter.C` macro. | ||
|
vkucera marked this conversation as resolved.
Outdated
|
||
| Fitter is configured in `config_massfitter.json`.\ | ||
| The fitter is **not** a part of O2Physics source code. | ||
|
|
||
| ## Dependencies | ||
| 1. ROOT | ||
| 2. RapidJSON. Download the header-only (no compilation needed) RapidJSON library, see the link <https://rapidjson.org>. | ||
|
|
||
| If you have O2Physics compilation you do not need to fulfill these dependencies explicitly. | ||
|
|
||
| ## How to run | ||
| ### As a ROOT macro | ||
| The `runMassFitter.C` can be compiled as ROOT macro. | ||
| ```bash | ||
| cd path-to-o2physics-src/PWGHF/D2H/Macros | ||
| source path-to-root-install/bin/thisroot.sh | ||
| export ROOT_INCLUDE_PATH=$ROOT_INCLUDE_PATH:path-to-json-include | ||
| root -l -x -b -q "HFInvMassFitter.cxx" "runMassFitter.C(\"config_massfitter.json\")" | ||
| ``` | ||
| If you have O2Physics compilation and enter into its environment there is no need to set environment variables (skip lines 2-3 above). | ||
|
|
||
| ### As a CMake project | ||
| It is also possible to compile the fitter as a CMake project or insert it into existing one if any. | ||
| Use the `CMakeLists_HFInvMassFitter.txt` (rename it into `CMakeLists.txt` before usage).\ | ||
| Compile the fitter with the following steps: | ||
| ```bash | ||
| cd path-to-o2physics-src/PWGHF/D2H/Macros | ||
| mkdir build | ||
| cd build | ||
| source path-to-root-install/bin/thisroot.sh | ||
| cmake -DHFFITTER_RAPIDJSON_INCLUDE_DIRS=path-to-json-include ../ | ||
| make | ||
| ``` | ||
| and run the fitter: | ||
| ```bash | ||
| ./runMassFitter ../config_massfitter.json | ||
| ``` | ||
| ### Directly from the terminal | ||
| Compile the fitter with the following steps: | ||
| ```bash | ||
| cd path-to-o2physics-src/PWGHF/D2H/Macros | ||
| mkdir build | ||
| cd build | ||
| source path-to-root-install/bin/thisroot.sh | ||
|
|
||
| # Generate ROOT dictionary: | ||
| rootcling -f G__HFInvMassFitter.cxx -c ../HFInvMassFitter.h ../HFInvMassFitterLinkDef.h | ||
|
|
||
| # Compile source code: | ||
| g++ -fPIC -I$(root-config --incdir) -I path-to-json-include -c ../HFInvMassFitter.cxx ../runMassFitter.C G__HFInvMassFitter.cxx | ||
|
|
||
| # Link the executable: | ||
| g++ -o runMassFitter HFInvMassFitter.o runMassFitter.o G__HFInvMassFitter.o $(root-config --libs) -lRooFit -lRooFitCore -lEG | ||
| ``` | ||
| and run the fitter: | ||
| ```bash | ||
| ./runMassFitter ../config_massfitter.json | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.