Skip to content

emanuele-villa/tof-reco

Repository files navigation

Standalone TOF reconstruction code

To not overflow this README, the documentation is in the docs/ folder. There you can find:

  • some instructions to use git (pull, push, merge, tag, issues, etc.);
  • the guidelines for the code;
  • the description of the code and the data.

Feel free to expand the documentation yourself or ask for what is missing to [email protected]. A short list of commands to set up the environment and run the code follows.

Instructions to set up the environment

Follow these instructions to set up the code in your local machine.

git clone https://git.t2k.org/tof_utils/reconstruction/tof-reco.git
cd tof-reco

Dependencies

To use the code in your local machine, you need to have:

  • ROOT installed in the standard location, meaning /usr/local/,
  • json header: json.hpp;
  • cmake (minimum 3.17);
  • gcc version at least 11, or a recent clang;

If needed, install or update these packages.

If you are working in lxplus, there is a simple script to source all the needed versions of software, source_lxplus.sh, run automatically at the beginninf of any app script.

TO initialize the repository (just the first time), you need to fetch the submodules. The update.sh script fetches the submodules or updates them, see the usage with ./scripts/update.sh --help. If it gets stuck it is probably due to connection issues, so just kill it and run it again until it completes successfully.

./scripts/update.sh --up

This script also allows you to change branch or version easily, again see usage.

Once all is set up, if you just want to compile the code to check if it's ok on your machine, you can do:

./scripts/compile.sh

However, compilation is already done in the scripts to run the apps.

If when compiling you get an error related to submodules, try

./scripts/update.sh --fix-submodules

In case the problem persists, get in touch.

The data can be found under /eos/experiment/neutplatform/t2knd280/ToF/, under daq/ (MIDAS files) or data/ (root files). In order to access the data, subscribe to the e-group eos-experiment-cenf-t2knd280-writers, search for it here: https://e-groups.cern.ch/e-groups/EgroupsSearchForm.do. Either download the runs you want from CERNbox (https://cernbox.cern.ch/files/spaces/eos/experiment/neutplatform/t2knd280/ToF) or just work in lxplus.

Details of the runs can be found here https://docs.google.com/spreadsheets/d/15NT4joJ0t3p2j6Rzqt6P1NoHgueVN5eeZ-fOHoEHNRg/edit#gid=148818969.

Checkout to a tagged version, apply changes

If you want to checkout to a tagged version, you can do it with update.sh script, or manually with:

git checkout tags/v4.3.0

You will now be in detached state, so to operate changes do the following:

git checkout [-b] mybranch

the -b flag is needed only if you want to create a new branch, otherwise you can just checkout to an existing one. Once the branch is ready to be merged into main, compile a merge request.

App settings

The settings to run the apps are under the settings/ folder. There is a basic-settings-template.json file that can be used directly, or as a template to create your own settings file. This whole subfolder is gitignored, so you don't have to worry about adding your own paths, all changes are not going to be pushed to git. However, it is generally better to create a new file starting from the template.

Run an app: monitorDataQuality

To run an app, you can use the scripts in the scripts/ folder. They come with a -h flag that prints out their usage. They can be run from any folder. The settings file can be given with the full path, only with the settings/myfile.json path, with just the file name, with and without the .json extension.

An example is:

./scripts/monitorDataQuality.sh -f 1225 -s settings/my-settings.json

This app will produce some plots that are then saved as pdfs and, if the option is enabled, also shown on the screen. Set the input and output folders, as well as the number of hits to analyze, in the settings file. Note that the output is going to be in a subfolder of the set output folder, named after the tag of the code (e.g. v8.0.0).

Batch job submission

Under jobSubmission/ there are some scripts to submit jobs to the condor batch system (scripts for kekcc will come in the future). There are two scripts, one to create the outputTree and one to create the rawRootConverter. They are highly automated and they use by default the output path /eos/experiment/neutplatform/t2knd280/ToF/data/<tof-reco-version>/. You can still create your own settings with your paths to have the output wherever you prefer.

The submit files are going to be created in the jobSubmission/ folder, and the logs in the jobSubmission/output/ folder. All these things are gitignored, so don't worry about it.

Note that the creation of the outputTree is automatically done for all subruns that are present, in batches. Batch size is different for global and local runs, that's why there are two separate settings. Feel free to explore different options and submit a MR if there seems to be something better than the current settings.

Refer to docs/condor-job-submission.md for additional information.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published