Using TUnfold 17. 9 with PyROOT


ROOT Version: 6. 28/02
Platform: Docker image (linux)
Compiler: Not Provided


Hello,
My question is similar to another post from 2017. I am posting this since I could not find a solution on this forum.

I want to use the latest version (v17.9) of TUnfold. However, latest version of ROOT comes with TUnfold v17 . 6 .

I downloaded the latest package and produced the corresponding library file libunfold .so.

Now, in the same directory I am using the following lines to load the library -

import ROOT
ROOT .gInterpreter.ProcessLine('#include "TUnfold.h"')
ROOT .gSystem.Load('libunfold.so')

Now if I use ROOT. TUnfold(). GetTUnfoldVersion(), i get v17.6 (vs v17.9) and the newer methods are also not available.

I am posting the full log with gDebug = 1 below

ROOT.gDebug = 1
ROOT.gInterpreter.ProcessLine('#include "TUnfold.h"')

Output:
Info in TUnixSystem::Load: loaded library /usr/ lib64/ root/ libUnfold.so.6.28.02, status 0
Info in TInterpreter::TCling::AutoLoad: loaded library libUnfold.so for TUnfold.h

ROOT. gSystem. Load('libunfold.so')

Output:

TClass::GetClass: Header Parsing - The representation of Experimental was not found in the type system. A lookup in the interpreter is about to be tried: this can cause parsing. This can be avoided selecting Experimental in the linkdef/selection file. TEnum::GetEnum: Header Parsing - The enumerator Experimental is not known to the typesystem: an interpreter lookup will be performed. This can imply parsing of headers. This can be avoided selecting the numerator in the linkdef/selection file. TClass::GetClass: Header Parsing - The representation of Experimental was not found in the type system. A lookup in the interpreter is about to be tried: this can cause parsing. This can be avoided selecting Experimental in the linkdef/selection file. TEnum::GetEnum: Header Parsing - The enumerator Experimental is not known to the typesystem: an interpreter lookup will be performed. This can imply parsing of headers. This can be avoided selecting the numerator in the linkdef/selection file. TClass::GetClass: Header Parsing - The representation of Experimental was not found in the type system. A lookup in the interpreter is about to be tried: this can cause parsing. This can be avoided selecting Experimental in the linkdef/selection file. TEnum::GetEnum: Header Parsing - The enumerator Experimental is not known to the typesystem: an interpreter lookup will be performed. This can imply parsing of headers. This can be avoided selecting the numerator in the linkdef/selection file.

Info in TUnixSystem::Load: loaded library / work/ unfold/toy_MC/tunfold_v17.9/libunfold. so, status 0

As you can see, TUnfold is being loaded from the old library. I need it to use the new ‘libunfold. so’ instead.

Am I doing something wrong?

Thank you!

Hi Aritra,

Welcome to the ROOT Community!
You are doing nothing wrong. The solution is to give precedence to the path of the header file and library of the more recent version of TUnfold on your system. You can either try out with their explicit path or give precedence to the directories where the header and library are with the ROOT_INCLUDE_PATH and LD_LIBRARY_PATH env variables.

I hope this helps.

Best,
D

As a side note: the imminent ROOT 6.34 release will provide TUnfold 17.9 natively, if that can help…

Cheers,
D

Thanks for the help! I tried setting the PATH manually in .bashrc, but it did not work. There seems to an error with the library itself.

cling::DynamicLibraryManager::loadLibrary(): /home/aritra/Desktop/tunfold_v17_9/libunfold.so: undefined symbol: _ZN21TUn_am_foldBinningV178StreamerER7TBuffer

However, the example files provided compiles perfectly when compiled using make bin.

But, it is great news that TUnfold v17.9 will be part of ROOT by this month!

Thank you,
Aritra