What is NPTool? - adrien-matta/nptool GitHub Wiki

What is NPTool?

General Concept

The NPTool philosophy

NPTool stands for Nuclear Physics Tool. It aims to be a coherent set of programs useful for experimental nuclear physicists. Because each experiment is different, people used to exchange codes and modified them to fit their immediate needs. However this leads to multiple versions of the same code with different functionalities, or worse, separate code and logic that will at some point needs to be put together.

In order to avoid such issues and to minimize the amount of work to be done for each experiment, one would need a common framework to work in.

NPTool aims to provide an universal collaborative framework so that users can add their own functionalities and share them with their collaborators. In this way all the improvements made by each contributor are now centralized and can directly benefit to the community.

Why NPTool? A brief history of the project

+The Historical Motto: Learn by yourself+ Nuclear physics experiment used to be pretty simple from the point of view of detection set-up. With usually of limited number of electronic channel and a straight forward way to connect measured information to the physical informations of interest. Because of this relative simplicity, a good workout was for each individual to perform the analysis all the way. Of course the natural benefice of such an approach is a complete understanding of the results and their reliabilities.

+An experimental shift:+ However, the advanced of radioactive beam experiment in inverse kinematic, the development of more complex detection system, in order to push away the experimental limitation, drive to incredibly complex experiment. Thousand of electronic channels need to be matched to each other, complex modular geometries are widely used while the cross section and beam intensity are decreasing... Today's experiment are complex to design, and harder to analyse.

+NPTool and the black box issue:+ The increasing complexity lead to longer analysis time and more and more time is addressed, usually by young man power, to technical issue and code development. A natural answer is to provide a Tool Box of already develop and thoroughly tested code to rely on. Of course one could sense the risk to draw a line between users and developers and transform the Tool Box into a Black Box.

NPTool was develop with this concern in mind, and has a specific architecture to highlight the part of interest, namely the part where the physics is done. The code is designed in an Object Oriented fashion, each object has their own specific method, derived from a common template, and each part are designed for a specific purpose. This way the code can easily be read, improved, tested and corrected by anyone. The idea is to put the user in the developing loop.

Geant4 and ROOT are now popular toolkit among the community. However, in average, people are lacking skills to use those toolkits at their full potential. It is not rare to see poorly designed ROOT tree or portion of code completely re-written for a new experiment using a very similar set-up than a previous one. NPTool is widely base on both tool kit, and provided a set of consistent tool to use them at their full potential: to perform fast, reliable simulations and analysis.

With more than 20 different detectors already implemented, NPTool is now a major actor in the community, allowing the simulation and analysis of a large variety of experiment at your finger tips.

Package Structure

The code structure is divided in three modules:


NPLib is the core of NPTool, it contain all the objects (classes) used in both the simulation and the analysis. The NPLib folder contains several different folder.

  • One for each detector: contains the classes (TDetectorData) used to store the raw data in a Root tree, as well as the classes (TDetectorPhysics) to analyses those raw data
  • Tools: Objects design to simplify your life : from managing user option to calibration file...
  • Physics: Objects design to perform physical calculation: Energy loss, two body kinematic,...
  • IORoot: Objects design to help you deal with the analysis of a large number of root file


This folder contain one folder for each analysis project. The most basic one being MakePhysicalTree.

./Analysis -h


A Geant4 based package to perform Monte Carlo Simulation of your experiment. for a review of the available option:

Simulation -h

Supported Detectors

Here a list of status: |Status |Comments ||Status |Comments | |!tick.png! !lock.png! | The algorithm is fully operational, no changes planned ||!page_edit.png! | The algorithm is still under development | |!tick.png! !wrench.png! | The algorithm is fully operational but functional changes are planned || !bug_error.png!| Bugs affecting runtime or results are spotted | |!chart_curve_error.png! | The algorithm is fully operational but need to be reviewed ||!calendar_add.png!| Scheduled but not started | |!help.png! | Status to be checked ||!calendar_delete.png!| Nothing scheduled |

Here is a list of the supported detector in NPTool and there status for Analysis and Simulation (by Alphabetic order): | Detector Name | Comments | NPA | NPS | |Annular S1|Silicon Annular |!tick.png! !wrench.png! |!tick.png! !wrench.png! | |CATS|Beam Tracking Detector |!tick.png! !lock.png! | !calendar_delete.png! | |Chateau de Crystal|Scintillator Array | !page_edit.png! | !page_edit.png! | |Chio|Ionisation Chamber, Digital electronic |!page_edit.png! | !calendar_delete.png! | |Compton Telescope|Satellite project|!page_edit.png! |!page_edit.png! | |Eurogam|Germanium Array|!page_edit.png! | !page_edit.png!| |EXL|Scintillator Array|!tick.png! !lock.png!| !calendar_delete.png!| |Exogam|Germanium Array|!tick.png! !wrench.png! | !calendar_add.png! | |GASPARD|Silicon Array|!tick.png! !wrench.png! |!tick.png! !wrench.png!| |HYDE|Silicon Array|!tick.png! !wrench.png! |!tick.png! !wrench.png! | |Maya|Active Target detector|!tick.png! !wrench.png! | !calendar_delete.png! | |MUST2|Silicon Array|!tick.png! !lock.png! |!tick.png! !lock.png! | |Paris|Scintillator Array|!tick.png! !wrench.png! |!tick.png! !wrench.png! | |Plastic|Scintillator detector|!tick.png! !lock.png! |!tick.png! !lock.png! | |Sharc|Silicon Array|!tick.png! !wrench.png! |!tick.png! !wrench.png! | |Speg|High resolution spectrometer|!tick.png! !wrench.png! | !calendar_delete.png! | |SSSD|Silicon detector|!tick.png! !lock.png! |!tick.png! !lock.png! | |Tigress|Germanium Array|!page_edit.png! | !calendar_add.png! | |Trifoil|Scintillator|!page_edit.png! | !calendar_add.png! | |Vamos|Spectrometer|!tick.png! !wrench.png! | !calendar_delete.png! | |W1|Silicon detector|!tick.png! !wrench.png! |!tick.png! !wrench.png! |

Supported (and Unsupported) Physics Cases

Physics Tools

Energy Loss Two body reaction

ROOT Tools

RootInput and RootOutput ASCII-File