Description of model API
Here we describe the aplication interface of classes that form the libElegent library.
The class Constants encapsulates physics and mathematical constants (e.g. proton mass, Euler’s constants) as well as process description (e.g. pp or app mode, centre-of-mass energy). The constants are set up by the static Init method which creates an instance of the class referenced by the global pointer cnts.
All models of hadronic interactions are implemented as classes inheriting from the Model class. If the model exists in several variants or versions, or if its amplitude can be calculated in several modes, the user can make the choice via the Configure method. Afterwards, the Init method shall be used to initialize model parameters and perform (potentially) time-expensive initialisations (e.g. pre-sampling).
The scattering amplitude (in t-space) and profile function (amplitude in b-space) can be caluculated by Amp(t) and Prf(b) methods respectively. For details (normalisation etc.) see the journal publication linked from the home page.
Coulomb and Coulomb-interference
The code related to the Coulomb amplitude and the Coulomb-hadronic interference is grouped in the CoulombInterference class.
The choice of the form factor parametrisation is made by ffType data member (possibilities are given by the FFType enum). The methods FF_e(t), FF_m(t) and FF_sq(t) return the electric, magnetic and square of the effective form factor.
The amplitude due to Coulomb, hadronic or both interactions can be obtained from the Amp(t) method. The type of the amplitude is chosen via the mode data member (choices given by the CIMode enum).
The Generator class implements a Monte-Carlo generator of elastic nucleon-nucleon scattering events according to a given cumulative distribution function (can be built by ElegentTDistributionSampler program). The constructor takes these parameters:
Generator(file, path, t_min, t_max, verbosity)
where file refers to a ROOT file with the cumulative distribution function. path gives the path of the distribution within the file. t_min and t_max can be used to constrain the t-range of the generated events. verbosity sets the verbosity level.
After creation of a Generator instance, its Init method shall be called to load and prepare all necessary data.
Finally, a random event in HepMC format can be generated as follows:
GenEvent* gEv = new GenEvent(); gEv->set_event_number(...); generator.Generate(gEv);