BARS as an application framework

In ROOT you create a macro for data analysis. In BARS you can create an application - a compiled program that uses BARS as a library.

Compiled applications have several advantages over ROOT macros:

Overall, we highly encourage use of the compiled BARS applications over interpreted ROOT macros.

You can download an application template with git, and start writing analysis code immediately - CMake will take care of linking your programm to ROOT and BARS.

See here for instructions on creating your first app and here for detailed documentation on BARS capabilities as an application framework.

Building your own application

To create a BARS appplication, simply clone this repository to a directory with the same name as your application.

Requirements

Only BARS installation is required. The exact steps are described here.

Installation and compilation

Clone this repository to a directory named as this app

$ git clone git@git.jinr.ru/Baikal/bars-app-standalone-example.git my-bars-app

Create a build directory.

$ cd my-bars-app
$ mkdir build

Create a Makefile and compile

$ cd build
$ cmake ..
$ make

Install it

$ make install

Congratulations, you've successfully created a BARS app. Here's the same thing, but as a bash script:

#!/usr/bin/env bash

APPNAME=$1

git clone git@git.jinr.ru/Baikal/bars-app-standalone-example.git $APPNAME
cd $APPNAME
mkdir build
cd build
cmake ..
make
make install

Running your app

You can now run my-bars-app in your shell as a standard comand and get a welcome message.

$ my-bars-app
Welcome to your BARS app!

Call --help for usage information.

$ my-bars-app --help

  ┏┓ ┏━┓┏━┓┏━┓
  ┣┻┓┣━┫┣┳┛┗━┓
  ┗━┛╹ ╹╹┗╸┗━┛
  Baikal Analysis and Reconstruction Software

Usage: my-bars-app [ options ]

Required options:

Other options:
    -h, --help                print this message
    -x, --config              path to a custom config file
    -v, --verbose             if set, the program will produce verbose output
    -i, --in                  input path
    -o, --out                 output path

Notice that options are split into 'requried' and 'other'. If a required option is missing, the app won't run.

App structure

Let's look what's inside the app repository we have cloned.

$ ls
build/  cmake/  CMakeLists.txt  README.md  src/

Here: