Projects are the working directory for a given experiment. It contain all experiment specific parts of the conversion, analysis and simulation. It contains the user analysis and simulation libraries, as well as local version of user selected plugins referred to as duplicates.

Creating a new project

The new-project command will create and register a new project. A folder named <project-name> will be create in the current directory. nptool will copy all basic files and folder. The project will be register in the current environment data base.

nptool --new-project <project-name>

Compiling your project

nptool projects compilation is performed via CMake. We recommend the following operation to perform a project compilation:

mkdir build install
cmake -B build -DCMAKE_INSTALL_PREFIX=./install ./
make -C build install
mkdir build install
cmake -GNinja -B build -DCMAKE_INSTALL_PREFIX=./install ./
ninja -C build install

Projects navigation

All projects can be accessed from any directory using the npp command, which support tab completion.

npp <project-name>

Project configuration

Each project contain a project.yaml file that allow customisation of the framework. The file allow selection of the output path of produced file. In addition, one can add default flag to be added to programs, allowing a lighter command line. Here is an example of configuration file:

# file that allow customisation of the programm ran within this project folder  
 # output directory:                                                             
  analysis output:   ./output/analysis   # output directory for npanalysis       
  simulation output: ./output/simulation # output directory for npsimulation     
  conversion output: ./output/conversion # output directory for npconversion     
  energy loss: ./energy_loss # energy loss table generated by the simulation     
  #List flags added at every execution:                                           
  default flag: --detector detector.yaml  # flag added to every program         
  default conversion flag: --config-file conversion.yaml # flag added to npconversion
  default analysis flag: --disable-branch --calibration calibration.txt # flag added to npanalysis
  default simulation flag: --random-seed 3 --physics-list physics-list.yaml # flag added to npsimulation
  default online flag: --interface root,8081 # flag added to nponline client                                                                                       

Here launching the command npanalysis without any flag will results in the execution of

npanalysis --detector detector.yaml --disable-branch --calibration calibration.txt

Flags provided in the CLI superseded flags used as default, so launching the command:

 npanalysis --detector alternative.yaml 

Will results in the execution of :

npanalysis --detector alternative.yaml --disable-branch --calibration calibration.txt

Plugin duplicate

A duplicate is a local version of an installed plugin. Duplicate can only be created inside a valid nptool project folder. When a project use a duplicate, the local version is used by the framework instead of the standard version.

nptool --duplicate <plugin-name>

The duplicate command will copy the plugin source directory locally, and edit the project CMakeLists.txt file for compilation. Running make or ninja will compile the duplicate automatically.

make -C build install
ninja -C build install