R3BRoot icon indicating copy to clipboard operation
R3BRoot copied to clipboard

[BIG UPDATE] Package manager, build.py, data IO using STL and Neuland time calibration rewrite

Open YanzhaoW opened this issue 9 months ago • 10 comments

This PR contains lots of new features. Here is the list:

  1. Implementing Conan package manager for R3BRoot. Just like Pip or Conda for python, Conan is the most popular package manager for C++ project. It has seamless integration with cmake without the need to setup any environment variables. Its main difference to spack (which is used by FairRoot) is Conan is a project-wise package manager, which means different projects could have different packages without any interference between each other. To add a library for the project, just add the name and version to the conanfile.txt in the root directory. Currently there are 4 libraries being added:
    • ms-gsl/4.0.0
    • range-v3/0.12.0
    • gtest/cci.20210126
    • nlohmann_json/3.11.2
  2. Adding a build script build.py to manage all the build processes for R3BRoot. To install the conan packages, use ./build.py -p. To configure cmake, use ./build.py -c. And to build the project, use ./build.py -b. To do all: ./build.py -a. For more specification, check ./build.py -h
  3. Completely getting rid of TClonesArray for data input and output. All the data read or written with ROOT TTree has STL types. For example, Neuland mapped data is stored as std::vector<R3B::PaddleTamexMappedData> and trigger mapped data is stored as std::map<unsigned int, R3B::PaddleTamexTrigMappedData>.
  4. Add an algorithm to automatically detect Neuland TrigIDMap. It can later be saved into a JSON file. If disabled, the TrigIDMap need to be read from a JSON file. JSON file reading and writing is implemented using nlohmann's JSON library.
  5. No usage of index arithmetic for data analysis. Rather, use range-v3 library to construct the data binding and data filtering.
  6. Following classes are rewritten as new classes (with type aliases):
    • R3BPaddleTamexMappedData -> R3B::PaddleTamexMappedData(R3BPaddleTamexMappedData2)
    • R3BTCalPar -> R3B::TCalPar (R3BTCalPar2)
    • R3BNeulandTamexReader -> R3BNeulandTamexReader2
    • R3BNeulandMapped2CalPar -> R3B::Neuland::Mapped2CalPar(R3BNeulandMapped2CalPar2)
    • R3BNeulandMapped2Cal -> R3B::Neuland::Mapped2Cal (R3BNeulandMapped2Cal2)
  7. Place all the new implementation in a new folder neuland/calibration/calLevel/
  8. Nearly all old code stay untouched.

TODO:

  • Adding documentation for the Neuland time calibration process.
  • Adding unit tests.

It's no hurry to merge this PR to the dev branch. Feel free the leave comments below if there are any suggestions. In the meanwhile, I will try to finish the energy calibration rewriting in few weeks.


Checklist:

YanzhaoW avatar Sep 06 '23 12:09 YanzhaoW