PARTONS  
PARtonic Tomography Of Nucleon Software
New module

Table of Contents

Introduction

PARTONS was conceived with the idea that anyone can plug his own models at any level of the computation chain. And this should be achieved without modifying the PARTONS library - one just needs to write a class (in his own project) that inherits from an abstract class of a given type and implement virtual functions. This tutorial gives some hints on the creation of such new modules. In particular, it provides templates that illustrate structures to be understood and filled by the developers.


General remarks

To better understand the following remarks, please take a look in parallel at the examples provided in the following section.

  1. It must have static const unsigned int classId member initialized by BaseObjectRegistry::registerBaseObject() and a default constructor taking the module name, so it can be correctly registered in the Registry.
  2. It must have a copy constructor and the corresponding function clone() implemented, so it can be correctly issued by the Factory.
  3. If it calls other modules registered in the Registry, they must be initialized in resolveObjectDependencies() and not in the constructor.

Templates for new modules


How to use a new module

After a proper compilation of your PARTONS-related project, you may use a new module as any other in PARTONS - see this tutorial for more details. For instance, to get a clone of your new GPD module, do as follows:

// Clone GPD module with the ModuleObjectFactory from our own custom module