How to use my .so file in a roofit script

I have defined a custom class using RooClassFactory::makePdf("RooBwbw","x,mass1,width1,mass2,width2,beta,argbeta"); and compiled it to generate a .so file.
I would like to know how to load and use this custom class in my RooFit scripts. Can anyone provide a detailed example or guidance on how to achieve this? Thank you in advance for your help.

Hi,

Thanks for the interesting post.
If you have your C++ code and want to compile a program that uses it, you are set and just need to follow the rules applying to all C++ projects.
If you wish to use custom classes in ROOT macros you need to make them known to ROOT. This can happen through dictionaries. In steps:

  • Have a look to this documentation I/O of custom classes - ROOT
  • Generate a dictionary for your class with rootcling and generate a rootmapfile as well (this will be needed to load the library at runtime when interpreting macros). Please see the output of the rootcling -h command for more information about rootmaps.
  • Compile the dictionary and your custom class code in a shared library and put it in the LD_LIBRARY_PATH together with the rootmap file.

Let us know how this goes.

Cheers,
Danilo